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