]> git.lyx.org Git - lyx.git/blob - src/frontends/gtk/GtkmmX.h
Change glob() API to accept a dir parameter.
[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 <gtkmm.h>
16 #include <gdk/gdkx.h>
17
18 #include <X11/Xlib.h>
19
20
21 inline Display * getDisplay()
22 {
23         return gdk_x11_get_default_xdisplay();
24 }
25
26
27 inline int getScreen()
28 {
29         return gdk_x11_get_default_screen();
30 }
31
32
33 inline Window getRootWindow()
34 {
35         static Window rootWin =
36                 GDK_WINDOW_XID(Gdk::Display::get_default()->
37                                get_default_screen()->
38                                get_root_window()->gobj());
39         return rootWin;
40 }
41
42
43 inline int getDepth()
44 {
45         static int depth;
46         if (!depth) {
47                 int width, height, x, y;
48                 Gdk::Display::get_default()->get_default_screen()->
49                         get_root_window()->
50                         get_geometry(x, y, width, height, depth);
51         }
52         return depth;
53 }
54
55
56 inline Colormap getColormap()
57 {
58         static Colormap colormap = GDK_COLORMAP_XCOLORMAP(
59                 Gdk::Display::get_default()->get_default_screen()->
60                 get_default_colormap()->gobj());
61         return colormap;
62 }
63
64
65 #endif