--- a/ui/ui/toolkit.h Thu Nov 14 23:22:35 2024 +0100 +++ b/ui/ui/toolkit.h Fri Nov 15 21:50:20 2024 +0100 @@ -238,6 +238,16 @@ * next container object */ UiObject *next; + + /* + * obj destroy func + */ + void (*destroy)(UiObject *obj); + + /* + * reference counter + */ + unsigned int ref; }; struct UiTabbedPane { @@ -420,6 +430,9 @@ UIEXPORT void ui_context_destroy(UiContext *ctx); +UIEXPORT void ui_object_ref(UiObject *obj); +UIEXPORT void ui_object_unref(UiObject *obj); + UIEXPORT void ui_onstartup(ui_callback f, void *userdata); UIEXPORT void ui_onopen(ui_callback f, void *userdata); UIEXPORT void ui_onexit(ui_callback f, void *userdata);