]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GtkmmX.h
Minipage is no more (long live the box inset)
[lyx.git] / src / frontends / gtk / GtkmmX.h
1 // -*- C++ -*-
2 /**
3  * \file GtkmmX.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Huang Ying
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef GTKMMX_H
13 #define GTKMMX_H
14
15 #include <X11/Xlib.h>
16 #include <gtkmm.h>
17 #include <gdk/gdkx.h>
18
19
20 inline Display * getDisplay()
21 {
22         return gdk_x11_get_default_xdisplay();
23 }
24
25
26 inline int getScreen()
27 {
28         return gdk_x11_get_default_screen();
29 }
30
31
32 inline Window getRootWindow()
33 {
34         static Window rootWin =
35                 GDK_WINDOW_XID(Gdk::Display::get_default()->
36                                get_default_screen()->
37                                get_root_window()->gobj());
38         return rootWin;
39 }
40
41
42 inline int getDepth()
43 {
44         static int depth;
45         if (!depth) {
46                 int width, height, x, y;
47                 Gdk::Display::get_default()->get_default_screen()->
48                         get_root_window()->
49                         get_geometry(x, y, width, height, depth);
50         }
51         return depth;
52 }
53
54
55 inline Colormap getColormap()
56 {
57         static Colormap colormap = GDK_COLORMAP_XCOLORMAP(
58                 Gdk::Display::get_default()->get_default_screen()->
59                 get_default_colormap()->gobj());
60         return colormap;
61 }
62
63
64 #endif