MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / PiuContainer_replace

Function PiuContainer_replace

modules/piu/All/piuContainer.c:782–819  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

780}
781
782void 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
821void PiuContainer_run(xsMachine *the)
822{

Callers

nothing calls this directly

Calls 4

PiuContentReflowFunction · 0.85
PiuContentInvalidateFunction · 0.85
PiuContainerBindContentFunction · 0.85

Tested by

no test coverage detected