ui/motif/toolkit.c

changeset 956
4cdfbfd2038d
parent 932
28fc967f74ef
child 966
e411ed7c5f10
--- a/ui/motif/toolkit.c	Sun Dec 07 10:51:47 2025 +0100
+++ b/ui/motif/toolkit.c	Sun Dec 07 11:05:22 2025 +0100
@@ -39,6 +39,7 @@
 #include "../common/toolbar.h"
 #include "../common/document.h"
 #include "../common/properties.h"
+#include "../common/app.h"
 #include <cx/buffer.h>
 
 #include <X11/Intrinsic.h>
@@ -49,13 +50,6 @@
 static Widget active_window;
 static const char *application_name;
 
-static ui_callback   startup_func;
-static void          *startup_data;
-static ui_callback   open_func;
-static void          *open_data;
-static ui_callback   exit_func;
-static void          *exit_data;
-
 static ui_callback appclose_fnc;
 static void *appclose_udata;
 
@@ -134,33 +128,14 @@
     return display;
 }
 
-void ui_onstartup(ui_callback f, void *userdata) {
-    startup_func = f;
-    startup_data = userdata;
-}
-
-void ui_onopen(ui_callback f, void *userdata) {
-    open_func = f;
-    open_data = userdata;
-}
-
-void ui_onexit(ui_callback f, void *userdata) {
-    exit_func = f;
-    exit_data = userdata;
-}
-
 void ui_app_exit_on_shutdown(UiBool exitapp) {
     exit_on_shutdown = exitapp;
 }
 
 void ui_main() {
-    if(startup_func) {
-        startup_func(NULL, startup_data);
-    }
+    uic_application_startup(NULL);
     XtAppMainLoop(app);
-    if(exit_func) {
-        exit_func(NULL, exit_data);
-    }
+    uic_application_exit(NULL);
     uic_store_app_properties();
     if(exit_on_shutdown) {
         exit(0);

mercurial