1 | /* $Id: vbox-gtk.h 101678 2023-10-31 11:38:53Z vboxsync $ */
|
---|
2 | /** @file
|
---|
3 | * Guest Additions - Definitions from Gtk 3.24.38 and Glib 2.17 libraries.
|
---|
4 | */
|
---|
5 |
|
---|
6 | /*
|
---|
7 | * Copyright (C) 2006-2023 Oracle and/or its affiliates.
|
---|
8 | *
|
---|
9 | * This file is part of VirtualBox base platform packages, as
|
---|
10 | * available from https://www.virtualbox.org.
|
---|
11 | *
|
---|
12 | * This program is free software; you can redistribute it and/or
|
---|
13 | * modify it under the terms of the GNU General Public License
|
---|
14 | * as published by the Free Software Foundation, in version 3 of the
|
---|
15 | * License.
|
---|
16 | *
|
---|
17 | * This program is distributed in the hope that it will be useful, but
|
---|
18 | * WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
19 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
20 | * General Public License for more details.
|
---|
21 | *
|
---|
22 | * You should have received a copy of the GNU General Public License
|
---|
23 | * along with this program; if not, see <https://www.gnu.org/licenses>.
|
---|
24 | *
|
---|
25 | * SPDX-License-Identifier: GPL-3.0-only
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef GA_INCLUDED_SRC_x11_VBoxClient_vbox_gtk_3_h
|
---|
29 | #define GA_INCLUDED_SRC_x11_VBoxClient_vbox_gtk_3_h
|
---|
30 | #ifndef RT_WITHOUT_PRAGMA_ONCE
|
---|
31 | # pragma once
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | extern "C"
|
---|
35 | {
|
---|
36 |
|
---|
37 |
|
---|
38 | /**
|
---|
39 | * Gtk definitions.
|
---|
40 | */
|
---|
41 |
|
---|
42 |
|
---|
43 | #ifndef FALSE
|
---|
44 | #define FALSE (0)
|
---|
45 | #endif
|
---|
46 |
|
---|
47 | #ifndef TRUE
|
---|
48 | #define TRUE (!FALSE)
|
---|
49 | #endif
|
---|
50 |
|
---|
51 | #define G_SOURCE_REMOVE FALSE
|
---|
52 |
|
---|
53 | #define GUINT_TO_POINTER(u) ((gpointer) (gulong) (u))
|
---|
54 | #define _GDK_MAKE_ATOM(val) ((GdkAtom)GUINT_TO_POINTER(val))
|
---|
55 |
|
---|
56 | #define GDK_NONE _GDK_MAKE_ATOM (0)
|
---|
57 |
|
---|
58 | #define GDK_SELECTION_CLIPBOARD _GDK_MAKE_ATOM (69)
|
---|
59 |
|
---|
60 | #define _G_TYPE_CIC(ip, gt, ct) ((ct*) (void *) ip)
|
---|
61 | #define G_TYPE_CHECK_INSTANCE_CAST(instance, g_type, c_type) (_G_TYPE_CIC ((instance), (g_type), c_type))
|
---|
62 |
|
---|
63 | #define G_CALLBACK(f) ((GCallback) (f))
|
---|
64 | #define g_signal_connect(instance, detailed_signal, c_handler, data) \
|
---|
65 | g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, (GConnectFlags) 0)
|
---|
66 |
|
---|
67 | #define g_signal_connect_after(instance, detailed_signal, c_handler, data) \
|
---|
68 | g_signal_connect_data ((instance), (detailed_signal), (c_handler), (data), NULL, G_CONNECT_AFTER)
|
---|
69 |
|
---|
70 | #define GTK_TYPE_WINDOW (gtk_window_get_type ())
|
---|
71 | #define GTK_WINDOW(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_WINDOW, GtkWindow))
|
---|
72 |
|
---|
73 | #define GTK_TYPE_CONTAINER (gtk_container_get_type ())
|
---|
74 | #define GTK_CONTAINER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_CONTAINER, GtkContainer))
|
---|
75 |
|
---|
76 | #define GTK_TYPE_BOX (gtk_box_get_type ())
|
---|
77 | #define GTK_BOX(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_BOX, GtkBox))
|
---|
78 |
|
---|
79 | #define GTK_TYPE_WIDGET (gtk_widget_get_type ())
|
---|
80 | #define GTK_WIDGET(widget) (G_TYPE_CHECK_INSTANCE_CAST ((widget), GTK_TYPE_WIDGET, GtkWidget))
|
---|
81 |
|
---|
82 | #define G_TYPE_APPLICATION (g_application_get_type ())
|
---|
83 | #define G_APPLICATION(inst) (G_TYPE_CHECK_INSTANCE_CAST ((inst), G_TYPE_APPLICATION, GApplication))
|
---|
84 |
|
---|
85 | typedef enum
|
---|
86 | {
|
---|
87 | G_APPLICATION_FLAGS_NONE = 0,
|
---|
88 | G_APPLICATION_DEFAULT_FLAGS = 0,
|
---|
89 | G_APPLICATION_IS_SERVICE = (1 << 0),
|
---|
90 | G_APPLICATION_IS_LAUNCHER = (1 << 1),
|
---|
91 |
|
---|
92 | G_APPLICATION_HANDLES_OPEN = (1 << 2),
|
---|
93 | G_APPLICATION_HANDLES_COMMAND_LINE = (1 << 3),
|
---|
94 | G_APPLICATION_SEND_ENVIRONMENT = (1 << 4),
|
---|
95 |
|
---|
96 | G_APPLICATION_NON_UNIQUE = (1 << 5),
|
---|
97 |
|
---|
98 | G_APPLICATION_CAN_OVERRIDE_APP_ID = (1 << 6),
|
---|
99 | G_APPLICATION_ALLOW_REPLACEMENT = (1 << 7),
|
---|
100 | G_APPLICATION_REPLACE = (1 << 8)
|
---|
101 | } GApplicationFlags;
|
---|
102 |
|
---|
103 | typedef enum
|
---|
104 | {
|
---|
105 | GTK_WINDOW_TOPLEVEL,
|
---|
106 | GTK_WINDOW_POPUP
|
---|
107 | } GtkWindowType;
|
---|
108 |
|
---|
109 | typedef enum
|
---|
110 | {
|
---|
111 | GDK_NOTHING = -1,
|
---|
112 | GDK_DELETE = 0,
|
---|
113 | GDK_DESTROY = 1,
|
---|
114 | GDK_EXPOSE = 2,
|
---|
115 | GDK_MOTION_NOTIFY = 3,
|
---|
116 | GDK_BUTTON_PRESS = 4,
|
---|
117 | GDK_2BUTTON_PRESS = 5,
|
---|
118 | GDK_DOUBLE_BUTTON_PRESS = GDK_2BUTTON_PRESS,
|
---|
119 | GDK_3BUTTON_PRESS = 6,
|
---|
120 | GDK_TRIPLE_BUTTON_PRESS = GDK_3BUTTON_PRESS,
|
---|
121 | GDK_BUTTON_RELEASE = 7,
|
---|
122 | GDK_KEY_PRESS = 8,
|
---|
123 | GDK_KEY_RELEASE = 9,
|
---|
124 | GDK_ENTER_NOTIFY = 10,
|
---|
125 | GDK_LEAVE_NOTIFY = 11,
|
---|
126 | GDK_FOCUS_CHANGE = 12,
|
---|
127 | GDK_CONFIGURE = 13,
|
---|
128 | GDK_MAP = 14,
|
---|
129 | GDK_UNMAP = 15,
|
---|
130 | GDK_PROPERTY_NOTIFY = 16,
|
---|
131 | GDK_SELECTION_CLEAR = 17,
|
---|
132 | GDK_SELECTION_REQUEST = 18,
|
---|
133 | GDK_SELECTION_NOTIFY = 19,
|
---|
134 | GDK_PROXIMITY_IN = 20,
|
---|
135 | GDK_PROXIMITY_OUT = 21,
|
---|
136 | GDK_DRAG_ENTER = 22,
|
---|
137 | GDK_DRAG_LEAVE = 23,
|
---|
138 | GDK_DRAG_MOTION = 24,
|
---|
139 | GDK_DRAG_STATUS = 25,
|
---|
140 | GDK_DROP_START = 26,
|
---|
141 | GDK_DROP_FINISHED = 27,
|
---|
142 | GDK_CLIENT_EVENT = 28,
|
---|
143 | GDK_VISIBILITY_NOTIFY = 29,
|
---|
144 | GDK_SCROLL = 31,
|
---|
145 | GDK_WINDOW_STATE = 32,
|
---|
146 | GDK_SETTING = 33,
|
---|
147 | GDK_OWNER_CHANGE = 34,
|
---|
148 | GDK_GRAB_BROKEN = 35,
|
---|
149 | GDK_DAMAGE = 36,
|
---|
150 | GDK_TOUCH_BEGIN = 37,
|
---|
151 | GDK_TOUCH_UPDATE = 38,
|
---|
152 | GDK_TOUCH_END = 39,
|
---|
153 | GDK_TOUCH_CANCEL = 40,
|
---|
154 | GDK_TOUCHPAD_SWIPE = 41,
|
---|
155 | GDK_TOUCHPAD_PINCH = 42,
|
---|
156 | GDK_PAD_BUTTON_PRESS = 43,
|
---|
157 | GDK_PAD_BUTTON_RELEASE = 44,
|
---|
158 | GDK_PAD_RING = 45,
|
---|
159 | GDK_PAD_STRIP = 46,
|
---|
160 | GDK_PAD_GROUP_MODE = 47,
|
---|
161 | GDK_EVENT_LAST /* helper variable for decls */
|
---|
162 | } GdkEventType;
|
---|
163 |
|
---|
164 | typedef enum
|
---|
165 | {
|
---|
166 | GDK_WINDOW_STATE_WITHDRAWN = 1 << 0,
|
---|
167 | GDK_WINDOW_STATE_ICONIFIED = 1 << 1,
|
---|
168 | GDK_WINDOW_STATE_MAXIMIZED = 1 << 2,
|
---|
169 | GDK_WINDOW_STATE_STICKY = 1 << 3,
|
---|
170 | GDK_WINDOW_STATE_FULLSCREEN = 1 << 4,
|
---|
171 | GDK_WINDOW_STATE_ABOVE = 1 << 5,
|
---|
172 | GDK_WINDOW_STATE_BELOW = 1 << 6,
|
---|
173 | GDK_WINDOW_STATE_FOCUSED = 1 << 7,
|
---|
174 | GDK_WINDOW_STATE_TILED = 1 << 8,
|
---|
175 | GDK_WINDOW_STATE_TOP_TILED = 1 << 9,
|
---|
176 | GDK_WINDOW_STATE_TOP_RESIZABLE = 1 << 10,
|
---|
177 | GDK_WINDOW_STATE_RIGHT_TILED = 1 << 11,
|
---|
178 | GDK_WINDOW_STATE_RIGHT_RESIZABLE = 1 << 12,
|
---|
179 | GDK_WINDOW_STATE_BOTTOM_TILED = 1 << 13,
|
---|
180 | GDK_WINDOW_STATE_BOTTOM_RESIZABLE = 1 << 14,
|
---|
181 | GDK_WINDOW_STATE_LEFT_TILED = 1 << 15,
|
---|
182 | GDK_WINDOW_STATE_LEFT_RESIZABLE = 1 << 16
|
---|
183 | } GdkWindowState;
|
---|
184 |
|
---|
185 | typedef enum
|
---|
186 | {
|
---|
187 | GTK_ORIENTATION_HORIZONTAL,
|
---|
188 | GTK_ORIENTATION_VERTICAL
|
---|
189 | } GtkOrientation;
|
---|
190 |
|
---|
191 | typedef enum
|
---|
192 | {
|
---|
193 | G_CONNECT_DEFAULT = 0,
|
---|
194 | G_CONNECT_AFTER = 1 << 0,
|
---|
195 | G_CONNECT_SWAPPED = 1 << 1
|
---|
196 | } GConnectFlags;
|
---|
197 |
|
---|
198 | typedef enum
|
---|
199 | {
|
---|
200 | GTK_DIR_TAB_FORWARD,
|
---|
201 | GTK_DIR_TAB_BACKWARD,
|
---|
202 | GTK_DIR_UP,
|
---|
203 | GTK_DIR_DOWN,
|
---|
204 | GTK_DIR_LEFT,
|
---|
205 | GTK_DIR_RIGHT
|
---|
206 | } GtkDirectionType;
|
---|
207 |
|
---|
208 | typedef struct _GdkWindow GdkWindow;
|
---|
209 | typedef char gint8;
|
---|
210 |
|
---|
211 | struct _GdkEventWindowState
|
---|
212 | {
|
---|
213 | GdkEventType type;
|
---|
214 | GdkWindow *window;
|
---|
215 | gint8 send_event;
|
---|
216 | GdkWindowState changed_mask;
|
---|
217 | GdkWindowState new_window_state;
|
---|
218 | };
|
---|
219 |
|
---|
220 | typedef struct _GList GList;
|
---|
221 | typedef struct _GdkAtom *GdkAtom;
|
---|
222 | typedef struct _GtkTargetList GtkTargetList;
|
---|
223 | typedef struct _GtkTargetEntry GtkTargetEntry;
|
---|
224 | typedef struct _GtkClipboard GtkClipboard;
|
---|
225 | typedef struct _GtkSelectionData GtkSelectionData;
|
---|
226 | typedef struct _GtkWindow GtkWindow;
|
---|
227 | typedef struct _GClosure GClosure;
|
---|
228 | typedef struct _GdkEventWindowState GdkEventWindowState;
|
---|
229 | typedef struct _GtkContainer GtkContainer;
|
---|
230 | typedef struct _GtkBox GtkBox;
|
---|
231 | typedef struct _GtkButton GtkButton;
|
---|
232 | typedef struct _GtkApplication GtkApplication;
|
---|
233 | typedef struct _GApplication GApplication;
|
---|
234 | typedef union _GdkEvent GdkEvent;
|
---|
235 |
|
---|
236 | typedef struct _GtkWidget GtkWidget;
|
---|
237 | typedef int gint;
|
---|
238 | typedef gint gboolean;
|
---|
239 | typedef char gchar;
|
---|
240 | typedef unsigned char guchar;
|
---|
241 | typedef unsigned int guint;
|
---|
242 | typedef unsigned long gulong;
|
---|
243 | typedef void* gpointer;
|
---|
244 | typedef double gdouble;
|
---|
245 | typedef gulong GType;
|
---|
246 |
|
---|
247 | typedef gboolean (*GSourceFunc) (gpointer user_data);
|
---|
248 | typedef void (*GtkClipboardGetFunc) (GtkClipboard *clipboard, GtkSelectionData *selection_data, guint info, gpointer user_data_or_owner);
|
---|
249 | typedef void (*GtkClipboardClearFunc)(GtkClipboard *clipboard, gpointer user_data_or_owner);
|
---|
250 | typedef void (*GCallback) (void);
|
---|
251 | typedef void (*GClosureNotify) (gpointer data, GClosure *closure);
|
---|
252 | typedef void (*GtkClipboardReceivedFunc) (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data);
|
---|
253 |
|
---|
254 |
|
---|
255 | extern GdkAtom gdk_atom_intern(const gchar *atom_name, gboolean only_if_exists);
|
---|
256 | extern gchar* gdk_atom_name(GdkAtom atom);
|
---|
257 |
|
---|
258 | extern guint gdk_threads_add_timeout(guint interval, GSourceFunc function, gpointer data);
|
---|
259 |
|
---|
260 | extern GtkApplication *gtk_application_new(const gchar *application_id, GApplicationFlags flags);
|
---|
261 | extern GtkWidget *gtk_application_window_new(GtkApplication *application);
|
---|
262 |
|
---|
263 | extern GType gtk_box_get_type(void);
|
---|
264 | extern GtkWidget* gtk_box_new(GtkOrientation orientation, gint spacing);
|
---|
265 | extern void gtk_box_pack_start(GtkBox* box, GtkWidget* child, gboolean expand, gboolean fill,
|
---|
266 | guint padding);
|
---|
267 | extern GtkWidget* gtk_button_new(void);
|
---|
268 |
|
---|
269 | extern GtkClipboard *gtk_clipboard_get(GdkAtom selection);
|
---|
270 | extern void gtk_clipboard_request_contents(GtkClipboard *clipboard, GdkAtom target,
|
---|
271 | GtkClipboardReceivedFunc callback, gpointer user_data);
|
---|
272 | extern gboolean gtk_clipboard_set_with_data(GtkClipboard* clipboard, const GtkTargetEntry* targets,
|
---|
273 | guint n_targets, GtkClipboardGetFunc get_func,
|
---|
274 | GtkClipboardClearFunc clear_func, gpointer user_data);
|
---|
275 | extern void gtk_clipboard_store(GtkClipboard* clipboard);
|
---|
276 | extern gboolean gtk_clipboard_wait_for_targets(GtkClipboard *clipboard, GdkAtom **targets, gint *n_targets);
|
---|
277 | extern void gtk_container_add(GtkContainer* container, GtkWidget* widget);
|
---|
278 | extern GType gtk_container_get_type(void);
|
---|
279 |
|
---|
280 | extern void gtk_init(int *argc, char ***argv);
|
---|
281 | extern void gtk_main(void);
|
---|
282 | extern void gtk_main_quit(void);
|
---|
283 |
|
---|
284 | extern guchar *gtk_selection_data_get_data(const GtkSelectionData* selection_data);
|
---|
285 | extern GdkAtom gtk_selection_data_get_data_type(const GtkSelectionData *selection_data);
|
---|
286 | extern const guchar *gtk_selection_data_get_data_with_length(const GtkSelectionData *selection_data, gint *length);
|
---|
287 | extern GdkAtom gtk_selection_data_get_target(const GtkSelectionData* selection_data);
|
---|
288 | extern void gtk_selection_data_set(GtkSelectionData* selection_data, GdkAtom type, gint format, const guchar* data, gint length);
|
---|
289 |
|
---|
290 | extern void gtk_target_list_add(GtkTargetList *list, GdkAtom target, guint flags, guint info);
|
---|
291 | extern GtkTargetList *gtk_target_list_new(const GtkTargetEntry *targets, guint ntargets);
|
---|
292 | extern void gtk_target_list_unref(GtkTargetList *list);
|
---|
293 |
|
---|
294 | extern void gtk_target_table_free(GtkTargetEntry* targets, gint n_targets);
|
---|
295 | extern GtkTargetEntry *gtk_target_table_new_from_list(GtkTargetList* list, gint* n_targets);
|
---|
296 |
|
---|
297 | extern void gtk_widget_destroy(GtkWidget* widget);
|
---|
298 | extern GType gtk_widget_get_type(void);
|
---|
299 | extern void gtk_widget_set_opacity(GtkWidget* widget, double opacity);
|
---|
300 | extern void gtk_widget_show_all(GtkWidget* widget);
|
---|
301 |
|
---|
302 | extern GType gtk_window_get_type(void);
|
---|
303 | extern void gtk_window_iconify(GtkWindow* window);
|
---|
304 | extern void gtk_window_present(GtkWindow* window);
|
---|
305 | extern void gtk_window_resize(GtkWindow* window, gint width, gint height);
|
---|
306 | extern void gtk_window_set_default_size(GtkWindow* window, gint width, gint height);
|
---|
307 |
|
---|
308 |
|
---|
309 | /**
|
---|
310 | * Glib definitions.
|
---|
311 | */
|
---|
312 |
|
---|
313 |
|
---|
314 | extern GType g_application_get_type(void);
|
---|
315 | extern gulong g_signal_connect_data(gpointer instance, const gchar *detailed_signal,
|
---|
316 | GCallback c_handler, gpointer data,
|
---|
317 | GClosureNotify destroy_data, GConnectFlags connect_flags);
|
---|
318 | extern void g_free(gpointer mem);
|
---|
319 |
|
---|
320 | extern int g_application_run(GApplication *application, int argc, char **argv);
|
---|
321 | extern GApplication *g_application_get_default(void);
|
---|
322 | extern void g_application_quit(GApplication *application);
|
---|
323 | extern void g_object_unref(gpointer object);
|
---|
324 |
|
---|
325 | } /* extern "C" */
|
---|
326 |
|
---|
327 | #endif /* !GA_INCLUDED_SRC_x11_VBoxClient_vbox_gtk_3_h */
|
---|
328 |
|
---|