| 780 | } |
| 781 | |
| 782 | void PiuContainer_replace(xsMachine *the) |
| 783 | { |
| 784 | PiuContainer* self = PIU(Container, xsThis); |
| 785 | PiuContent* content = PIU(Content, xsArg(0)); |
| 786 | PiuContent* by = PIU(Content, xsArg(1)); |
| 787 | PiuContent* previous; |
| 788 | PiuContent* next; |
| 789 | xsAssert(self != NULL); |
| 790 | xsAssert(content != NULL); |
| 791 | xsAssert((*content)->container == self); |
| 792 | xsAssert(by != NULL); |
| 793 | xsAssert((*by)->container == NULL); |
| 794 | xsAssert((*by)->previous == NULL); |
| 795 | xsAssert((*by)->next == NULL); |
| 796 | PiuContentReflow(content, piuSizeChanged); |
| 797 | PiuContentInvalidate(content, NULL); |
| 798 | PiuContainerUnbindContent(self, content); |
| 799 | previous = (*content)->previous; |
| 800 | next = (*content)->next; |
| 801 | if (previous) { |
| 802 | (*content)->previous = NULL; |
| 803 | (*previous)->next = by; |
| 804 | } |
| 805 | else |
| 806 | (*self)->first = by; |
| 807 | if (next) { |
| 808 | (*content)->next = NULL; |
| 809 | (*next)->previous = by; |
| 810 | } |
| 811 | else |
| 812 | (*self)->last = by; |
| 813 | (*content)->container = NULL; |
| 814 | (*by)->container = self; |
| 815 | (*by)->previous = previous; |
| 816 | (*by)->next = next; |
| 817 | PiuContainerBindContent(self, by); |
| 818 | PiuContentReflow(by, piuSizeChanged); |
| 819 | } |
| 820 | |
| 821 | void PiuContainer_run(xsMachine *the) |
| 822 | { |
nothing calls this directly
no test coverage detected