This is a multi-part message in MIME format. ------=_NextPart_000_0044_01C330FD.944E6290 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hi! I am stuck with a windows computer at the moment, so I wanted to do some improvements to Qt. This patch adds at least partial support of QCursor, QWidget::setCursor(...) should work, at least for those that I could figure out what the Windows equivalents were. Don't know about overrideCursor, as I'm not really sure how that works. And also own bitmap-cursors doesn't work, as I have to figure out how that works. Richard L=E4rk=E4ng ------=_NextPart_000_0044_01C330FD.944E6290 Content-Type: application/octet-stream; name="cursor.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="cursor.diff" Index: qapplication_win32.cpp=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: = /cvsroot/kde-cygwin/qt-2/src/kernel/Attic/qapplication_win32.cpp,v=0A= retrieving revision 1.1.2.11=0A= diff -u -r1.1.2.11 qapplication_win32.cpp=0A= --- qapplication_win32.cpp 15 Mar 2003 00:12:31 -0000 1.1.2.11=0A= +++ qapplication_win32.cpp 12 Jun 2003 14:03:06 -0000=0A= @@ -2221,7 +2221,7 @@=0A= #ifdef DEBUG_QAPPLICATION=0A= qDebug("qapplication_win.cpp: setOverrideCursor");=0A= #endif=0A= -/* if ( !cursorStack ) {=0A= + if ( !cursorStack ) {=0A= cursorStack =3D new QCursorList;=0A= CHECK_PTR( cursorStack );=0A= cursorStack->setAutoDelete( TRUE );=0A= @@ -2238,11 +2238,11 @@=0A= while ( (w=3Dit.current()) ) { // for all widgets that have=0A= if ( w->testWState(WState_OwnCursor) &&=0A= ( !amw || !w->isVisible() || w->topLevelWidget() =3D=3D amw ) ) = // set a cursor=0A= - XDefineCursor( w->x11Display(), w->winId(), app_cursor->handle() );=0A= +// XDefineCursor( w->x11Display(), w->winId(), app_cursor->handle() = );=0A= ++it;=0A= }=0A= - XFlush( appDpy ); // make X execute it NOW=0A= -*/}=0A= +// XFlush( appDpy ); // make X execute it NOW=0A= +}=0A= =0A= /*!=0A= Undoes the last setOverrideCursor().=0A= @@ -6794,14 +6794,15 @@=0A= case WM_DESTROY:=0A= PostQuitMessage (0);=0A= break;=0A= -#if 0=0A= case WM_SETCURSOR: {=0A= + qDebug("qapplication_win.cpp: WM_SETCURSOR");=0A= QCursor *cursor =3D qApp->overrideCursor ();=0A= if (cursor && cursor->handle ())=0A= - SetCursor (cursor->handle ());=0A= + SetCursor (cursor->handle());=0A= + else=0A= + SetCursor(widget->cursor().handle());=0A= break;=0A= }=0A= -#endif=0A= default:=0A= qDebug("qapplication_win.cpp: processNextEvent: = DefWindowProc");=0A= return DefWindowProc(hwnd, uMsg, wParam, lParam);=0A= Index: qcursor_win32.cpp=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/kde-cygwin/qt-2/src/kernel/Attic/qcursor_win32.cpp,v=0A= retrieving revision 1.1.2.1=0A= diff -u -r1.1.2.1 qcursor_win32.cpp=0A= --- qcursor_win32.cpp 19 Jan 2003 15:09:41 -0000 1.1.2.1=0A= +++ qcursor_win32.cpp 12 Jun 2003 14:03:07 -0000=0A= @@ -34,6 +34,9 @@=0A= #include "qdatastream.h"=0A= #include "qt_x11.h"=0A= #include =0A= +#define Status WIN_Status=0A= +#include =0A= +#undef WIN_Status=0A= =0A= // NOT REVISED=0A= =0A= @@ -52,7 +55,7 @@=0A= QBitmap *bm, *bmm;=0A= short hx, hy;=0A= XColor fg,bg;=0A= - Cursor hcurs;=0A= + HCURSOR hcurs;=0A= Pixmap pm, pmm;=0A= };=0A= =0A= @@ -401,11 +404,11 @@=0A= =0A= HCURSOR QCursor::handle() const=0A= {=0A= -/* if ( !initialized )=0A= + if ( !initialized )=0A= initialize();=0A= if ( !data->hcurs )=0A= update();=0A= -*/ return (HCURSOR)data->hcurs;=0A= + return data->hcurs;=0A= }=0A= =0A= =0A= @@ -428,7 +431,11 @@=0A= XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,=0A= &root_x, &root_y, &win_x, &win_y, &buttons );=0A= return QPoint( root_x, root_y );=0A= -*/ return QPoint( 1,1);=0A= +*/=0A= + POINT* p;=0A= + GetCursorPos(p);=0A= + return QPoint(p->x, p->y);=0A= +=0A= }=0A= =0A= /*!=0A= @@ -449,7 +456,7 @@=0A= if (pos() =3D=3D QPoint(x,y))=0A= return;=0A= =0A= -// XWarpPointer( qt_xdisplay(), None, qt_xrootwin(), 0, 0, 0, 0, x, = y );=0A= + SetCursorPos(x, y);=0A= }=0A= =0A= /*!=0A= @@ -463,279 +470,71 @@=0A= =0A= void QCursor::update() const=0A= {=0A= -/* if ( !initialized )=0A= + if ( !initialized )=0A= initialize();=0A= register QCursorData *d =3D data; // cheat const!=0A= if ( d->hcurs ) // already loaded=0A= return;=0A= =0A= - Display *dpy =3D qt_xdisplay();=0A= - Window rootwin =3D qt_xrootwin();=0A= -=0A= if ( d->cshape =3D=3D BitmapCursor ) {=0A= + /*=0A= d->hcurs =3D XCreatePixmapCursor( dpy, d->bm->handle(), = d->bmm->handle(),=0A= - &d->fg, &d->bg, d->hx, d->hy );=0A= - return;=0A= - }=0A= -=0A= - static uchar cur_blank_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= -=0A= - // Non-standard X11 cursors are created from bitmaps=0A= -=0A= -#ifndef QT_USE_APPROXIMATE_CURSORS=0A= - static uchar cur_ver_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x80, 0x01, 0xc0, 0x03, 0xe0, 0x07, 0xf0, 0x0f,=0A= - 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0x80, 0x01, 0xf0, 0x0f,=0A= - 0xe0, 0x07, 0xc0, 0x03, 0x80, 0x01, 0x00, 0x00 };=0A= - static uchar mcur_ver_bits[] =3D {=0A= - 0x00, 0x00, 0x80, 0x03, 0xc0, 0x07, 0xe0, 0x0f, 0xf0, 0x1f, 0xf8, 0x3f,=0A= - 0xfc, 0x7f, 0xc0, 0x07, 0xc0, 0x07, 0xc0, 0x07, 0xfc, 0x7f, 0xf8, 0x3f,=0A= - 0xf0, 0x1f, 0xe0, 0x0f, 0xc0, 0x07, 0x80, 0x03 };=0A= - static uchar cur_hor_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x08, 0x30, 0x18,=0A= - 0x38, 0x38, 0xfc, 0x7f, 0xfc, 0x7f, 0x38, 0x38, 0x30, 0x18, 0x20, 0x08,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar mcur_hor_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x40, 0x04, 0x60, 0x0c, 0x70, 0x1c, 0x78, 0x3c,=0A= - 0xfc, 0x7f, 0xfe, 0xff, 0xfe, 0xff, 0xfe, 0xff, 0xfc, 0x7f, 0x78, 0x3c,=0A= - 0x70, 0x1c, 0x60, 0x0c, 0x40, 0x04, 0x00, 0x00 };=0A= - static uchar cur_bdiag_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x3e, 0x00, 0x3c, 0x00, 0x3e,=0A= - 0x00, 0x37, 0x88, 0x23, 0xd8, 0x01, 0xf8, 0x00, 0x78, 0x00, 0xf8, 0x00,=0A= - 0xf8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar mcur_bdiag_bits[] =3D {=0A= - 0x00, 0x00, 0xc0, 0x7f, 0x80, 0x7f, 0x00, 0x7f, 0x00, 0x7e, 0x04, 0x7f,=0A= - 0x8c, 0x7f, 0xdc, 0x77, 0xfc, 0x63, 0xfc, 0x41, 0xfc, 0x00, 0xfc, 0x01,=0A= - 0xfc, 0x03, 0xfc, 0x07, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar cur_fdiag_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x01, 0xf8, 0x00, 0x78, 0x00,=0A= - 0xf8, 0x00, 0xd8, 0x01, 0x88, 0x23, 0x00, 0x37, 0x00, 0x3e, 0x00, 0x3c,=0A= - 0x00, 0x3e, 0x00, 0x3f, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar mcur_fdiag_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0xfc, 0x07, 0xfc, 0x03, 0xfc, 0x01, 0xfc, 0x00,=0A= - 0xfc, 0x41, 0xfc, 0x63, 0xdc, 0x77, 0x8c, 0x7f, 0x04, 0x7f, 0x00, 0x7e,=0A= - 0x00, 0x7f, 0x80, 0x7f, 0xc0, 0x7f, 0x00, 0x00 };=0A= - static uchar *cursor_bits16[] =3D {=0A= - cur_ver_bits, mcur_ver_bits, cur_hor_bits, mcur_hor_bits,=0A= - cur_bdiag_bits, mcur_bdiag_bits, cur_fdiag_bits, mcur_fdiag_bits,=0A= - 0, 0, cur_blank_bits, cur_blank_bits };=0A= -=0A= - static uchar vsplit_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,=0A= - 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,=0A= - 0x00, 0x41, 0x82, 0x00, 0x80, 0x41, 0x82, 0x01, 0xc0, 0x7f, 0xfe, 0x03,=0A= - 0x80, 0x41, 0x82, 0x01, 0x00, 0x41, 0x82, 0x00, 0x00, 0x40, 0x02, 0x00,=0A= - 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00,=0A= - 0x00, 0x40, 0x02, 0x00, 0x00, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar vsplitm_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,=0A= - 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe3, 0xc7, 0x00,=0A= - 0x80, 0xe3, 0xc7, 0x01, 0xc0, 0xff, 0xff, 0x03, 0xe0, 0xff, 0xff, 0x07,=0A= - 0xc0, 0xff, 0xff, 0x03, 0x80, 0xe3, 0xc7, 0x01, 0x00, 0xe3, 0xc7, 0x00,=0A= - 0x00, 0xe2, 0x47, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00,=0A= - 0x00, 0xe0, 0x07, 0x00, 0x00, 0xe0, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar hsplit_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x80, 0x00, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00,=0A= - 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,=0A= - 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f, 0x00,=0A= - 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,=0A= - 0x00, 0x80, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0xe0, 0x03, 0x00,=0A= - 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar hsplitm_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00,=0A= - 0x00, 0xc0, 0x01, 0x00, 0x00, 0xe0, 0x03, 0x00, 0x00, 0xf0, 0x07, 0x00,=0A= - 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,=0A= - 0x00, 0xc0, 0x01, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,=0A= - 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00, 0x80, 0xff, 0xff, 0x00,=0A= - 0x80, 0xff, 0xff, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0xc0, 0x01, 0x00,=0A= - 0x00, 0xc0, 0x01, 0x00, 0x00, 0xf8, 0x0f, 0x00, 0x00, 0xf0, 0x07, 0x00,=0A= - 0x00, 0xe0, 0x03, 0x00, 0x00, 0xc0, 0x01, 0x00, 0x00, 0x80, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar phand_bits[] =3D {=0A= - 0x00, 0x00, 0x00, 0x00, 0xfe, 0x01, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00,=0A= - 0x7e, 0x04, 0x00, 0x00, 0x08, 0x08, 0x00, 0x00, 0x70, 0x08, 0x00, 0x00,=0A= - 0x08, 0x08, 0x00, 0x00, 0x70, 0x14, 0x00, 0x00, 0x08, 0x22, 0x00, 0x00,=0A= - 0x30, 0x41, 0x00, 0x00, 0xc0, 0x20, 0x00, 0x00, 0x40, 0x12, 0x00, 0x00,=0A= - 0x80, 0x08, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= - static uchar phandm_bits[] =3D {=0A= - 0xfe, 0x01, 0x00, 0x00, 0xff, 0x03, 0x00, 0x00, 0xff, 0x07, 0x00, 0x00,=0A= - 0xff, 0x0f, 0x00, 0x00, 0xfe, 0x1f, 0x00, 0x00, 0xf8, 0x1f, 0x00, 0x00,=0A= - 0xfc, 0x1f, 0x00, 0x00, 0xf8, 0x3f, 0x00, 0x00, 0xfc, 0x7f, 0x00, 0x00,=0A= - 0xf8, 0xff, 0x00, 0x00, 0xf0, 0x7f, 0x00, 0x00, 0xe0, 0x3f, 0x00, 0x00,=0A= - 0xc0, 0x1f, 0x00, 0x00, 0x80, 0x0f, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00,=0A= - 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,=0A= - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };=0A= -=0A= - static uchar *cursor_bits32[] =3D {=0A= - vsplit_bits, vsplitm_bits, hsplit_bits, hsplitm_bits,=0A= - phand_bits, phandm_bits=0A= - };=0A= -=0A= - static uchar forbidden_bits[] =3D {=0A= - = 0x00,0x00,0x00,0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xf0,0x00,0x38,0xc0,0x0= 1,=0A= - = 0x7c,0x80,0x03,0xec,0x00,0x03,0xce,0x01,0x07,0x86,0x03,0x06,0x06,0x07,0x0= 6,=0A= - = 0x06,0x0e,0x06,0x06,0x1c,0x06,0x0e,0x38,0x07,0x0c,0x70,0x03,0x1c,0xe0,0x0= 3,=0A= - = 0x38,0xc0,0x01,0xf0,0xe0,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x00,0x00,0x00,0x0= 0 };=0A= -=0A= - static unsigned char forbiddenm_bits[] =3D {=0A= - = 0x80,0x1f,0x00,0xe0,0x7f,0x00,0xf0,0xff,0x00,0xf8,0xff,0x01,0xfc,0xf0,0x0= 3,=0A= - = 0xfe,0xc0,0x07,0xfe,0x81,0x07,0xff,0x83,0x0f,0xcf,0x07,0x0f,0x8f,0x0f,0x0= f,=0A= - = 0x0f,0x1f,0x0f,0x0f,0x3e,0x0f,0x1f,0xfc,0x0f,0x1e,0xf8,0x07,0x3e,0xf0,0x0= 7,=0A= - = 0xfc,0xe0,0x03,0xf8,0xff,0x01,0xf0,0xff,0x00,0xe0,0x7f,0x00,0x80,0x1f,0x0= 0};=0A= -=0A= - static uchar *cursor_bits20[] =3D {=0A= - forbidden_bits, forbiddenm_bits=0A= - };=0A= -=0A= - if ( d->cshape >=3D SizeVerCursor && d->cshape < SizeAllCursor ||=0A= - d->cshape =3D=3D BlankCursor ) {=0A= - XColor bg, fg; // ignore stupid CFront message=0A= - bg.red =3D 255 << 8;=0A= - bg.green =3D 255 << 8;=0A= - bg.blue =3D 255 << 8;=0A= - fg.red =3D 0;=0A= - fg.green =3D 0;=0A= - fg.blue =3D 0;=0A= - int i =3D (d->cshape - SizeVerCursor)*2;=0A= - d->pm =3D XCreateBitmapFromData( dpy, rootwin, (char = *)cursor_bits16[i],=0A= - 16, 16 );=0A= - d->pmm =3D XCreateBitmapFromData( dpy, rootwin, (char = *)cursor_bits16[i+1],=0A= - 16,16);=0A= - d->hcurs =3D XCreatePixmapCursor( dpy, d->pm, d->pmm, &fg, &bg, 8, 8 );=0A= - return;=0A= - }=0A= - if ( d->cshape >=3D SplitVCursor && d->cshape <=3D = PointingHandCursor ) {=0A= - XColor bg, fg; // ignore stupid CFront message=0A= - bg.red =3D 255 << 8;=0A= - bg.green =3D 255 << 8;=0A= - bg.blue =3D 255 << 8;=0A= - fg.red =3D 0;=0A= - fg.green =3D 0;=0A= - fg.blue =3D 0;=0A= - int i =3D (d->cshape - SplitVCursor)*2;=0A= - d->pm =3D XCreateBitmapFromData( dpy, rootwin, (char = *)cursor_bits32[i],=0A= - 32, 32 );=0A= - d->pmm =3D XCreateBitmapFromData( dpy, rootwin, (char = *)cursor_bits32[i+1],=0A= - 32, 32);=0A= - int hs =3D d->cshape !=3D PointingHandCursor? 16 : 0;=0A= - d->hcurs =3D XCreatePixmapCursor( dpy, d->pm, d->pmm, &fg, &bg, hs, hs = );=0A= + &d->fg, &d->bg, d->hx, d->hy );*/=0A= + // TODO how?=0A= + d->hcurs =3D LoadCursor(0, IDC_ARROW);=0A= return;=0A= }=0A= - if ( d->cshape =3D=3D ForbiddenCursor ) {=0A= - XColor bg, fg; // ignore stupid CFront message=0A= - bg.red =3D 255 << 8;=0A= - bg.green =3D 255 << 8;=0A= - bg.blue =3D 255 << 8;=0A= - fg.red =3D 0;=0A= - fg.green =3D 0;=0A= - fg.blue =3D 0;=0A= - int i =3D (d->cshape - ForbiddenCursor)*2;=0A= - d->pm =3D XCreateBitmapFromData( dpy, rootwin, (char = *)cursor_bits20[i],=0A= - 20, 20 );=0A= - d->pmm =3D XCreateBitmapFromData( dpy, rootwin, (char = *)cursor_bits20[i+1],=0A= - 20, 20);=0A= - d->hcurs =3D XCreatePixmapCursor( dpy, d->pm, d->pmm, &fg, &bg, 10, 10 = );=0A= - return;=0A= - }=0A= -#endif /* ! QT_USE_APPROXIMATE_CURSORS *//*=0A= =0A= - uint sh;=0A= - switch ( d->cshape ) { // map Q cursor to X cursor=0A= + LPCSTR sh;=0A= + switch ( d->cshape ) {=0A= case ArrowCursor:=0A= - sh =3D XC_left_ptr;=0A= + sh =3D IDC_ARROW;=0A= break;=0A= case UpArrowCursor:=0A= - sh =3D XC_center_ptr;=0A= + sh =3D IDC_UPARROW;=0A= break;=0A= case CrossCursor:=0A= - sh =3D XC_crosshair;=0A= + sh =3D IDC_CROSS;=0A= break;=0A= case WaitCursor:=0A= - sh =3D XC_watch;=0A= + sh =3D IDC_WAIT;=0A= break;=0A= case IbeamCursor:=0A= - sh =3D XC_xterm;=0A= + sh =3D IDC_IBEAM;=0A= break;=0A= case SizeAllCursor:=0A= - sh =3D XC_fleur;=0A= + sh =3D IDC_SIZEALL;=0A= break;=0A= -#ifdef QT_USE_APPROXIMATE_CURSORS=0A= case SizeVerCursor:=0A= - sh =3D XC_top_side;=0A= + sh =3D IDC_SIZENS;=0A= break;=0A= case SizeHorCursor:=0A= - sh =3D XC_right_side;=0A= + sh =3D IDC_SIZEWE;=0A= break;=0A= case SizeBDiagCursor:=0A= - sh =3D XC_top_right_corner;=0A= + sh =3D IDC_SIZENESW;=0A= break;=0A= case SizeFDiagCursor:=0A= - sh =3D XC_bottom_right_corner;=0A= + sh =3D IDC_SIZENWSE;=0A= break;=0A= case BlankCursor:=0A= - XColor bg, fg; // ignore stupid CFront = message=0A= - bg.red =3D 255 << 8;=0A= - bg.green =3D 255 << 8;=0A= - bg.blue =3D 255 << 8;=0A= - fg.red =3D 0;=0A= - fg.green =3D 0;=0A= - fg.blue =3D 0;=0A= - d->pm =3D XCreateBitmapFromData( dpy, rootwin,=0A= - (char *)cur_blank_bits, 16, 16 );=0A= - d->pmm =3D XCreateBitmapFromData( dpy, rootwin,=0A= - (char *)cur_blank_bits, 16,16);=0A= - d->hcurs =3D XCreatePixmapCursor( dpy, d->pm, d->pmm, &fg,=0A= - &bg, 8, 8 );=0A= - return;=0A= - break;=0A= case SplitVCursor:=0A= - sh =3D XC_sb_h_double_arrow;=0A= - break;=0A= case SplitHCursor:=0A= - sh =3D XC_sb_v_double_arrow;=0A= + // TODO What?=0A= + sh =3D IDC_ARROW;=0A= + break;=0A= break;=0A= case PointingHandCursor:=0A= - sh =3D XC_hand1;=0A= + sh =3D IDC_HAND;=0A= break;=0A= case ForbiddenCursor:=0A= - sh =3D XC_circle;=0A= + sh =3D IDC_NO;=0A= break;=0A= -#endif /* QT_USE_APPROXIMATE_CURSORS *//*=0A= default:=0A= -#if defined(CHECK_RANGE)=0A= + sh =3D IDC_ARROW;=0A= qWarning( "QCursor::update: Invalid cursor shape %d", d->cshape );=0A= -#endif=0A= return;=0A= }=0A= - d->hcurs =3D XCreateFontCursor( dpy, sh );=0A= -*/}=0A= + d->hcurs =3D LoadCursor(0, sh);=0A= +}=0A= +=0A= Index: qwidget_win32.cpp=0A= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=0A= RCS file: /cvsroot/kde-cygwin/qt-2/src/kernel/Attic/qwidget_win32.cpp,v=0A= retrieving revision 1.1.2.5=0A= diff -u -r1.1.2.5 qwidget_win32.cpp=0A= --- qwidget_win32.cpp 13 Mar 2003 01:46:56 -0000 1.1.2.5=0A= +++ qwidget_win32.cpp 12 Jun 2003 14:03:25 -0000=0A= @@ -366,7 +366,7 @@=0A= #ifdef DEBUG_QWIDGET=0A= qDebug("qwidget_win.cpp: destroy");=0A= #endif=0A= -/* deactivateWidgetCleanup();=0A= + deactivateWidgetCleanup();=0A= if ( testWState(WState_Created) ) {=0A= clearWState( WState_Created );=0A= if ( children() ) {=0A= @@ -390,14 +390,15 @@=0A= else if ( testWFlags(WType_Popup) )=0A= qApp->closePopup( this );=0A= #ifdef QT_XFT=0A= - qt_destroy_ft_draw (x11Display (), winid);=0A= +// qt_destroy_ft_draw (x11Display (), winid);=0A= #endif=0A= if ( testWFlags(WType_Desktop) ) {=0A= if ( acceptDrops() )=0A= qt_dnd_enable( this, FALSE );=0A= } else {=0A= if ( destroyWindow )=0A= - qt_XDestroyWindow( this, x11Display(), winid );=0A= + DestroyWindow(winid);=0A= + //qt_XDestroyWindow( this, x11Display(), winid );=0A= }=0A= setWinId( 0 );=0A= =0A= @@ -405,7 +406,7 @@=0A= if ( testWState(WState_Reparented) )=0A= qPRCleanup(this);=0A= }=0A= -*/}=0A= +}=0A= =0A= /*!=0A= Reparents the widget. The widget gets a new \a parent, new widget=0A= @@ -807,7 +808,7 @@=0A= #ifdef DEBUG_QWIDGET=0A= qDebug("qwidget_win.cpp: setCursor");=0A= #endif=0A= -/* if ( cursor.handle() !=3D arrowCursor.handle()=0A= + if ( cursor.handle() !=3D arrowCursor.handle()=0A= || (extra && extra->curs) ) {=0A= createExtra();=0A= delete extra->curs;=0A= @@ -815,10 +816,14 @@=0A= }=0A= setWState( WState_OwnCursor );=0A= QCursor *oc =3D QApplication::overrideCursor();=0A= - XDefineCursor( x11Display(), winId(),=0A= - oc ? oc->handle() : cursor.handle() );=0A= - XFlush( x11Display() );=0A= -*/}=0A= +=0A= + if (oc)=0A= + extra->curs =3D oc;=0A= +=0A= +// XDefineCursor( x11Display(), winId(),=0A= +// oc ? oc->handle() : cursor.handle() );=0A= +// XFlush( x11Display() );=0A= +}=0A= =0A= =0A= /*!=0A= @@ -1448,19 +1453,21 @@=0A= #ifdef DEBUG_QWIDGET=0A= qDebug("qwidget_win.cpp: hideWindow");=0A= #endif=0A= -/* clearWState( WState_Exposed );=0A= + clearWState( WState_Exposed );=0A= deactivateWidgetCleanup();=0A= if ( isTopLevel() ) {=0A= qt_deferred_map_take( this );=0A= if ( winId() ) // in nsplugin, may be 0=0A= - XWithdrawWindow( x11Display(), winId(), x11Screen() );=0A= + ShowWindow(winid, SW_HIDE);=0A= +// XWithdrawWindow( x11Display(), winId(), x11Screen() );=0A= crect.moveTopLeft( fpos );=0A= topData()->fsize =3D crect.size();=0A= } else {=0A= if ( winId() ) // in nsplugin, may be 0=0A= - XUnmapWindow( x11Display(), winId() );=0A= + ShowWindow(winid, SW_HIDE);=0A= +// XUnmapWindow( x11Display(), winId() );=0A= }=0A= -*/}=0A= +}=0A= =0A= =0A= /*!=0A= ------=_NextPart_000_0044_01C330FD.944E6290 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kde-cygwin mailing list kde-cygwin@mail.kde.org http://mail.kde.org/mailman/listinfo/kde-cygwin ------=_NextPart_000_0044_01C330FD.944E6290--