Ignore:
Timestamp:
Aug 5, 2009, 3:19:05 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Implemented widget creation/destruction functions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qapplication_pm.cpp

    r98 r99  
    9191static void releaseAutoCapture();
    9292
    93 static void unregWinClasses();
    94 
    9593extern QCursor *qt_grab_cursor();
    9694
    97 extern "C" MRESULT EXPENTRY QtWndProc(HWND, ULONG, MPARAM, MPARAM);
     95MRESULT EXPENTRY QtWndProc(HWND, ULONG, MPARAM, MPARAM);
    9896
    9997class QETWidget : public QWidget                // event translator widget
     
    189187void qt_cleanup()
    190188{
    191     unregWinClasses();
    192189    QPixmapCache::clear();
    193190
     
    224221    return false;
    225222#endif
    226 }
    227 
    228 typedef QSet<QString> WinClassNameHash;
    229 Q_GLOBAL_STATIC(WinClassNameHash, winclassNames)
    230 
    231 // register window class
    232 const QString qt_reg_winclass(QWidget *w)
    233 {
    234     int flags = w->windowFlags();
    235     int type = flags & Qt::WindowType_Mask;
    236 
    237     QString cname;
    238     ULONG style = 0;
    239 
    240     if (type == Qt::Window) {
    241         // this class is for frame window clients when WC_FRAME is used.
    242         cname = QLatin1String("QWindow");
    243         style |= CS_MOVENOTIFY;
    244     } else if (type == Qt::Popup || type == Qt::Tool || type == Qt::ToolTip) {
    245         cname = QLatin1String("QPopup");
    246         // @todo do we really want SAVEBITS here?
    247         style |= CS_SAVEBITS;
    248     } else {
    249         cname = QLatin1String("QWidget");
    250     }
    251 
    252     if (winclassNames()->contains(cname)) // already registered in our list
    253         return cname;
    254 
    255     // QT_EXTRAWINDATASIZE is defined in qwindowdefs_pm.h
    256     WinRegisterClass(0, cname.toLatin1(), QtWndProc, style, QT_EXTRAWINDATASIZE);
    257 
    258     winclassNames()->insert(cname);
    259     return cname;
    260 }
    261 
    262 static void unregWinClasses()
    263 {
    264     // there is no need to unregister private window classes -- it is done
    265     // automatically upon process termination.
    266     winclassNames()->clear();
    267223}
    268224
     
    466422// QtWndProc() receives all messages from the main event loop
    467423
    468 extern "C"
    469424MRESULT EXPENTRY QtWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     425
     426
     427
     428
     429
     430
     431
     432
    470433{
    471434    // @todo implement
Note: See TracChangeset for help on using the changeset viewer.