QT_BEGIN_NAMESPACE
+#ifndef QT_NO_CLIPBOARD
+
class QXcbClipboardMime : public QXcbMime
{
Q_OBJECT
return buf;
}
+#endif // QT_NO_CLIPBOARD
+
QT_END_NAMESPACE
#include "qxcbclipboard.moc"
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_CLIPBOARD
+
class QXcbConnection;
class QXcbScreen;
class QXcbClipboardMime;
};
+#endif // QT_NO_CLIPBOARD
+
QT_END_NAMESPACE
#endif // QXCBCLIPBOARD_H
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();
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();
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:
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;
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)
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(); }
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;
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DRAGANDDROP
+
//#define DND_DEBUG
#ifdef DND_DEBUG
#define DEBUG qDebug
return formats;
}
+#endif // QT_NO_DRAGANDDROP
+
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DRAGANDDROP
+
class QMouseEvent;
class QWindow;
class QXcbConnection;
xcb_window_t findRealWindow(const QPoint & pos, xcb_window_t w, int md, bool ignoreNonXdndAwareWindows);
};
+#endif // QT_NO_DRAGANDDROP
+
QT_END_NAMESPACE
#endif
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
{
QPlatformNativeInterface *nativeInterface()const;
+#ifndef QT_NO_CLIPBOARD
QPlatformClipboard *clipboard() const;
+#endif
+#ifndef QT_NO_DRAGANDDROP
QPlatformDrag *drag() const;
+#endif
QPlatformInputContext *inputContext() const;
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DRAGANDDROP
+
QXcbMime::QXcbMime()
: QInternalMimeData()
{ }
return 0;
}
+#endif // QT_NO_DRAGANDDROP
+
QT_END_NAMESPACE
QT_BEGIN_NAMESPACE
+#ifndef QT_NO_DRAGANDDROP
+
class QXcbMime : public QInternalMimeData {
Q_OBJECT
public:
const QList<xcb_atom_t> &atoms, QByteArray *requestedEncoding);
};
+#endif // QT_NO_DRAGANDDROP
+
QT_END_NAMESPACE
#endif // QXCBMIME_H
if (window()->windowFlags() & Qt::WindowTransparentForInput)
setTransparentForMouseEvents(true);
+#ifndef QT_NO_DRAGANDDROP
connection()->drag()->dndEnable(this, true);
+#endif
}
QXcbWindow::~QXcbWindow()
} 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)) {
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);