46 |
46 |
47 #ifndef UI_GTK2 |
47 #ifndef UI_GTK2 |
48 static GtkApplication *app; |
48 static GtkApplication *app; |
49 #endif |
49 #endif |
50 |
50 |
51 static char *application_name; |
51 static const char *application_name; |
52 |
52 |
53 static ui_callback startup_func; |
53 static ui_callback startup_func; |
54 static void *startup_data; |
54 static void *startup_data; |
55 static ui_callback open_func; |
55 static ui_callback open_func; |
56 void *open_data; |
56 void *open_data; |
62 |
62 |
63 static UiObject *active_window; |
63 static UiObject *active_window; |
64 |
64 |
65 static int scale_factor = 1; |
65 static int scale_factor = 1; |
66 |
66 |
67 void ui_init(char *appname, int argc, char **argv) { |
67 UIEXPORT void ui_init(const char *appname, int argc, char **argv) { |
68 uic_init_global_context(); |
68 uic_init_global_context(); |
69 |
69 |
70 gtk_init(&argc, &argv); |
70 gtk_init(&argc, &argv); |
71 application_name = appname; |
71 application_name = appname; |
72 |
72 |
84 scale_factor = gdk_monitor_get_scale_factor( |
84 scale_factor = gdk_monitor_get_scale_factor( |
85 gdk_display_get_primary_monitor(gdk_display_get_default())); |
85 gdk_display_get_primary_monitor(gdk_display_get_default())); |
86 #endif |
86 #endif |
87 } |
87 } |
88 |
88 |
89 char* ui_appname() { |
89 const char* ui_appname() { |
90 return application_name; |
90 return application_name; |
91 } |
91 } |
92 |
92 |
93 void ui_onstartup(ui_callback f, void *userdata) { |
93 void ui_onstartup(ui_callback f, void *userdata) { |
94 startup_func = f; |
94 startup_func = f; |