| 129 } |
129 } |
| 130 uic_object_destroyed(obj); |
130 uic_object_destroyed(obj); |
| 131 cxMempoolFree(obj->ctx->mp); |
131 cxMempoolFree(obj->ctx->mp); |
| 132 } |
132 } |
| 133 |
133 |
| |
134 UiObject* uic_object_new_toplevel(void) { |
| |
135 CxMempool *mp = cxMempoolCreateSimple(256); |
| |
136 UiObject *obj = cxCalloc(mp->allocator, 1, sizeof(UiObject)); |
| |
137 obj->ctx = uic_context(obj, mp); |
| |
138 uic_object_created(obj); |
| |
139 return obj; |
| |
140 } |
| |
141 |
| 134 UiObject* uic_object_new(UiObject *toplevel, UIWIDGET widget) { |
142 UiObject* uic_object_new(UiObject *toplevel, UIWIDGET widget) { |
| 135 return uic_ctx_object_new(toplevel->ctx, widget); |
143 return uic_ctx_object_new(toplevel->ctx, widget); |
| 136 } |
144 } |
| 137 |
145 |
| 138 UiObject* uic_ctx_object_new(UiContext *ctx, UIWIDGET widget) { |
146 UiObject* uic_ctx_object_new(UiContext *ctx, UIWIDGET widget) { |