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