diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-03 15:28:29 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2011-01-04 14:18:29 (GMT) |
commit | afc9371b68d7db91c0874b3923a376224656e4c4 (patch) | |
tree | 0c18871c60037d798ec22cb30cff1c990d12574c /src/plugins/platforms | |
parent | c33402ff531c1667305907963c221b88dd168691 (diff) | |
download | Qt-afc9371b68d7db91c0874b3923a376224656e4c4.zip Qt-afc9371b68d7db91c0874b3923a376224656e4c4.tar.gz Qt-afc9371b68d7db91c0874b3923a376224656e4c4.tar.bz2 |
Renamed QTestLiteStaticInfo to QTestLiteStatic
Diffstat (limited to 'src/plugins/platforms')
6 files changed, 121 insertions, 67 deletions
diff --git a/src/plugins/platforms/testlite/qtestliteclipboard.cpp b/src/plugins/platforms/testlite/qtestliteclipboard.cpp index fdd6d30..9e1b387 100644 --- a/src/plugins/platforms/testlite/qtestliteclipboard.cpp +++ b/src/plugins/platforms/testlite/qtestliteclipboard.cpp @@ -28,7 +28,7 @@ const QMimeData * QTestLiteClipboard::mimeData(QClipboard::Mode mode) const QTestLiteClipboard *that = const_cast<QTestLiteClipboard *>(this); that->m_xClipboard = new QTestLiteMime(mode,that); } - Window clipboardOwner = XGetSelectionOwner(screen()->display(),QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD)); + Window clipboardOwner = XGetSelectionOwner(screen()->display(),QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD)); if (clipboardOwner == owner()) { return m_clientClipboard; } else { @@ -49,7 +49,7 @@ void QTestLiteClipboard::setMimeData(QMimeData *data, QClipboard::Mode mode) break; case QClipboard::Clipboard: - modeAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); + modeAtom = QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD); d = &m_clientClipboard; break; @@ -131,16 +131,16 @@ Atom QTestLiteClipboard::sendTargetsSelection(QMimeData *d, Window window, Atom QVector<Atom> types; QStringList formats = QInternalMimeData::formatsHelper(d); for (int i = 0; i < formats.size(); ++i) { - QList<Atom> atoms = QTestLiteMime::xdndMimeAtomsForFormat(screen()->display(),formats.at(i)); + QList<Atom> atoms = QTestLiteMime::mimeAtomsForFormat(screen()->display(),formats.at(i)); for (int j = 0; j < atoms.size(); ++j) { if (!types.contains(atoms.at(j))) types.append(atoms.at(j)); } } - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS)); - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::MULTIPLE)); - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TIMESTAMP)); - types.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::SAVE_TARGETS)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::TARGETS)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::MULTIPLE)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::TIMESTAMP)); + types.append(QTestLiteStatic::atom(QTestLiteStatic::SAVE_TARGETS)); XChangeProperty(screen()->display(), window, property, XA_ATOM, 32, PropModeReplace, (uchar *) types.data(), types.size()); @@ -164,7 +164,7 @@ Atom QTestLiteClipboard::sendSelection(QMimeData *d, Atom target, Window window, // don't allow INCR transfers when using MULTIPLE or to // Motif clients (since Motif doesn't support INCR) - static Atom motif_clip_temporary = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIP_TEMPORARY); + static Atom motif_clip_temporary = QTestLiteStatic::atom(QTestLiteStatic::CLIP_TEMPORARY); bool allow_incr = property != motif_clip_temporary; // X_ChangeProperty protocol request is 24 bytes @@ -172,7 +172,7 @@ Atom QTestLiteClipboard::sendSelection(QMimeData *d, Atom target, Window window, if (data.size() > increment && allow_incr) { long bytes = data.size(); XChangeProperty(screen()->display(), window, property, - QTestLiteStaticInfo::atom(QTestLiteStaticInfo::INCR), 32, PropModeReplace, (uchar *) &bytes, 1); + QTestLiteStatic::atom(QTestLiteStatic::INCR), 32, PropModeReplace, (uchar *) &bytes, 1); // (void)new QClipboardINCRTransaction(window, property, atomFormat, dataFormat, data, increment); qDebug() << "not implemented INCRT just YET!"; @@ -212,7 +212,7 @@ void QTestLiteClipboard::handleSelectionRequest(XEvent *xevent) QMimeData *d; if (req->selection == XA_PRIMARY) { d = m_clientSelection; - } else if (req->selection == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD)) { + } else if (req->selection == QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD)) { d = m_clientClipboard; } else { qWarning("QClipboard: Unknown selection '%lx'", req->selection); @@ -226,9 +226,9 @@ void QTestLiteClipboard::handleSelectionRequest(XEvent *xevent) return; } - Atom xa_targets = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TARGETS); - Atom xa_multiple = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::MULTIPLE); - Atom xa_timestamp = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TIMESTAMP); + Atom xa_targets = QTestLiteStatic::atom(QTestLiteStatic::TARGETS); + Atom xa_multiple = QTestLiteStatic::atom(QTestLiteStatic::MULTIPLE); + Atom xa_timestamp = QTestLiteStatic::atom(QTestLiteStatic::TIMESTAMP); struct AtomPair { Atom target; Atom property; } *multi = 0; Atom multi_type = XNone; @@ -394,7 +394,7 @@ bool QTestLiteClipboard::clipboardReadProperty(Window win, Atom property, bool d XFree((char*)data); } - if (*format == 8 && *type == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) { + if (*format == 8 && *type == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) { // convert COMPOUND_TEXT to a multibyte string XTextProperty textprop; textprop.encoding = *type; @@ -492,8 +492,8 @@ QByteArray QTestLiteClipboard::getDataInFormat(Atom modeAtom, Atom fmtatom) XSelectInput(screen()->display(), win, NoEventMask); // don't listen for any events - XDeleteProperty(screen()->display(), win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION)); - XConvertSelection(screen()->display(), modeAtom, fmtatom, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), win, CurrentTime); + XDeleteProperty(screen()->display(), win, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION)); + XConvertSelection(screen()->display(), modeAtom, fmtatom, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION), win, CurrentTime); XSync(screen()->display(), false); XEvent xevent; @@ -505,10 +505,10 @@ QByteArray QTestLiteClipboard::getDataInFormat(Atom modeAtom, Atom fmtatom) Atom type; XSelectInput(screen()->display(), win, PropertyChangeMask); - if (clipboardReadProperty(win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), true, &buf, 0, &type, 0)) { - if (type == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::INCR)) { + if (clipboardReadProperty(win, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION), true, &buf, 0, &type, 0)) { + if (type == QTestLiteStatic::atom(QTestLiteStatic::INCR)) { int nbytes = buf.size() >= 4 ? *((int*)buf.data()) : 0; - buf = clipboardReadIncrementalProperty(win, QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_QT_SELECTION), nbytes, false); + buf = clipboardReadIncrementalProperty(win, QTestLiteStatic::atom(QTestLiteStatic::_QT_SELECTION), nbytes, false); } } diff --git a/src/plugins/platforms/testlite/qtestlitemime.cpp b/src/plugins/platforms/testlite/qtestlitemime.cpp index 6261383..6a08b8c 100644 --- a/src/plugins/platforms/testlite/qtestlitemime.cpp +++ b/src/plugins/platforms/testlite/qtestlitemime.cpp @@ -99,7 +99,7 @@ QString QTestLiteMime::xdndMimeAtomToString(Display *display, Atom a) { if (!a) return 0; - if (a == XA_STRING || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)) { + if (a == XA_STRING || a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)) { return "text/plain"; // some Xdnd clients are dumb } char *atom = XGetAtomName(display, a); @@ -123,10 +123,10 @@ QStringList QTestLiteMime::xdndMimeFormatsForAtom(Display *display, Atom a) formats.append(atomName); // special cases for string type - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING) + if (a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING) || a == XA_STRING - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + || a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) formats.append(QLatin1String("text/plain")); // special cases for uris @@ -152,27 +152,27 @@ bool QTestLiteMime::xdndMimeDataForAtom(Display *display, Atom a, QMimeData *mim *dataFormat = 16; ret = true; } else { - if ((a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING) + if ((a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING) || a == XA_STRING - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + || a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) && QInternalMimeData::hasFormatHelper(QLatin1String("text/plain"), mimeData)) { - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)){ + if (a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)){ *data = QInternalMimeData::renderDataHelper(QLatin1String("text/plain"), mimeData); ret = true; } else if (a == XA_STRING) { *data = QString::fromUtf8(QInternalMimeData::renderDataHelper( QLatin1String("text/plain"), mimeData)).toLocal8Bit(); ret = true; - } else if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) { + } else if (a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) { // the ICCCM states that TEXT and COMPOUND_TEXT are in the // encoding of choice, so we choose the encoding of the locale QByteArray strData = QString::fromUtf8(QInternalMimeData::renderDataHelper( QLatin1String("text/plain"), mimeData)).toLocal8Bit(); char *list[] = { strData.data(), NULL }; - XICCEncodingStyle style = (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + XICCEncodingStyle style = (a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) ? XCompoundTextStyle : XStdICCTextStyle; XTextProperty textprop; if (list[0] != NULL @@ -222,10 +222,10 @@ QList<Atom> QTestLiteMime::xdndMimeAtomsForFormat(Display *display, const QStrin // special cases for strings if (format == QLatin1String("text/plain")) { - atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)); + atoms.append(QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)); atoms.append(XA_STRING); - atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT)); - atoms.append(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)); + atoms.append(QTestLiteStatic::atom(QTestLiteStatic::TEXT)); + atoms.append(QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)); } // special cases for uris @@ -262,12 +262,12 @@ QVariant QTestLiteMime::xdndMimeConvertToFormat(Display *display, Atom a, const // special cases for string types if (format == QLatin1String("text/plain")) { - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING)) + if (a == QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING)) return QString::fromUtf8(data); if (a == XA_STRING) return QString::fromLatin1(data); - if (a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT) - || a == QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT)) + if (a == QTestLiteStatic::atom(QTestLiteStatic::TEXT) + || a == QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT)) // #### might be wrong for COMPUND_TEXT return QString::fromLocal8Bit(data, data.size()); } @@ -312,12 +312,12 @@ Atom QTestLiteMime::xdndMimeAtomForFormat(Display *display, const QString &forma // find matches for string types if (format == QLatin1String("text/plain")) { - if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING))) - return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::UTF8_STRING); - if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT))) - return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::COMPOUND_TEXT); - if (atoms.contains(QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT))) - return QTestLiteStaticInfo::atom(QTestLiteStaticInfo::TEXT); + if (atoms.contains(QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING))) + return QTestLiteStatic::atom(QTestLiteStatic::UTF8_STRING); + if (atoms.contains(QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT))) + return QTestLiteStatic::atom(QTestLiteStatic::COMPOUND_TEXT); + if (atoms.contains(QTestLiteStatic::atom(QTestLiteStatic::TEXT))) + return QTestLiteStatic::atom(QTestLiteStatic::TEXT); if (atoms.contains(XA_STRING)) return XA_STRING; } diff --git a/src/plugins/platforms/testlite/qtestlitescreen.cpp b/src/plugins/platforms/testlite/qtestlitescreen.cpp index 2ae7028..82dab9a 100644 --- a/src/plugins/platforms/testlite/qtestlitescreen.cpp +++ b/src/plugins/platforms/testlite/qtestlitescreen.cpp @@ -248,14 +248,14 @@ QTestLiteScreen::~QTestLiteScreen() bool QTestLiteScreen::handleEvent(XEvent *xe) { int quit = false; - QTestLiteWindow *xw = 0; + QTestLiteWindow *platformWindow = 0; QWidget *widget = QWidget::find(xe->xany.window); if (widget) { xw = static_cast<QTestLiteWindow *>(widget->platformWindow()); } - Atom wmProtocolsAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_PROTOCOLS); - Atom wmDeleteWindowAtom = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_DELETE_WINDOW); + Atom wmProtocolsAtom = QTestLiteStatic::atom(QTestLiteStatic::WM_PROTOCOLS); + Atom wmDeleteWindowAtom = QTestLiteStatic::atom(QTestLiteStatic::WM_DELETE_WINDOW); switch (xe->type) { case ClientMessage: @@ -346,7 +346,7 @@ bool QTestLiteScreen::handleEvent(XEvent *xe) static Bool checkForClipboardEvents(Display *, XEvent *e, XPointer) { - Atom clipboard = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::CLIPBOARD); + Atom clipboard = QTestLiteStatic::atom(QTestLiteStatic::CLIPBOARD); return ((e->type == SelectionRequest && (e->xselectionrequest.selection == XA_PRIMARY || e->xselectionrequest.selection == clipboard)) || (e->type == SelectionClear && (e->xselectionclear.selection == XA_PRIMARY diff --git a/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp b/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp index 20d73a2..875ac9e 100644 --- a/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp +++ b/src/plugins/platforms/testlite/qtestlitestaticinfo.cpp @@ -246,7 +246,7 @@ public: return supported; } - Atom atom(QTestLiteStaticInfo::X11Atom atom) + Atom atom(QTestLiteStatic::X11Atom atom) { return m_allAtoms[atom]; } @@ -260,10 +260,58 @@ public: return ptrXFixesSelectSelectionInput; } + QImage qimageFromXImage(XImage *xi) + { + QImage::Format format = QImage::Format_ARGB32_Premultiplied; + if (xi->depth == 24) + format = QImage::Format_RGB32; + else if (xi->depth == 16) + format = QImage::Format_RGB16; + + QImage image = QImage((uchar *)xi->data, xi->width, xi->height, xi->bytes_per_line, format).copy(); + + // we may have to swap the byte order + if ((QSysInfo::ByteOrder == QSysInfo::LittleEndian && xi->byte_order == MSBFirst) + || (QSysInfo::ByteOrder == QSysInfo::BigEndian && xi->byte_order == LSBFirst)) + { + for (int i=0; i < image.height(); i++) { + if (xi->depth == 16) { + ushort *p = (ushort*)image.scanLine(i); + ushort *end = p + image.width(); + while (p < end) { + *p = ((*p << 8) & 0xff00) | ((*p >> 8) & 0x00ff); + p++; + } + } else { + uint *p = (uint*)image.scanLine(i); + uint *end = p + image.width(); + while (p < end) { + *p = ((*p << 24) & 0xff000000) | ((*p << 8) & 0x00ff0000) + | ((*p >> 8) & 0x0000ff00) | ((*p >> 24) & 0x000000ff); + p++; + } + } + } + } + + // fix-up alpha channel + if (format == QImage::Format_RGB32) { + QRgb *p = (QRgb *)image.bits(); + for (int y = 0; y < xi->height; ++y) { + for (int x = 0; x < xi->width; ++x) + p[x] |= 0xff000000; + p += xi->bytes_per_line / 4; + } + } + + return image; + } + + private: void initializeAllAtoms(QTestLiteScreen *screen) { - const char *names[QTestLiteStaticInfo::NAtoms]; + const char *names[QTestLiteStatic::NAtoms]; const char *ptr = x11_atomnames; int i = 0; @@ -274,17 +322,17 @@ private: ++ptr; } - Q_ASSERT(i == QTestLiteStaticInfo::NPredefinedAtoms); + Q_ASSERT(i == QTestLiteStatic::NPredefinedAtoms); QByteArray settings_atom_name("_QT_SETTINGS_TIMESTAMP_"); settings_atom_name += XDisplayName(qPrintable(screen->displayName())); names[i++] = settings_atom_name; - Q_ASSERT(i == QTestLiteStaticInfo::NAtoms); + Q_ASSERT(i == QTestLiteStatic::NAtoms); #if 0//defined(XlibSpecificationRelease) && (XlibSpecificationRelease >= 6) XInternAtoms(screen->display(), (char **)names, i, False, m_allAtoms); #else - for (i = 0; i < QTestLiteStaticInfo::NAtoms; ++i) + for (i = 0; i < QTestLiteStatic::NAtoms; ++i) m_allAtoms[i] = XInternAtom(screen->display(), (char *)names[i], False); #endif } @@ -298,7 +346,7 @@ private: unsigned char *data = 0; int e = XGetWindowProperty(screen->display(), screen->rootWindow(), - this->atom(QTestLiteStaticInfo::_NET_SUPPORTED), 0, 0, + this->atom(QTestLiteStatic::_NET_SUPPORTED), 0, 0, False, XA_ATOM, &type, &format, &nitems, &after, &data); if (data) XFree(data); @@ -309,7 +357,7 @@ private: while (after > 0) { XGetWindowProperty(screen->display(), screen->rootWindow(), - this->atom(QTestLiteStaticInfo::_NET_SUPPORTED), offset, 1024, + this->atom(QTestLiteStatic::_NET_SUPPORTED), offset, 1024, False, XA_ATOM, &type, &format, &nitems, &after, &data); if (type == XA_ATOM && format == 32) { @@ -367,7 +415,7 @@ private: } Atom *m_supportedAtoms; - Atom m_allAtoms[QTestLiteStaticInfo::NAtoms]; + Atom m_allAtoms[QTestLiteStatic::NAtoms]; #ifndef QT_NO_XFIXES PtrXFixesQueryExtension ptrXFixesQueryExtension; @@ -385,28 +433,28 @@ private: Q_GLOBAL_STATIC(QTestLiteStaticInfoPrivate, qTestLiteStaticInfoPrivate); -Atom QTestLiteStaticInfo::atom(QTestLiteStaticInfo::X11Atom atom) +Atom QTestLiteStatic::atom(QTestLiteStatic::X11Atom atom) { return qTestLiteStaticInfoPrivate()->atom(atom); } -bool QTestLiteStaticInfo::isSupportedByWM(Atom atom) +bool QTestLiteStatic::isSupportedByWM(Atom atom) { return qTestLiteStaticInfoPrivate()->isSupportedByWM(atom); } -bool QTestLiteStaticInfo::useXFixes() +bool QTestLiteStatic::useXFixes() { return qTestLiteStaticInfoPrivate()->useXFixes(); } -int QTestLiteStaticInfo::xFixesEventBase() +int QTestLiteStatic::xFixesEventBase() { return qTestLiteStaticInfoPrivate()->xFixesEventBase(); } #ifndef QT_NO_XFIXES -PtrXFixesSelectSelectionInput QTestLiteStaticInfo::xFixesSelectSelectionInput() +PtrXFixesSelectSelectionInput QTestLiteStatic::xFixesSelectSelectionInput() { qDebug() << qTestLiteStaticInfoPrivate()->useXFixes(); if (!qTestLiteStaticInfoPrivate()->useXFixes()) @@ -414,4 +462,9 @@ PtrXFixesSelectSelectionInput QTestLiteStaticInfo::xFixesSelectSelectionInput() return qTestLiteStaticInfoPrivate()->xFixesSelectSelectionInput(); } + +QImage QTestLiteStatic::qimageFromXImage(XImage *xi) +{ + return qTestLiteStaticInfoPrivate()->qimageFromXImage(xi); +} #endif //QT_NO_XFIXES diff --git a/src/plugins/platforms/testlite/qtestlitestaticinfo.h b/src/plugins/platforms/testlite/qtestlitestaticinfo.h index ed0f7bd..328de60 100644 --- a/src/plugins/platforms/testlite/qtestlitestaticinfo.h +++ b/src/plugins/platforms/testlite/qtestlitestaticinfo.h @@ -190,7 +190,7 @@ enum { #endif -class QTestLiteStaticInfo +class QTestLiteStatic { public: enum X11Atom { @@ -364,6 +364,7 @@ public: static PtrXFixesSelectSelectionInput xFixesSelectSelectionInput(); #endif //QT_NO_XFIXES + static QImage qimageFromXImage(XImage *xi); }; diff --git a/src/plugins/platforms/testlite/qtestlitewindow.cpp b/src/plugins/platforms/testlite/qtestlitewindow.cpp index 71232ac..e8d40d7 100644 --- a/src/plugins/platforms/testlite/qtestlitewindow.cpp +++ b/src/plugins/platforms/testlite/qtestlitewindow.cpp @@ -113,14 +113,14 @@ QTestLiteWindow::QTestLiteWindow(QWidget *window) Atom protocols[5]; int n = 0; - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_DELETE_WINDOW); // support del window protocol - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::WM_TAKE_FOCUS); // support take focus window protocol - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_PING); // support _NET_WM_PING protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::WM_DELETE_WINDOW); // support del window protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::WM_TAKE_FOCUS); // support take focus window protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::_NET_WM_PING); // support _NET_WM_PING protocol #ifndef QT_NO_XSYNC - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_SYNC_REQUEST); // support _NET_WM_SYNC_REQUEST protocol + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::_NET_WM_SYNC_REQUEST); // support _NET_WM_SYNC_REQUEST protocol #endif // QT_NO_XSYNC if (window->windowFlags() & Qt::WindowContextHelpButtonHint) - protocols[n++] = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_NET_WM_CONTEXT_HELP); + protocols[n++] = QTestLiteStatic::atom(QTestLiteStatic::_NET_WM_CONTEXT_HELP); XSetWMProtocols(mScreen->display(), x_window, protocols, n); } @@ -344,7 +344,7 @@ QtMWMHints QTestLiteWindow::getMWMHints() const int format; ulong nitems, bytesLeft; uchar *data = 0; - Atom atomForMotifWmHints = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_MOTIF_WM_HINTS); + Atom atomForMotifWmHints = QTestLiteStatic::atom(QTestLiteStatic::_MOTIF_WM_HINTS); if ((XGetWindowProperty(mScreen->display(), x_window, atomForMotifWmHints, 0, 5, false, atomForMotifWmHints, &type, &format, &nitems, &bytesLeft, &data) == Success) @@ -368,7 +368,7 @@ QtMWMHints QTestLiteWindow::getMWMHints() const void QTestLiteWindow::setMWMHints(const QtMWMHints &mwmhints) { - Atom atomForMotifWmHints = QTestLiteStaticInfo::atom(QTestLiteStaticInfo::_MOTIF_WM_HINTS); + Atom atomForMotifWmHints = QTestLiteStatic::atom(QTestLiteStatic::_MOTIF_WM_HINTS); if (mwmhints.flags != 0l) { XChangeProperty(mScreen->display(), x_window, atomForMotifWmHints, atomForMotifWmHints, 32, |