Fix xcb plugin compilation for -qconfig large

Change-Id: I1ee1fb9c140396e83272d607ee4dd63ce2c50b8d
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
This commit is contained in:
Tasuku Suzuki 2012-05-17 05:16:10 +09:00 committed by Qt by Nokia
parent ad7d953963
commit 576d4a1cce
11 changed files with 65 additions and 1 deletions

View File

@ -56,6 +56,8 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_CLIPBOARD
class QXcbClipboardMime : public QXcbMime
{
Q_OBJECT
@ -862,6 +864,8 @@ QByteArray QXcbClipboard::getSelection(xcb_atom_t selection, xcb_atom_t target,
return buf;
}
#endif // QT_NO_CLIPBOARD
QT_END_NAMESPACE
#include "qxcbclipboard.moc"

View File

@ -49,6 +49,8 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_CLIPBOARD
class QXcbConnection;
class QXcbScreen;
class QXcbClipboardMime;
@ -107,6 +109,8 @@ private:
};
#endif // QT_NO_CLIPBOARD
QT_END_NAMESPACE
#endif // QXCBCLIPBOARD_H

View File

@ -186,8 +186,12 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
m_wmSupport.reset(new QXcbWMSupport(this));
m_keyboard = new QXcbKeyboard(this);
#ifndef QT_NO_CLIPBOARD
m_clipboard = new QXcbClipboard(this);
#endif
#ifndef QT_NO_DRAGANDDROP
m_drag = new QXcbDrag(this);
#endif
#ifdef XCB_USE_DRI2
initializeDri2();
@ -197,8 +201,12 @@ QXcbConnection::QXcbConnection(QXcbNativeInterface *nativeInterface, const char
QXcbConnection::~QXcbConnection()
{
#ifndef QT_NO_CLIPBOARD
delete m_clipboard;
#endif
#ifndef QT_NO_DRAGANDDROP
delete m_drag;
#endif
// Delete screens in reverse order to avoid crash in case of multiple screens
while (!m_screens.isEmpty())
delete m_screens.takeLast();
@ -562,15 +570,23 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
case XCB_SELECTION_REQUEST:
{
xcb_selection_request_event_t *sr = (xcb_selection_request_event_t *)event;
#ifndef QT_NO_DRAGANDDROP
if (sr->selection == atom(QXcbAtom::XdndSelection))
m_drag->handleSelectionRequest(sr);
else
#endif
{
#ifndef QT_NO_CLIPBOARD
m_clipboard->handleSelectionRequest(sr);
#endif
}
break;
}
case XCB_SELECTION_CLEAR:
setTime(((xcb_selection_clear_event_t *)event)->time);
#ifndef QT_NO_CLIPBOARD
m_clipboard->handleSelectionClearRequest((xcb_selection_clear_event_t *)event);
#endif
handled = true;
break;
case XCB_SELECTION_NOTIFY:
@ -594,7 +610,9 @@ void QXcbConnection::handleXcbEvent(xcb_generic_event_t *event)
if (!handled) {
if (response_type == xfixes_first_event + XCB_XFIXES_SELECTION_NOTIFY) {
setTime(((xcb_xfixes_selection_notify_event_t *)event)->timestamp);
#ifndef QT_NO_CLIPBOARD
m_clipboard->handleXFixesSelectionRequest((xcb_xfixes_selection_notify_event_t *)event);
#endif
handled = true;
} else if (has_randr_extension && response_type == xrandr_first_event + XCB_RANDR_SCREEN_CHANGE_NOTIFY) {
xcb_randr_screen_change_notify_event_t *change_event = (xcb_randr_screen_change_notify_event_t *)event;
@ -744,11 +762,13 @@ void QXcbConnection::handleClientMessageEvent(const xcb_client_message_event_t *
if (event->format != 32)
return;
#ifndef QT_NO_DRAGANDDROP
if (event->type == atom(QXcbAtom::XdndStatus)) {
drag()->handleStatus(event);
} else if (event->type == atom(QXcbAtom::XdndFinished)) {
drag()->handleFinished(event);
}
#endif
QXcbWindow *window = platformWindowFromId(event->window);
if (!window)

View File

@ -310,8 +310,12 @@ public:
QXcbKeyboard *keyboard() const { return m_keyboard; }
#ifndef QT_NO_CLIPBOARD
QXcbClipboard *clipboard() const { return m_clipboard; }
#endif
#ifndef QT_NO_DRAGANDDROP
QXcbDrag *drag() const { return m_drag; }
#endif
QXcbWMSupport *wmSupport() const { return m_wmSupport.data(); }
@ -393,8 +397,12 @@ private:
xcb_window_t m_connectionEventListener;
QXcbKeyboard *m_keyboard;
#ifndef QT_NO_CLIPBOARD
QXcbClipboard *m_clipboard;
#endif
#ifndef QT_NO_DRAGANDDROP
QXcbDrag *m_drag;
#endif
QScopedPointer<QXcbWMSupport> m_wmSupport;
QXcbNativeInterface *m_nativeInterface;

View File

@ -61,6 +61,8 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
//#define DND_DEBUG
#ifdef DND_DEBUG
#define DEBUG qDebug
@ -1261,4 +1263,6 @@ QStringList QXcbDropData::formats_sys() const
return formats;
}
#endif // QT_NO_DRAGANDDROP
QT_END_NAMESPACE

View File

@ -59,6 +59,8 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
class QMouseEvent;
class QWindow;
class QXcbConnection;
@ -161,6 +163,8 @@ private:
xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows);
};
#endif // QT_NO_DRAGANDDROP
QT_END_NAMESPACE
#endif

View File

@ -226,15 +226,19 @@ QPlatformNativeInterface * QXcbIntegration::nativeInterface() const
return m_nativeInterface.data();
}
#ifndef QT_NO_CLIPBOARD
QPlatformClipboard *QXcbIntegration::clipboard() const
{
return m_connections.at(0)->clipboard();
}
#endif
#ifndef QT_NO_DRAGANDDROP
QPlatformDrag *QXcbIntegration::drag() const
{
return m_connections.at(0)->drag();
}
#endif
QPlatformInputContext *QXcbIntegration::inputContext() const
{

View File

@ -72,8 +72,12 @@ public:
QPlatformNativeInterface *nativeInterface()const;
#ifndef QT_NO_CLIPBOARD
QPlatformClipboard *clipboard() const;
#endif
#ifndef QT_NO_DRAGANDDROP
QPlatformDrag *drag() const;
#endif
QPlatformInputContext *inputContext() const;

View File

@ -54,6 +54,8 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
QXcbMime::QXcbMime()
: QInternalMimeData()
{ }
@ -289,4 +291,6 @@ xcb_atom_t QXcbMime::mimeAtomForFormat(QXcbConnection *connection, const QString
return 0;
}
#endif // QT_NO_DRAGANDDROP
QT_END_NAMESPACE

View File

@ -51,6 +51,8 @@
QT_BEGIN_NAMESPACE
#ifndef QT_NO_DRAGANDDROP
class QXcbMime : public QInternalMimeData {
Q_OBJECT
public:
@ -67,6 +69,8 @@ public:
const QList<xcb_atom_t> &atoms, QByteArray *requestedEncoding);
};
#endif // QT_NO_DRAGANDDROP
QT_END_NAMESPACE
#endif // QXCBMIME_H

View File

@ -376,7 +376,9 @@ void QXcbWindow::create()
if (window()->windowFlags() & Qt::WindowTransparentForInput)
setTransparentForMouseEvents(true);
#ifndef QT_NO_DRAGANDDROP
connection()->drag()->dndEnable(this, true);
#endif
}
QXcbWindow::~QXcbWindow()
@ -1298,6 +1300,7 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
} else {
qWarning() << "QXcbWindow: Unhandled WM_PROTOCOLS message:" << connection()->atomName(event->data.data32[0]);
}
#ifndef QT_NO_DRAGANDDROP
} else if (event->type == atom(QXcbAtom::XdndEnter)) {
connection()->drag()->handleEnter(window(), event);
} else if (event->type == atom(QXcbAtom::XdndPosition)) {
@ -1306,6 +1309,7 @@ void QXcbWindow::handleClientMessageEvent(const xcb_client_message_event_t *even
connection()->drag()->handleLeave(window(), event);
} else if (event->type == atom(QXcbAtom::XdndDrop)) {
connection()->drag()->handleDrop(window(), event);
#endif
} else if (event->type == atom(QXcbAtom::_XEMBED)) { // QSystemTrayIcon
} else {
qWarning() << "QXcbWindow: Unhandled client message:" << connection()->atomName(event->type);