ui/gtk/toolkit.h

branch
newapi
changeset 302
b00cbbfeec7a
parent 300
2f924f7ca901
child 305
98470af75dcf
equal deleted inserted replaced
301:f9e7c57e1e2f 302:b00cbbfeec7a
36 #ifdef __cplusplus 36 #ifdef __cplusplus
37 extern "C" { 37 extern "C" {
38 #endif 38 #endif
39 39
40 #pragma clang diagnostic ignored "-Wdeprecated-declarations" 40 #pragma clang diagnostic ignored "-Wdeprecated-declarations"
41
42
43 #if GLIB_MAJOR_VERSION * 1000 + GLIB_MINOR_VERSION > 74
44 #define UI_G_APPLICATION_FLAGS G_APPLICATION_DEFAULT_FLAGS
45 #else
46 #define UI_G_APPLICATION_FLAGS G_APPLICATION_FLAGS_NONE
47 #endif
41 48
49 #ifdef UI_LIBADWAITA
50 #define UI_APPLICATION AdwApplication*
51 #define UI_APPLICATION_NEW(id) adw_application_new(id, UI_G_APPLICATION_FLAGS)
52 #elif GTK_MAJOR_VERSION >= 3
53 #define UI_APPLICATION GtkApplication*
54 #define UI_APPLICATION_NEW(id) gtk_application_new(id, UI_G_APPLICATION_FLAGS)
55 #endif
42 56
43 #if GTK_MAJOR_VERSION >= 4 57 #if GTK_MAJOR_VERSION >= 4
44 #define WINDOW_SHOW(window) gtk_window_present(GTK_WINDOW(window)) 58 #define WINDOW_SHOW(window) gtk_window_present(GTK_WINDOW(window))
45 #define WINDOW_DESTROY(window) gtk_window_destroy(GTK_WINDOW(window)) 59 #define WINDOW_DESTROY(window) gtk_window_destroy(GTK_WINDOW(window))
46 #define WINDOW_SET_CONTENT(window, child) gtk_window_set_child(GTK_WINDOW(window), child) 60 #define WINDOW_SET_CONTENT(window, child) gtk_window_set_child(GTK_WINDOW(window), child)
85 #endif 99 #endif
86 100
87 typedef enum UiOrientation UiOrientation; 101 typedef enum UiOrientation UiOrientation;
88 enum UiOrientation { UI_HORIZONTAL = 0, UI_VERTICAL }; 102 enum UiOrientation { UI_HORIZONTAL = 0, UI_VERTICAL };
89 103
90 #ifndef UI_GTK2 104 #ifdef UI_APPLICATION
91 void ui_app_quit(); 105 void ui_app_quit();
92 GtkApplication* ui_get_application(); 106 GtkApplication* ui_get_application();
93 #endif 107 #endif
94 108
95 int ui_get_scalefactor(); 109 int ui_get_scalefactor();

mercurial