1 /* |
1 /* |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
2 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. |
3 * |
3 * |
4 * Copyright 2014 Olaf Wintermann. All rights reserved. |
4 * Copyright 2024 Olaf Wintermann. All rights reserved. |
5 * |
5 * |
6 * Redistribution and use in source and binary forms, with or without |
6 * Redistribution and use in source and binary forms, with or without |
7 * modification, are permitted provided that the following conditions are met: |
7 * modification, are permitted provided that the following conditions are met: |
8 * |
8 * |
9 * 1. Redistributions of source code must retain the above copyright |
9 * 1. Redistributions of source code must retain the above copyright |
36 |
36 |
37 #ifdef __cplusplus |
37 #ifdef __cplusplus |
38 extern "C" { |
38 extern "C" { |
39 #endif |
39 #endif |
40 |
40 |
41 Display* ui_get_display(); |
|
42 |
|
43 typedef struct UiEventData { |
41 typedef struct UiEventData { |
44 UiObject *obj; |
42 UiObject *obj; |
45 ui_callback callback; |
43 ui_callback callback; |
46 void *userdata; |
44 void *userdata; |
47 int value; |
45 int value; |
|
46 void *customdata; |
48 } UiEventData; |
47 } UiEventData; |
|
48 |
|
49 typedef struct UiEventDataExt { |
|
50 UiObject *obj; |
|
51 ui_callback callback; |
|
52 void *userdata; |
|
53 ui_callback callback2; |
|
54 void *userdata2; |
|
55 int value0; |
|
56 int value1; |
|
57 int value2; |
|
58 int value3; |
|
59 void *customdata0; |
|
60 void *customdata1; |
|
61 void *customdata2; |
|
62 void *customdata3; |
|
63 } UiEventDataExt; |
|
64 |
|
65 typedef struct UiVarEventData { |
|
66 UiObject *obj; |
|
67 UiVar *var; |
|
68 UiObserver **observers; |
|
69 ui_callback callback; |
|
70 void *userdata; |
|
71 int value; |
|
72 } UiVarEventData; |
49 |
73 |
50 typedef struct UiJob { |
74 typedef struct UiJob { |
51 UiObject *obj; |
75 UiObject *obj; |
52 ui_threadfunc job_func; |
76 ui_threadfunc job_func; |
53 void *job_data; |
77 void *job_data; |
58 typedef enum UiOrientation UiOrientation; |
82 typedef enum UiOrientation UiOrientation; |
59 enum UiOrientation { UI_HORIZONTAL = 0, UI_VERTICAL }; |
83 enum UiOrientation { UI_HORIZONTAL = 0, UI_VERTICAL }; |
60 |
84 |
61 void ui_exit_mainloop(); |
85 void ui_exit_mainloop(); |
62 |
86 |
|
87 Display* ui_motif_get_display(void); |
|
88 |
63 void ui_set_active_window(Widget w); |
89 void ui_set_active_window(Widget w); |
64 Widget ui_get_active_window(); |
90 Widget ui_get_active_window(); |
65 |
91 |
66 void ui_secondary_event_loop(int *loop); |
92 void ui_secondary_event_loop(int *loop); |
67 void ui_window_dark_theme(Display *dp, Window window); |
93 void ui_window_dark_theme(Display *dp, Window window); |
|
94 |
|
95 void ui_destroy_eventdata(Widget w, XtPointer data, XtPointer d); |
|
96 |
|
97 void ui_set_widget_groups(UiContext *ctx, Widget widget, const int *groups) ; |
|
98 void ui_set_widget_ngroups(UiContext *ctx, Widget widget, const int *groups, size_t ngroups); |
68 |
99 |
69 #ifdef __cplusplus |
100 #ifdef __cplusplus |
70 } |
101 } |
71 #endif |
102 #endif |
72 |
103 |