42 #include "qplatformdefs.h" 47 #ifndef QT_NO_DRAGANDDROP 76 #include <X11/extensions/Xfixes.h> 85 #define DEBUG if(0) qDebug 89 #define DNDDEBUG qDebug() 91 #define DNDDEBUG if(0) qDebug() 97 for (
int i = 0; i <
X11->dndDropTransactions.count(); ++i) {
110 for (
int i = 0; i <
X11->dndDropTransactions.count(); ++i) {
141 unsigned char *
data = 0;
143 AnyPropertyType, &type, &f,&n,&a,&data) ==
Success) {
157 if (!XQueryTree(
X11->display, window, &root, &parent, &children, &unused))
314 #include "qdnd_x11.moc" 340 unsigned char *retval = 0;
342 XA_WINDOW, &type, &f,&n,&a,&retval);
343 WId *proxy_id_ptr = (
WId *)retval;
345 if (type == XA_WINDOW && proxy_id_ptr) {
346 proxy_id = *proxy_id_ptr;
350 X11->ignoreBadwindow();
352 XA_WINDOW, &type, &f,&n,&a,&retval);
353 proxy_id_ptr = (
WId *)retval;
354 if (
X11->badwindow() || type != XA_WINDOW || !proxy_id_ptr || *proxy_id_ptr != proxy_id)
365 DNDDEBUG <<
"xdndEnable" << w << on;
373 XGrabServer(
X11->display);
381 XA_WINDOW, 32, PropModeReplace, (
unsigned char *)&proxy_id, 1);
383 XA_WINDOW, 32, PropModeReplace, (
unsigned char *)&proxy_id, 1);
386 XUngrabServer(
X11->display);
388 xdnd_widget = w->
window();
395 XA_ATOM, 32, PropModeReplace, (
unsigned char *)&atm, 1);
406 DNDDEBUG <<
"not deleting XDndAware";
419 char *atom = XGetAtomName(
display, a);
427 if (!mimeType || !*mimeType)
429 return XInternAtom(
display, mimeType, False);
437 char *atom = XGetAtomName(
display, a);
457 QString atomName = xdndMimeAtomToString(a);
482 QString atomName = xdndMimeAtomToString(a);
495 }
else if (a == XA_STRING) {
504 char *list[] = { strData.
data(), NULL };
507 ? XCompoundTextStyle : XStdICCTextStyle;
508 XTextProperty textprop;
510 && XmbTextListToTextProperty(
X11->display, list, 1, style,
512 *atomFormat = textprop.encoding;
513 *dataFormat = textprop.format;
514 *data =
QByteArray((
const char *) textprop.value, textprop.nitems * textprop.format / 8);
517 DEBUG(
" textprop type %lx\n" 518 " textprop name '%s'\n" 523 X11->xdndMimeAtomToString(textprop.encoding).toLatin1().data(),
524 textprop.format, textprop.nitems, data->
size());
526 XFree(textprop.value);
535 *data =
QByteArray(reinterpret_cast<const char *>(mozUri.utf16()), mozUri.length() * 2);
537 }
else if ((a == XA_PIXMAP || a == XA_BITMAP) && mimeData->
hasImage()) {
539 if (a == XA_BITMAP && pm.
depth() != 1) {
546 Pixmap handle = pm.
handle();
547 *data =
QByteArray((
const char *) &handle,
sizeof(Pixmap));
554 DEBUG(
"QClipboard: xdndMimeDataForAtom(): converting to type '%s' is not supported",
qPrintable(atomName));
557 return ret && data != 0;
564 atoms.
append(xdndMimeStringToAtom(format));
591 QString atomName = xdndMimeAtomToString(a);
592 if (atomName == format)
625 if (data.
size() > 1 && data.
at(1) == 0)
633 if (a == XA_PIXMAP && data.
size() ==
sizeof(Pixmap)) {
634 Pixmap xpm = *((Pixmap*)data.
data());
637 QPixmap qpm = QPixmap::fromX11Pixmap(xpm);
644 imageWriter.
write(imageToWrite);
670 Atom a = xdndMimeStringToAtom(format);
693 Atom a = xdndMimeStringToAtom(formatWithCharset);
700 Atom a = xdndMimeStringToAtom(format);
727 delete xdnd_data.
deco;
745 for(
int i = children.
size(); i > 0;) {
772 if (current_embedding_widget != 0 && current_embedding_widget != w) {
778 current_embedding_widget = 0;
782 if (extra && extra->xDndProxy != 0) {
784 if (current_embedding_widget != w) {
788 current_embedding_widget = w;
792 XSendEvent(
X11->display, extra->xDndProxy, False, NoEventMask, (
XEvent*)xe);
793 if (qt_xdnd_current_widget != w) {
794 qt_xdnd_current_widget = w;
798 current_embedding_widget = 0;
804 motifdnd_active =
false;
808 const long *
l = xe->xclient.data.l;
809 int version = (int)(((
unsigned long)(l[1])) >> 24);
822 unsigned char *retval = 0;
835 for(i=2; i < 5; i++) {
844 const unsigned long *
l = (
const unsigned long *)xe->xclient.data.l;
846 QPoint p((l[2] & 0xffff0000) >> 16, l[2] & 0x0000ffff);
865 ((
sizeof(Time) == 8 && xe->xclient.data.l[3] < 0)
873 XClientMessageEvent response;
874 response.type = ClientMessage;
876 response.format = 32;
879 response.data.l[1] = 0;
880 response.data.l[2] = 0;
881 response.data.l[3] = 0;
882 response.data.l[4] = 0;
904 if (target_widget != qt_xdnd_current_widget) {
905 if (qt_xdnd_current_widget) {
909 if (qt_xdnd_current_widget != target_widget) {
910 qt_xdnd_current_widget = target_widget;
913 qt_xdnd_current_position = p;
923 DEBUG() <<
"qt_handle_xdnd_position action=" <<
X11->xdndAtomToString(l[4]);
924 if (!target_widget) {
927 qt_xdnd_current_widget =
c;
928 qt_xdnd_current_position = p;
936 response.data.l[1] = 1;
940 response.data.l[0] = 0;
945 answerRect =
QRect(c->
mapToGlobal(answerRect.topLeft()), answerRect.size());
947 if (answerRect.left() < 0)
949 if (answerRect.right() > 4096)
950 answerRect.setRight(4096);
951 if (answerRect.top() < 0)
952 answerRect.setTop(0);
953 if (answerRect.bottom() > 4096)
954 answerRect.setBottom(4096);
955 if (answerRect.width() < 0)
956 answerRect.setWidth(0);
957 if (answerRect.height() < 0)
958 answerRect.setHeight(0);
960 response.data.l[2] = (answerRect.x() << 16) + answerRect.y();
961 response.data.l[3] = (answerRect.width() << 16) + answerRect.height();
972 DEBUG() <<
"sending XdndStatus";
981 if (event->type != ClientMessage)
983 XClientMessageEvent *ev = &
event->xclient;
993 DEBUG(
"xdndHandlePosition");
1003 const unsigned long *
l = (
const unsigned long *)xe->xclient.data.l;
1009 if ((
int)(l[1] & 2) == 0) {
1010 QPoint p((l[2] & 0xffff0000) >> 16, l[2] & 0x0000ffff);
1011 QSize s((l[3] & 0xffff0000) >> 16, l[3] & 0x0000ffff);
1012 qt_xdnd_source_sameanswer =
QRect(p, s);
1014 qt_xdnd_source_sameanswer =
QRect();
1027 if (event->type != ClientMessage)
1029 XClientMessageEvent *ev = &
event->xclient;
1039 DEBUG(
"xdndHandleStatus");
1044 DEBUG(
"xdndHandleStatus end");
1049 DEBUG(
"xdnd leave");
1050 if (!qt_xdnd_current_widget ||
1056 current_embedding_widget = 0;
1057 qt_xdnd_current_widget = 0;
1061 const unsigned long *
l = (
const unsigned long *)xe->xclient.data.l;
1069 qt_xdnd_current_widget = 0;
1075 qt_xdnd_current_widget = 0;
1086 XClientMessageEvent leave;
1087 leave.type = ClientMessage;
1092 leave.data.l[1] = 0;
1093 leave.data.l[2] = 0;
1094 leave.data.l[3] = 0;
1095 leave.data.l[4] = 0;
1103 X11->xdndHandleLeave(w, (
const XEvent *)&leave,
false);
1106 NoEventMask, (
XEvent*)&leave);
1122 DEBUG(
"xdndHandleDrop");
1123 if (!qt_xdnd_current_widget) {
1129 current_embedding_widget = 0;
1131 qt_xdnd_current_widget = 0;
1134 const unsigned long *
l = (
const unsigned long *)xe->xclient.data.l;
1149 ((
sizeof(Time) == 8 && xe->xclient.data.l[2] < 0)
1163 if (dropData && dropData->
hasImage())
1168 if (manager->object && !manager->dragPrivate()->data->hasImage())
1169 dropData = manager->dragPrivate()->
data;
1171 dropData = manager->dropData;
1188 XClientMessageEvent finished;
1189 finished.type = ClientMessage;
1191 finished.format = 32;
1194 <<
"qt_xdnd_current_widget" << qt_xdnd_current_widget
1195 << (qt_xdnd_current_widget ? qt_xdnd_current_widget->
effectiveWinId() : 0)
1196 <<
"t_xdnd_current_widget->window()" 1197 << (qt_xdnd_current_widget ? qt_xdnd_current_widget->
window() : 0)
1200 finished.data.l[1] = de.
isAccepted() ? 1 : 0;
1203 NoEventMask, (
XEvent*)&finished);
1209 qt_xdnd_current_widget = 0;
1219 DEBUG(
"xdndHandleFinished");
1220 const unsigned long *
l = (
const unsigned long *)xe->xclient.data.l;
1222 DNDDEBUG <<
"xdndHandleFinished, l[0]" << l[0]
1247 current_embedding_widget = 0;
1256 current_embedding_widget = embedding_widget;
1257 manager->
object = currentObject;
1269 for (
int i = 0; i <
X11->dndDropTransactions.count(); ++i) {
1276 X11->dndDropTransactions.removeAt(i--);
1286 if (beingCancelled) {
1288 qApp->removeEventFilter(
this);
1290 beingCancelled =
false;
1308 qApp->removeEventFilter(
this);
1313 DEBUG(
"drop, resetting object");
1314 beingCancelled =
false;
1329 qApp->removeEventFilter(
this);
1330 beingCancelled =
false;
1333 qt_xdnd_source_sameanswer =
QRect();
1342 switch (e->
type()) {
1353 case QEvent::AccelAvailable:
1363 if (!noDropCursor) {
1364 #ifndef QT_NO_CURSOR 1381 if (xdnd_data.
deco) {
1390 #ifndef QT_NO_CURSOR 1392 qApp->changeOverrideCursor(*c);
1399 DEBUG(
"QDragManager::cancel");
1403 beingCancelled =
true;
1409 #ifndef QT_NO_CURSOR 1410 if (restoreCursor) {
1412 restoreCursor =
false;
1416 if (deleteSource &&
object)
1417 object->deleteLater();
1429 int nrectanglesRet, dummyOrdering;
1430 XRectangle *rectangles = XShapeGetRectangles(
QX11Info::display(), w, shapeType, &nrectanglesRet, &dummyOrdering);
1431 bool interacts =
false;
1433 for (
int i = 0; !interacts && i < nrectanglesRet; ++i)
1448 X11->ignoreBadwindow();
1449 XWindowAttributes attr;
1450 XGetWindowAttributes(
X11->display, w, &attr);
1451 if (
X11->badwindow())
1454 if (attr.map_state == IsViewable
1455 &&
QRect(attr.x,attr.y,attr.width,attr.height).
contains(pos)) {
1456 bool windowContainsMouse = !ignoreNonXdndAwareWindows;
1461 unsigned char *
data;
1464 AnyPropertyType, &type, &f,&n,&a,&data);
1465 if (data) XFree(data);
1469 #else // !QT_NO_SHAPE 1473 #if defined(ShapeInput) && defined(ShapeBounding) 1475 #elif defined(ShapeBounding) 1478 windowContainsMouse =
true;
1480 if (windowContainsMouse)
1482 #endif // QT_NO_SHAPE 1489 if (XQueryTree(
X11->display, w, &r, &p, &c, &nc)) {
1491 for (
uint i=nc; !r && i--;) {
1493 c[i], md-1, ignoreNonXdndAwareWindows);
1504 if (!windowContainsMouse)
1519 DEBUG() <<
"QDragManager::move enter";
1525 int screen = QCursor::x11Screen();
1528 delete xdnd_data.
deco;
1529 QWidget*
parent =
object->source()->window()->x11Info().screen() == screen
1539 if (qt_xdnd_source_sameanswer.
contains(globalPos) && qt_xdnd_source_sameanswer.
isValid())
1546 if (!XTranslateCoordinates(
X11->display, rootwin, rootwin, globalPos.
x(), globalPos.
y(), &lx, &ly, &target))
1550 if (target == rootwin) {
1552 }
else if (target) {
1555 while (target != 0) {
1560 if (!XTranslateCoordinates(
X11->display, src, target, lx, ly, &lx2, &ly2, &t)) {
1572 unsigned char *
data = 0;
1574 AnyPropertyType, &type, &f,&n,&a,&data);
1583 if (!XTranslateCoordinates(
X11->display, src, src, lx, ly, &lx2, &ly2, &target)) {
1589 DNDDEBUG <<
"need to find real window";
1608 DNDDEBUG <<
"the widget w is" << w;
1612 proxy_target = target;
1613 int target_version = 1;
1619 unsigned char *retval;
1620 X11->ignoreBadwindow();
1622 1, False, AnyPropertyType, &type, &f,&n,&a,&retval);
1623 int *tv = (
int *)retval;
1643 int flags = target_version << 24;
1645 for (
int i = 0; i < fmts.
size(); ++i) {
1647 for (
int j = 0; j < atoms.
size(); ++j) {
1652 if (types.
size() > 3) {
1653 XChangeProperty(
X11->display,
1655 XA_ATOM, 32, PropModeReplace,
1656 (
unsigned char *)types.
data(),
1660 XClientMessageEvent enter;
1661 enter.type = ClientMessage;
1662 enter.window = target;
1665 enter.data.l[0] = dragPrivate()->source->effectiveWinId();
1666 enter.data.l[1] = flags;
1667 enter.data.l[2] = types.
size()>0 ? types.
at(0) : 0;
1668 enter.data.l[3] = types.
size()>1 ? types.
at(1) : 0;
1669 enter.data.l[4] = types.
size()>2 ? types.
at(2) : 0;
1671 qt_xdnd_source_sameanswer =
QRect(globalPos.
x() - 2,
1672 globalPos.
y() -2 , 5, 5);
1674 DEBUG(
"sending Xdnd enter");
1676 X11->xdndHandleEnter(w, (
const XEvent *)&enter,
false);
1678 XSendEvent(
X11->display, proxy_target, False, NoEventMask, (
XEvent*)&enter);
1688 XClientMessageEvent
move;
1689 move.type = ClientMessage;
1690 move.window = target;
1693 move.window = target;
1694 move.data.l[0] = dragPrivate()->source->effectiveWinId();
1696 move.data.l[2] = (globalPos.
x() << 16) + globalPos.
y();
1697 move.data.l[3] =
X11->time;
1699 DEBUG(
"sending Xdnd position");
1706 XSendEvent(
X11->display, proxy_target, False, NoEventMask,
1714 DEBUG() <<
"QDragManager::move leave";
1732 XClientMessageEvent drop;
1733 drop.type = ClientMessage;
1737 drop.data.l[0] = dragPrivate()->source->effectiveWinId();
1739 drop.data.l[2] =
X11->time;
1757 X11->dndDropTransactions.append(t);
1761 X11->xdndHandleDrop(w, (
const XEvent *)&drop,
false);
1764 NoEventMask, (
XEvent*)&drop);
1769 current_embedding_widget = 0;
1772 #ifndef QT_NO_CURSOR 1773 if (restoreCursor) {
1775 restoreCursor =
false;
1798 if (qt_xdnd_current_widget) {
1800 qt_xdnd_current_widget = 0;
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;
1839 if (at == -1 && req->time == CurrentTime) {
1855 manager->
object =
X11->dndDropTransactions.at(at).object;
1856 }
else if (at != -2) {
1861 Atom atomFormat = req->target;
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;
1876 manager->
object = currentObject;
1880 XSendEvent(
X11->display, req->requestor, False, 0, &evt);
1927 XFlush(
X11->display);
1930 bool got=
X11->clipboardWaitForEvent(tw->
effectiveWinId(), SelectionNotify, &xevent, 5000);
1936 int nbytes = result.
size() >= 4 ? *((
int*)result.
data()) : 0;
1938 }
else if (type != a && type !=
XNone) {
1939 DEBUG(
"Qt clipboard: unknown atom %ld", type);
1946 return X11->xdndMimeConvertToFormat(a, result,
QLatin1String(format), requestedType, encoding);
1962 motifdndEnable(w, on);
1968 if (
object == o || !o || !o->d_func()->
source)
1973 qApp->removeEventFilter(
this);
1974 beingCancelled =
false;
1989 if (XCheckTypedEvent(
X11->display, ClientMessage, &event) &&
1991 qApp->x11ProcessEvent(&event);
1994 struct timeval usleep_tv;
1995 usleep_tv.tv_sec = 0;
1996 usleep_tv.tv_usec = 50000;
1997 select(0, 0, 0, 0, &usleep_tv);
2002 object->d_func()->
target = 0;
2009 qApp->installEventFilter(
this);
2010 XSetSelectionOwner(
X11->display,
ATOM(
XdndSelection), dragPrivate()->source->window()->internalWinId(),
X11->time);
2012 qt_xdnd_source_sameanswer =
QRect();
2013 #ifndef QT_NO_CURSOR 2017 restoreCursor =
true;
2028 (void) eventLoop->
exec();
2032 #ifndef QT_NO_CURSOR 2033 if (restoreCursor) {
2034 qApp->restoreOverrideCursor();
2035 restoreCursor =
false;
2049 delete xdnd_data.
deco;
2063 if (xdnd_data.
deco) {
2067 pm = dragPrivate()->pixmap;
2069 pm_hot = dragPrivate()->hotspot;
2087 ?
X11->motifdndObtainData(mime)
2094 return formats().contains(format);
2100 if (
X11->motifdnd_active) {
2103 while (!(fmt =
X11->motifdndFormat(i)).
isEmpty()) {
2111 for (
int j = 0; j < formatsForAtom.
size(); ++j) {
2113 formats.
append(formatsForAtom.
at(j));
2123 #endif // QT_NO_DRAGANDDROP The QVariant class acts like a union for the most common Qt data types.
int startTimer(int interval)
Starts a timer and returns a timer identifier, or returns zero if it could not start a timer...
QBool contains(QChar c, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
The QPainter class performs low-level painting on widgets and other paint devices.
QImage toImage() const
Converts the pixmap to a QImage.
Qt::DropActions possible_actions
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.
static int qtaction_to_xdndaction(Qt::DropAction a)
QPixmap xdndMimeTransferedPixmap[2]
bool hasExpired(qint64 timeout) const
Returns true if this QElapsedTimer has already expired by timeout milliseconds (that is...
The QKeyEvent class describes a key event.
bool hasFormat_sys(const QString &mimeType) const
void xdndHandlePosition(QWidget *, const XEvent *, bool)
bool isNull() const
Returns true if the rectangle is a null rectangle, otherwise returns false.
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
QStringList formats_sys() const
bool filterEvent(void *message)
Sends message through the event filter that was set by setEventFilter().
The QCursor class provides a mouse cursor with an arbitrary shape.
Q_DECL_CONSTEXPR const T & qMin(const T &a, const T &b)
static const int default_pm_hotx
QWidget * source() const
Returns the source of the drag object.
#define QT_END_NAMESPACE
This macro expands to.
The QDrag class provides support for MIME-based drag and drop data transfer.
int width() const
Returns the width of the pixmap.
QPointer< QWidget > widget
char * data()
Returns a pointer to the data stored in the byte array.
static Time qt_xdnd_target_current_time
static QPoint qt_xdnd_current_position
void qAddPostRoutine(QtCleanUpFunction p)
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...
static QAbstractEventDispatcher * instance(QThread *thread=0)
Returns a pointer to the event dispatcher object for the specified thread.
bool open(OpenMode openMode)
Reimplemented Function
static QWidget * find_child(QWidget *tlw, QPoint &p)
const int qt_xdnd_max_type
static Qt::DropAction xdndaction_to_qtaction(Atom atom)
#define at(className, varName)
QString xdndMimeAtomToString(Atom a)
The QByteArray class provides an array of bytes.
static Qt::HANDLE appRootWindow(int screen=-1)
Returns a handle for the applications root window on the given screen.
static Atom qt_xdnd_types[qt_xdnd_max_type+1]
static QStringList formatsHelper(const QMimeData *data)
QString toUpper() const Q_REQUIRED_RESULT
Returns an uppercase copy of the string.
void setDropAction(Qt::DropAction action)
Sets the action to be performed on the data by the target.
Qt::DropAction dropAction() const
Returns the action to be performed on the data by the target.
int select(int, fd_set *, fd_set *, fd_set *, struct timeval *)
bool save(const QString &fileName, const char *format=0, int quality=-1) const
Saves the image to the file with the given fileName, using the given image file format and quality fa...
void accept()
Calls QDropEvent::accept().
bool startsWith(const QString &s, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the string starts with s; otherwise returns false.
static bool xdndEnable(QWidget *w, bool on)
static QWidget * current_embedding_widget
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
Qt::HANDLE handle() const
Returns the pixmap's handle to the device context.
long ASN1_INTEGER_get ASN1_INTEGER * a
QRect intersected(const QRect &other) const
Returns the intersection of this rectangle and the given rectangle.
static int findXdndDropTransactionByWindow(Window window)
static QCursor * copyCursor
QByteArray data(const QString &mimetype) const
Returns the data stored in the object in the format described by the MIME type specified by mimeType...
void cancel(bool deleteSource=true)
int depth() const
Returns the depth of the pixmap.
The QBuffer class provides a QIODevice interface for a QByteArray.
static QPixmap * defaultPm
static XEvent last_enter_event
The QString class provides a Unicode character string.
static Bool xdnd_status_scanner(Display *, XEvent *event, XPointer)
T * qobject_cast(QObject *object)
The QDragMoveEvent class provides an event which is sent while a drag and drop action is in progress...
void emitActionChanged(Qt::DropAction newAction)
The QVector class is a template class that provides a dynamic array.
The QObject class is the base class of all Qt objects.
static Window qt_xdnd_current_proxy_target
The QElapsedTimer class provides a fast way to calculate elapsed times.
Atom xdndStringToAtom(const char *)
The QChar class provides a 16-bit Unicode character.
static QString fromRawData(const QChar *, int size)
Constructs a QString that uses the first size Unicode characters in the array unicode.
static QCursor * noDropCursor
static bool xdndHandleBadwindow()
bool isEmpty() const
Returns true if the list contains no items; otherwise returns false.
Qt::DropAction drag(QDrag *)
static QRect qt_xdnd_source_sameanswer
static XdndData xdnd_data
static Window findRealWindow(const QPoint &pos, Window w, int md, bool ignoreNonXdndAwareWindows)
static QCursor * moveCursor
int key() const
Returns the code of the key that was pressed or released.
The QBitmap class provides monochrome (1-bit depth) pixmaps.
void append(const T &t)
Inserts value at the end of the list.
QWidget * embedding_widget
#define QT_BEGIN_NAMESPACE
This macro expands to.
Q_GUI_EXPORT EGLDisplay display()
QBool contains(const T &t) const
Returns true if the list contains an occurrence of value; otherwise returns false.
static bool isEmpty(const char *str)
The QEventLoop class provides a means of entering and leaving an event loop.
QByteArray & buffer()
Returns a reference to the QBuffer's internal buffer.
bool isEmpty() const
Returns true if the string has no characters; otherwise returns false.
The QImageWriter class provides a format independent interface for writing images to files or other d...
QRect answerRect() const
Returns the rectangle in the widget where the drop will occur if accepted.
static QVariant xdndObtainData(const char *format, QVariant::Type requestedType)
static Qt::DropAction last_target_accepted_action
const T & at(int i) const
Returns the item at index position i in the list.
The QStringList class provides a list of strings.
static QString fromUtf8(const char *, int size=-1)
Returns a QString initialized with the first size bytes of the UTF-8 string str.
void append(const T &t)
Inserts value at the end of the vector.
static QCursor * linkCursor
static const int default_pm_hoty
int timerId() const
Returns the unique timer identifier, which is the same identifier as returned from QObject::startTime...
The QImage class provides a hardware-independent image representation that allows direct access to th...
static const char * data(const QByteArray &arr)
static bool hasFormatHelper(const QString &mimeType, const QMimeData *data)
int indexOf(QChar c, int from=0, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
static void handle_xdnd_status(QWidget *w, const XEvent *xe, bool)
The QLatin1String class provides a thin wrapper around an US-ASCII/Latin-1 encoded string literal...
static Window qt_xdnd_current_target
static QTextCodec * codec(MYSQL *mysql)
Type
This enum type defines the types of variable that a QVariant can contain.
static bool sendEvent(QObject *receiver, QEvent *event)
Sends event event directly to receiver receiver, using the notify() function.
QBool contains(const QString &str, Qt::CaseSensitivity cs=Qt::CaseSensitive) const
Returns true if the list contains the string str; otherwise returns false.
static void split(QT_FT_Vector *b)
The QDragLeaveEvent class provides an event that is sent to a widget when a drag and drop action leav...
QByteArray toLatin1() const Q_REQUIRED_RESULT
Returns a Latin-1 representation of the string as a QByteArray.
static bool checkEmbedded(QWidget *w, const XEvent *xe)
static WId xdndProxy(WId w)
static int transaction_expiry_timer
The QMimeData class provides a container for data that records information about its MIME type...
static Atom qt_xdnd_dragsource_xid
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
static Qt::DropAction global_accepted_action
static QByteArray renderDataHelper(const QString &mimeType, const QMimeData *data)
void xdndHandleLeave(QWidget *, const XEvent *, bool)
void xdndHandleDrop(QWidget *, const XEvent *, bool)
bool contains(const QPoint &p, bool proper=false) const
Returns true if the given point is inside or on the edge of the rectangle, otherwise returns false...
static Qt::DropActions possible_actions
const T & at(int i) const
Returns the item at index position i in the vector.
The QMouseEvent class contains parameters that describe a mouse event.
static Bool xdnd_position_scanner(Display *, XEvent *event, XPointer)
static QDesktopWidget * desktop()
Returns the desktop widget (also called the root window).
QShapedPixmapWidget * deco
void xdndHandleEnter(QWidget *, const XEvent *, bool)
static QDragManager * self()
T & first()
Returns a reference to the first item in the list.
const char * constData() const
Returns a pointer to the data stored in the byte array.
Atom xdndMimeStringToAtom(const QString &mimeType)
QVariant imageData() const
Returns a QVariant storing a QImage if the object can return an image; otherwise returns a null varia...
bool hasImage() const
Returns true if the object can return an image; otherwise returns false.
QString toUnicode(const QByteArray &) const
Converts a from the encoding of this codec to Unicode, and returns the result in a QString...
QString mid(int position, int n=-1) const Q_REQUIRED_RESULT
Returns a string that contains n characters of this string, starting at the specified position index...
virtual bool hasFormat(const QString &mimetype) const
Returns true if the object can return data for the MIME type specified by mimeType; otherwise returns...
QVariant retrieveData_sys(const QString &mimeType, QVariant::Type type) const
static QPointer< QWidget > qt_xdnd_current_widget
QList< QByteArray > split(char sep) const
Splits the byte array into subarrays wherever sep occurs, and returns the list of those arrays...
void setDevice(QIODevice *device)
Sets QImageWriter's device to device.
static void restartXdndDropExpiryTimer()
bool isWidgetType() const
Returns true if the object is a widget; otherwise returns false.
static Qt::KeyboardModifiers queryKeyboardModifiers()
Queries and returns the state of the modifier keys on the keyboard.
bool dndEnable(QWidget *w, bool on)
static bool waiting_for_status
static Time qt_xdnd_source_current_time
QImage convertToFormat(Format f, Qt::ImageConversionFlags flags=Qt::AutoColor) const Q_REQUIRED_RESULT
Returns a copy of the image in the given format.
The QDropEvent class provides an event which is sent when a drag and drop action is completed...
static Qt::KeyboardModifiers keyboardModifiers()
Returns the current state of the modifier keys on the keyboard.
QByteArray xdndAtomToString(Atom a)
QString & append(QChar c)
void qDeleteInEventHandler(QObject *o)
static void qt_xdnd_cleanup()
static Qt::KeyboardModifiers modifier_buttons
QBitmap mask() const
Extracts a bitmap mask from the pixmap's alpha channel.
The QTimerEvent class contains parameters that describe a timer event.
void setLeft(int pos)
Sets the left edge of the rectangle to the given x coordinate.
Atom xdndMimeAtomForFormat(const QString &format, QVariant::Type requestedType, const QList< Atom > &atoms, QByteArray *requestedEncoding)
static Window findXdndAwareParent(Window window)
static QString fromLatin1(const char *, int size=-1)
Returns a QString initialized with the first size characters of the Latin-1 string str...
static int findXdndDropTransactionByTime(Time timestamp)
bool xdndMimeDataForAtom(Atom a, QMimeData *mimeData, QByteArray *data, Atom *atomFormat, int *dataFormat)
QObject * parent() const
Returns a pointer to the parent object.
The QDragEnterEvent class provides an event which is sent to a widget when a drag and drop action ent...
The QPoint class defines a point in the plane using integer precision.
int size() const
Returns the number of items in the list.
static void qt_xdnd_send_leave()
if(void) toggleToolbarShown
The QRect class defines a rectangle in the plane using integer precision.
void xdndHandleStatus(QWidget *, const XEvent *, bool)
static QTextCodec * codecForName(const QByteArray &name)
Searches all installed QTextCodec objects and returns the one which best matches name; the match is c...
const QObjectList & children() const
Returns a list of child objects.
T qvariant_cast(const QVariant &)
int size() const
Returns the number of bytes in this byte array.
bool contains(const T &t) const
Returns true if the vector contains an occurrence of value; otherwise returns false.
int y() const
Returns the y coordinate of this point.
The QPixmap class is an off-screen image representation that can be used as a paint device...
void drawPixmap(const QRectF &targetRect, const QPixmap &pixmap, const QRectF &sourceRect)
Draws the rectangular portion source of the given pixmap into the given target in the paint device...
int height() const
Returns the height of the pixmap.
void setFormat(const QByteArray &format)
Sets the format QImageWriter will use when writing images, to format.
void xdndHandleFinished(QWidget *, const XEvent *, bool)
void accept()
Sets the accept flag of the event object, the equivalent of calling setAccepted(true).
bool isEmpty() const
Returns true if the byte array has size 0; otherwise returns false.
The QSize class defines the size of a two-dimensional object using integer point precision.
T * data()
Returns a pointer to the data stored in the vector.
static Qt::MouseButtons mouseButtons()
Returns the current state of the buttons on the mouse.
#define Q_DECLARE_PRIVATE(Class)
int x() const
Returns the x coordinate of this point.
void move(const QPoint &)
static void restoreOverrideCursor()
Undoes the last setOverrideCursor().
bool isNull() const
Returns true if this is a null pixmap; otherwise returns false.
The QTextCodec class provides conversions between text encodings.
bool isValid() const
Returns true if the rectangle is valid, otherwise returns false.
char at(int i) const
Returns the character at index position i in the byte array.
The QPaintEvent class contains event parameters for paint events.
QStringList xdndMimeFormatsForAtom(Atom a)
static int qt_xdnd_current_screen
bool write(const QImage &image)
Writes the image image to the assigned device or file name.
The QEvent class is the base class of all event classes.
Type type() const
Returns the event type.
#define qPrintable(string)
const QPoint & globalPos() const
Returns the global position of the mouse cursor at the time of the event.
bool eventFilter(QObject *, QEvent *)
Filters events if this object has been installed as an event filter for the watched object...
QDragPrivate * dragPrivate() const
#define Q_UNUSED(x)
Indicates to the compiler that the parameter with the specified name is not used in the body of a fun...
int size() const
Returns the number of items in the vector.
QList< Atom > xdndMimeAtomsForFormat(const QString &format)
void start()
Starts this timer.
void deleteLater()
Schedules this object for deletion.
void xdndHandleSelectionRequest(const XSelectionRequestEvent *)
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
QVariant xdndMimeConvertToFormat(Atom a, const QByteArray &data, const QString &format, QVariant::Type requestedType, const QByteArray &encoding)
int xdndMimeTransferedPixmapIndex
int exec(ProcessEventsFlags flags=AllEvents)
Enters the main event loop and waits until exit() is called.
void clear()
Clears the contents of the byte array and makes it empty.
static Display * display()
Returns the default display for the application.
static void flush()
Flushes the platform specific event queues.
static QPoint pos()
Returns the position of the cursor (hot spot) in global screen coordinates.
static void handle_xdnd_position(QWidget *, const XEvent *, bool)
static const char *const default_pm[]
The QList class is a template class that provides lists.
void timerEvent(QTimerEvent *)
This event handler can be reimplemented in a subclass to receive timer events for the object...
QWidget * target() const
Returns the target of the drag and drop operation.
static bool windowInteractsWithPosition(const QPoint &pos, Window w, int shapeType)
void killTimer(int id)
Kills the timer with timer identifier, id.
#define forever
This macro is provided for convenience for writing infinite loops.