add wrapper functions for accessing some UiObject members

Sat, 14 Jun 2025 11:05:57 +0200

author
Olaf Wintermann <olaf.wintermann@gmail.com>
date
Sat, 14 Jun 2025 11:05:57 +0200
changeset 621
84b351712c19
parent 620
174c11734dad
child 622
9090faa4094b

add wrapper functions for accessing some UiObject members

ui/common/wrapper.c file | annotate | diff | comparison | revisions
ui/common/wrapper.h file | annotate | diff | comparison | revisions
--- a/ui/common/wrapper.c	Fri Jun 13 21:37:00 2025 +0200
+++ b/ui/common/wrapper.c	Sat Jun 14 11:05:57 2025 +0200
@@ -28,6 +28,23 @@
 
 #include "wrapper.h"
 
+/* ---------------------------- UiObject ---------------------------- */
+
+UiContext* ui_object_get_context(UiObject *obj) {
+    return obj->ctx;
+}
+
+void* ui_object_get_windowdata(UiObject *obj) {
+    return obj->window;
+}
+
+void ui_object_set_windowdata(UiObject *obj, void *windowdata) {
+    obj->window = windowdata;
+}
+
+
+/* ---------------------------- UiEvent ---------------------------- */
+
 UiObject* ui_event_get_obj(UiEvent *event) {
     return event->obj;
 }
--- a/ui/common/wrapper.h	Fri Jun 13 21:37:00 2025 +0200
+++ b/ui/common/wrapper.h	Sat Jun 14 11:05:57 2025 +0200
@@ -35,6 +35,10 @@
 extern "C" {
 #endif
 
+UIEXPORT UiContext* ui_object_get_context(UiObject *obj);
+UIEXPORT void* ui_object_get_windowdata(UiObject *obj);
+UIEXPORT void ui_object_set_windowdata(UiObject *obj, void *windowdata);
+    
 UIEXPORT UiObject* ui_event_get_obj(UiEvent *event);
 UIEXPORT void* ui_event_get_document(UiEvent *event);
 UIEXPORT void* ui_event_get_windowdata(UiEvent *event);

mercurial