46 #include <qplatformdefs.h> 48 #include <QtGui/private/qapplication_p.h> 49 #include <QtCore/QBuffer> 50 #include <QtCore/QLibrary> 60 "_NET_WM_CONTEXT_HELP\0" 61 "_NET_WM_SYNC_REQUEST\0" 62 "_NET_WM_SYNC_REQUEST_COUNTER\0" 82 "_QT_CLIPBOARD_SENTINEL\0" 83 "_QT_SELECTION_SENTINEL\0" 91 "_QT_INPUT_ENCODING\0" 96 "ENLIGHTENMENT_DESKTOP\0" 98 "_SGI_DESKS_MANAGER\0" 102 "_NET_VIRTUAL_ROOTS\0" 105 "_NET_MOVERESIZE_WINDOW\0" 106 "_NET_WM_MOVERESIZE\0" 109 "_NET_WM_ICON_NAME\0" 114 "_NET_WM_WINDOW_OPACITY\0" 117 "_NET_WM_STATE_ABOVE\0" 118 "_NET_WM_STATE_BELOW\0" 119 "_NET_WM_STATE_FULLSCREEN\0" 120 "_NET_WM_STATE_MAXIMIZED_HORZ\0" 121 "_NET_WM_STATE_MAXIMIZED_VERT\0" 122 "_NET_WM_STATE_MODAL\0" 123 "_NET_WM_STATE_STAYS_ON_TOP\0" 124 "_NET_WM_STATE_DEMANDS_ATTENTION\0" 126 "_NET_WM_USER_TIME\0" 127 "_NET_WM_USER_TIME_WINDOW\0" 128 "_NET_WM_FULL_PLACEMENT\0" 130 "_NET_WM_WINDOW_TYPE\0" 131 "_NET_WM_WINDOW_TYPE_DESKTOP\0" 132 "_NET_WM_WINDOW_TYPE_DOCK\0" 133 "_NET_WM_WINDOW_TYPE_TOOLBAR\0" 134 "_NET_WM_WINDOW_TYPE_MENU\0" 135 "_NET_WM_WINDOW_TYPE_UTILITY\0" 136 "_NET_WM_WINDOW_TYPE_SPLASH\0" 137 "_NET_WM_WINDOW_TYPE_DIALOG\0" 138 "_NET_WM_WINDOW_TYPE_DROPDOWN_MENU\0" 139 "_NET_WM_WINDOW_TYPE_POPUP_MENU\0" 140 "_NET_WM_WINDOW_TYPE_TOOLTIP\0" 141 "_NET_WM_WINDOW_TYPE_NOTIFICATION\0" 142 "_NET_WM_WINDOW_TYPE_COMBO\0" 143 "_NET_WM_WINDOW_TYPE_DND\0" 144 "_NET_WM_WINDOW_TYPE_NORMAL\0" 145 "_KDE_NET_WM_WINDOW_TYPE_OVERRIDE\0" 147 "_KDE_NET_WM_FRAME_STRUT\0" 149 "_NET_STARTUP_INFO\0" 150 "_NET_STARTUP_INFO_BEGIN\0" 152 "_NET_SUPPORTING_WM_CHECK\0" 156 "_NET_SYSTEM_TRAY_VISUAL\0" 158 "_NET_ACTIVE_WINDOW\0" 183 "XdndActionPrivate\0" 186 "_MOTIF_DRAG_AND_DROP_MESSAGE\0" 187 "_MOTIF_DRAG_INITIATOR_INFO\0" 188 "_MOTIF_DRAG_RECEIVER_INFO\0" 189 "_MOTIF_DRAG_WINDOW\0" 190 "_MOTIF_DRAG_TARGETS\0" 192 "XmTRANSFER_SUCCESS\0" 193 "XmTRANSFER_FAILURE\0" 225 int highestVernum,
const char *symbol)
234 for(
int i = highestVernum; i > vernum; --i)
239 QLibrary xfixesLib(libName, version);
247 # define XFIXES_LOAD_RUNTIME(vernum, symbol, symbol_type) \ 248 (symbol_type)qt_load_library_runtime("libXfixes", vernum, 4, #symbol); 249 # define XFIXES_LOAD_V1(symbol) \ 250 XFIXES_LOAD_RUNTIME(1, symbol, Ptr##symbol) 251 # define XFIXES_LOAD_V2(symbol) \ 252 XFIXES_LOAD_RUNTIME(2, symbol, Ptr##symbol) 278 bool supported =
false;
309 else if (xi->depth == 16)
315 if ((QSysInfo::ByteOrder == QSysInfo::LittleEndian && xi->byte_order == MSBFirst)
316 || (QSysInfo::ByteOrder == QSysInfo::BigEndian && xi->byte_order == LSBFirst))
318 for (
int i=0; i < image.
height(); i++) {
319 if (xi->depth == 16) {
323 *p = ((*p << 8) & 0xff00) | ((*p >> 8) & 0x00ff);
330 *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000)
331 | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff);
341 for (
int y = 0; y < xi->height; ++y) {
342 for (
int x = 0; x < xi->width; ++x)
344 p += xi->bytes_per_line / 4;
368 QByteArray settings_atom_name(
"_QT_SETTINGS_TIMESTAMP_");
370 names[i++] = settings_atom_name;
373 #if 0//defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6) 386 unsigned long nitems, after;
387 unsigned char *
data = 0;
395 if (e ==
Success && type == XA_ATOM && format == 32) {
404 if (type == XA_ATOM && format == 32) {
405 ts.
write(reinterpret_cast<char *>(data), nitems *
sizeof(
long));
415 nitems = buffer.
size() /
sizeof(
Atom);
419 for (i = 0; i < nitems; i++)
454 #endif // QT_NO_XFIXES 479 return qTestLiteStaticInfoPrivate()->atom(atom);
484 return qTestLiteStaticInfoPrivate()->isSupportedByWM(atom);
489 return qTestLiteStaticInfoPrivate()->useXFixes();
494 return qTestLiteStaticInfoPrivate()->xFixesEventBase();
500 qDebug() << qTestLiteStaticInfoPrivate()->useXFixes();
501 if (!qTestLiteStaticInfoPrivate()->
useXFixes())
504 return qTestLiteStaticInfoPrivate()->xFixesSelectSelectionInput();
509 return qTestLiteStaticInfoPrivate()->qimageFromXImage(xi);
511 #endif //QT_NO_XFIXES T qobject_cast(QObject *object)
void resolveXFixes(QXlibScreen *screen)
static bool isSupportedByWM(Atom atom)
Format
The following image formats are available in Qt.
QImage copy(const QRect &rect=QRect()) const
Returns a sub-area of the image as a new image.
int xFixesEventBase() const
Status(* PtrXFixesQueryVersion)(Display *, int *, int *)
bool open(OpenMode openMode)
Reimplemented Function
The QByteArray class provides an array of bytes.
Display * nativeDisplay() const
QString displayName() const
bool isSupportedByWM(Atom atom)
Q_GLOBAL_STATIC(QTestLiteStaticInfoPrivate, qTestLiteStaticInfoPrivate)
long ASN1_INTEGER_get ASN1_INTEGER * a
void * resolve(const char *symbol)
Returns the address of the exported symbol symbol.
The QBuffer class provides a QIODevice interface for a QByteArray.
PtrXFixesSelectSelectionInput xFixesSelectSelectionInput() const
QTestLiteStaticInfoPrivate()
Q_CORE_EXPORT void qDebug(const char *,...)
void initializeAllAtoms(QXlibScreen *screen)
PtrXFixesQueryVersion ptrXFixesQueryVersion
QByteArray & buffer()
Returns a reference to the QBuffer's internal buffer.
Bool(* PtrXFixesQueryExtension)(Display *, int *, int *)
Atom m_allAtoms[QXlibStatic::NAtoms]
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
PtrXFixesQueryExtension ptrXFixesQueryExtension
static void * qt_load_library_runtime(const char *library, int vernum, int highestVernum, const char *symbol)
Try to resolve a symbol from library with the version specified by vernum.
const T * ptr(const T &t)
#define XFIXES_LOAD_V2(symbol)
static const char * x11_atomnames
static Atom atom(X11Atom atom)
uchar * bits()
Returns a pointer to the first pixel data.
int width() const
Returns the width of the image.
Atom atom(QXlibStatic::X11Atom atom)
void(* PtrXFixesSelectSelectionInput)(Display *dpy, Window win, Atom selection, unsigned long eventMask)
QImage qimageFromXImage(XImage *xi)
void(* PtrXFixesSetCursorName)(Display *dpy, Cursor cursor, const char *name)
int height() const
Returns the height of the image.
int size() const
Returns the number of bytes in this byte array.
static int xFixesEventBase()
static QImage qimageFromXImage(XImage *xi)
#define Q_FOREACH(variable, container)
Same as foreach(variable, container).
PtrXFixesSetCursorName ptrXFixesSetCursorName
static PtrXFixesSelectSelectionInput xFixesSelectSelectionInput()
qint64 write(const char *data, qint64 len)
Writes at most maxSize bytes of data from data to the device.
static const KeyPair *const end
QXlibDisplay * display() const
#define qPrintable(string)
PtrXFixesSelectSelectionInput ptrXFixesSelectSelectionInput
uchar * scanLine(int)
Returns a pointer to the pixel data at the scanline with index i.
The QLibrary class loads shared libraries at runtime.
#define XFIXES_LOAD_V1(symbol)
void initializeSupportedAtoms(QXlibScreen *screen)