1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
14 typedef union _GdkEvent GdkEvent
;
15 typedef struct _GdkWindow GdkWindow
;
16 typedef struct _GdkDisplay GdkDisplay
;
17 typedef struct _GdkScreen GdkScreen
;
21 GDK_FULLSCREEN_ON_CURRENT_MONITOR
,
22 GDK_FULLSCREEN_ON_ALL_MONITORS
25 int main(int argc
, char *argv
[])
28 void (*gtk_init
)(int*, char***);
29 GdkWindow
* (*gdk_x11_window_foreign_new_for_display
)(GdkDisplay
*, Window
);
30 GdkDisplay
* (*gdk_display_get_default
)(void);
31 GdkEvent
* (*gdk_event_get
)(void);
32 void (*gtk_main_do_event
)(GdkEvent
*);
33 void (*gdk_event_free
)(GdkEvent
*);
34 void (*gdk_window_fullscreen
)(GdkWindow
*);
35 void (*gdk_window_set_fullscreen_mode
)(GdkWindow
*, GdkFullscreenMode
);
41 handle
= dlopen("libgtk-3.so.0", RTLD_LAZY
);
45 gtk_init
= (void (*) (int*, char***))
46 dlsym(handle
, "gtk_init");
47 gdk_x11_window_foreign_new_for_display
= (GdkWindow
* (*)(GdkDisplay
*, Window
))
48 dlsym(handle
, "gdk_x11_window_foreign_new_for_display");
49 gdk_display_get_default
= (GdkDisplay
* (*)(void))
50 dlsym(handle
, "gdk_display_get_default");
51 gdk_event_get
= (GdkEvent
* (*)(void))
52 dlsym(handle
, "gdk_event_get");
53 gtk_main_do_event
= (void (*)(GdkEvent
*))
54 dlsym(handle
, "gtk_main_do_event");
55 gdk_event_free
= (void (*)(GdkEvent
*))
56 dlsym(handle
, "gdk_event_free");
57 gdk_window_fullscreen
= (void (*)(GdkWindow
*))
58 dlsym(handle
, "gdk_window_fullscreen");
59 gdk_window_set_fullscreen_mode
= (void (*)(GdkWindow
*, GdkFullscreenMode
))
60 dlsym(handle
, "gdk_window_set_fullscreen_mode");
63 !gdk_x11_window_foreign_new_for_display
||
64 !gdk_display_get_default
||
68 !gdk_window_fullscreen
||
69 !gdk_window_set_fullscreen_mode
)
75 gtk_init(&argc
, &argv
);
77 windowid
= atoi(argv
[1]);
79 window
= gdk_x11_window_foreign_new_for_display(gdk_display_get_default(), windowid
);
86 gdk_window_set_fullscreen_mode(window
, GDK_FULLSCREEN_ON_ALL_MONITORS
);
87 gdk_window_fullscreen(window
);
89 while ((event
= gdk_event_get()) != NULL
)
91 gtk_main_do_event(event
);
92 gdk_event_free(event
);
98 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */