145:853685152c1d | 146:dd0ae1c62a72 |
---|---|
58 static ui_callback appclose_fnc; | 58 static ui_callback appclose_fnc; |
59 static void *appclose_udata; | 59 static void *appclose_udata; |
60 | 60 |
61 static UiObject *active_window; | 61 static UiObject *active_window; |
62 | 62 |
63 static int scale_factor = 1; | |
64 | |
63 void ui_init(char *appname, int argc, char **argv) { | 65 void ui_init(char *appname, int argc, char **argv) { |
64 gtk_init(&argc, &argv); | 66 gtk_init(&argc, &argv); |
65 application_name = appname; | 67 application_name = appname; |
66 | 68 |
67 uic_docmgr_init(); | 69 uic_docmgr_init(); |
71 ui_list_init(); | 73 ui_list_init(); |
72 | 74 |
73 ui_image_init(); | 75 ui_image_init(); |
74 | 76 |
75 uic_load_app_properties(); | 77 uic_load_app_properties(); |
78 | |
79 #ifdef UI_SUPPORTS_SCALE | |
80 scale_factor = gdk_monitor_get_scale_factor( | |
81 gdk_display_get_primary_monitor(gdk_display_get_default())); | |
82 #endif | |
76 } | 83 } |
77 | 84 |
78 char* ui_appname() { | 85 char* ui_appname() { |
79 return application_name; | 86 return application_name; |
80 } | 87 } |
220 } else { | 227 } else { |
221 return NULL; | 228 return NULL; |
222 } | 229 } |
223 } | 230 } |
224 | 231 |
232 int ui_get_scalefactor() { | |
233 return scale_factor; | |
234 } | |
235 | |
225 void ui_destroy_userdata(GtkWidget *object, void *userdata) { | 236 void ui_destroy_userdata(GtkWidget *object, void *userdata) { |
226 free(userdata); | 237 free(userdata); |
227 } | 238 } |
228 | 239 |
229 void ui_destroy_vardata(GtkWidget *object, UiVarEventData *data) { | 240 void ui_destroy_vardata(GtkWidget *object, UiVarEventData *data) { |