]>
Commit | Line | Data |
---|---|---|
f618020a MB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/unix/utilsx11.h | |
3 | // Purpose: Miscellaneous X11 functions | |
acdc8633 | 4 | // Author: Mattia Barbon, Vaclav Slavik, Vadim Zeitlin |
f618020a MB |
5 | // Modified by: |
6 | // Created: 25.03.02 | |
7 | // RCS-ID: $Id$ | |
77ffb593 | 8 | // Copyright: (c) wxWidgets team |
acdc8633 | 9 | // (c) 2010 Vadim Zeitlin |
65571936 | 10 | // Licence: wxWindows licence |
f618020a MB |
11 | ///////////////////////////////////////////////////////////////////////////// |
12 | ||
13 | #ifndef _WX_UNIX_UTILSX11_H_ | |
14 | #define _WX_UNIX_UTILSX11_H_ | |
15 | ||
16 | #include "wx/defs.h" | |
8166ab43 VS |
17 | #include "wx/gdicmn.h" |
18 | ||
acdc8633 VZ |
19 | #include <X11/Xlib.h> |
20 | ||
77ffb593 | 21 | // NB: Content of this header is for wxWidgets' private use! It is not |
8166ab43 | 22 | // part of public API and may be modified or even disappear in the future! |
f618020a MB |
23 | |
24 | #if defined(__WXMOTIF__) || defined(__WXGTK__) || defined(__WXX11__) | |
25 | ||
26 | #if defined(__WXGTK__) | |
27 | typedef void WXDisplay; | |
28 | typedef void* WXWindow; | |
29 | #endif | |
590e3264 | 30 | typedef unsigned long WXKeySym; |
f618020a | 31 | |
571d991b VZ |
32 | int wxCharCodeXToWX(WXKeySym keySym); |
33 | WXKeySym wxCharCodeWXToX(int id); | |
34 | ||
f618020a MB |
35 | class wxIconBundle; |
36 | ||
37 | void wxSetIconsX11( WXDisplay* display, WXWindow window, | |
38 | const wxIconBundle& ib ); | |
39 | ||
8166ab43 VS |
40 | |
41 | enum wxX11FullScreenMethod | |
42 | { | |
43 | wxX11_FS_AUTODETECT = 0, | |
44 | wxX11_FS_WMSPEC, | |
45 | wxX11_FS_KDE, | |
46 | wxX11_FS_GENERIC | |
47 | }; | |
48 | ||
49 | wxX11FullScreenMethod wxGetFullScreenMethodX11(WXDisplay* display, | |
50 | WXWindow rootWindow); | |
51 | ||
52 | void wxSetFullScreenStateX11(WXDisplay* display, WXWindow rootWindow, | |
53 | WXWindow window, bool show, wxRect *origSize, | |
54 | wxX11FullScreenMethod method); | |
55 | ||
f618020a | 56 | |
acdc8633 VZ |
57 | // Class wrapping X11 Display: it opens it in ctor and closes it in dtor. |
58 | class wxX11Display | |
59 | { | |
60 | public: | |
61 | wxX11Display() { m_dpy = XOpenDisplay(NULL); } | |
62 | ~wxX11Display() { if ( m_dpy ) XCloseDisplay(m_dpy); } | |
63 | ||
64 | operator Display *() const { return m_dpy; } | |
65 | ||
66 | // Using DefaultRootWindow() with an object of wxX11Display class doesn't | |
67 | // compile because it is a macro which tries to cast wxX11Display so | |
68 | // provide a convenient helper. | |
69 | Window DefaultRoot() const { return DefaultRootWindow(m_dpy); } | |
70 | ||
71 | private: | |
72 | Display *m_dpy; | |
73 | ||
74 | wxDECLARE_NO_COPY_CLASS(wxX11Display); | |
75 | }; | |
76 | ||
77 | #endif // __WXMOTIF__, __WXGTK__, __WXX11__ | |
78 | ||
79 | #endif // _WX_UNIX_UTILSX11_H_ |