Qt 4.8
Classes | Public Types | Public Functions | Static Public Functions | Public Variables | List of all members
QX11Data Struct Reference

#include <qt_x11_p.h>

Classes

struct  PatternFills
 
struct  ScrollInProgress
 
struct  SolidFills
 

Public Types

enum  { FM_Unknown = -1, FM_Other = 0, FM_PointerRoot = 1 }
 
enum  { solid_fill_count = 16 }
 
enum  { pattern_fill_count = 16 }
 
enum  X11Atom {
  WM_PROTOCOLS, WM_DELETE_WINDOW, WM_TAKE_FOCUS, _NET_WM_PING,
  _NET_WM_CONTEXT_HELP, _NET_WM_SYNC_REQUEST, _NET_WM_SYNC_REQUEST_COUNTER, WM_STATE,
  WM_CHANGE_STATE, WM_CLIENT_LEADER, WM_WINDOW_ROLE, SM_CLIENT_ID,
  CLIPBOARD, INCR, TARGETS, MULTIPLE,
  TIMESTAMP, SAVE_TARGETS, CLIP_TEMPORARY, _QT_SELECTION,
  _QT_CLIPBOARD_SENTINEL, _QT_SELECTION_SENTINEL, CLIPBOARD_MANAGER, RESOURCE_MANAGER,
  _XSETROOT_ID, _QT_SCROLL_DONE, _QT_INPUT_ENCODING, _MOTIF_WM_HINTS,
  DTWM_IS_RUNNING, ENLIGHTENMENT_DESKTOP, _DT_SAVE_MODE, _SGI_DESKS_MANAGER,
  _NET_SUPPORTED, _NET_VIRTUAL_ROOTS, _NET_WORKAREA, _NET_MOVERESIZE_WINDOW,
  _NET_WM_MOVERESIZE, _NET_WM_NAME, _NET_WM_ICON_NAME, _NET_WM_ICON,
  _NET_WM_PID, _NET_WM_WINDOW_OPACITY, _NET_WM_STATE, _NET_WM_STATE_ABOVE,
  _NET_WM_STATE_BELOW, _NET_WM_STATE_FULLSCREEN, _NET_WM_STATE_MAXIMIZED_HORZ, _NET_WM_STATE_MAXIMIZED_VERT,
  _NET_WM_STATE_MODAL, _NET_WM_STATE_STAYS_ON_TOP, _NET_WM_STATE_DEMANDS_ATTENTION, _NET_WM_USER_TIME,
  _NET_WM_USER_TIME_WINDOW, _NET_WM_FULL_PLACEMENT, _NET_WM_WINDOW_TYPE, _NET_WM_WINDOW_TYPE_DESKTOP,
  _NET_WM_WINDOW_TYPE_DOCK, _NET_WM_WINDOW_TYPE_TOOLBAR, _NET_WM_WINDOW_TYPE_MENU, _NET_WM_WINDOW_TYPE_UTILITY,
  _NET_WM_WINDOW_TYPE_SPLASH, _NET_WM_WINDOW_TYPE_DIALOG, _NET_WM_WINDOW_TYPE_DROPDOWN_MENU, _NET_WM_WINDOW_TYPE_POPUP_MENU,
  _NET_WM_WINDOW_TYPE_TOOLTIP, _NET_WM_WINDOW_TYPE_NOTIFICATION, _NET_WM_WINDOW_TYPE_COMBO, _NET_WM_WINDOW_TYPE_DND,
  _NET_WM_WINDOW_TYPE_NORMAL, _KDE_NET_WM_WINDOW_TYPE_OVERRIDE, _KDE_NET_WM_FRAME_STRUT, _NET_STARTUP_INFO,
  _NET_STARTUP_INFO_BEGIN, _NET_SUPPORTING_WM_CHECK, _NET_WM_CM_S0, _NET_SYSTEM_TRAY_VISUAL,
  _NET_ACTIVE_WINDOW, COMPOUND_TEXT, TEXT, UTF8_STRING,
  XdndEnter, XdndPosition, XdndStatus, XdndLeave,
  XdndDrop, XdndFinished, XdndTypelist, XdndActionList,
  XdndSelection, XdndAware, XdndProxy, XdndActionCopy,
  XdndActionLink, XdndActionMove, XdndActionPrivate, _MOTIF_DRAG_AND_DROP_MESSAGE,
  _MOTIF_DRAG_INITIATOR_INFO, _MOTIF_DRAG_RECEIVER_INFO, _MOTIF_DRAG_WINDOW, _MOTIF_DRAG_TARGETS,
  XmTRANSFER_SUCCESS, XmTRANSFER_FAILURE, _XKB_RULES_NAMES, _XEMBED,
  _XEMBED_INFO, XWacomStylus, XWacomCursor, XWacomEraser,
  XTabletStylus, XTabletEraser, XTablet, NPredefinedAtoms,
  _QT_SETTINGS_TIMESTAMP = NPredefinedAtoms, NAtoms
}
 

Public Functions

QByteArray clipboardReadIncrementalProperty (Window win, Atom property, int nbytes, bool nullterm)
 
bool clipboardReadProperty (Window win, Atom property, bool deleteProperty, QByteArray *buffer, int *size, Atom *type, int *format)
 
bool clipboardWaitForEvent (Window win, int type, XEvent *event, int timeout, bool checkManager=false)
 
bool dndEnable (QWidget *w, bool on)
 
Window findClientWindow (Window, Atom, bool)
 
Picture getSolidFill (int screen, const QColor &c)
 
bool isSupportedByWM (Atom atom)
 
void motifdndEnable (QWidget *, bool)
 
QByteArray motifdndFormat (int n)
 
void motifdndHandle (QWidget *, const XEvent *, bool)
 
QVariant motifdndObtainData (const char *format)
 
XRenderColor preMultiply (const QColor &c)
 
QByteArray xdndAtomToString (Atom a)
 
void xdndHandleDrop (QWidget *, const XEvent *, bool)
 
void xdndHandleEnter (QWidget *, const XEvent *, bool)
 
void xdndHandleFinished (QWidget *, const XEvent *, bool)
 
void xdndHandleLeave (QWidget *, const XEvent *, bool)
 
void xdndHandlePosition (QWidget *, const XEvent *, bool)
 
void xdndHandleSelectionRequest (const XSelectionRequestEvent *)
 
void xdndHandleStatus (QWidget *, const XEvent *, bool)
 
Atom xdndMimeAtomForFormat (const QString &format, QVariant::Type requestedType, const QList< Atom > &atoms, QByteArray *requestedEncoding)
 
QList< Atom > xdndMimeAtomsForFormat (const QString &format)
 
QString xdndMimeAtomToString (Atom a)
 
QVariant xdndMimeConvertToFormat (Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding)
 
bool xdndMimeDataForAtom (Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat)
 
QStringList xdndMimeFormatsForAtom (Atom a)
 
Atom xdndMimeStringToAtom (const QString &mimeType)
 
Atom xdndStringToAtom (const char *)
 

Static Public Functions

static bool badwindow ()
 
static void ignoreBadwindow ()
 
static Qt::KeyboardModifiers translateModifiers (int s)
 
static bool xdndHandleBadwindow ()
 
static void xdndSetup ()
 

Public Variables

Colormap * argbColormaps
 
Visual ** argbVisuals
 
Atom atoms [NAtoms]
 
QHash< int, int > bppForDepth
 
int color_count
 
Colormap colormap
 
bool compositingManagerRunning
 
bool custom_cmap
 
QString default_im
 
int defaultScreen
 
QList< QWidget * > deferred_map
 
DesktopEnvironment desktopEnvironment: 8
 
uint desktopVersion: 8
 
Displaydisplay
 
char * displayName
 
QList< QXdndDropTransactiondndDropTransactions
 
bool fc_antialias
 
int fc_hint_style
 
qreal fc_scale
 
int focus_model
 
bool foreignDisplay
 
bool has_fontconfig
 
bool ignore_badwindow
 
int mitshm_major
 
bool motifdnd_active
 
Atom * net_supported_list
 
Window * net_virtual_root_list
 
struct QX11Data::PatternFills pattern_fills [pattern_fill_count]
 
PtrXCloseDevice ptrXCloseDevice
 
PtrXcursorLibraryLoadCursor ptrXcursorLibraryLoadCursor
 
PtrXFixesQueryExtension ptrXFixesQueryExtension
 
PtrXFixesQueryVersion ptrXFixesQueryVersion
 
PtrXFixesSelectSelectionInput ptrXFixesSelectSelectionInput
 
PtrXFixesSetCursorName ptrXFixesSetCursorName
 
PtrXFreeDeviceList ptrXFreeDeviceList
 
PtrXineramaIsActive ptrXineramaIsActive
 
PtrXineramaQueryExtension ptrXineramaQueryExtension
 
PtrXineramaQueryScreens ptrXineramaQueryScreens
 
PtrXListInputDevices ptrXListInputDevices
 
PtrXOpenDevice ptrXOpenDevice
 
PtrXRRQueryExtension ptrXRRQueryExtension
 
PtrXRRRootToScreen ptrXRRRootToScreen
 
PtrXRRSelectInput ptrXRRSelectInput
 
PtrXRRUpdateConfiguration ptrXRRUpdateConfiguration
 
PtrXSelectExtensionEvent ptrXSelectExtensionEvent
 
int screenCount
 
QX11InfoDatascreens
 
bool seen_badwindow
 
QList< ScrollInProgresssip_list
 
long sip_serial
 
struct QX11Data::SolidFills solid_fills [solid_fill_count]
 
char * startupId
 
Time time
 
bool use_mitshm
 
bool use_mitshm_pixmaps
 
bool use_xfixes
 
bool use_xinput
 
bool use_xkb
 
bool use_xrandr
 
bool use_xrender
 
Time userTime
 
Visual * visual
 
int visual_class
 
int visual_id
 
Window wm_client_leader
 
int xfixes_errorbase
 
int xfixes_eventbase
 
int xfixes_major
 
int xinput_errorbase
 
int xinput_eventbase
 
int xinput_major
 
int xkb_errorbase
 
int xkb_eventbase
 
int xkb_major
 
int xrandr_errorbase
 
int xrandr_eventbase
 
int xrandr_major
 
int xrender_major
 
int xrender_version
 

Detailed Description

Definition at line 349 of file qt_x11_p.h.

Enumerations

◆ anonymous enum

anonymous enum
Enumerator
FM_Unknown 
FM_Other 
FM_PointerRoot 

Definition at line 396 of file qt_x11_p.h.

396  {
397  FM_Unknown = -1,
398  FM_Other = 0,
399  FM_PointerRoot = 1
400  };

◆ anonymous enum

anonymous enum
Enumerator
solid_fill_count 

Definition at line 507 of file qt_x11_p.h.

◆ anonymous enum

anonymous enum
Enumerator
pattern_fill_count 

Definition at line 513 of file qt_x11_p.h.

◆ X11Atom

Enumerator
WM_PROTOCOLS 
WM_DELETE_WINDOW 
WM_TAKE_FOCUS 
_NET_WM_PING 
_NET_WM_CONTEXT_HELP 
_NET_WM_SYNC_REQUEST 
_NET_WM_SYNC_REQUEST_COUNTER 
WM_STATE 
WM_CHANGE_STATE 
WM_CLIENT_LEADER 
WM_WINDOW_ROLE 
SM_CLIENT_ID 
CLIPBOARD 
INCR 
TARGETS 
MULTIPLE 
TIMESTAMP 
SAVE_TARGETS 
CLIP_TEMPORARY 
_QT_SELECTION 
_QT_CLIPBOARD_SENTINEL 
_QT_SELECTION_SENTINEL 
CLIPBOARD_MANAGER 
RESOURCE_MANAGER 
_XSETROOT_ID 
_QT_SCROLL_DONE 
_QT_INPUT_ENCODING 
_MOTIF_WM_HINTS 
DTWM_IS_RUNNING 
ENLIGHTENMENT_DESKTOP 
_DT_SAVE_MODE 
_SGI_DESKS_MANAGER 
_NET_SUPPORTED 
_NET_VIRTUAL_ROOTS 
_NET_WORKAREA 
_NET_MOVERESIZE_WINDOW 
_NET_WM_MOVERESIZE 
_NET_WM_NAME 
_NET_WM_ICON_NAME 
_NET_WM_ICON 
_NET_WM_PID 
_NET_WM_WINDOW_OPACITY 
_NET_WM_STATE 
_NET_WM_STATE_ABOVE 
_NET_WM_STATE_BELOW 
_NET_WM_STATE_FULLSCREEN 
_NET_WM_STATE_MAXIMIZED_HORZ 
_NET_WM_STATE_MAXIMIZED_VERT 
_NET_WM_STATE_MODAL 
_NET_WM_STATE_STAYS_ON_TOP 
_NET_WM_STATE_DEMANDS_ATTENTION 
_NET_WM_USER_TIME 
_NET_WM_USER_TIME_WINDOW 
_NET_WM_FULL_PLACEMENT 
_NET_WM_WINDOW_TYPE 
_NET_WM_WINDOW_TYPE_DESKTOP 
_NET_WM_WINDOW_TYPE_DOCK 
_NET_WM_WINDOW_TYPE_TOOLBAR 
_NET_WM_WINDOW_TYPE_MENU 
_NET_WM_WINDOW_TYPE_UTILITY 
_NET_WM_WINDOW_TYPE_SPLASH 
_NET_WM_WINDOW_TYPE_DIALOG 
_NET_WM_WINDOW_TYPE_DROPDOWN_MENU 
_NET_WM_WINDOW_TYPE_POPUP_MENU 
_NET_WM_WINDOW_TYPE_TOOLTIP 
_NET_WM_WINDOW_TYPE_NOTIFICATION 
_NET_WM_WINDOW_TYPE_COMBO 
_NET_WM_WINDOW_TYPE_DND 
_NET_WM_WINDOW_TYPE_NORMAL 
_KDE_NET_WM_WINDOW_TYPE_OVERRIDE 
_KDE_NET_WM_FRAME_STRUT 
_NET_STARTUP_INFO 
_NET_STARTUP_INFO_BEGIN 
_NET_SUPPORTING_WM_CHECK 
_NET_WM_CM_S0 
_NET_SYSTEM_TRAY_VISUAL 
_NET_ACTIVE_WINDOW 
COMPOUND_TEXT 
TEXT 
UTF8_STRING 
XdndEnter 
XdndPosition 
XdndStatus 
XdndLeave 
XdndDrop 
XdndFinished 
XdndTypelist 
XdndActionList 
XdndSelection 
XdndAware 
XdndProxy 
XdndActionCopy 
XdndActionLink 
XdndActionMove 
XdndActionPrivate 
_MOTIF_DRAG_AND_DROP_MESSAGE 
_MOTIF_DRAG_INITIATOR_INFO 
_MOTIF_DRAG_RECEIVER_INFO 
_MOTIF_DRAG_WINDOW 
_MOTIF_DRAG_TARGETS 
XmTRANSFER_SUCCESS 
XmTRANSFER_FAILURE 
_XKB_RULES_NAMES 
_XEMBED 
_XEMBED_INFO 
XWacomStylus 
XWacomCursor 
XWacomEraser 
XTabletStylus 
XTabletEraser 
XTablet 
NPredefinedAtoms 
_QT_SETTINGS_TIMESTAMP 
NAtoms 

Definition at line 537 of file qt_x11_p.h.

537  {
538  // window-manager <-> client protocols
539  WM_PROTOCOLS,
542  _NET_WM_PING,
546 
547  // ICCCM window state
548  WM_STATE,
550 
551  // Session management
554  SM_CLIENT_ID,
555 
556  // Clipboard
557  CLIPBOARD,
558  INCR,
559  TARGETS,
560  MULTIPLE,
561  TIMESTAMP,
562  SAVE_TARGETS,
568 
570 
571  _XSETROOT_ID,
572 
575 
577 
582 
583  // EWMH (aka NETWM)
587 
590 
591  _NET_WM_NAME,
593  _NET_WM_ICON,
594 
595  _NET_WM_PID,
596 
598 
608 
612 
629 
631 
634 
636 
638 
640 
642 
643  // Property formats
645  TEXT,
646  UTF8_STRING,
647 
648  // Xdnd
649  XdndEnter,
650  XdndPosition,
651  XdndStatus,
652  XdndLeave,
653  XdndDrop,
654  XdndFinished,
655  XdndTypelist,
657 
659 
660  XdndAware,
661  XdndProxy,
662 
667 
668  // Motif DND
674 
677 
678  // Xkb
680 
681  // XEMBED
682  _XEMBED,
683  _XEMBED_INFO,
684 
685  XWacomStylus,
686  XWacomCursor,
687  XWacomEraser,
688 
691  XTablet,
692 
694 
696  NAtoms
697  };

Functions

◆ badwindow()

static bool QX11Data::badwindow ( )
inlinestatic

Definition at line 488 of file qt_x11_p.h.

488  {
489  qt_x11Data->ignore_badwindow = false;
490  return qt_x11Data->seen_badwindow;
491  }
bool seen_badwindow
Definition: qt_x11_p.h:494
Q_GUI_EXPORT QX11Data * qt_x11Data
Definition: qt_x11_p.h:722
bool ignore_badwindow
Definition: qt_x11_p.h:493

◆ clipboardReadIncrementalProperty()

QByteArray QX11Data::clipboardReadIncrementalProperty ( Window  win,
Atom  property,
int  nbytes,
bool  nullterm 
)

Definition at line 725 of file qclipboard_x11.cpp.

726 {
727  XEvent event;
728 
729  QByteArray buf;
730  QByteArray tmp_buf;
731  bool alloc_error = false;
732  int length;
733  int offset = 0;
734 
735  if (nbytes > 0) {
736  // Reserve buffer + zero-terminator (for text data)
737  // We want to complete the INCR transfer even if we cannot
738  // allocate more memory
739  buf.resize(nbytes+1);
740  alloc_error = buf.size() != nbytes+1;
741  }
742 
743  for (;;) {
744  XFlush(display);
745  if (!clipboardWaitForEvent(win,PropertyNotify,&event,clipboard_timeout))
746  break;
747  if (event.xproperty.atom != property ||
748  event.xproperty.state != PropertyNewValue)
749  continue;
750  if (X11->clipboardReadProperty(win, property, true, &tmp_buf, &length, 0, 0)) {
751  if (length == 0) { // no more data, we're done
752  if (nullterm) {
753  buf.resize(offset+1);
754  buf[offset] = '\0';
755  } else {
756  buf.resize(offset);
757  }
758  return buf;
759  } else if (!alloc_error) {
760  if (offset+length > (int)buf.size()) {
761  buf.resize(offset+length+65535);
762  if (buf.size() != offset+length+65535) {
763  alloc_error = true;
764  length = buf.size() - offset;
765  }
766  }
767  memcpy(buf.data()+offset, tmp_buf.constData(), length);
768  tmp_buf.resize(0);
769  offset += length;
770  }
771  } else {
772  break;
773  }
774  }
775 
776  // timed out ... create a new requestor window, otherwise the requestor
777  // could consider next request to be still part of this timed out request
778  delete requestor;
779  requestor = new QWidget(0);
780  requestor->setObjectName(QLatin1String("internal clipboard requestor"));
781  // We don't need this internal widget to appear in QApplication::topLevelWidgets()
784 
785  return QByteArray();
786 }
static int clipboard_timeout
EventRef event
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
bool remove(const T &value)
Definition: qset.h:89
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define X11
Definition: qt_x11_p.h:724
void setObjectName(const QString &name)
Definition: qobject.cpp:1112
union _XEvent XEvent
Definition: qwindowdefs.h:116
static QWidgetSet * allWidgets
Definition: qwidget_p.h:715
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
static QWidget * requestor
Display * display
Definition: qt_x11_p.h:392
void resize(int size)
Sets the size of the byte array to size bytes.
const char * property
Definition: qwizard.cpp:138
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
bool clipboardWaitForEvent(Window win, int type, XEvent *event, int timeout, bool checkManager=false)

◆ clipboardReadProperty()

bool QX11Data::clipboardReadProperty ( Window  win,
Atom  property,
bool  deleteProperty,
QByteArray buffer,
int *  size,
Atom *  type,
int *  format 
)

Definition at line 606 of file qclipboard_x11.cpp.

608 {
609  int maxsize = maxSelectionIncr(display);
610  ulong bytes_left; // bytes_after
611  ulong length; // nitems
612  uchar *data;
613  Atom dummy_type;
614  int dummy_format;
615  int r;
616 
617  if (!type) // allow null args
618  type = &dummy_type;
619  if (!format)
620  format = &dummy_format;
621 
622  // Don't read anything, just get the size of the property data
623  r = XGetWindowProperty(display, win, property, 0, 0, False,
624  AnyPropertyType, type, format,
625  &length, &bytes_left, &data);
626  if (r != Success || (type && *type == XNone)) {
627  buffer->resize(0);
628  return false;
629  }
630  XFree((char*)data);
631 
632  int offset = 0, buffer_offset = 0, format_inc = 1, proplen = bytes_left;
633 
634  VDEBUG("QClipboard: read_property(): initial property length: %d", proplen);
635 
636  switch (*format) {
637  case 8:
638  default:
639  format_inc = sizeof(char) / 1;
640  break;
641 
642  case 16:
643  format_inc = sizeof(short) / 2;
644  proplen *= sizeof(short) / 2;
645  break;
646 
647  case 32:
648  format_inc = sizeof(long) / 4;
649  proplen *= sizeof(long) / 4;
650  break;
651  }
652 
653  int newSize = proplen;
654  buffer->resize(newSize);
655 
656  bool ok = (buffer->size() == newSize);
657  VDEBUG("QClipboard: read_property(): buffer resized to %d", buffer->size());
658 
659  if (ok && newSize) {
660  // could allocate buffer
661 
662  while (bytes_left) {
663  // more to read...
664 
665  r = XGetWindowProperty(display, win, property, offset, maxsize/4,
666  False, AnyPropertyType, type, format,
667  &length, &bytes_left, &data);
668  if (r != Success || (type && *type == XNone))
669  break;
670 
671  offset += length / (32 / *format);
672  length *= format_inc * (*format) / 8;
673 
674  // Here we check if we get a buffer overflow and tries to
675  // recover -- this shouldn't normally happen, but it doesn't
676  // hurt to be defensive
677  if ((int)(buffer_offset + length) > buffer->size()) {
678  length = buffer->size() - buffer_offset;
679 
680  // escape loop
681  bytes_left = 0;
682  }
683 
684  memcpy(buffer->data() + buffer_offset, data, length);
685  buffer_offset += length;
686 
687  XFree((char*)data);
688  }
689 
690  if (*format == 8 && *type == ATOM(COMPOUND_TEXT)) {
691  // convert COMPOUND_TEXT to a multibyte string
692  XTextProperty textprop;
693  textprop.encoding = *type;
694  textprop.format = *format;
695  textprop.nitems = buffer_offset;
696  textprop.value = (unsigned char *) buffer->data();
697 
698  char **list_ret = 0;
699  int count;
700  if (XmbTextPropertyToTextList(display, &textprop, &list_ret,
701  &count) == Success && count && list_ret) {
702  offset = buffer_offset = strlen(list_ret[0]);
703  buffer->resize(offset);
704  memcpy(buffer->data(), list_ret[0], offset);
705  }
706  if (list_ret) XFreeStringList(list_ret);
707  }
708  }
709 
710  // correct size, not 0-term.
711  if (size)
712  *size = buffer_offset;
713 
714  VDEBUG("QClipboard: read_property(): buffer size %d, buffer offset %d, offset %d",
715  buffer->size(), buffer_offset, offset);
716 
717  if (deleteProperty)
718  XDeleteProperty(display, win, property);
719 
720  XFlush(display);
721 
722  return ok;
723 }
int type
Definition: qmetatype.cpp:239
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
#define ATOM(x)
Definition: qt_x11_p.h:723
unsigned char uchar
Definition: qglobal.h:994
static const char * data(const QByteArray &arr)
unsigned long ulong
Definition: qglobal.h:997
Display * display
Definition: qt_x11_p.h:392
void resize(int size)
Sets the size of the byte array to size bytes.
const char * property
Definition: qwizard.cpp:138
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
static int maxSelectionIncr(Display *dpy)
#define VDEBUG

◆ clipboardWaitForEvent()

bool QX11Data::clipboardWaitForEvent ( Window  win,
int  type,
XEvent event,
int  timeout,
bool  checkManager = false 
)

Definition at line 518 of file qclipboard_x11.cpp.

519 {
520  QElapsedTimer started;
521  started.start();
522  QElapsedTimer now = started;
523 
524  if (QAbstractEventDispatcher::instance()->inherits("QtMotif")
525  || QApplication::clipboard()->property("useEventLoopWhenWaiting").toBool()) {
526  if (waiting_for_data) {
527  Q_ASSERT(!"QClipboard: internal error, qt_xclb_wait_for_event recursed");
528  return false;
529  }
530  waiting_for_data = true;
531 
532 
533  has_captured_event = false;
534  capture_event_win = win;
536 
537  QApplication::EventFilter old_event_filter =
538  qApp->setEventFilter(qt_x11_clipboard_event_filter);
539 
540  do {
541  if (XCheckTypedWindowEvent(display, win, type, event)) {
542  waiting_for_data = false;
543  qApp->setEventFilter(old_event_filter);
544  return true;
545  }
546 
547  if (checkManager && XGetSelectionOwner(X11->display, ATOM(CLIPBOARD_MANAGER)) == XNone)
548  return false;
549 
550  XSync(X11->display, false);
551  usleep(50000);
552 
553  now.start();
554 
555  QEventLoop::ProcessEventsFlags flags(QEventLoop::ExcludeUserInputEvents
560  eventDispatcher->processEvents(flags);
561 
562  if (has_captured_event) {
563  waiting_for_data = false;
564  *event = captured_event;
565  qApp->setEventFilter(old_event_filter);
566  return true;
567  }
568  } while (started.msecsTo(now) < timeout);
569 
570  waiting_for_data = false;
571  qApp->setEventFilter(old_event_filter);
572  } else {
573  do {
574  if (XCheckTypedWindowEvent(X11->display,win,type,event))
575  return true;
576 
577  if (checkManager && XGetSelectionOwner(X11->display, ATOM(CLIPBOARD_MANAGER)) == XNone)
578  return false;
579 
580  // process other clipboard events, since someone is probably requesting data from us
581  XEvent e;
582  // Pass the event through the event dispatcher filter so that applications
583  // which install an event filter on the dispatcher get to handle it first.
584  if (XCheckIfEvent(X11->display, &e, checkForClipboardEvents, 0) &&
586  qApp->x11ProcessEvent(&e);
587 
588  now.start();
589 
590  XFlush(X11->display);
591 
592  // sleep 50 ms, so we don't use up CPU cycles all the time.
593  struct timeval usleep_tv;
594  usleep_tv.tv_sec = 0;
595  usleep_tv.tv_usec = 50000;
596  select(0, 0, 0, 0, &usleep_tv);
597  } while (started.msecsTo(now) < timeout);
598  }
599  return false;
600 }
int type
Definition: qmetatype.cpp:239
bool filterEvent(void *message)
Sends message through the event filter that was set by setEventFilter().
EventRef event
static QAbstractEventDispatcher * instance(QThread *thread=0)
Returns a pointer to the event dispatcher object for the specified thread.
qint64 msecsTo(const QElapsedTimer &other) const
Returns the number of milliseconds between this QElapsedTimer and other.
static Bool checkForClipboardEvents(Display *, XEvent *e, XPointer)
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
static XEvent captured_event
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define X11
Definition: qt_x11_p.h:724
The QElapsedTimer class provides a fast way to calculate elapsed times.
Definition: qelapsedtimer.h:53
union _XEvent XEvent
Definition: qwindowdefs.h:116
#define ATOM(x)
Definition: qt_x11_p.h:723
static bool toBool(Register *reg, int type, bool *ok=0)
static QClipboard * clipboard()
Returns a pointer to the application global clipboard.
static int capture_event_type
#define qApp
virtual bool processEvents(QEventLoop::ProcessEventsFlags flags)=0
Processes pending events that match flags until there are no more events to process.
Display * display
Definition: qt_x11_p.h:392
bool(* EventFilter)(void *message, long *result)
A function with the following signature that can be used as an event filter:
static bool waiting_for_data
static Window capture_event_win
const char * property
Definition: qwizard.cpp:138
static bool has_captured_event
static bool qt_x11_clipboard_event_filter(void *message, long *)
void start()
Starts this timer.
The QAbstractEventDispatcher class provides an interface to manage Qt&#39;s event queue.

◆ dndEnable()

bool QX11Data::dndEnable ( QWidget w,
bool  on 
)

Definition at line 1954 of file qdnd_x11.cpp.

1955 {
1956  w = w->window();
1957 
1958  if (bool(((QExtraWidget*)w)->topData()->dnd) == on)
1959  return true; // been there, done that
1960  ((QExtraWidget*)w)->topData()->dnd = on ? 1 : 0;
1961 
1962  motifdndEnable(w, on);
1963  return xdndEnable(w, on);
1964 }
void motifdndEnable(QWidget *, bool)
static bool xdndEnable(QWidget *w, bool on)
Definition: qdnd_x11.cpp:363
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492

◆ findClientWindow()

Window QX11Data::findClientWindow ( Window  win,
Atom  property,
bool  leaf 
)

Definition at line 2940 of file qapplication_x11.cpp.

2941 {
2942  Atom type = XNone;
2943  int format, i;
2944  ulong nitems, after;
2945  uchar *data = 0;
2946  Window root, parent, target=0, *children=0;
2947  uint nchildren;
2948  if (XGetWindowProperty(X11->display, win, property, 0, 0, false, AnyPropertyType,
2949  &type, &format, &nitems, &after, &data) == Success) {
2950  if (data)
2951  XFree((char *)data);
2952  if (type)
2953  return win;
2954  }
2955  if (!XQueryTree(X11->display,win,&root,&parent,&children,&nchildren)) {
2956  if (children)
2957  XFree((char *)children);
2958  return 0;
2959  }
2960  for (i=nchildren-1; !target && i >= 0; i--)
2961  target = X11->findClientWindow(children[i], property, leaf);
2962  if (children)
2963  XFree((char *)children);
2964  return target;
2965 }
int type
Definition: qmetatype.cpp:239
#define X11
Definition: qt_x11_p.h:724
unsigned char uchar
Definition: qglobal.h:994
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
unsigned long ulong
Definition: qglobal.h:997
const char * property
Definition: qwizard.cpp:138

◆ getSolidFill()

Picture QX11Data::getSolidFill ( int  screen,
const QColor c 
)

Definition at line 3071 of file qwidget_x11.cpp.

3072 {
3073  if (!X11->use_xrender)
3074  return XNone;
3075 
3076  XRenderColor color = preMultiply(c);
3077  for (int i = 0; i < X11->solid_fill_count; ++i) {
3078  if (X11->solid_fills[i].screen == screen
3079  && X11->solid_fills[i].color.alpha == color.alpha
3080  && X11->solid_fills[i].color.red == color.red
3081  && X11->solid_fills[i].color.green == color.green
3082  && X11->solid_fills[i].color.blue == color.blue)
3083  return X11->solid_fills[i].picture;
3084  }
3085  // none found, replace one
3086  int i = qrand() % 16;
3087 
3088  if (X11->solid_fills[i].screen != screen && X11->solid_fills[i].picture) {
3089  XRenderFreePicture (X11->display, X11->solid_fills[i].picture);
3090  X11->solid_fills[i].picture = 0;
3091  }
3092 
3093  if (!X11->solid_fills[i].picture) {
3094  Pixmap pixmap = XCreatePixmap (X11->display, RootWindow (X11->display, screen), 1, 1, 32);
3095  XRenderPictureAttributes attrs;
3096  attrs.repeat = True;
3097  X11->solid_fills[i].picture = XRenderCreatePicture (X11->display, pixmap,
3098  XRenderFindStandardFormat(X11->display, PictStandardARGB32),
3099  CPRepeat, &attrs);
3100  XFreePixmap (X11->display, pixmap);
3101  }
3102 
3103  X11->solid_fills[i].color = color;
3104  X11->solid_fills[i].screen = screen;
3105  XRenderFillRectangle (X11->display, PictOpSrc, X11->solid_fills[i].picture, &color, 0, 0, 1, 1);
3106  return X11->solid_fills[i].picture;
3107 }
Q_CORE_EXPORT int qrand()
#define X11
Definition: qt_x11_p.h:724
XRenderColor preMultiply(const QColor &c)

◆ ignoreBadwindow()

static void QX11Data::ignoreBadwindow ( )
inlinestatic

Definition at line 482 of file qt_x11_p.h.

482  {
484  qt_x11Data->seen_badwindow = false;
485  }
bool seen_badwindow
Definition: qt_x11_p.h:494
Q_GUI_EXPORT QX11Data * qt_x11Data
Definition: qt_x11_p.h:722
bool ignore_badwindow
Definition: qt_x11_p.h:493

◆ isSupportedByWM()

bool QX11Data::isSupportedByWM ( Atom  atom)

Definition at line 1438 of file qapplication_x11.cpp.

1439 {
1440  if (!X11->net_supported_list)
1441  return false;
1442 
1443  bool supported = false;
1444  int i = 0;
1445  while (X11->net_supported_list[i] != 0) {
1446  if (X11->net_supported_list[i++] == atom) {
1447  supported = true;
1448  break;
1449  }
1450  }
1451 
1452  return supported;
1453 }
#define X11
Definition: qt_x11_p.h:724

◆ motifdndEnable()

void QX11Data::motifdndEnable ( QWidget widget,
bool   
)

Definition at line 791 of file qmotifdnd_x11.cpp.

792 {
794 }
Display * display
Definition: qt_x11_p.h:392
static void DndWriteReceiverProperty(Display *dpy, Window window, unsigned char protocol_style)
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
#define DND_DRAG_DYNAMIC

◆ motifdndFormat()

QByteArray QX11Data::motifdndFormat ( int  n)

Definition at line 696 of file qmotifdnd_x11.cpp.

697 {
698  if (!motifdnd_active)
699  return 0; // should not happen
700 
701  if (n >= num_src_targets)
702  return 0;
703 
704  Atom target = src_targets[n];
705 
706  if (target == XA_STRING)
707  return "text/plain;charset=ISO-8859-1";
708  if (target == ATOM(UTF8_STRING))
709  return "text/plain;charset=UTF-8";
710  if (target == ATOM(COMPOUND_TEXT))
711  return QByteArray("text/plain;charset=") + QTextCodec::codecForLocale()->name();
712  if (target == ATOM(TEXT))
713  return "text/plain";
714 
715  return ("x-motif-dnd/" + X11->xdndAtomToString(target));
716 }
static QTextCodec * codecForLocale()
Returns a pointer to the codec most suitable for this locale.
static Atom * src_targets
bool motifdnd_active
Definition: qt_x11_p.h:390
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
#define X11
Definition: qt_x11_p.h:724
static ushort num_src_targets
#define ATOM(x)
Definition: qt_x11_p.h:723
virtual QByteArray name() const =0
QTextCodec subclasses must reimplement this function.

◆ motifdndHandle()

void QX11Data::motifdndHandle ( QWidget widget,
const XEvent xe,
bool   
)

Definition at line 797 of file qmotifdnd_x11.cpp.

798 {
799  XEvent event = *xe;
800  XClientMessageEvent cm ;
801  DndData dnd_data ;
802  char receiver ;
803 
804  if (!(DndParseClientMessage ((XClientMessageEvent*)&event,
805  &dnd_data, &receiver))) {
806  return;
807  }
808 
809  switch (dnd_data.reason) {
810 
811  case DND_DRAG_MOTION:
812  {
813  QPoint p = widget->mapFromGlobal(QPoint(dnd_data.x, dnd_data.y));
814  QWidget *c = widget->childAt(p);
815 
816  if (!c || !c->acceptDrops()) {
817  // not over a drop site
818  if (dropWidget) {
819  QDragLeaveEvent dragLeaveEvent;
820  QApplication::sendEvent(dropWidget, &dragLeaveEvent);
821 
822  dropWidget = 0;
824 
825  dnd_data.reason = DND_DROP_SITE_LEAVE;
826  dnd_data.time = X11->time;
827  DndFillClientMessage (event.xclient.display, sourceWindow, &cm, &dnd_data, receiver);
828  XSendEvent(event.xbutton.display, sourceWindow, False, 0, (XEvent *)&cm) ;
829  } else {
830  dnd_data.reason = DND_DRAG_MOTION;
831  dnd_data.status = DND_NO_DROP_SITE;
832  dnd_data.time = X11->time;
833  dnd_data.operation = DND_NOOP;
834  dnd_data.operations = DND_NOOP;
835  DndFillClientMessage (event.xclient.display, sourceWindow, &cm, &dnd_data, receiver);
836  XSendEvent(event.xbutton.display, sourceWindow, False, 0, (XEvent *)&cm) ;
837  }
838  } else {
839  Q_ASSERT(c != 0);
840  p = c->mapFrom(widget, p);
841 
842  if (dropWidget != c) {
843  if (dropWidget) {
844  QDragLeaveEvent le;
846  }
847 
848  dropWidget = c;
850 
851  const Qt::DropActions possibleActions =
853  QDragEnterEvent de(p, possibleActions, QDragManager::self()->dropData,
856 
857  dnd_data.reason = DND_DROP_SITE_ENTER;
858  dnd_data.time = X11->time;
859  if (de.isAccepted()) {
860  lastAcceptedAction = de.dropAction();
861 
862  dnd_data.status = DND_VALID_DROP_SITE;
864  } else {
865  dnd_data.status = DND_INVALID_DROP_SITE;
866  dnd_data.operation = DND_NOOP;
867  dnd_data.operations = DND_NOOP;
868  }
869  DndFillClientMessage (event.xclient.display, sourceWindow, &cm, &dnd_data, receiver);
870  XSendEvent(event.xbutton.display, sourceWindow, False, 0, (XEvent *)&cm);
871  } else {
872  const Qt::DropActions possibleActions =
874  QDragMoveEvent me(p, possibleActions, QDragManager::self()->dropData,
877  me.setDropAction(lastAcceptedAction);
878  me.accept();
879  }
881 
882  dnd_data.reason = DND_DRAG_MOTION;
883  dnd_data.time = X11->time;
884 
885  if (me.isAccepted()) {
886  lastAcceptedAction = me.dropAction();
887 
888  dnd_data.status = DND_VALID_DROP_SITE;
890  } else {
891  dnd_data.status = DND_INVALID_DROP_SITE;
892  dnd_data.operation = DND_NOOP;
893  dnd_data.operations = DND_NOOP;
894  }
895 
896  DndFillClientMessage (event.xclient.display, sourceWindow, &cm, &dnd_data, receiver);
897  XSendEvent(event.xbutton.display, sourceWindow, False, 0, (XEvent *)&cm);
898  }
899  }
900 
901  break;
902  }
903 
904  case DND_TOP_LEVEL_ENTER:
905  {
906  /* get the size of our drop site for later use */
907 
908  motifdnd_active = true;
909  sourceWindow = dnd_data.src_window;
910 
911  /* no answer needed, just read source property */
912  DndReadSourceProperty (event.xclient.display,
913  sourceWindow,
914  dnd_data.property,
916 
917  break;
918  }
919 
920  case DND_TOP_LEVEL_LEAVE:
921  {
922  XEvent nextEvent;
923  if (XCheckTypedWindowEvent(X11->display, widget->winId(), ClientMessage, &nextEvent)) {
924  // we just want to check, not eat (should use XPeekIfEvent)
925  XPutBackEvent(X11->display, &nextEvent);
926 
927  if (DndParseClientMessage (&nextEvent.xclient, &dnd_data, &receiver)
928  && dnd_data.reason == DND_DROP_START) {
929  // expecting drop next, keeping DnD alive
930  break;
931  }
932  }
933 
934  // not expecting drop, need to send drag leave events and such here
935  if (dropWidget) {
936  QDragLeaveEvent le;
938  }
939 
941  dropWidget = 0;
943 
944  motifdnd_active = false;
945 
946  break;
947  }
948 
950  // ### need to echo
951  break;
952 
953  case DND_DROP_START:
954  {
956  Q_ASSERT(sourceWindow == dnd_data.src_window);
957 
959  // echo DROP_START
960  dnd_data.reason = DND_DROP_START;
961  dnd_data.status = DND_NO_DROP_SITE;
962  dnd_data.operation = DND_NOOP;
963  dnd_data.operations = DND_NOOP;
964  DndFillClientMessage (event.xclient.display, sourceWindow, &cm, &dnd_data, 0);
965  XSendEvent(event.xbutton.display, sourceWindow, False, 0, (XEvent *)&cm);
966 
967  // we have to convert selection in order to indicate failure to the initiator
968  XConvertSelection (X11->display, dnd_data.property, ATOM(XmTRANSFER_FAILURE),
969  dnd_data.property, dnd_data.src_window, dnd_data.time);
970 
971  if (dropWidget) {
972  QDragLeaveEvent e;
974  }
975 
976  motifdnd_active = false;
978  dropWidget = 0;
980 
981  return;
982  }
983 
984  // store selection and its time
985  Dnd_selection = dnd_data.property;
986  Dnd_selection_time = dnd_data.time;
987 
988  QPoint p(dnd_data.x, dnd_data.y);
993  de.accept();
994  }
996 
997  // reset
999  Dnd_selection_time = 0;
1000 
1001  // echo DROP_START depending on the result of the dropEvent
1002  if (de.isAccepted()) {
1003  dnd_data.reason = DND_DROP_START;
1004  dnd_data.status = DND_VALID_DROP_SITE;
1005  dnd_data.operation = QtDropActionToDndOperation(de.dropAction());
1006  } else {
1007  dnd_data.reason = DND_DROP_START;
1008  dnd_data.status = DND_NO_DROP_SITE;
1009  dnd_data.operation = DND_NOOP;
1010  dnd_data.operations = DND_NOOP;
1011  }
1012  DndFillClientMessage (event.xclient.display, sourceWindow, &cm, &dnd_data, 0);
1013  XSendEvent(event.xbutton.display, sourceWindow, False, 0, (XEvent *)&cm);
1014 
1015  sourceWindow = XNone;
1016  dropWidget = 0;
1018 
1019  motifdnd_active = false;
1020 
1021  break;
1022  }
1023 
1024  default:
1025  break;
1026  } // end of switch (dnd_data.reason)
1027 }
#define DND_DROP_SITE_ENTER
unsigned char c[8]
Definition: qnumeric_p.h:62
static Atom * src_targets
EventRef event
bool motifdnd_active
Definition: qt_x11_p.h:390
static Bool DndParseClientMessage(XClientMessageEvent *cm, DndData *dnd_data, char *receiver)
Window src_window
#define DND_OPERATION_CHANGED
static void DndReadSourceProperty(Display *dpy, Window window, Atom dnd_selection, Atom **targets, unsigned short *num_targets)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
void setDropAction(Qt::DropAction action)
Sets the action to be performed on the data by the target.
Definition: qevent.cpp:2746
#define DND_INVALID_DROP_SITE
static uchar QtDropActionToDndOperation(Qt::DropAction action)
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
Definition: qevent.h:530
#define Q_ASSERT(cond)
Definition: qglobal.h:1823
#define X11
Definition: qt_x11_p.h:724
static Atom Dnd_selection
static ushort num_src_targets
union _XEvent XEvent
Definition: qwindowdefs.h:116
#define ATOM(x)
Definition: qt_x11_p.h:723
static Time Dnd_selection_time
#define DND_TOP_LEVEL_LEAVE
unsigned char operation
#define DND_VALID_DROP_SITE
QWidget * childAt(int x, int y) const
Returns the visible child widget at the position ({x}, {y}) in the widget&#39;s coordinate system...
Definition: qwidget.h:934
#define DND_DROP_START
static Qt::DropActions DndOperationsToQtDropActions(uchar op)
#define DND_NO_DROP_SITE
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
Definition: qevent.h:577
bool acceptDrops
whether drop events are enabled for this widget
Definition: qwidget.h:197
static QDragManager * self()
Definition: qdnd.cpp:163
unsigned char reason
#define DND_TOP_LEVEL_ENTER
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
Definition: qevent.h:476
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
static void DndFillClientMessage(Display *dpy, Window window, XClientMessageEvent *cm, DndData *dnd_data, char receiver)
unsigned char status
QDropData * dropData
Definition: qdnd_p.h:251
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
Definition: qevent.h:555
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
#define DND_DROP_SITE_LEAVE
QPoint mapFromGlobal(const QPoint &) const
Translates the global screen coordinate pos to widget coordinates.
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
WId winId() const
Returns the window system identifier of the widget.
Definition: qwidget.cpp:2557
#define DND_NOOP
static Window sourceWindow
QPoint mapFrom(QWidget *, const QPoint &) const
Translates the widget coordinate pos from the coordinate system of parent to this widget&#39;s coordinate...
Definition: qwidget.cpp:4433
static Qt::DropAction lastAcceptedAction
#define DND_DRAG_MOTION
static QWidget * dropWidget
unsigned char operations

◆ motifdndObtainData()

QVariant QX11Data::motifdndObtainData ( const char *  format)

Definition at line 719 of file qmotifdnd_x11.cpp.

720 {
721  QByteArray result;
722 
723  if (Dnd_selection == 0 || !dropWidget)
724  return result;
725 
726  // try to convert the selection to the requested property
727  // qDebug("trying to convert to '%s'", mimeType);
728 
729  int n=0;
730  QByteArray f;
731  do {
732  f = motifdndFormat(n);
733  if (f.isEmpty())
734  return result;
735  n++;
736  } while(qstricmp(mimeType, f.data()));
737 
738  Atom conversion_type = XNone;
739  if (f == "text/plain;charset=ISO-8859-1") {
740  conversion_type = XA_STRING;
741  } else if (f == "text/plain;charset=UTF-8") {
742  conversion_type = ATOM(UTF8_STRING);
743  } else if (f == (QByteArray("text/plain;charset=") + QTextCodec::codecForLocale()->name())) {
744  conversion_type = ATOM(COMPOUND_TEXT);
745  } else if (f == "text/plain") {
746  conversion_type = ATOM(TEXT);
747  } else if (f.startsWith("x-motif-dnd/")) {
748  // strip off the "x-motif-dnd/" prefix
749  conversion_type = X11->xdndStringToAtom(f.remove(0, 12));
750  }
751 
752  if (XGetSelectionOwner(X11->display, Dnd_selection) == XNone) {
753  return result; // should never happen?
754  }
755 
756  QWidget* tw = dropWidget;
757  if ((dropWidget->windowType() == Qt::Desktop)) {
758  tw = new QWidget;
759  }
760 
761  // convert selection to the appropriate type
762  XConvertSelection (X11->display, Dnd_selection, conversion_type,
764 
765  XFlush(X11->display);
766 
767  XEvent xevent;
768  bool got=X11->clipboardWaitForEvent(tw->internalWinId(), SelectionNotify, &xevent, 5000);
769  if (got) {
770  Atom type;
771 
772  if (X11->clipboardReadProperty(tw->internalWinId(), Dnd_selection, true, &result, 0, &type, 0)) {
773  }
774  }
775 
776  // we have to convert selection in order to indicate success to the initiator
777  XConvertSelection (X11->display, Dnd_selection, ATOM(XmTRANSFER_SUCCESS),
779 
780  // wait again for SelectionNotify event
781  X11->clipboardWaitForEvent(tw->internalWinId(), SelectionNotify, &xevent, 5000);
782 
783  if ((dropWidget->windowType() == Qt::Desktop)) {
784  delete tw;
785  }
786 
787  return result;
788 }
static QTextCodec * codecForLocale()
Returns a pointer to the codec most suitable for this locale.
int type
Definition: qmetatype.cpp:239
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
bool startsWith(const QByteArray &a) const
Returns true if this byte array starts with byte array ba; otherwise returns false.
#define X11
Definition: qt_x11_p.h:724
static Atom Dnd_selection
QByteArray motifdndFormat(int n)
union _XEvent XEvent
Definition: qwindowdefs.h:116
#define ATOM(x)
Definition: qt_x11_p.h:723
static Time Dnd_selection_time
const char * name
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
Qt::WindowType windowType() const
Returns the window type of this widget.
Definition: qwidget.h:937
Q_CORE_EXPORT int qstricmp(const char *, const char *)
QByteArray & remove(int index, int len)
Removes len bytes from the array, starting at index position pos, and returns a reference to the arra...
static QWidget * dropWidget

◆ preMultiply()

XRenderColor QX11Data::preMultiply ( const QColor c)

Definition at line 3058 of file qwidget_x11.cpp.

3059 {
3060  XRenderColor color;
3061  const uint A = c.alpha(),
3062  R = c.red(),
3063  G = c.green(),
3064  B = c.blue();
3065  color.alpha = (A | A << 8);
3066  color.red = (R | R << 8) * color.alpha / 0x10000;
3067  color.green = (G | G << 8) * color.alpha / 0x10000;
3068  color.blue = (B | B << 8) * color.alpha / 0x10000;
3069  return color;
3070 }
ushort red
Returns the red color component of this color.
Definition: qcolor.h:243
#define A(arg)
unsigned int uint
Definition: qglobal.h:996
ushort blue
Returns the blue color component of this color.
Definition: qcolor.h:245
ushort alpha
Returns the alpha color component of this color.
Definition: qcolor.h:242
ushort green
Returns the green color component of this color.
Definition: qcolor.h:244

◆ translateModifiers()

Qt::KeyboardModifiers QX11Data::translateModifiers ( int  s)
static

Definition at line 4198 of file qapplication_x11.cpp.

4199 {
4200  Qt::KeyboardModifiers ret = 0;
4201  if (s & ShiftMask)
4202  ret |= Qt::ShiftModifier;
4203  if (s & ControlMask)
4204  ret |= Qt::ControlModifier;
4205  if (s & qt_alt_mask)
4206  ret |= Qt::AltModifier;
4207  if (s & qt_meta_mask)
4208  ret |= Qt::MetaModifier;
4209  if (s & qt_mode_switch_mask)
4210  ret |= Qt::GroupSwitchModifier;
4211  return ret;
4212 }
uchar qt_alt_mask
uchar qt_mode_switch_mask
uchar qt_meta_mask

◆ xdndAtomToString()

QByteArray QX11Data::xdndAtomToString ( Atom  a)

Definition at line 412 of file qdnd_x11.cpp.

413 {
414  if (!a) return 0;
415 
416  if (a == XA_STRING || a == ATOM(UTF8_STRING)) {
417  return "text/plain"; // some Xdnd clients are dumb
418  }
419  char *atom = XGetAtomName(display, a);
420  QByteArray result = atom;
421  XFree(atom);
422  return result;
423 }
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
long ASN1_INTEGER_get ASN1_INTEGER * a
#define ATOM(x)
Definition: qt_x11_p.h:723
Display * display
Definition: qt_x11_p.h:392

◆ xdndHandleBadwindow()

bool QX11Data::xdndHandleBadwindow ( )
static

Definition at line 1782 of file qdnd_x11.cpp.

1783 {
1784  if (qt_xdnd_current_target) {
1785  QDragManager *manager = QDragManager::self();
1786  if (manager->object) {
1789  manager->object->deleteLater();
1790  manager->object = 0;
1791  xdnd_data.deco->deleteLater(); //delay freeing to avoid crash QTBUG-19363
1792  xdnd_data.deco = 0;
1793  return true;
1794  }
1795  }
1796  if (qt_xdnd_dragsource_xid) {
1798  if (qt_xdnd_current_widget) {
1801  }
1802  return true;
1803  }
1804  return false;
1805 }
static void postEvent(QObject *receiver, QEvent *event)
Adds the event event, with the object receiver as the receiver of the event, to an event queue and re...
QDrag * object
Definition: qdnd_p.h:238
static Window qt_xdnd_current_proxy_target
Definition: qdnd_x11.cpp:226
static XdndData xdnd_data
Definition: qdnd_x11.cpp:321
static Window qt_xdnd_current_target
Definition: qdnd_x11.cpp:224
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
Definition: qevent.h:577
static Atom qt_xdnd_dragsource_xid
Definition: qdnd_x11.cpp:213
QShapedPixmapWidget * deco
Definition: qdnd_x11.cpp:317
static QDragManager * self()
Definition: qdnd.cpp:163
static QPointer< QWidget > qt_xdnd_current_widget
Definition: qdnd_x11.cpp:230
void deleteLater()
Schedules this object for deletion.
Definition: qobject.cpp:2145

◆ xdndHandleDrop()

void QX11Data::xdndHandleDrop ( QWidget ,
const XEvent xe,
bool  passive 
)

Definition at line 1120 of file qdnd_x11.cpp.

1121 {
1122  DEBUG("xdndHandleDrop");
1123  if (!qt_xdnd_current_widget) {
1125  return; // sanity
1126  }
1127 
1128  if (!passive && checkEmbedded(qt_xdnd_current_widget, xe)){
1132  return;
1133  }
1134  const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
1135 
1136  QDragManager *manager = QDragManager::self();
1137  DEBUG("xdnd drop");
1138 
1139  if (l[0] != qt_xdnd_dragsource_xid) {
1140  DEBUG("xdnd drop from unexpected source (%08lx not %08lx", l[0], qt_xdnd_dragsource_xid);
1141  return;
1142  }
1143 
1144  // update the "user time" from the timestamp in the event.
1145  if (l[2] != 0) {
1146  // Some X server/client combination swallow the first 32 bit and
1147  // interpret a set bit 31 as negative sign.
1148  qt_xdnd_target_current_time = X11->userTime =
1149  ((sizeof(Time) == 8 && xe->xclient.data.l[2] < 0)
1150  ? uint(l[2])
1151  : l[2]);
1152  }
1153 
1154  if (!passive) {
1155  // this could be a same-application drop, just proxied due to
1156  // some XEMBEDding, so try to find the real QMimeData used
1157  // based on the timestamp for this drop.
1158  QMimeData *dropData = 0;
1160  if (at != -1) {
1161  dropData = QDragManager::dragPrivate(X11->dndDropTransactions.at(at).object)->data;
1162  // Can't use the source QMimeData if we need the image conversion code from xdndObtainData
1163  if (dropData && dropData->hasImage())
1164  dropData = 0;
1165  }
1166  // if we can't find it, then use the data in the drag manager
1167  if (!dropData) {
1168  if (manager->object && !manager->dragPrivate()->data->hasImage())
1169  dropData = manager->dragPrivate()->data;
1170  else
1171  dropData = manager->dropData;
1172  }
1173 
1174  // Drop coming from another app? Update keyboard modifiers.
1175  if (!qt_xdnd_dragging) {
1177  }
1178 
1182  if (!de.isAccepted()) {
1183  // Ignore a failed drag
1185  } else {
1186  global_accepted_action = de.dropAction();
1187  }
1188  XClientMessageEvent finished;
1189  finished.type = ClientMessage;
1190  finished.window = qt_xdnd_dragsource_xid;
1191  finished.format = 32;
1192  finished.message_type = ATOM(XdndFinished);
1193  DNDDEBUG << "xdndHandleDrop"
1194  << "qt_xdnd_current_widget" << qt_xdnd_current_widget
1196  << "t_xdnd_current_widget->window()"
1200  finished.data.l[1] = de.isAccepted() ? 1 : 0; // flags
1201  finished.data.l[2] = qtaction_to_xdndaction(global_accepted_action);
1202  XSendEvent(X11->display, qt_xdnd_dragsource_xid, False,
1203  NoEventMask, (XEvent*)&finished);
1204  } else {
1205  QDragLeaveEvent e;
1207  }
1210  waiting_for_status = false;
1211 
1212  // reset
1213  qt_xdnd_target_current_time = CurrentTime;
1214 }
static int qtaction_to_xdndaction(Qt::DropAction a)
Definition: qdnd_x11.cpp:189
static Time qt_xdnd_target_current_time
Definition: qdnd_x11.cpp:233
static QPoint qt_xdnd_current_position
Definition: qdnd_x11.cpp:231
WId effectiveWinId() const
Returns the effective window system identifier of the widget, i.
Definition: qwidget.cpp:2654
#define at(className, varName)
static QWidget * current_embedding_widget
Definition: qdnd_x11.cpp:249
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
Definition: qmimedata.cpp:524
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
#define ATOM(x)
Definition: qt_x11_p.h:723
static const char * data(const QByteArray &arr)
unsigned int uint
Definition: qglobal.h:996
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
Definition: qevent.h:577
static bool checkEmbedded(QWidget *w, const XEvent *xe)
Definition: qdnd_x11.cpp:767
The QMimeData class provides a container for data that records information about its MIME type...
Definition: qmimedata.h:57
static Atom qt_xdnd_dragsource_xid
Definition: qdnd_x11.cpp:213
static Qt::DropAction global_accepted_action
Definition: qdnd_x11.cpp:245
static Qt::DropActions possible_actions
Definition: qdnd_x11.cpp:246
bool qt_xdnd_dragging
Definition: qdnd_x11.cpp:237
static QDragManager * self()
Definition: qdnd.cpp:163
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
Definition: qmimedata.cpp:471
static QPointer< QWidget > qt_xdnd_current_widget
Definition: qdnd_x11.cpp:230
static Qt::KeyboardModifiers queryKeyboardModifiers()
Queries and returns the state of the modifier keys on the keyboard.
static bool waiting_for_status
Definition: qdnd_x11.cpp:239
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
Definition: qevent.h:476
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
#define DNDDEBUG
Definition: qdnd_x11.cpp:91
static Qt::KeyboardModifiers modifier_buttons
static int findXdndDropTransactionByTime(Time timestamp)
Definition: qdnd_x11.cpp:107
QFactoryLoader * l
WId internalWinId() const
Returns the window system identifier of the widget, or 0 if the widget is not created yet...
Definition: qwidget.h:244
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
T * data() const
Definition: qpointer.h:79
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
#define DEBUG
Definition: qdnd_x11.cpp:85
QDragPrivate * dragPrivate() const
Definition: qdnd_p.h:231

◆ xdndHandleEnter()

void QX11Data::xdndHandleEnter ( QWidget ,
const XEvent xe,
bool   
)

Definition at line 802 of file qdnd_x11.cpp.

803 {
804  motifdnd_active = false;
805 
806  last_enter_event.xclient = xe->xclient;
807 
808  const long *l = xe->xclient.data.l;
809  int version = (int)(((unsigned long)(l[1])) >> 24);
810 
811  if (version > xdnd_version)
812  return;
813 
814  qt_xdnd_dragsource_xid = l[0];
815 
816  int j = 0;
817  if (l[1] & 1) {
818  // get the types from XdndTypeList
819  Atom type = XNone;
820  int f;
821  unsigned long n, a;
822  unsigned char *retval = 0;
823  XGetWindowProperty(X11->display, qt_xdnd_dragsource_xid, ATOM(XdndTypelist), 0,
824  qt_xdnd_max_type, False, XA_ATOM, &type, &f,&n,&a,&retval);
825  if (retval) {
826  Atom *data = (Atom *)retval;
827  for (; j<qt_xdnd_max_type && j < (int)n; j++) {
828  qt_xdnd_types[j] = data[j];
829  }
830  XFree((uchar*)data);
831  }
832  } else {
833  // get the types from the message
834  int i;
835  for(i=2; i < 5; i++) {
836  qt_xdnd_types[j++] = l[i];
837  }
838  }
839  qt_xdnd_types[j] = 0;
840 }
int type
Definition: qmetatype.cpp:239
bool motifdnd_active
Definition: qt_x11_p.h:390
const int qt_xdnd_max_type
Definition: qdnd_x11.cpp:216
static Atom qt_xdnd_types[qt_xdnd_max_type+1]
Definition: qdnd_x11.cpp:217
long ASN1_INTEGER_get ASN1_INTEGER * a
static XEvent last_enter_event
Definition: qdnd_x11.cpp:250
#define X11
Definition: qt_x11_p.h:724
#define ATOM(x)
Definition: qt_x11_p.h:723
unsigned char uchar
Definition: qglobal.h:994
static const char * data(const QByteArray &arr)
static Atom qt_xdnd_dragsource_xid
Definition: qdnd_x11.cpp:213
const int xdnd_version
Definition: qdnd_x11.cpp:176
QFactoryLoader * l

◆ xdndHandleFinished()

void QX11Data::xdndHandleFinished ( QWidget ,
const XEvent xe,
bool  passive 
)

Definition at line 1217 of file qdnd_x11.cpp.

1218 {
1219  DEBUG("xdndHandleFinished");
1220  const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
1221 
1222  DNDDEBUG << "xdndHandleFinished, l[0]" << l[0]
1223  << "qt_xdnd_current_target" << qt_xdnd_current_target
1224  << "qt_xdnd_current_proxy_targe" << qt_xdnd_current_proxy_target;
1225 
1226  if (l[0]) {
1227  int at = findXdndDropTransactionByWindow(l[0]);
1228  if (at != -1) {
1230 
1231  QXdndDropTransaction t = X11->dndDropTransactions.takeAt(at);
1232  QDragManager *manager = QDragManager::self();
1233 
1234  Window target = qt_xdnd_current_target;
1235  Window proxy_target = qt_xdnd_current_proxy_target;
1236  QWidget *embedding_widget = current_embedding_widget;
1237  QDrag *currentObject = manager->object;
1238 
1242  manager->object = t.object;
1243 
1244  if (!passive)
1246 
1250 
1251  if (t.object)
1252  t.object->deleteLater();
1253 
1254  qt_xdnd_current_target = target;
1255  qt_xdnd_current_proxy_target = proxy_target;
1256  current_embedding_widget = embedding_widget;
1257  manager->object = currentObject;
1258  }
1259  }
1260  waiting_for_status = false;
1261 }
The QDrag class provides support for MIME-based drag and drop data transfer.
Definition: qdrag.h:61
QDrag * object
Definition: qdnd_p.h:238
#define at(className, varName)
The QWidget class is the base class of all user interface objects.
Definition: qwidget.h:150
static QWidget * current_embedding_widget
Definition: qdnd_x11.cpp:249
static int findXdndDropTransactionByWindow(Window window)
Definition: qdnd_x11.cpp:94
static Window qt_xdnd_current_proxy_target
Definition: qdnd_x11.cpp:226
#define X11
Definition: qt_x11_p.h:724
QWidget * embedding_widget
Definition: qt_x11_p.h:331
static Window qt_xdnd_current_target
Definition: qdnd_x11.cpp:224
static bool checkEmbedded(QWidget *w, const XEvent *xe)
Definition: qdnd_x11.cpp:767
static QDragManager * self()
Definition: qdnd.cpp:163
static QPointer< QWidget > qt_xdnd_current_widget
Definition: qdnd_x11.cpp:230
static void restartXdndDropExpiryTimer()
Definition: qdnd_x11.cpp:124
static bool waiting_for_status
Definition: qdnd_x11.cpp:239
#define DNDDEBUG
Definition: qdnd_x11.cpp:91
if(void) toggleToolbarShown
QFactoryLoader * l
#define DEBUG
Definition: qdnd_x11.cpp:85
void deleteLater()
Schedules this object for deletion.
Definition: qobject.cpp:2145

◆ xdndHandleLeave()

void QX11Data::xdndHandleLeave ( QWidget w,
const XEvent xe,
bool   
)

Definition at line 1047 of file qdnd_x11.cpp.

1048 {
1049  DEBUG("xdnd leave");
1050  if (!qt_xdnd_current_widget ||
1051  w->window() != qt_xdnd_current_widget->window()) {
1052  return; // sanity
1053  }
1054 
1058  return;
1059  }
1060 
1061  const unsigned long *l = (const unsigned long *)xe->xclient.data.l;
1062 
1063  QDragLeaveEvent e;
1065 
1066  if (l[0] != qt_xdnd_dragsource_xid) {
1067  // This often happens - leave other-process window quickly
1068  DEBUG("xdnd drag leave from unexpected source (%08lx not %08lx", l[0], qt_xdnd_dragsource_xid);
1070  return;
1071  }
1072 
1074  qt_xdnd_types[0] = 0;
1076 }
static Atom qt_xdnd_types[qt_xdnd_max_type+1]
Definition: qdnd_x11.cpp:217
static QWidget * current_embedding_widget
Definition: qdnd_x11.cpp:249
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
Definition: qevent.h:577
static bool checkEmbedded(QWidget *w, const XEvent *xe)
Definition: qdnd_x11.cpp:767
static Atom qt_xdnd_dragsource_xid
Definition: qdnd_x11.cpp:213
static QPointer< QWidget > qt_xdnd_current_widget
Definition: qdnd_x11.cpp:230
QFactoryLoader * l
QWidget * window() const
Returns the window for this widget, i.e.
Definition: qwidget.cpp:4492
#define DEBUG
Definition: qdnd_x11.cpp:85

◆ xdndHandlePosition()

void QX11Data::xdndHandlePosition ( QWidget w,
const XEvent xe,
bool  passive 
)

Definition at line 991 of file qdnd_x11.cpp.

992 {
993  DEBUG("xdndHandlePosition");
994  while (XCheckIfEvent(X11->display, (XEvent *)xe, xdnd_position_scanner, 0))
995  ;
996 
997  handle_xdnd_position(w, xe, passive);
998 }
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
static Bool xdnd_position_scanner(Display *, XEvent *event, XPointer)
Definition: qdnd_x11.cpp:979
#define DEBUG
Definition: qdnd_x11.cpp:85
static void handle_xdnd_position(QWidget *, const XEvent *, bool)
Definition: qdnd_x11.cpp:842

◆ xdndHandleSelectionRequest()

void QX11Data::xdndHandleSelectionRequest ( const XSelectionRequestEvent *  req)

Definition at line 1807 of file qdnd_x11.cpp.

1808 {
1809  if (!req)
1810  return;
1811  XEvent evt;
1812  evt.xselection.type = SelectionNotify;
1813  evt.xselection.display = req->display;
1814  evt.xselection.requestor = req->requestor;
1815  evt.xselection.selection = req->selection;
1816  evt.xselection.target = XNone;
1817  evt.xselection.property = XNone;
1818  evt.xselection.time = req->time;
1819 
1820  QDragManager *manager = QDragManager::self();
1821  QDrag *currentObject = manager->object;
1822 
1823  // which transaction do we use? (note: -2 means use current manager->object)
1824  int at = -1;
1825 
1826  // figure out which data the requestor is really interested in
1827  if (manager->object && req->time == qt_xdnd_source_current_time) {
1828  // requestor wants the current drag data
1829  at = -2;
1830  } else {
1831  // if someone has requested data in response to XdndDrop, find the corresponding transaction. the
1832  // spec says to call XConvertSelection() using the timestamp from the XdndDrop
1833  at = findXdndDropTransactionByTime(req->time);
1834  if (at == -1) {
1835  // no dice, perhaps the client was nice enough to use the same window id in XConvertSelection()
1836  // that we sent the XdndDrop event to.
1837  at = findXdndDropTransactionByWindow(req->requestor);
1838  }
1839  if (at == -1 && req->time == CurrentTime) {
1840  // previous Qt versions always requested the data on a child of the target window
1841  // using CurrentTime... but it could be asking for either drop data or the current drag's data
1842  Window target = findXdndAwareParent(req->requestor);
1843  if (target) {
1845  at = -2;
1846  else
1847  at = findXdndDropTransactionByWindow(target);
1848  }
1849  }
1850  }
1851  if (at >= 0) {
1853 
1854  // use the drag object from an XdndDrop tansaction
1855  manager->object = X11->dndDropTransactions.at(at).object;
1856  } else if (at != -2) {
1857  // no transaction found, we'll have to reject the request
1858  manager->object = 0;
1859  }
1860  if (manager->object) {
1861  Atom atomFormat = req->target;
1862  int dataFormat = 0;
1863  QByteArray data;
1864  if (X11->xdndMimeDataForAtom(req->target, manager->dragPrivate()->data,
1865  &data, &atomFormat, &dataFormat)) {
1866  int dataSize = data.size() / (dataFormat / 8);
1867  XChangeProperty (X11->display, req->requestor, req->property,
1868  atomFormat, dataFormat, PropModeReplace,
1869  (unsigned char *)data.data(), dataSize);
1870  evt.xselection.property = req->property;
1871  evt.xselection.target = atomFormat;
1872  }
1873  }
1874 
1875  // reset manager->object in case we modified it above
1876  manager->object = currentObject;
1877 
1878  // ### this can die if req->requestor crashes at the wrong
1879  // ### moment
1880  XSendEvent(X11->display, req->requestor, False, 0, &evt);
1881 }
The QDrag class provides support for MIME-based drag and drop data transfer.
Definition: qdrag.h:61
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
QDrag * object
Definition: qdnd_p.h:238
#define at(className, varName)
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
static int findXdndDropTransactionByWindow(Window window)
Definition: qdnd_x11.cpp:94
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
static const char * data(const QByteArray &arr)
static Window qt_xdnd_current_target
Definition: qdnd_x11.cpp:224
static QDragManager * self()
Definition: qdnd.cpp:163
static void restartXdndDropExpiryTimer()
Definition: qdnd_x11.cpp:124
static Time qt_xdnd_source_current_time
Definition: qdnd_x11.cpp:227
QMimeData * data
Definition: qdnd_p.h:179
static Window findXdndAwareParent(Window window)
Definition: qdnd_x11.cpp:133
static int findXdndDropTransactionByTime(Time timestamp)
Definition: qdnd_x11.cpp:107
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
QDragPrivate * dragPrivate() const
Definition: qdnd_p.h:231

◆ xdndHandleStatus()

void QX11Data::xdndHandleStatus ( QWidget w,
const XEvent xe,
bool  passive 
)

Definition at line 1037 of file qdnd_x11.cpp.

1038 {
1039  DEBUG("xdndHandleStatus");
1040  while (XCheckIfEvent(X11->display, (XEvent *)xe, xdnd_status_scanner, 0))
1041  ;
1042 
1043  handle_xdnd_status(w, xe, passive);
1044  DEBUG("xdndHandleStatus end");
1045 }
static Bool xdnd_status_scanner(Display *, XEvent *event, XPointer)
Definition: qdnd_x11.cpp:1025
#define X11
Definition: qt_x11_p.h:724
union _XEvent XEvent
Definition: qwindowdefs.h:116
static void handle_xdnd_status(QWidget *w, const XEvent *xe, bool)
Definition: qdnd_x11.cpp:1001
#define DEBUG
Definition: qdnd_x11.cpp:85

◆ xdndMimeAtomForFormat()

Atom QX11Data::xdndMimeAtomForFormat ( const QString format,
QVariant::Type  requestedType,
const QList< Atom > &  atoms,
QByteArray requestedEncoding 
)

Definition at line 652 of file qdnd_x11.cpp.

653 {
654  encoding->clear();
655 
656  // find matches for string types
657  if (format == QLatin1String("text/plain")) {
658  if (atoms.contains(ATOM(UTF8_STRING)))
659  return ATOM(UTF8_STRING);
660  if (atoms.contains(ATOM(COMPOUND_TEXT)))
661  return ATOM(COMPOUND_TEXT);
662  if (atoms.contains(ATOM(TEXT)))
663  return ATOM(TEXT);
664  if (atoms.contains(XA_STRING))
665  return XA_STRING;
666  }
667 
668  // find matches for uri types
669  if (format == QLatin1String("text/uri-list")) {
670  Atom a = xdndMimeStringToAtom(format);
671  if (a && atoms.contains(a))
672  return a;
673  a = xdndMimeStringToAtom(QLatin1String("text/x-moz-url"));
674  if (a && atoms.contains(a))
675  return a;
676  }
677 
678  // find match for image
679  if (format == QLatin1String("image/ppm")) {
680  if (atoms.contains(XA_PIXMAP))
681  return XA_PIXMAP;
682  }
683 
684  // for string/text requests try to use a format with a well-defined charset
685  // first to avoid encoding problems
686  if (requestedType == QVariant::String
687  && format.startsWith(QLatin1String("text/"))
688  && !format.contains(QLatin1String("charset="))) {
689 
690  QString formatWithCharset = format;
691  formatWithCharset.append(QLatin1String(";charset=utf-8"));
692 
693  Atom a = xdndMimeStringToAtom(formatWithCharset);
694  if (a && atoms.contains(a)) {
695  *encoding = "utf-8";
696  return a;
697  }
698  }
699 
700  Atom a = xdndMimeStringToAtom(format);
701  if (a && atoms.contains(a))
702  return a;
703 
704  return 0;
705 }
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Definition: qstring.h:904
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
Definition: qstring.cpp:3734
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define ATOM(x)
Definition: qt_x11_p.h:723
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
Definition: qlist.h:880
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
Definition: qstring.h:654
Atom xdndMimeStringToAtom(const QString &mimeType)
Definition: qdnd_x11.cpp:445
QString & append(QChar c)
Definition: qstring.cpp:1777

◆ xdndMimeAtomsForFormat()

QList< Atom > QX11Data::xdndMimeAtomsForFormat ( const QString format)

Definition at line 561 of file qdnd_x11.cpp.

562 {
564  atoms.append(xdndMimeStringToAtom(format));
565 
566  // special cases for strings
567  if (format == QLatin1String("text/plain")) {
568  atoms.append(ATOM(UTF8_STRING));
569  atoms.append(XA_STRING);
570  atoms.append(ATOM(TEXT));
571  atoms.append(ATOM(COMPOUND_TEXT));
572  }
573 
574  // special cases for uris
575  if (format == QLatin1String("text/uri-list")) {
576  atoms.append(xdndMimeStringToAtom(QLatin1String("text/x-moz-url")));
577  }
578 
579  //special cases for images
580  if (format == QLatin1String("image/ppm"))
581  atoms.append(XA_PIXMAP);
582  if (format == QLatin1String("image/pbm"))
583  atoms.append(XA_BITMAP);
584 
585  return atoms;
586 }
Atom atoms[NAtoms]
Definition: qt_x11_p.h:698
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
#define ATOM(x)
Definition: qt_x11_p.h:723
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
Atom xdndMimeStringToAtom(const QString &mimeType)
Definition: qdnd_x11.cpp:445
The QList class is a template class that provides lists.
Definition: qdatastream.h:62

◆ xdndMimeAtomToString()

QString QX11Data::xdndMimeAtomToString ( Atom  a)

Definition at line 433 of file qdnd_x11.cpp.

434 {
435  QString atomName;
436  if (a) {
437  char *atom = XGetAtomName(display, a);
438  atomName = QString::fromLatin1(atom);
439  XFree(atom);
440  }
441  return atomName;
442 }
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
Definition: qstring.h:83
Display * display
Definition: qt_x11_p.h:392
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188

◆ xdndMimeConvertToFormat()

QVariant QX11Data::xdndMimeConvertToFormat ( Atom  a,
const QByteArray data,
const QString format,
QVariant::Type  requestedType,
const QByteArray encoding 
)

Definition at line 589 of file qdnd_x11.cpp.

590 {
591  QString atomName = xdndMimeAtomToString(a);
592  if (atomName == format)
593  return data;
594 
595  if (!encoding.isEmpty()
596  && atomName == format + QLatin1String(";charset=") + QString::fromLatin1(encoding)) {
597 
598  if (requestedType == QVariant::String) {
600  if (codec)
601  return codec->toUnicode(data);
602  }
603 
604  return data;
605  }
606 
607  // special cases for string types
608  if (format == QLatin1String("text/plain")) {
609  if (a == ATOM(UTF8_STRING))
610  return QString::fromUtf8(data);
611  if (a == XA_STRING)
612  return QString::fromLatin1(data);
613  if (a == ATOM(TEXT) || a == ATOM(COMPOUND_TEXT))
614  // #### might be wrong for COMPUND_TEXT
615  return QString::fromLocal8Bit(data, data.size());
616  }
617 
618  // special case for uri types
619  if (format == QLatin1String("text/uri-list")) {
620  if (atomName == QLatin1String("text/x-moz-url")) {
621  // we expect this as utf16 <url><space><title>
622  // the first part is a url that should only contain ascci char
623  // so it should be safe to check that the second char is 0
624  // to verify that it is utf16
625  if (data.size() > 1 && data.at(1) == 0)
626  return QString::fromRawData((const QChar *)data.constData(),
627  data.size() / 2).split(QLatin1Char('\n')).first().toLatin1();
628  }
629  }
630 
631  // special cas for images
632  if (format == QLatin1String("image/ppm")) {
633  if (a == XA_PIXMAP && data.size() == sizeof(Pixmap)) {
634  Pixmap xpm = *((Pixmap*)data.data());
635  if (!xpm)
636  return QByteArray();
637  QPixmap qpm = QPixmap::fromX11Pixmap(xpm);
638  QImageWriter imageWriter;
639  imageWriter.setFormat("PPMRAW");
640  QImage imageToWrite = qpm.toImage();
641  QBuffer buf;
643  imageWriter.setDevice(&buf);
644  imageWriter.write(imageToWrite);
645  return buf.buffer();
646  }
647  }
648  return QVariant();
649 }
The QVariant class acts like a union for the most common Qt data types.
Definition: qvariant.h:92
QImage toImage() const
Converts the pixmap to a QImage.
Definition: qpixmap.cpp:542
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
Definition: qstring.cpp:4245
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
bool open(OpenMode openMode)
Reimplemented Function
Definition: qbuffer.cpp:338
QString xdndMimeAtomToString(Atom a)
Definition: qdnd_x11.cpp:433
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
The QBuffer class provides a QIODevice interface for a QByteArray.
Definition: qbuffer.h:57
The QString class provides a Unicode character string.
Definition: qstring.h:83
The QChar class provides a 16-bit Unicode character.
Definition: qchar.h:72
static QString fromRawData(const QChar *, int size)
Constructs a QString that uses the first size Unicode characters in the array unicode.
Definition: qstring.cpp:7673
#define ATOM(x)
Definition: qt_x11_p.h:723
QByteArray & buffer()
Returns a reference to the QBuffer&#39;s internal buffer.
Definition: qbuffer.cpp:271
The QImageWriter class provides a format independent interface for writing images to files or other d...
Definition: qimagewriter.h:59
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static const char * data(const QByteArray &arr)
static QTextCodec * codec(MYSQL *mysql)
Definition: qsql_mysql.cpp:220
static void split(QT_FT_Vector *b)
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
void setDevice(QIODevice *device)
Sets QImageWriter&#39;s device to device.
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
void setFormat(const QByteArray &format)
Sets the format QImageWriter will use when writing images, to format.
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
Definition: qbytearray.h:421
The QTextCodec class provides conversions between text encodings.
Definition: qtextcodec.h:62
char at(int i) const
Returns the character at index position i in the byte array.
Definition: qbytearray.h:413
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55

◆ xdndMimeDataForAtom()

bool QX11Data::xdndMimeDataForAtom ( Atom  a,
QMimeData mimeData,
QByteArray data,
Atom *  atomFormat,
int *  dataFormat 
)

Definition at line 477 of file qdnd_x11.cpp.

478 {
479  bool ret = false;
480  *atomFormat = a;
481  *dataFormat = 8;
482  QString atomName = xdndMimeAtomToString(a);
483  if (QInternalMimeData::hasFormatHelper(atomName, mimeData)) {
484  *data = QInternalMimeData::renderDataHelper(atomName, mimeData);
485  if (atomName == QLatin1String("application/x-color"))
486  *dataFormat = 16;
487  ret = true;
488  } else {
489  if ((a == ATOM(UTF8_STRING) || a == XA_STRING
490  || a == ATOM(TEXT) || a == ATOM(COMPOUND_TEXT))
491  && QInternalMimeData::hasFormatHelper(QLatin1String("text/plain"), mimeData)) {
492  if (a == ATOM(UTF8_STRING)){
493  *data = QInternalMimeData::renderDataHelper(QLatin1String("text/plain"), mimeData);
494  ret = true;
495  } else if (a == XA_STRING) {
497  QLatin1String("text/plain"), mimeData)).toLocal8Bit();
498  ret = true;
499  } else if (a == ATOM(TEXT) || a == ATOM(COMPOUND_TEXT)) {
500  // the ICCCM states that TEXT and COMPOUND_TEXT are in the
501  // encoding of choice, so we choose the encoding of the locale
503  QLatin1String("text/plain"), mimeData)).toLocal8Bit();
504  char *list[] = { strData.data(), NULL };
505 
506  XICCEncodingStyle style = (a == ATOM(COMPOUND_TEXT))
507  ? XCompoundTextStyle : XStdICCTextStyle;
508  XTextProperty textprop;
509  if (list[0] != NULL
510  && XmbTextListToTextProperty(X11->display, list, 1, style,
511  &textprop) == Success) {
512  *atomFormat = textprop.encoding;
513  *dataFormat = textprop.format;
514  *data = QByteArray((const char *) textprop.value, textprop.nitems * textprop.format / 8);
515  ret = true;
516 
517  DEBUG(" textprop type %lx\n"
518  " textprop name '%s'\n"
519  " format %d\n"
520  " %ld items\n"
521  " %d bytes\n",
522  textprop.encoding,
523  X11->xdndMimeAtomToString(textprop.encoding).toLatin1().data(),
524  textprop.format, textprop.nitems, data->size());
525 
526  XFree(textprop.value);
527  }
528  }
529  } else if (atomName == QLatin1String("text/x-moz-url") &&
530  QInternalMimeData::hasFormatHelper(QLatin1String("text/uri-list"), mimeData)) {
532  QLatin1String("text/uri-list"), mimeData).split('\n').first();
533  QString mozUri = QString::fromLatin1(uri, uri.size());
534  mozUri += QLatin1Char('\n');
535  *data = QByteArray(reinterpret_cast<const char *>(mozUri.utf16()), mozUri.length() * 2);
536  ret = true;
537  } else if ((a == XA_PIXMAP || a == XA_BITMAP) && mimeData->hasImage()) {
538  QPixmap pm = qvariant_cast<QPixmap>(mimeData->imageData());
539  if (a == XA_BITMAP && pm.depth() != 1) {
540  QImage img = pm.toImage();
542  pm = QPixmap::fromImage(img);
543  }
545  if (dm) {
546  Pixmap handle = pm.handle();
547  *data = QByteArray((const char *) &handle, sizeof(Pixmap));
550  (dm->xdndMimeTransferedPixmapIndex + 1) % 2;
551  ret = true;
552  }
553  } else {
554  DEBUG("QClipboard: xdndMimeDataForAtom(): converting to type '%s' is not supported", qPrintable(atomName));
555  }
556  }
557  return ret && data != 0;
558 }
QImage toImage() const
Converts the pixmap to a QImage.
Definition: qpixmap.cpp:542
static QPixmap fromImage(const QImage &image, Qt::ImageConversionFlags flags=Qt::AutoColor)
Converts the given image to a pixmap using the specified flags to control the conversion.
Definition: qpixmap.cpp:2197
QPixmap xdndMimeTransferedPixmap[2]
Definition: qdnd_p.h:259
char * data()
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:429
QString xdndMimeAtomToString(Atom a)
Definition: qdnd_x11.cpp:433
The QByteArray class provides an array of bytes.
Definition: qbytearray.h:135
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
Qt::HANDLE handle() const
Returns the pixmap&#39;s handle to the device context.
Definition: qpixmap.cpp:1299
long ASN1_INTEGER_get ASN1_INTEGER * a
int depth() const
Returns the depth of the pixmap.
Definition: qpixmap.cpp:695
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define X11
Definition: qt_x11_p.h:724
#define ATOM(x)
Definition: qt_x11_p.h:723
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
Definition: qstring.cpp:4302
The QImage class provides a hardware-independent image representation that allows direct access to th...
Definition: qimage.h:87
static bool hasFormatHelper(const QString &mimeType, const QMimeData *data)
Definition: qdnd.cpp:428
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
Definition: qstring.cpp:4049
static QByteArray renderDataHelper(const QString &mimeType, const QMimeData *data)
Definition: qdnd.cpp:447
static QDragManager * self()
Definition: qdnd.cpp:163
T & first()
Returns a reference to the first item in the list.
Definition: qlist.h:282
QVariant imageData() const
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null varia...
Definition: qmimedata.cpp:442
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
Definition: qmimedata.cpp:471
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
Definition: qimage.cpp:3966
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
Definition: qstring.cpp:4188
T qvariant_cast(const QVariant &)
Definition: qvariant.h:571
int size() const
Returns the number of bytes in this byte array.
Definition: qbytearray.h:402
The QPixmap class is an off-screen image representation that can be used as a paint device...
Definition: qpixmap.h:71
#define DEBUG
Definition: qdnd_x11.cpp:85
#define qPrintable(string)
Definition: qglobal.h:1750
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
Definition: qchar.h:55
int xdndMimeTransferedPixmapIndex
Definition: qdnd_p.h:260

◆ xdndMimeFormatsForAtom()

QStringList QX11Data::xdndMimeFormatsForAtom ( Atom  a)

Definition at line 453 of file qdnd_x11.cpp.

454 {
455  QStringList formats;
456  if (a) {
457  QString atomName = xdndMimeAtomToString(a);
458  formats.append(atomName);
459 
460  // special cases for string type
461  if (a == ATOM(UTF8_STRING) || a == XA_STRING
462  || a == ATOM(TEXT) || a == ATOM(COMPOUND_TEXT))
463  formats.append(QLatin1String("text/plain"));
464 
465  // special cases for uris
466  if (atomName == QLatin1String("text/x-moz-url"))
467  formats.append(QLatin1String("text/uri-list"));
468 
469  // special case for images
470  if (a == XA_PIXMAP)
471  formats.append(QLatin1String("image/ppm"));
472  }
473  return formats;
474 }
QString xdndMimeAtomToString(Atom a)
Definition: qdnd_x11.cpp:433
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
long ASN1_INTEGER_get ASN1_INTEGER * a
The QString class provides a Unicode character string.
Definition: qstring.h:83
#define ATOM(x)
Definition: qt_x11_p.h:723
void append(const T &t)
Inserts value at the end of the list.
Definition: qlist.h:507
The QStringList class provides a list of strings.
Definition: qstringlist.h:66

◆ xdndMimeStringToAtom()

Atom QX11Data::xdndMimeStringToAtom ( const QString mimeType)

Definition at line 445 of file qdnd_x11.cpp.

446 {
447  if (mimeType.isEmpty())
448  return 0;
449  return XInternAtom(display, mimeType.toLatin1().constData(), False);
450 }
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
Definition: qstring.h:704
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
Definition: qstring.cpp:3993
const char * constData() const
Returns a pointer to the data stored in the byte array.
Definition: qbytearray.h:433
Display * display
Definition: qt_x11_p.h:392

◆ xdndSetup()

void QX11Data::xdndSetup ( )
static

Definition at line 707 of file qdnd_x11.cpp.

707  {
710 }
void qAddPostRoutine(QtCleanUpFunction p)
static void qt_xdnd_cleanup()
Definition: qdnd_x11.cpp:713
static void initialize()
Definition: qcursor.cpp:417

◆ xdndStringToAtom()

Atom QX11Data::xdndStringToAtom ( const char *  mimeType)

Definition at line 425 of file qdnd_x11.cpp.

426 {
427  if (!mimeType || !*mimeType)
428  return 0;
429  return XInternAtom(display, mimeType, False);
430 }
Display * display
Definition: qt_x11_p.h:392

Properties

◆ argbColormaps

Colormap* QX11Data::argbColormaps

Definition at line 471 of file qt_x11_p.h.

◆ argbVisuals

Visual** QX11Data::argbVisuals

Definition at line 470 of file qt_x11_p.h.

◆ atoms

Atom QX11Data::atoms[NAtoms]

Definition at line 698 of file qt_x11_p.h.

◆ bppForDepth

QHash<int, int> QX11Data::bppForDepth

Definition at line 474 of file qt_x11_p.h.

◆ color_count

int QX11Data::color_count

Definition at line 499 of file qt_x11_p.h.

◆ colormap

Colormap QX11Data::colormap

Definition at line 504 of file qt_x11_p.h.

◆ compositingManagerRunning

bool QX11Data::compositingManagerRunning

Definition at line 702 of file qt_x11_p.h.

◆ custom_cmap

bool QX11Data::custom_cmap

Definition at line 500 of file qt_x11_p.h.

◆ default_im

QString QX11Data::default_im

Definition at line 479 of file qt_x11_p.h.

◆ defaultScreen

int QX11Data::defaultScreen

Definition at line 473 of file qt_x11_p.h.

◆ deferred_map

QList<QWidget *> QX11Data::deferred_map

Definition at line 453 of file qt_x11_p.h.

◆ desktopEnvironment

DesktopEnvironment QX11Data::desktopEnvironment

Definition at line 533 of file qt_x11_p.h.

◆ desktopVersion

uint QX11Data::desktopVersion

Definition at line 534 of file qt_x11_p.h.

◆ display

Display* QX11Data::display

Definition at line 392 of file qt_x11_p.h.

◆ displayName

char* QX11Data::displayName

Definition at line 393 of file qt_x11_p.h.

◆ dndDropTransactions

QList<QXdndDropTransaction> QX11Data::dndDropTransactions

Definition at line 383 of file qt_x11_p.h.

◆ fc_antialias

bool QX11Data::fc_antialias

Definition at line 528 of file qt_x11_p.h.

◆ fc_hint_style

int QX11Data::fc_hint_style

Definition at line 529 of file qt_x11_p.h.

◆ fc_scale

qreal QX11Data::fc_scale

Definition at line 527 of file qt_x11_p.h.

◆ focus_model

int QX11Data::focus_model

Definition at line 401 of file qt_x11_p.h.

◆ foreignDisplay

bool QX11Data::foreignDisplay

Definition at line 394 of file qt_x11_p.h.

◆ has_fontconfig

bool QX11Data::has_fontconfig

Definition at line 526 of file qt_x11_p.h.

◆ ignore_badwindow

bool QX11Data::ignore_badwindow

Definition at line 493 of file qt_x11_p.h.

Referenced by badwindow(), and ignoreBadwindow().

◆ mitshm_major

int QX11Data::mitshm_major

Definition at line 439 of file qt_x11_p.h.

◆ motifdnd_active

bool QX11Data::motifdnd_active

Definition at line 390 of file qt_x11_p.h.

◆ net_supported_list

Atom* QX11Data::net_supported_list

Definition at line 463 of file qt_x11_p.h.

◆ net_virtual_root_list

Window* QX11Data::net_virtual_root_list

Definition at line 465 of file qt_x11_p.h.

◆ pattern_fills

struct QX11Data::PatternFills QX11Data::pattern_fills[pattern_fill_count]

◆ ptrXCloseDevice

PtrXCloseDevice QX11Data::ptrXCloseDevice

Definition at line 428 of file qt_x11_p.h.

◆ ptrXcursorLibraryLoadCursor

PtrXcursorLibraryLoadCursor QX11Data::ptrXcursorLibraryLoadCursor

Definition at line 705 of file qt_x11_p.h.

◆ ptrXFixesQueryExtension

PtrXFixesQueryExtension QX11Data::ptrXFixesQueryExtension

Definition at line 421 of file qt_x11_p.h.

◆ ptrXFixesQueryVersion

PtrXFixesQueryVersion QX11Data::ptrXFixesQueryVersion

Definition at line 422 of file qt_x11_p.h.

◆ ptrXFixesSelectSelectionInput

PtrXFixesSelectSelectionInput QX11Data::ptrXFixesSelectSelectionInput

Definition at line 424 of file qt_x11_p.h.

◆ ptrXFixesSetCursorName

PtrXFixesSetCursorName QX11Data::ptrXFixesSetCursorName

Definition at line 423 of file qt_x11_p.h.

◆ ptrXFreeDeviceList

PtrXFreeDeviceList QX11Data::ptrXFreeDeviceList

Definition at line 431 of file qt_x11_p.h.

◆ ptrXineramaIsActive

PtrXineramaIsActive QX11Data::ptrXineramaIsActive

Definition at line 710 of file qt_x11_p.h.

◆ ptrXineramaQueryExtension

PtrXineramaQueryExtension QX11Data::ptrXineramaQueryExtension

Definition at line 709 of file qt_x11_p.h.

◆ ptrXineramaQueryScreens

PtrXineramaQueryScreens QX11Data::ptrXineramaQueryScreens

Definition at line 711 of file qt_x11_p.h.

◆ ptrXListInputDevices

PtrXListInputDevices QX11Data::ptrXListInputDevices

Definition at line 429 of file qt_x11_p.h.

◆ ptrXOpenDevice

PtrXOpenDevice QX11Data::ptrXOpenDevice

Definition at line 430 of file qt_x11_p.h.

◆ ptrXRRQueryExtension

PtrXRRQueryExtension QX11Data::ptrXRRQueryExtension

Definition at line 718 of file qt_x11_p.h.

◆ ptrXRRRootToScreen

PtrXRRRootToScreen QX11Data::ptrXRRRootToScreen

Definition at line 717 of file qt_x11_p.h.

◆ ptrXRRSelectInput

PtrXRRSelectInput QX11Data::ptrXRRSelectInput

Definition at line 715 of file qt_x11_p.h.

◆ ptrXRRUpdateConfiguration

PtrXRRUpdateConfiguration QX11Data::ptrXRRUpdateConfiguration

Definition at line 716 of file qt_x11_p.h.

◆ ptrXSelectExtensionEvent

PtrXSelectExtensionEvent QX11Data::ptrXSelectExtensionEvent

Definition at line 432 of file qt_x11_p.h.

◆ screenCount

int QX11Data::screenCount

Definition at line 472 of file qt_x11_p.h.

◆ screens

QX11InfoData* QX11Data::screens

Definition at line 469 of file qt_x11_p.h.

◆ seen_badwindow

bool QX11Data::seen_badwindow

Definition at line 494 of file qt_x11_p.h.

Referenced by badwindow(), and ignoreBadwindow().

◆ sip_list

QList<ScrollInProgress> QX11Data::sip_list

Definition at line 460 of file qt_x11_p.h.

◆ sip_serial

long QX11Data::sip_serial

Definition at line 459 of file qt_x11_p.h.

◆ solid_fills

struct QX11Data::SolidFills QX11Data::solid_fills[solid_fill_count]

◆ startupId

char* QX11Data::startupId

Definition at line 531 of file qt_x11_p.h.

◆ time

Time QX11Data::time

Definition at line 476 of file qt_x11_p.h.

Referenced by x11Time().

◆ use_mitshm

bool QX11Data::use_mitshm

Definition at line 437 of file qt_x11_p.h.

◆ use_mitshm_pixmaps

bool QX11Data::use_mitshm_pixmaps

Definition at line 438 of file qt_x11_p.h.

◆ use_xfixes

bool QX11Data::use_xfixes

Definition at line 415 of file qt_x11_p.h.

◆ use_xinput

bool QX11Data::use_xinput

Definition at line 442 of file qt_x11_p.h.

◆ use_xkb

bool QX11Data::use_xkb

Definition at line 448 of file qt_x11_p.h.

◆ use_xrandr

bool QX11Data::use_xrandr

Definition at line 404 of file qt_x11_p.h.

◆ use_xrender

bool QX11Data::use_xrender

Definition at line 410 of file qt_x11_p.h.

◆ userTime

Time QX11Data::userTime

Definition at line 477 of file qt_x11_p.h.

◆ visual

Visual* QX11Data::visual

Definition at line 503 of file qt_x11_p.h.

◆ visual_class

int QX11Data::visual_class

Definition at line 497 of file qt_x11_p.h.

◆ visual_id

int QX11Data::visual_id

Definition at line 498 of file qt_x11_p.h.

◆ wm_client_leader

Window QX11Data::wm_client_leader

Definition at line 467 of file qt_x11_p.h.

◆ xfixes_errorbase

int QX11Data::xfixes_errorbase

Definition at line 418 of file qt_x11_p.h.

◆ xfixes_eventbase

int QX11Data::xfixes_eventbase

Definition at line 417 of file qt_x11_p.h.

◆ xfixes_major

int QX11Data::xfixes_major

Definition at line 416 of file qt_x11_p.h.

◆ xinput_errorbase

int QX11Data::xinput_errorbase

Definition at line 445 of file qt_x11_p.h.

◆ xinput_eventbase

int QX11Data::xinput_eventbase

Definition at line 444 of file qt_x11_p.h.

◆ xinput_major

int QX11Data::xinput_major

Definition at line 443 of file qt_x11_p.h.

◆ xkb_errorbase

int QX11Data::xkb_errorbase

Definition at line 451 of file qt_x11_p.h.

◆ xkb_eventbase

int QX11Data::xkb_eventbase

Definition at line 450 of file qt_x11_p.h.

◆ xkb_major

int QX11Data::xkb_major

Definition at line 449 of file qt_x11_p.h.

◆ xrandr_errorbase

int QX11Data::xrandr_errorbase

Definition at line 407 of file qt_x11_p.h.

◆ xrandr_eventbase

int QX11Data::xrandr_eventbase

Definition at line 406 of file qt_x11_p.h.

◆ xrandr_major

int QX11Data::xrandr_major

Definition at line 405 of file qt_x11_p.h.

◆ xrender_major

int QX11Data::xrender_major

Definition at line 411 of file qt_x11_p.h.

◆ xrender_version

int QX11Data::xrender_version

Definition at line 412 of file qt_x11_p.h.


The documentation for this struct was generated from the following files: