ui/common/object.c

changeset 802
cc73993a3ff9
parent 801
e096c441e874
child 870
e167cf006213
equal deleted inserted replaced
801:e096c441e874 802:cc73993a3ff9
72 cx_foreach(objcallback *, cb, i) { 72 cx_foreach(objcallback *, cb, i) {
73 cb->func(obj, cb->userdata); 73 cb->func(obj, cb->userdata);
74 } 74 }
75 } 75 }
76 76
77 void ui_end(UiObject *obj) {
78 if(!obj->next) {
79 return;
80 }
81
82 UiObject *prev = NULL;
83 while(obj->next) {
84 prev = obj;
85 obj = obj->next;
86 }
87
88 if(prev) {
89 // TODO: free last obj
90 prev->next = NULL;
91 }
92 }
93
94 void ui_end_new(UiObject *obj) {
95 if(!obj->container_end) {
96 return;
97 }
98 UiContainerX *rm = obj->container_end;
99 uic_object_pop_container(obj);
100 ui_free(obj->ctx, rm);
101 }
102
103 void ui_newline(UiObject *obj) {
104 UiContainerX *container = obj->container_end;
105 if(container) {
106 container->newline = TRUE;
107 }
108 }
109
110 void ui_object_ref(UiObject *obj) { 77 void ui_object_ref(UiObject *obj) {
111 obj->ref++; 78 obj->ref++;
112 } 79 }
113 80
114 int ui_object_unref(UiObject *obj) { 81 int ui_object_unref(UiObject *obj) {

mercurial