/src/gui/kernel/qt_x11_p.h

https://bitbucket.org/ultra_iter/qt-vtl · C Header · 757 lines · 518 code · 120 blank · 119 comment · 7 complexity · 06465bc8d8f38fac184d15fa63ceb1ba MD5 · raw file

  1. /****************************************************************************
  2. **
  3. ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
  4. ** All rights reserved.
  5. ** Contact: Nokia Corporation (qt-info@nokia.com)
  6. **
  7. ** This file is part of the QtGui module of the Qt Toolkit.
  8. **
  9. ** $QT_BEGIN_LICENSE:LGPL$
  10. ** GNU Lesser General Public License Usage
  11. ** This file may be used under the terms of the GNU Lesser General Public
  12. ** License version 2.1 as published by the Free Software Foundation and
  13. ** appearing in the file LICENSE.LGPL included in the packaging of this
  14. ** file. Please review the following information to ensure the GNU Lesser
  15. ** General Public License version 2.1 requirements will be met:
  16. ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
  17. **
  18. ** In addition, as a special exception, Nokia gives you certain additional
  19. ** rights. These rights are described in the Nokia Qt LGPL Exception
  20. ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
  21. **
  22. ** GNU General Public License Usage
  23. ** Alternatively, this file may be used under the terms of the GNU General
  24. ** Public License version 3.0 as published by the Free Software Foundation
  25. ** and appearing in the file LICENSE.GPL included in the packaging of this
  26. ** file. Please review the following information to ensure the GNU General
  27. ** Public License version 3.0 requirements will be met:
  28. ** http://www.gnu.org/copyleft/gpl.html.
  29. **
  30. ** Other Usage
  31. ** Alternatively, this file may be used in accordance with the terms and
  32. ** conditions contained in a signed written agreement between you and Nokia.
  33. **
  34. **
  35. **
  36. **
  37. **
  38. ** $QT_END_LICENSE$
  39. **
  40. ****************************************************************************/
  41. #ifndef QT_X11_P_H
  42. #define QT_X11_P_H
  43. //
  44. // W A R N I N G
  45. // -------------
  46. //
  47. // This file is not part of the Qt API. It exists purely as an
  48. // implementation detail. This header file may change from version to
  49. // version without notice, or even be removed.
  50. //
  51. // We mean it.
  52. //
  53. #include "QtGui/qwindowdefs.h"
  54. #include "QtCore/qhash.h"
  55. #include "QtCore/qlist.h"
  56. #include "QtCore/qvariant.h"
  57. // the following is necessary to work around breakage in many versions
  58. // of XFree86's Xlib.h still in use
  59. // ### which versions?
  60. #if defined(_XLIB_H_) // crude hack, but...
  61. #error "cannot include <X11/Xlib.h> before this file"
  62. #endif
  63. #define XRegisterIMInstantiateCallback qt_XRegisterIMInstantiateCallback
  64. #define XUnregisterIMInstantiateCallback qt_XUnregisterIMInstantiateCallback
  65. #define XSetIMValues qt_XSetIMValues
  66. #include <X11/Xlib.h>
  67. #undef XRegisterIMInstantiateCallback
  68. #undef XUnregisterIMInstantiateCallback
  69. #undef XSetIMValues
  70. #include <X11/Xutil.h>
  71. #include <X11/Xos.h>
  72. #ifdef index
  73. # undef index
  74. #endif
  75. #ifdef rindex
  76. # undef rindex
  77. #endif
  78. #ifdef Q_OS_VXWORS
  79. # ifdef open
  80. # undef open
  81. # endif
  82. # ifdef getpid
  83. # undef getpid
  84. # endif
  85. #endif // Q_OS_VXWORKS
  86. #include <X11/Xatom.h>
  87. //#define QT_NO_SHAPE
  88. #ifdef QT_NO_SHAPE
  89. # define XShapeCombineRegion(a,b,c,d,e,f,g)
  90. # define XShapeCombineMask(a,b,c,d,e,f,g)
  91. #else
  92. # include <X11/extensions/shape.h>
  93. #endif // QT_NO_SHAPE
  94. #if !defined (QT_NO_TABLET)
  95. # include <X11/extensions/XInput.h>
  96. #if defined (Q_OS_IRIX)
  97. # include <X11/extensions/SGIMisc.h>
  98. # include <wacom.h>
  99. #endif
  100. #endif // QT_NO_TABLET
  101. // #define QT_NO_XINERAMA
  102. #ifndef QT_NO_XINERAMA
  103. # if 0 // ### Xsun, but how to detect it?
  104. // Xinerama is only supported in Solaris 7 with patches 107648/108376 and
  105. // Solaris 8 or above which introduce the X11R6.4 Xserver.
  106. // To switch the Xinerama functionality on, you need to add the "+xinerama"
  107. // argument to the Xsun start line.
  108. // At least Solaris 7 and 8 are missing Xinerama system headers and function
  109. // declarations (bug 4284701).
  110. // The Xinerama API is not documented. In theory it could change but it
  111. // probably won't because Sun are using it in at least dtlogin (bug 4221829).
  112. extern "C" Bool XPanoramiXQueryExtension(
  113. Display*,
  114. int*,
  115. int*
  116. );
  117. extern "C" Status XPanoramiXQueryVersion(
  118. Display*,
  119. int*,
  120. int*
  121. );
  122. extern "C" Status XPanoramiXGetState(
  123. Display*,
  124. Drawable,
  125. XPanoramiXInfo*
  126. );
  127. extern "C" Status XPanoramiXGetScreenCount(
  128. Display *,
  129. Drawable,
  130. XPanoramiXInfo*
  131. );
  132. extern "C" Status XPanoramiXGetScreenSize(
  133. Display*,
  134. Drawable,
  135. int,
  136. XPanoramiXInfo*
  137. );
  138. # else // XFree86
  139. // XFree86 does not C++ify Xinerama (at least up to XFree86 4.0.3).
  140. extern "C" {
  141. # include <X11/extensions/Xinerama.h>
  142. }
  143. # endif
  144. #endif // QT_NO_XINERAMA
  145. // #define QT_NO_XRANDR
  146. #ifndef QT_NO_XRANDR
  147. # include <X11/extensions/Xrandr.h>
  148. #endif // QT_NO_XRANDR
  149. // #define QT_NO_XRENDER
  150. #ifndef QT_NO_XRENDER
  151. # include <X11/extensions/Xrender.h>
  152. #endif // QT_NO_XRENDER
  153. #ifndef QT_NO_XSYNC
  154. extern "C" {
  155. # include "X11/extensions/sync.h"
  156. }
  157. #endif
  158. // #define QT_NO_XKB
  159. #ifndef QT_NO_XKB
  160. # include <X11/XKBlib.h>
  161. #endif // QT_NO_XKB
  162. #if !defined(XlibSpecificationRelease)
  163. # define X11R4
  164. typedef char *XPointer;
  165. #else
  166. # undef X11R4
  167. #endif
  168. // #define QT_NO_XIM
  169. #if defined(X11R4)
  170. // X11R4 does not have XIM
  171. #define QT_NO_XIM
  172. #elif defined(Q_OS_OSF) && (XlibSpecificationRelease < 6)
  173. // broken in Xlib up to OSF/1 3.2
  174. #define QT_NO_XIM
  175. #elif defined(Q_OS_AIX)
  176. // broken in Xlib up to what version of AIX?
  177. #define QT_NO_XIM
  178. #elif defined(QT_NO_DEBUG) && defined(Q_OS_IRIX)
  179. // XmbLookupString broken on IRIX
  180. // XCreateIC broken when compiling -64 on IRIX 6.5.2
  181. #define QT_NO_XIM
  182. #elif defined(Q_OS_HPUX) && defined(__LP64__)
  183. // XCreateIC broken when compiling 64-bit ELF on HP-UX 11.0
  184. #define QT_NO_XIM
  185. #elif defined(Q_OS_SCO)
  186. // ### suggested by user...
  187. // ### #define QT_NO_XIM
  188. #endif // QT_NO_XIM
  189. #ifndef QT_NO_XFIXES
  190. typedef Bool (*PtrXFixesQueryExtension)(Display *, int *, int *);
  191. typedef Status (*PtrXFixesQueryVersion)(Display *, int *, int *);
  192. typedef void (*PtrXFixesSetCursorName)(Display *dpy, Cursor cursor, const char *name);
  193. typedef void (*PtrXFixesSelectSelectionInput)(Display *dpy, Window win, Atom selection, unsigned long eventMask);
  194. #endif // QT_NO_XFIXES
  195. #ifndef QT_NO_XCURSOR
  196. #include <X11/Xcursor/Xcursor.h>
  197. typedef Cursor (*PtrXcursorLibraryLoadCursor)(Display *, const char *);
  198. #endif // QT_NO_XCURSOR
  199. #ifndef QT_NO_XINERAMA
  200. typedef Bool (*PtrXineramaQueryExtension)(Display *dpy, int *event_base, int *error_base);
  201. typedef Bool (*PtrXineramaIsActive)(Display *dpy);
  202. typedef XineramaScreenInfo *(*PtrXineramaQueryScreens)(Display *dpy, int *number);
  203. #endif // QT_NO_XINERAMA
  204. #ifndef QT_NO_XRANDR
  205. typedef void (*PtrXRRSelectInput)(Display *, Window, int);
  206. typedef int (*PtrXRRUpdateConfiguration)(XEvent *);
  207. typedef int (*PtrXRRRootToScreen)(Display *, Window);
  208. typedef Bool (*PtrXRRQueryExtension)(Display *, int *, int *);
  209. #endif // QT_NO_XRANDR
  210. #ifndef QT_NO_XINPUT
  211. typedef int (*PtrXCloseDevice)(Display *, XDevice *);
  212. typedef XDeviceInfo* (*PtrXListInputDevices)(Display *, int *);
  213. typedef XDevice* (*PtrXOpenDevice)(Display *, XID);
  214. typedef void (*PtrXFreeDeviceList)(XDeviceInfo *);
  215. typedef int (*PtrXSelectExtensionEvent)(Display *, Window, XEventClass *, int);
  216. #endif // QT_NO_XINPUT
  217. /*
  218. * Solaris patch 108652-47 and higher fixes crases in
  219. * XRegisterIMInstantiateCallback, but the function doesn't seem to
  220. * work.
  221. *
  222. * Instead, we disabled R6 input, and open the input method
  223. * immediately at application start.
  224. */
  225. #if !defined(QT_NO_XIM) && (XlibSpecificationRelease >= 6) && \
  226. !defined(Q_OS_SOLARIS)
  227. #define USE_X11R6_XIM
  228. //######### XFree86 has wrong declarations for XRegisterIMInstantiateCallback
  229. //######### and XUnregisterIMInstantiateCallback in at least version 3.3.2.
  230. //######### Many old X11R6 header files lack XSetIMValues.
  231. //######### Therefore, we have to declare these functions ourselves.
  232. extern "C" Bool XRegisterIMInstantiateCallback(
  233. Display*,
  234. struct _XrmHashBucketRec*,
  235. char*,
  236. char*,
  237. XIMProc, //XFree86 has XIDProc, which has to be wrong
  238. XPointer
  239. );
  240. extern "C" Bool XUnregisterIMInstantiateCallback(
  241. Display*,
  242. struct _XrmHashBucketRec*,
  243. char*,
  244. char*,
  245. XIMProc, //XFree86 has XIDProc, which has to be wrong
  246. XPointer
  247. );
  248. extern "C" char *XSetIMValues(XIM /* im */, ...);
  249. #endif
  250. #ifndef QT_NO_FONTCONFIG
  251. #include <fontconfig/fontconfig.h>
  252. #endif
  253. #ifndef QT_NO_XIM
  254. // some platforms (eg. Solaris 2.51) don't have these defines in Xlib.h
  255. #ifndef XNResetState
  256. #define XNResetState "resetState"
  257. #endif
  258. #ifndef XIMPreserveState
  259. #define XIMPreserveState (1L<<1)
  260. #endif
  261. #endif
  262. #ifndef X11R4
  263. # include <X11/Xlocale.h>
  264. #endif // X11R4
  265. #ifndef QT_NO_MITSHM
  266. # include <X11/extensions/XShm.h>
  267. #endif // QT_NO_MITSHM
  268. QT_BEGIN_NAMESPACE
  269. class QWidget;
  270. struct QX11InfoData {
  271. uint ref;
  272. int screen;
  273. int dpiX;
  274. int dpiY;
  275. int depth;
  276. int cells;
  277. Colormap colormap;
  278. Visual *visual;
  279. bool defaultColormap;
  280. bool defaultVisual;
  281. int subpixel;
  282. };
  283. class QDrag;
  284. struct QXdndDropTransaction
  285. {
  286. Time timestamp;
  287. Window target;
  288. Window proxy_target;
  289. QWidget *targetWidget;
  290. QWidget *embedding_widget;
  291. QDrag *object;
  292. };
  293. class QMimeData;
  294. struct QX11Data;
  295. extern Q_GUI_EXPORT QX11Data *qt_x11Data;
  296. enum DesktopEnvironment {
  297. DE_UNKNOWN,
  298. DE_KDE,
  299. DE_GNOME,
  300. DE_CDE,
  301. DE_MEEGO_COMPOSITOR,
  302. DE_4DWM
  303. };
  304. struct QX11Data
  305. {
  306. static Qt::KeyboardModifiers translateModifiers(int s);
  307. Window findClientWindow(Window, Atom, bool);
  308. // from qclipboard_x11.cpp
  309. bool clipboardWaitForEvent(Window win, int type, XEvent *event, int timeout);
  310. bool clipboardReadProperty(Window win, Atom property, bool deleteProperty,
  311. QByteArray *buffer, int *size, Atom *type, int *format);
  312. QByteArray clipboardReadIncrementalProperty(Window win, Atom property, int nbytes, bool nullterm);
  313. // from qdnd_x11.cpp
  314. bool dndEnable(QWidget* w, bool on);
  315. static void xdndSetup();
  316. void xdndHandleEnter(QWidget *, const XEvent *, bool);
  317. void xdndHandlePosition(QWidget *, const XEvent *, bool);
  318. void xdndHandleStatus(QWidget *, const XEvent *, bool);
  319. void xdndHandleLeave(QWidget *, const XEvent *, bool);
  320. void xdndHandleDrop(QWidget *, const XEvent *, bool);
  321. void xdndHandleFinished(QWidget *, const XEvent *, bool);
  322. void xdndHandleSelectionRequest(const XSelectionRequestEvent *);
  323. static bool xdndHandleBadwindow();
  324. QByteArray xdndAtomToString(Atom a);
  325. Atom xdndStringToAtom(const char *);
  326. QString xdndMimeAtomToString(Atom a);
  327. Atom xdndMimeStringToAtom(const QString &mimeType);
  328. QStringList xdndMimeFormatsForAtom(Atom a);
  329. bool xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat);
  330. QList<Atom> xdndMimeAtomsForFormat(const QString &format);
  331. QVariant xdndMimeConvertToFormat(Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding);
  332. Atom xdndMimeAtomForFormat(const QString &format, QVariant::Type requestedType, const QList<Atom> &atoms, QByteArray *requestedEncoding);
  333. QList<QXdndDropTransaction> dndDropTransactions;
  334. // from qmotifdnd_x11.cpp
  335. void motifdndHandle(QWidget *, const XEvent *, bool);
  336. void motifdndEnable(QWidget *, bool);
  337. QVariant motifdndObtainData(const char *format);
  338. QByteArray motifdndFormat(int n);
  339. bool motifdnd_active;
  340. Display *display;
  341. char *displayName;
  342. bool foreignDisplay;
  343. // current focus model
  344. enum {
  345. FM_Unknown = -1,
  346. FM_Other = 0,
  347. FM_PointerRoot = 1
  348. };
  349. int focus_model;
  350. // true if Qt is compiled w/ RANDR support and RANDR is supported on the connected Display
  351. bool use_xrandr;
  352. int xrandr_major;
  353. int xrandr_eventbase;
  354. int xrandr_errorbase;
  355. // true if Qt is compiled w/ RENDER support and RENDER is supported on the connected Display
  356. bool use_xrender;
  357. int xrender_major;
  358. int xrender_version;
  359. // true if Qt is compiled w/ XFIXES support and XFIXES is supported on the connected Display
  360. bool use_xfixes;
  361. int xfixes_major;
  362. int xfixes_eventbase;
  363. int xfixes_errorbase;
  364. #ifndef QT_NO_XFIXES
  365. PtrXFixesQueryExtension ptrXFixesQueryExtension;
  366. PtrXFixesQueryVersion ptrXFixesQueryVersion;
  367. PtrXFixesSetCursorName ptrXFixesSetCursorName;
  368. PtrXFixesSelectSelectionInput ptrXFixesSelectSelectionInput;
  369. #endif
  370. #ifndef QT_NO_XINPUT
  371. PtrXCloseDevice ptrXCloseDevice;
  372. PtrXListInputDevices ptrXListInputDevices;
  373. PtrXOpenDevice ptrXOpenDevice;
  374. PtrXFreeDeviceList ptrXFreeDeviceList;
  375. PtrXSelectExtensionEvent ptrXSelectExtensionEvent;
  376. #endif // QT_NO_XINPUT
  377. // true if Qt is compiled w/ MIT-SHM support and MIT-SHM is supported on the connected Display
  378. bool use_mitshm;
  379. bool use_mitshm_pixmaps;
  380. int mitshm_major;
  381. // true if Qt is compiled w/ Tablet support and we have a tablet.
  382. bool use_xinput;
  383. int xinput_major;
  384. int xinput_eventbase;
  385. int xinput_errorbase;
  386. // for XKEYBOARD support
  387. bool use_xkb;
  388. int xkb_major;
  389. int xkb_eventbase;
  390. int xkb_errorbase;
  391. QList<QWidget *> deferred_map;
  392. struct ScrollInProgress {
  393. long id;
  394. QWidget* scrolled_widget;
  395. int dx, dy;
  396. };
  397. long sip_serial;
  398. QList<ScrollInProgress> sip_list;
  399. // window managers list of supported "stuff"
  400. Atom *net_supported_list;
  401. // list of virtual root windows
  402. Window *net_virtual_root_list;
  403. // client leader window
  404. Window wm_client_leader;
  405. QX11InfoData *screens;
  406. Visual **argbVisuals;
  407. Colormap *argbColormaps;
  408. int screenCount;
  409. int defaultScreen;
  410. QHash<int, int> bppForDepth;
  411. Time time;
  412. Time userTime;
  413. QString default_im;
  414. // starts to ignore bad window errors from X
  415. static inline void ignoreBadwindow() {
  416. qt_x11Data->ignore_badwindow = true;
  417. qt_x11Data->seen_badwindow = false;
  418. }
  419. // ends ignoring bad window errors and returns whether an error had happened.
  420. static inline bool badwindow() {
  421. qt_x11Data->ignore_badwindow = false;
  422. return qt_x11Data->seen_badwindow;
  423. }
  424. bool ignore_badwindow;
  425. bool seen_badwindow;
  426. // options
  427. int visual_class;
  428. int visual_id;
  429. int color_count;
  430. bool custom_cmap;
  431. // outside visual/colormap
  432. Visual *visual;
  433. Colormap colormap;
  434. #ifndef QT_NO_XRENDER
  435. enum { solid_fill_count = 16 };
  436. struct SolidFills {
  437. XRenderColor color;
  438. int screen;
  439. Picture picture;
  440. } solid_fills[solid_fill_count];
  441. enum { pattern_fill_count = 16 };
  442. struct PatternFills {
  443. XRenderColor color;
  444. XRenderColor bg_color;
  445. int screen;
  446. int style;
  447. bool opaque;
  448. Picture picture;
  449. } pattern_fills[pattern_fill_count];
  450. Picture getSolidFill(int screen, const QColor &c);
  451. XRenderColor preMultiply(const QColor &c);
  452. #endif
  453. bool has_fontconfig;
  454. qreal fc_scale;
  455. bool fc_antialias;
  456. int fc_hint_style;
  457. char *startupId;
  458. DesktopEnvironment desktopEnvironment : 8;
  459. uint desktopVersion : 8; /* Used only for KDE */
  460. /* Warning: if you modify this list, modify the names of atoms in qapplication_x11.cpp as well! */
  461. enum X11Atom {
  462. // window-manager <-> client protocols
  463. WM_PROTOCOLS,
  464. WM_DELETE_WINDOW,
  465. WM_TAKE_FOCUS,
  466. _NET_WM_PING,
  467. _NET_WM_CONTEXT_HELP,
  468. _NET_WM_SYNC_REQUEST,
  469. _NET_WM_SYNC_REQUEST_COUNTER,
  470. // ICCCM window state
  471. WM_STATE,
  472. WM_CHANGE_STATE,
  473. // Session management
  474. WM_CLIENT_LEADER,
  475. WM_WINDOW_ROLE,
  476. SM_CLIENT_ID,
  477. // Clipboard
  478. CLIPBOARD,
  479. INCR,
  480. TARGETS,
  481. MULTIPLE,
  482. TIMESTAMP,
  483. SAVE_TARGETS,
  484. CLIP_TEMPORARY,
  485. _QT_SELECTION,
  486. _QT_CLIPBOARD_SENTINEL,
  487. _QT_SELECTION_SENTINEL,
  488. CLIPBOARD_MANAGER,
  489. RESOURCE_MANAGER,
  490. _XSETROOT_ID,
  491. _QT_SCROLL_DONE,
  492. _QT_INPUT_ENCODING,
  493. _MOTIF_WM_HINTS,
  494. DTWM_IS_RUNNING,
  495. ENLIGHTENMENT_DESKTOP,
  496. _DT_SAVE_MODE,
  497. _SGI_DESKS_MANAGER,
  498. // EWMH (aka NETWM)
  499. _NET_SUPPORTED,
  500. _NET_VIRTUAL_ROOTS,
  501. _NET_WORKAREA,
  502. _NET_MOVERESIZE_WINDOW,
  503. _NET_WM_MOVERESIZE,
  504. _NET_WM_NAME,
  505. _NET_WM_ICON_NAME,
  506. _NET_WM_ICON,
  507. _NET_WM_PID,
  508. _NET_WM_WINDOW_OPACITY,
  509. _NET_WM_STATE,
  510. _NET_WM_STATE_ABOVE,
  511. _NET_WM_STATE_BELOW,
  512. _NET_WM_STATE_FULLSCREEN,
  513. _NET_WM_STATE_MAXIMIZED_HORZ,
  514. _NET_WM_STATE_MAXIMIZED_VERT,
  515. _NET_WM_STATE_MODAL,
  516. _NET_WM_STATE_STAYS_ON_TOP,
  517. _NET_WM_STATE_DEMANDS_ATTENTION,
  518. _NET_WM_USER_TIME,
  519. _NET_WM_USER_TIME_WINDOW,
  520. _NET_WM_FULL_PLACEMENT,
  521. _NET_WM_WINDOW_TYPE,
  522. _NET_WM_WINDOW_TYPE_DESKTOP,
  523. _NET_WM_WINDOW_TYPE_DOCK,
  524. _NET_WM_WINDOW_TYPE_TOOLBAR,
  525. _NET_WM_WINDOW_TYPE_MENU,
  526. _NET_WM_WINDOW_TYPE_UTILITY,
  527. _NET_WM_WINDOW_TYPE_SPLASH,
  528. _NET_WM_WINDOW_TYPE_DIALOG,
  529. _NET_WM_WINDOW_TYPE_DROPDOWN_MENU,
  530. _NET_WM_WINDOW_TYPE_POPUP_MENU,
  531. _NET_WM_WINDOW_TYPE_TOOLTIP,
  532. _NET_WM_WINDOW_TYPE_NOTIFICATION,
  533. _NET_WM_WINDOW_TYPE_COMBO,
  534. _NET_WM_WINDOW_TYPE_DND,
  535. _NET_WM_WINDOW_TYPE_NORMAL,
  536. _KDE_NET_WM_WINDOW_TYPE_OVERRIDE,
  537. _KDE_NET_WM_FRAME_STRUT,
  538. _NET_STARTUP_INFO,
  539. _NET_STARTUP_INFO_BEGIN,
  540. _NET_SUPPORTING_WM_CHECK,
  541. _NET_WM_CM_S0,
  542. _NET_SYSTEM_TRAY_VISUAL,
  543. _NET_ACTIVE_WINDOW,
  544. // Property formats
  545. COMPOUND_TEXT,
  546. TEXT,
  547. UTF8_STRING,
  548. // Xdnd
  549. XdndEnter,
  550. XdndPosition,
  551. XdndStatus,
  552. XdndLeave,
  553. XdndDrop,
  554. XdndFinished,
  555. XdndTypelist,
  556. XdndActionList,
  557. XdndSelection,
  558. XdndAware,
  559. XdndProxy,
  560. XdndActionCopy,
  561. XdndActionLink,
  562. XdndActionMove,
  563. XdndActionPrivate,
  564. // Motif DND
  565. _MOTIF_DRAG_AND_DROP_MESSAGE,
  566. _MOTIF_DRAG_INITIATOR_INFO,
  567. _MOTIF_DRAG_RECEIVER_INFO,
  568. _MOTIF_DRAG_WINDOW,
  569. _MOTIF_DRAG_TARGETS,
  570. XmTRANSFER_SUCCESS,
  571. XmTRANSFER_FAILURE,
  572. // Xkb
  573. _XKB_RULES_NAMES,
  574. // XEMBED
  575. _XEMBED,
  576. _XEMBED_INFO,
  577. XWacomStylus,
  578. XWacomCursor,
  579. XWacomEraser,
  580. XTabletStylus,
  581. XTabletEraser,
  582. NPredefinedAtoms,
  583. _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms,
  584. NAtoms
  585. };
  586. Atom atoms[NAtoms];
  587. bool isSupportedByWM(Atom atom);
  588. bool compositingManagerRunning;
  589. #ifndef QT_NO_XCURSOR
  590. PtrXcursorLibraryLoadCursor ptrXcursorLibraryLoadCursor;
  591. #endif // QT_NO_XCURSOR
  592. #ifndef QT_NO_XINERAMA
  593. PtrXineramaQueryExtension ptrXineramaQueryExtension;
  594. PtrXineramaIsActive ptrXineramaIsActive;
  595. PtrXineramaQueryScreens ptrXineramaQueryScreens;
  596. #endif // QT_NO_XINERAMA
  597. #ifndef QT_NO_XRANDR
  598. PtrXRRSelectInput ptrXRRSelectInput;
  599. PtrXRRUpdateConfiguration ptrXRRUpdateConfiguration;
  600. PtrXRRRootToScreen ptrXRRRootToScreen;
  601. PtrXRRQueryExtension ptrXRRQueryExtension;
  602. #endif // QT_NO_XRANDR
  603. };
  604. extern QX11Data *qt_x11Data;
  605. #define ATOM(x) qt_x11Data->atoms[QX11Data::x]
  606. #define X11 qt_x11Data
  607. // rename a couple of X defines to get rid of name clashes
  608. // resolve the conflict between X11's FocusIn and QEvent::FocusIn
  609. enum {
  610. XFocusOut = FocusOut,
  611. XFocusIn = FocusIn,
  612. XKeyPress = KeyPress,
  613. XKeyRelease = KeyRelease,
  614. XNone = None,
  615. XRevertToParent = RevertToParent,
  616. XGrayScale = GrayScale,
  617. XCursorShape = CursorShape
  618. };
  619. #undef FocusOut
  620. #undef FocusIn
  621. #undef KeyPress
  622. #undef KeyRelease
  623. #undef None
  624. #undef RevertToParent
  625. #undef GrayScale
  626. #undef CursorShape
  627. #ifdef FontChange
  628. #undef FontChange
  629. #endif
  630. Q_DECLARE_TYPEINFO(XPoint, Q_PRIMITIVE_TYPE);
  631. Q_DECLARE_TYPEINFO(XRectangle, Q_PRIMITIVE_TYPE);
  632. Q_DECLARE_TYPEINFO(XChar2b, Q_PRIMITIVE_TYPE);
  633. #ifndef QT_NO_XRENDER
  634. Q_DECLARE_TYPEINFO(XGlyphElt32, Q_PRIMITIVE_TYPE);
  635. #endif
  636. QT_END_NAMESPACE
  637. #endif // QT_X11_P_H