src/gui/kernel/qcursor_x11.cpp
branchGCC_SURGE
changeset 31 5daf16870df6
parent 30 5dc02b23752f
equal deleted inserted replaced
27:93b982ccede2 31:5daf16870df6
    37 **
    37 **
    38 ** $QT_END_LICENSE$
    38 ** $QT_END_LICENSE$
    39 **
    39 **
    40 ****************************************************************************/
    40 ****************************************************************************/
    41 
    41 
       
    42 #include <qdebug.h>
    42 #include <qdatastream.h>
    43 #include <qdatastream.h>
    43 #include <private/qcursor_p.h>
    44 #include <private/qcursor_p.h>
    44 #include <private/qt_x11_p.h>
    45 #include <private/qt_x11_p.h>
       
    46 #include <private/qapplication_p.h>
    45 #include <qbitmap.h>
    47 #include <qbitmap.h>
    46 #include <qcursor.h>
    48 #include <qcursor.h>
    47 #include <X11/cursorfont.h>
    49 #include <X11/cursorfont.h>
    48 
    50 
    49 #include <qlibrary.h>
    51 #include <qlibrary.h>
    55 #ifndef QT_NO_XFIXES
    57 #ifndef QT_NO_XFIXES
    56 #  include <X11/extensions/Xfixes.h>
    58 #  include <X11/extensions/Xfixes.h>
    57 #endif // QT_NO_XFIXES
    59 #endif // QT_NO_XFIXES
    58 
    60 
    59 #include "qx11info_x11.h"
    61 #include "qx11info_x11.h"
       
    62 #include <private/qpixmap_x11_p.h>
    60 
    63 
    61 QT_BEGIN_NAMESPACE
    64 QT_BEGIN_NAMESPACE
    62 
    65 
    63 // Define QT_USE_APPROXIMATE_CURSORS when compiling if you REALLY want to
    66 // Define QT_USE_APPROXIMATE_CURSORS when compiling if you REALLY want to
    64 // use the ugly X11 cursors.
    67 // use the ugly X11 cursors.
   260         "pointing_hand",
   263         "pointing_hand",
   261         "forbidden",
   264         "forbidden",
   262         "whats_this",
   265         "whats_this",
   263         "left_ptr_watch",
   266         "left_ptr_watch",
   264         "openhand",
   267         "openhand",
   265         "closedhand"
   268         "closedhand",
       
   269         "copy",
       
   270         "move",
       
   271         "link"
   266     };
   272     };
   267 
   273 
   268 #ifndef QT_NO_XCURSOR
   274 #ifndef QT_NO_XCURSOR
   269     if (X11->ptrXcursorLibraryLoadCursor)
   275     if (X11->ptrXcursorLibraryLoadCursor) {
   270         hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, cursorNames[cshape]);
   276         // special case for non-standard dnd-* cursors
       
   277         switch (cshape) {
       
   278         case Qt::DragCopyCursor:
       
   279             hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, "dnd-copy");
       
   280             break;
       
   281         case Qt::DragMoveCursor:
       
   282             hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, "dnd-move");
       
   283             break;
       
   284         case Qt::DragLinkCursor:
       
   285             hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, "dnd-link");
       
   286             break;
       
   287         default:
       
   288             break;
       
   289         }
       
   290         if (!hcurs)
       
   291             hcurs = X11->ptrXcursorLibraryLoadCursor(dpy, cursorNames[cshape]);
       
   292     }
   271     if (hcurs)
   293     if (hcurs)
   272         return;
   294         return;
   273 #endif // QT_NO_XCURSOR
   295 #endif // QT_NO_XCURSOR
   274 
   296 
   275     static const char cur_blank_bits[] = {
   297     static const uchar cur_blank_bits[] = {
   276         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   298         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   277         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   299         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   278         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   300         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   279 
   301 
   280     // Non-standard X11 cursors are created from bitmaps
   302     // Non-standard X11 cursors are created from bitmaps
   281 
   303 
   282 #ifndef QT_USE_APPROXIMATE_CURSORS
   304 #ifndef QT_USE_APPROXIMATE_CURSORS
   283     static const char cur_ver_bits[] = {
   305     static const uchar cur_ver_bits[] = {
   284         0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f,
   306         0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f,
   285         0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xf0, 0x0f,
   307         0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xf0, 0x0f,
   286         0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00 };
   308         0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00 };
   287     static const char mcur_ver_bits[] = {
   309     static const uchar mcur_ver_bits[] = {
   288         0x00, 0x00, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xf8, 0x3f,
   310         0x00, 0x00, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xf8, 0x3f,
   289         0xfc, 0x7f, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xfc, 0x7f, 0xf8, 0x3f,
   311         0xfc, 0x7f, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xfc, 0x7f, 0xf8, 0x3f,
   290         0xf0, 0x1f, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03 };
   312         0xf0, 0x1f, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03 };
   291     static const char cur_hor_bits[] = {
   313     static const uchar cur_hor_bits[] = {
   292         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x30, 0x18,
   314         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x30, 0x18,
   293         0x38, 0x38, 0xfc, 0x7f, 0xfc, 0x7f, 0x38, 0x38, 0x30, 0x18, 0x20, 0x08,
   315         0x38, 0x38, 0xfc, 0x7f, 0xfc, 0x7f, 0x38, 0x38, 0x30, 0x18, 0x20, 0x08,
   294         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   316         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   295     static const char mcur_hor_bits[] = {
   317     static const uchar mcur_hor_bits[] = {
   296         0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x60, 0x0c, 0x70, 0x1c, 0x78, 0x3c,
   318         0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x60, 0x0c, 0x70, 0x1c, 0x78, 0x3c,
   297         0xfc, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfc, 0x7f, 0x78, 0x3c,
   319         0xfc, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfc, 0x7f, 0x78, 0x3c,
   298         0x70, 0x1c, 0x60, 0x0c, 0x40, 0x04, 0x00, 0x00 };
   320         0x70, 0x1c, 0x60, 0x0c, 0x40, 0x04, 0x00, 0x00 };
   299     static const char cur_bdiag_bits[] = {
   321     static const uchar cur_bdiag_bits[] = {
   300         0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3c, 0x00, 0x3e,
   322         0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3c, 0x00, 0x3e,
   301         0x00, 0x37, 0x88, 0x23, 0xd8, 0x01, 0xf8, 0x00, 0x78, 0x00, 0xf8, 0x00,
   323         0x00, 0x37, 0x88, 0x23, 0xd8, 0x01, 0xf8, 0x00, 0x78, 0x00, 0xf8, 0x00,
   302         0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   324         0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   303     static const char mcur_bdiag_bits[] = {
   325     static const uchar mcur_bdiag_bits[] = {
   304         0x00, 0x00, 0xc0, 0x7f, 0x80, 0x7f, 0x00, 0x7f, 0x00, 0x7e, 0x04, 0x7f,
   326         0x00, 0x00, 0xc0, 0x7f, 0x80, 0x7f, 0x00, 0x7f, 0x00, 0x7e, 0x04, 0x7f,
   305         0x8c, 0x7f, 0xdc, 0x77, 0xfc, 0x63, 0xfc, 0x41, 0xfc, 0x00, 0xfc, 0x01,
   327         0x8c, 0x7f, 0xdc, 0x77, 0xfc, 0x63, 0xfc, 0x41, 0xfc, 0x00, 0xfc, 0x01,
   306         0xfc, 0x03, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00 };
   328         0xfc, 0x03, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00 };
   307     static const char cur_fdiag_bits[] = {
   329     static const uchar cur_fdiag_bits[] = {
   308         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0xf8, 0x00, 0x78, 0x00,
   330         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0xf8, 0x00, 0x78, 0x00,
   309         0xf8, 0x00, 0xd8, 0x01, 0x88, 0x23, 0x00, 0x37, 0x00, 0x3e, 0x00, 0x3c,
   331         0xf8, 0x00, 0xd8, 0x01, 0x88, 0x23, 0x00, 0x37, 0x00, 0x3e, 0x00, 0x3c,
   310         0x00, 0x3e, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00 };
   332         0x00, 0x3e, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00 };
   311     static const char mcur_fdiag_bits[] = {
   333     static const uchar mcur_fdiag_bits[] = {
   312         0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc, 0x03, 0xfc, 0x01, 0xfc, 0x00,
   334         0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc, 0x03, 0xfc, 0x01, 0xfc, 0x00,
   313         0xfc, 0x41, 0xfc, 0x63, 0xdc, 0x77, 0x8c, 0x7f, 0x04, 0x7f, 0x00, 0x7e,
   335         0xfc, 0x41, 0xfc, 0x63, 0xdc, 0x77, 0x8c, 0x7f, 0x04, 0x7f, 0x00, 0x7e,
   314         0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x7f, 0x00, 0x00 };
   336         0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x7f, 0x00, 0x00 };
   315     static const char *cursor_bits16[] = {
   337     static const uchar *cursor_bits16[] = {
   316         cur_ver_bits, mcur_ver_bits, cur_hor_bits, mcur_hor_bits,
   338         cur_ver_bits, mcur_ver_bits, cur_hor_bits, mcur_hor_bits,
   317         cur_bdiag_bits, mcur_bdiag_bits, cur_fdiag_bits, mcur_fdiag_bits,
   339         cur_bdiag_bits, mcur_bdiag_bits, cur_fdiag_bits, mcur_fdiag_bits,
   318         0, 0, cur_blank_bits, cur_blank_bits };
   340         0, 0, cur_blank_bits, cur_blank_bits };
   319 
   341 
   320     static const char vsplit_bits[] = {
   342     static const uchar vsplit_bits[] = {
   321         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   343         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   322         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   344         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   323         0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00,
   345         0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00,
   324         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   346         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   325         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
   347         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,
   327         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   349         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   328         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00,
   350         0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00,
   329         0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   351         0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   330         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   352         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   331         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   353         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   332     static const char vsplitm_bits[] = {
   354     static const uchar vsplitm_bits[] = {
   333         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   355         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   334         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   356         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,
   335         0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00,
   357         0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00,
   336         0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
   358         0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
   337         0x00, 0xc0, 0x01, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,
   359         0x00, 0xc0, 0x01, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,
   339         0x80, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
   361         0x80, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,
   340         0x00, 0xc0, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00,
   362         0x00, 0xc0, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00,
   341         0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
   363         0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,
   342         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   364         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   343         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   365         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   344     static const char hsplit_bits[] = {
   366     static const uchar hsplit_bits[] = {
   345         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   367         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   346         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   368         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   347         0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
   369         0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
   348         0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
   370         0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
   349         0x00, 0x41, 0x82, 0x00, 0x80, 0x41, 0x82, 0x01, 0xc0, 0x7f, 0xfe, 0x03,
   371         0x00, 0x41, 0x82, 0x00, 0x80, 0x41, 0x82, 0x01, 0xc0, 0x7f, 0xfe, 0x03,
   351         0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
   373         0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,
   352         0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
   374         0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,
   353         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   375         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   354         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   376         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   355         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   377         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   356     static const char hsplitm_bits[] = {
   378     static const uchar hsplitm_bits[] = {
   357         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   379         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   358         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   380         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   359         0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
   381         0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
   360         0x00, 0xe0, 0x07, 0x00, 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe3, 0xc7, 0x00,
   382         0x00, 0xe0, 0x07, 0x00, 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe3, 0xc7, 0x00,
   361         0x80, 0xe3, 0xc7, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,
   383         0x80, 0xe3, 0xc7, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,
   363         0x00, 0xe2, 0x47, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
   385         0x00, 0xe2, 0x47, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,
   364         0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
   386         0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,
   365         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   387         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   366         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   388         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   367         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   389         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
   368     static const char whatsthis_bits[] = {
   390     static const uchar whatsthis_bits[] = {
   369         0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0xf0, 0x07, 0x00,
   391         0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0xf0, 0x07, 0x00,
   370         0x09, 0x18, 0x0e, 0x00, 0x11, 0x1c, 0x0e, 0x00, 0x21, 0x1c, 0x0e, 0x00,
   392         0x09, 0x18, 0x0e, 0x00, 0x11, 0x1c, 0x0e, 0x00, 0x21, 0x1c, 0x0e, 0x00,
   371         0x41, 0x1c, 0x0e, 0x00, 0x81, 0x1c, 0x0e, 0x00, 0x01, 0x01, 0x07, 0x00,
   393         0x41, 0x1c, 0x0e, 0x00, 0x81, 0x1c, 0x0e, 0x00, 0x01, 0x01, 0x07, 0x00,
   372         0x01, 0x82, 0x03, 0x00, 0xc1, 0xc7, 0x01, 0x00, 0x49, 0xc0, 0x01, 0x00,
   394         0x01, 0x82, 0x03, 0x00, 0xc1, 0xc7, 0x01, 0x00, 0x49, 0xc0, 0x01, 0x00,
   373         0x95, 0xc0, 0x01, 0x00, 0x93, 0xc0, 0x01, 0x00, 0x21, 0x01, 0x00, 0x00,
   395         0x95, 0xc0, 0x01, 0x00, 0x93, 0xc0, 0x01, 0x00, 0x21, 0x01, 0x00, 0x00,
   375         0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   397         0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   376         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   398         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   377         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   399         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   378         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   400         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   379         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
   401         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
   380     static const char whatsthism_bits[] = {
   402     static const uchar whatsthism_bits[] = {
   381         0x01, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x07, 0x00, 0x07, 0xf8, 0x0f, 0x00,
   403         0x01, 0x00, 0x00, 0x00, 0x03, 0xf0, 0x07, 0x00, 0x07, 0xf8, 0x0f, 0x00,
   382         0x0f, 0xfc, 0x1f, 0x00, 0x1f, 0x3e, 0x1f, 0x00, 0x3f, 0x3e, 0x1f, 0x00,
   404         0x0f, 0xfc, 0x1f, 0x00, 0x1f, 0x3e, 0x1f, 0x00, 0x3f, 0x3e, 0x1f, 0x00,
   383         0x7f, 0x3e, 0x1f, 0x00, 0xff, 0x3e, 0x1f, 0x00, 0xff, 0x9d, 0x0f, 0x00,
   405         0x7f, 0x3e, 0x1f, 0x00, 0xff, 0x3e, 0x1f, 0x00, 0xff, 0x9d, 0x0f, 0x00,
   384         0xff, 0xc3, 0x07, 0x00, 0xff, 0xe7, 0x03, 0x00, 0x7f, 0xe0, 0x03, 0x00,
   406         0xff, 0xc3, 0x07, 0x00, 0xff, 0xe7, 0x03, 0x00, 0x7f, 0xe0, 0x03, 0x00,
   385         0xf7, 0xe0, 0x03, 0x00, 0xf3, 0xe0, 0x03, 0x00, 0xe1, 0xe1, 0x03, 0x00,
   407         0xf7, 0xe0, 0x03, 0x00, 0xf3, 0xe0, 0x03, 0x00, 0xe1, 0xe1, 0x03, 0x00,
   387         0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   409         0x80, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   388         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   410         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   389         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   411         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   390         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   412         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   391         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
   413         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, };
   392     static const char busy_bits[] = {
   414     static const uchar busy_bits[] = {
   393         0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
   415         0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
   394         0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
   416         0x09, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x00, 0x21, 0x00, 0x00, 0x00,
   395         0x41, 0xe0, 0xff, 0x00, 0x81, 0x20, 0x80, 0x00, 0x01, 0xe1, 0xff, 0x00,
   417         0x41, 0xe0, 0xff, 0x00, 0x81, 0x20, 0x80, 0x00, 0x01, 0xe1, 0xff, 0x00,
   396         0x01, 0x42, 0x40, 0x00, 0xc1, 0x47, 0x40, 0x00, 0x49, 0x40, 0x55, 0x00,
   418         0x01, 0x42, 0x40, 0x00, 0xc1, 0x47, 0x40, 0x00, 0x49, 0x40, 0x55, 0x00,
   397         0x95, 0x80, 0x2a, 0x00, 0x93, 0x00, 0x15, 0x00, 0x21, 0x01, 0x0a, 0x00,
   419         0x95, 0x80, 0x2a, 0x00, 0x93, 0x00, 0x15, 0x00, 0x21, 0x01, 0x0a, 0x00,
   399         0x80, 0x41, 0x4a, 0x00, 0x00, 0x40, 0x55, 0x00, 0x00, 0xe0, 0xff, 0x00,
   421         0x80, 0x41, 0x4a, 0x00, 0x00, 0x40, 0x55, 0x00, 0x00, 0xe0, 0xff, 0x00,
   400         0x00, 0x20, 0x80, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
   422         0x00, 0x20, 0x80, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
   401         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   423         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   402         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   424         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   403         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
   425         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
   404     static const char busym_bits[] = {
   426     static const uchar busym_bits[] = {
   405         0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
   427         0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
   406         0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
   428         0x0f, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x00,
   407         0x7f, 0xe0, 0xff, 0x00, 0xff, 0xe0, 0xff, 0x00, 0xff, 0xe1, 0xff, 0x00,
   429         0x7f, 0xe0, 0xff, 0x00, 0xff, 0xe0, 0xff, 0x00, 0xff, 0xe1, 0xff, 0x00,
   408         0xff, 0xc3, 0x7f, 0x00, 0xff, 0xc7, 0x7f, 0x00, 0x7f, 0xc0, 0x7f, 0x00,
   430         0xff, 0xc3, 0x7f, 0x00, 0xff, 0xc7, 0x7f, 0x00, 0x7f, 0xc0, 0x7f, 0x00,
   409         0xf7, 0x80, 0x3f, 0x00, 0xf3, 0x00, 0x1f, 0x00, 0xe1, 0x01, 0x0e, 0x00,
   431         0xf7, 0x80, 0x3f, 0x00, 0xf3, 0x00, 0x1f, 0x00, 0xe1, 0x01, 0x0e, 0x00,
   412         0x00, 0xe0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
   434         0x00, 0xe0, 0xff, 0x00, 0x00, 0xe0, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00,
   413         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   435         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   414         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   436         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
   415         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
   437         0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00};
   416 
   438 
   417     static const char * const cursor_bits32[] = {
   439     static const uchar * const cursor_bits32[] = {
   418         vsplit_bits, vsplitm_bits, hsplit_bits, hsplitm_bits,
   440         vsplit_bits, vsplitm_bits, hsplit_bits, hsplitm_bits,
   419         0, 0, 0, 0, whatsthis_bits, whatsthism_bits, busy_bits, busym_bits
   441         0, 0, 0, 0, whatsthis_bits, whatsthism_bits, busy_bits, busym_bits
   420     };
   442     };
   421 
   443 
   422     static const char forbidden_bits[] = {
   444     static const uchar forbidden_bits[] = {
   423         0x00,0x00,0x00,0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xf0,0x00,0x38,0xc0,0x01,
   445         0x00,0x00,0x00,0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xf0,0x00,0x38,0xc0,0x01,
   424         0x7c,0x80,0x03,0xec,0x00,0x03,0xce,0x01,0x07,0x86,0x03,0x06,0x06,0x07,0x06,
   446         0x7c,0x80,0x03,0xec,0x00,0x03,0xce,0x01,0x07,0x86,0x03,0x06,0x06,0x07,0x06,
   425         0x06,0x0e,0x06,0x06,0x1c,0x06,0x0e,0x38,0x07,0x0c,0x70,0x03,0x1c,0xe0,0x03,
   447         0x06,0x0e,0x06,0x06,0x1c,0x06,0x0e,0x38,0x07,0x0c,0x70,0x03,0x1c,0xe0,0x03,
   426         0x38,0xc0,0x01,0xf0,0xe0,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00,0x00,0x00,0x00 };
   448         0x38,0xc0,0x01,0xf0,0xe0,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00,0x00,0x00,0x00 };
   427 
   449 
   428     static const char forbiddenm_bits[] = {
   450     static const uchar forbiddenm_bits[] = {
   429         0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xff,0x00,0xf8,0xff,0x01,0xfc,0xf0,0x03,
   451         0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xff,0x00,0xf8,0xff,0x01,0xfc,0xf0,0x03,
   430         0xfe,0xc0,0x07,0xfe,0x81,0x07,0xff,0x83,0x0f,0xcf,0x07,0x0f,0x8f,0x0f,0x0f,
   452         0xfe,0xc0,0x07,0xfe,0x81,0x07,0xff,0x83,0x0f,0xcf,0x07,0x0f,0x8f,0x0f,0x0f,
   431         0x0f,0x1f,0x0f,0x0f,0x3e,0x0f,0x1f,0xfc,0x0f,0x1e,0xf8,0x07,0x3e,0xf0,0x07,
   453         0x0f,0x1f,0x0f,0x0f,0x3e,0x0f,0x1f,0xfc,0x0f,0x1e,0xf8,0x07,0x3e,0xf0,0x07,
   432         0xfc,0xe0,0x03,0xf8,0xff,0x01,0xf0,0xff,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00};
   454         0xfc,0xe0,0x03,0xf8,0xff,0x01,0xf0,0xff,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00};
   433 
   455 
   434     static const char openhand_bits[] = {
   456     static const uchar openhand_bits[] = {
   435         0x80,0x01,0x58,0x0e,0x64,0x12,0x64,0x52,0x48,0xb2,0x48,0x92,
   457         0x80,0x01,0x58,0x0e,0x64,0x12,0x64,0x52,0x48,0xb2,0x48,0x92,
   436         0x16,0x90,0x19,0x80,0x11,0x40,0x02,0x40,0x04,0x40,0x04,0x20,
   458         0x16,0x90,0x19,0x80,0x11,0x40,0x02,0x40,0x04,0x40,0x04,0x20,
   437         0x08,0x20,0x10,0x10,0x20,0x10,0x00,0x00};
   459         0x08,0x20,0x10,0x10,0x20,0x10,0x00,0x00};
   438     static const char openhandm_bits[] = {
   460     static const uchar openhandm_bits[] = {
   439        0x80,0x01,0xd8,0x0f,0xfc,0x1f,0xfc,0x5f,0xf8,0xff,0xf8,0xff,
   461        0x80,0x01,0xd8,0x0f,0xfc,0x1f,0xfc,0x5f,0xf8,0xff,0xf8,0xff,
   440        0xf6,0xff,0xff,0xff,0xff,0x7f,0xfe,0x7f,0xfc,0x7f,0xfc,0x3f,
   462        0xf6,0xff,0xff,0xff,0xff,0x7f,0xfe,0x7f,0xfc,0x7f,0xfc,0x3f,
   441        0xf8,0x3f,0xf0,0x1f,0xe0,0x1f,0x00,0x00};
   463        0xf8,0x3f,0xf0,0x1f,0xe0,0x1f,0x00,0x00};
   442     static const char closedhand_bits[] = {
   464     static const uchar closedhand_bits[] = {
   443         0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0x48,0x32,0x08,0x50,
   465         0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0x48,0x32,0x08,0x50,
   444         0x10,0x40,0x18,0x40,0x04,0x40,0x04,0x20,0x08,0x20,0x10,0x10,
   466         0x10,0x40,0x18,0x40,0x04,0x40,0x04,0x20,0x08,0x20,0x10,0x10,
   445         0x20,0x10,0x20,0x10,0x00,0x00,0x00,0x00};
   467         0x20,0x10,0x20,0x10,0x00,0x00,0x00,0x00};
   446     static const char closedhandm_bits[] = {
   468     static const uchar closedhandm_bits[] = {
   447         0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0xf8,0x3f,0xf8,0x7f,
   469         0x00,0x00,0x00,0x00,0x00,0x00,0xb0,0x0d,0xf8,0x3f,0xf8,0x7f,
   448         0xf0,0x7f,0xf8,0x7f,0xfc,0x7f,0xfc,0x3f,0xf8,0x3f,0xf0,0x1f,
   470         0xf0,0x7f,0xf8,0x7f,0xfc,0x7f,0xfc,0x3f,0xf8,0x3f,0xf0,0x1f,
   449         0xe0,0x1f,0xe0,0x1f,0x00,0x00,0x00,0x00};
   471         0xe0,0x1f,0xe0,0x1f,0x00,0x00,0x00,0x00};
   450 
   472 
   451     static const char * const cursor_bits20[] = {
   473     static const uchar * const cursor_bits20[] = {
   452         forbidden_bits, forbiddenm_bits
   474         forbidden_bits, forbiddenm_bits
   453     };
   475     };
   454 
   476 
   455     if ((cshape >= Qt::SizeVerCursor && cshape < Qt::SizeAllCursor)
   477     if ((cshape >= Qt::SizeVerCursor && cshape < Qt::SizeAllCursor)
   456         || cshape == Qt::BlankCursor) {
   478         || cshape == Qt::BlankCursor) {
   460         bg.blue  = 255 << 8;
   482         bg.blue  = 255 << 8;
   461         fg.red   = 0;
   483         fg.red   = 0;
   462         fg.green = 0;
   484         fg.green = 0;
   463         fg.blue  = 0;
   485         fg.blue  = 0;
   464         int i = (cshape - Qt::SizeVerCursor) * 2;
   486         int i = (cshape - Qt::SizeVerCursor) * 2;
   465         pm  = XCreateBitmapFromData(dpy, rootwin, cursor_bits16[i], 16, 16);
   487         pm  = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char*>(cursor_bits16[i]), 16, 16);
   466         pmm = XCreateBitmapFromData(dpy, rootwin, cursor_bits16[i + 1], 16, 16);
   488         pmm = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char*>(cursor_bits16[i + 1]), 16, 16);
   467         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8);
   489         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8);
   468     } else if ((cshape >= Qt::SplitVCursor && cshape <= Qt::SplitHCursor)
   490     } else if ((cshape >= Qt::SplitVCursor && cshape <= Qt::SplitHCursor)
   469                || cshape == Qt::WhatsThisCursor || cshape == Qt::BusyCursor) {
   491                || cshape == Qt::WhatsThisCursor || cshape == Qt::BusyCursor) {
   470         XColor bg, fg;
   492         XColor bg, fg;
   471         bg.red   = 255 << 8;
   493         bg.red   = 255 << 8;
   473         bg.blue  = 255 << 8;
   495         bg.blue  = 255 << 8;
   474         fg.red   = 0;
   496         fg.red   = 0;
   475         fg.green = 0;
   497         fg.green = 0;
   476         fg.blue  = 0;
   498         fg.blue  = 0;
   477         int i = (cshape - Qt::SplitVCursor) * 2;
   499         int i = (cshape - Qt::SplitVCursor) * 2;
   478         pm  = XCreateBitmapFromData(dpy, rootwin, cursor_bits32[i], 32, 32);
   500         pm  = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char *>(cursor_bits32[i]), 32, 32);
   479         pmm = XCreateBitmapFromData(dpy, rootwin, cursor_bits32[i + 1], 32, 32);
   501         pmm = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char *>(cursor_bits32[i + 1]), 32, 32);
   480         int hs = (cshape == Qt::PointingHandCursor || cshape == Qt::WhatsThisCursor
   502         int hs = (cshape == Qt::PointingHandCursor || cshape == Qt::WhatsThisCursor
   481                   || cshape == Qt::BusyCursor) ? 0 : 16;
   503                   || cshape == Qt::BusyCursor) ? 0 : 16;
   482         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, hs, hs);
   504         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, hs, hs);
   483     } else if (cshape == Qt::ForbiddenCursor) {
   505     } else if (cshape == Qt::ForbiddenCursor) {
   484         XColor bg, fg;
   506         XColor bg, fg;
   487         bg.blue  = 255 << 8;
   509         bg.blue  = 255 << 8;
   488         fg.red   = 0;
   510         fg.red   = 0;
   489         fg.green = 0;
   511         fg.green = 0;
   490         fg.blue  = 0;
   512         fg.blue  = 0;
   491         int i = (cshape - Qt::ForbiddenCursor) * 2;
   513         int i = (cshape - Qt::ForbiddenCursor) * 2;
   492         pm  = XCreateBitmapFromData(dpy, rootwin, cursor_bits20[i], 20, 20);
   514         pm  = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char *>(cursor_bits20[i]), 20, 20);
   493         pmm = XCreateBitmapFromData(dpy, rootwin, cursor_bits20[i + 1], 20, 20);
   515         pmm = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char *>(cursor_bits20[i + 1]), 20, 20);
   494         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 10, 10);
   516         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 10, 10);
   495     } else if (cshape == Qt::OpenHandCursor || cshape == Qt::ClosedHandCursor) {
   517     } else if (cshape == Qt::OpenHandCursor || cshape == Qt::ClosedHandCursor) {
   496         XColor bg, fg;
   518         XColor bg, fg;
   497         bg.red   = 255 << 8;
   519         bg.red   = 255 << 8;
   498         bg.green = 255 << 8;
   520         bg.green = 255 << 8;
   499         bg.blue  = 255 << 8;
   521         bg.blue  = 255 << 8;
   500         fg.red   = 0;
   522         fg.red   = 0;
   501         fg.green = 0;
   523         fg.green = 0;
   502         fg.blue  = 0;
   524         fg.blue  = 0;
   503         bool open = cshape == Qt::OpenHandCursor;
   525         bool open = cshape == Qt::OpenHandCursor;
   504         pm  = XCreateBitmapFromData(dpy, rootwin, open ? openhand_bits : closedhand_bits, 16, 16);
   526         pm  = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char *>(open ? openhand_bits : closedhand_bits), 16, 16);
   505         pmm = XCreateBitmapFromData(dpy, rootwin, open ? openhandm_bits : closedhandm_bits, 16, 16);
   527         pmm = XCreateBitmapFromData(dpy, rootwin, reinterpret_cast<const char *>(open ? openhandm_bits : closedhandm_bits), 16, 16);
       
   528         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8);
       
   529     } else if (cshape == Qt::DragCopyCursor || cshape == Qt::DragMoveCursor
       
   530                || cshape == Qt::DragLinkCursor) {
       
   531         XColor bg, fg;
       
   532         bg.red   = 255 << 8;
       
   533         bg.green = 255 << 8;
       
   534         bg.blue  = 255 << 8;
       
   535         fg.red   = 0;
       
   536         fg.green = 0;
       
   537         fg.blue  = 0;
       
   538         QImage image = QApplicationPrivate::instance()->getPixmapCursor(cshape).toImage();
       
   539         pm = QX11PixmapData::createBitmapFromImage(image);
       
   540         pmm = QX11PixmapData::createBitmapFromImage(image.createAlphaMask().convertToFormat(QImage::Format_MonoLSB));
   506         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8);
   541         hcurs = XCreatePixmapCursor(dpy, pm, pmm, &fg, &bg, 8, 8);
   507     }
   542     }
   508 
   543 
   509     if (hcurs)
   544     if (hcurs)
   510     {
   545     {
   575         sh = XC_circle;
   610         sh = XC_circle;
   576         break;
   611         break;
   577     case Qt::BusyCursor:
   612     case Qt::BusyCursor:
   578         sh = XC_watch;
   613         sh = XC_watch;
   579         break;
   614         break;
       
   615     case Qt::DragCopyCursor:
       
   616         sh = XC_tcross;
       
   617         break;
       
   618     case Qt::DragLinkCursor:
       
   619         sh = XC_center_ptr;
       
   620         break;
       
   621     case Qt::DragMoveCursor:
       
   622         sh = XC_top_left_arrow;
       
   623         break;
   580 #endif /* QT_USE_APPROXIMATE_CURSORS */
   624 #endif /* QT_USE_APPROXIMATE_CURSORS */
   581     default:
   625     default:
   582         qWarning("QCursor::update: Invalid cursor shape %d", cshape);
   626         qWarning("QCursor::update: Invalid cursor shape %d", cshape);
   583         return;
   627         return;
   584     }
   628     }