Changeset 95 for trunk/src


Ignore:
Timestamp:
Jul 31, 2009, 1:13:57 AM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Added OS/2 stubs for platform-specific parts of all key GUI classes. Non-key classes are temporarily disabled with QT_NO_ defines.

Location:
trunk/src/gui
Files:
13 added
18 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/gui.pro

    r92 r95  
    55win32-msvc*|win32-icc:QMAKE_LFLAGS += /BASE:0x65000000
    66
    7 !win32:!embedded:!mac:CONFIG      += x11
     7!win32:!os2:!embedded:!mac:CONFIG      += x11
    88
    99unix:QMAKE_PKGCONFIG_REQUIRES = QtCore
     
    2020
    2121#modules
    22 # @todo on OS/2, temporarily disable some modules until implemented
    23 os2 {
    24     include(kernel/kernel.pri)
    25 } else {
    26     include(kernel/kernel.pri)
    27     include(image/image.pri)
    28     include(painting/painting.pri)
    29     include(text/text.pri)
    30     include(styles/styles.pri)
    31     include(widgets/widgets.pri)
    32     include(dialogs/dialogs.pri)
    33     include(accessible/accessible.pri)
    34     include(itemviews/itemviews.pri)
    35     include(inputmethod/inputmethod.pri)
    36     include(graphicsview/graphicsview.pri)
    37     include(util/util.pri)
    38 }
     22include(kernel/kernel.pri)
     23include(image/image.pri)
     24include(painting/painting.pri)
     25include(text/text.pri)
     26include(styles/styles.pri)
     27include(widgets/widgets.pri)
     28include(dialogs/dialogs.pri)
     29include(accessible/accessible.pri)
     30include(itemviews/itemviews.pri)
     31include(inputmethod/inputmethod.pri)
     32include(graphicsview/graphicsview.pri)
     33include(util/util.pri)
    3934
    4035embedded: QT += network
  • trunk/src/gui/image/image.pri

    r2 r95  
    5050win32 {
    5151    SOURCES += image/qpixmap_win.cpp
     52}
     53os2 {
     54    SOURCES += image/qpixmap_pm.cpp
    5255}
    5356embedded {
  • trunk/src/gui/image/qpixmap.cpp

    r2 r95  
    18441844#elif defined(Q_WS_WIN)
    18451845    return 32; // XXX
     1846#elif defined(Q_WS_PM)
     1847    return 32; // @todo check this
    18461848#elif defined(Q_WS_MAC)
    18471849    return 32;
  • trunk/src/gui/image/qpixmapdatafactory.cpp

    r2 r95  
    5151# include <private/qpixmap_raster_p.h>
    5252#endif
     53#ifdef Q_WS_PM
     54# include <private/qpixmap_raster_p.h> // @todo check this
     55#endif
    5356#ifdef Q_WS_MAC
    5457# include <private/qpixmap_mac_p.h>
     
    7881#elif defined(Q_WS_WIN)
    7982    return new QRasterPixmapData(type);
     83#elif defined(Q_WS_PM)
     84    return new QRasterPixmapData(type); // @todo check this
    8085#elif defined(Q_WS_MAC)
    8186    return new QMacPixmapData(type);
  • trunk/src/gui/kernel/kernel.pri

    r92 r95  
    9292
    9393os2 {
    94         # @todo override everything since most things are not ready...
    95         HEADERS = \
    96                 kernel/qapplication.h \
    97                 kernel/qapplication_p.h \
    98                 kernel/qwidget.h \
    99                 kernel/qwidget_p.h
    100         SOURCES = \
    101                 kernel/qapplication.cpp \
    102                 kernel/qwidget.cpp
    103 
    10494        SOURCES += \
    10595                kernel/qapplication_pm.cpp \
     96                kernel/qclipboard_pm.cpp \
     97                kernel/qcursor_pm.cpp \
     98                kernel/qdesktopwidget_pm.cpp \
     99                kernel/qdnd_pm.cpp \
     100                kernel/qkeymapper_pm.cpp \
     101                kernel/qsound_pm.cpp \
    106102                kernel/qwidget_pm.cpp
    107103}
  • trunk/src/gui/kernel/qapplication.cpp

    r92 r95  
    127127QApplicationPrivate *QApplicationPrivate::self = 0;
    128128
     129#ifndef QT_NO_IM
    129130QInputContext *QApplicationPrivate::inputContext;
     131#endif
    130132
    131133bool QApplicationPrivate::quitOnLastWindowClosed = true;
     
    20562058        focus_widget = focus;
    20572059
     2060#ifndef QT_NO_IM
    20582061        if (prev && ((reason != Qt::PopupFocusReason && reason != Qt::MenuBarFocusReason
    20592062            && prev->testAttribute(Qt::WA_InputMethodEnabled))
     
    20682071            }
    20692072        }
     2073#endif
    20702074
    20712075        if(focus_widget)
     
    20892093            }
    20902094            if(focus && QApplicationPrivate::focus_widget == focus) {
     2095#ifndef QT_NO_IM
    20912096                if (focus->testAttribute(Qt::WA_InputMethodEnabled)) {
    20922097                    QInputContext *qic = focus->inputContext();
     
    20942099                        qic->setFocusWidget( focus_widget );
    20952100                }
     2101#endif
    20962102                QFocusEvent in(QEvent::FocusIn, reason);
    20972103                QPointer<QWidget> that = focus;
     
    49034909void QApplication::setInputContext(QInputContext *inputContext)
    49044910{
     4911#ifndef QT_NO_IM
    49054912    Q_D(QApplication);
    49064913    Q_UNUSED(d);// only static members being used.
     
    49124919        delete d->inputContext;
    49134920    d->inputContext = inputContext;
     4921#endif
    49144922}
    49154923
     
    49214929QInputContext *QApplication::inputContext() const
    49224930{
     4931#ifndef QT_NO_IM
    49234932    Q_D(const QApplication);
    49244933    Q_UNUSED(d);// only static members being used.
     
    49364945#endif
    49374946    return d->inputContext;
     4947#else
     4948    return 0;
     4949#endif
    49384950}
    49394951
  • trunk/src/gui/kernel/qapplication_p.h

    r92 r95  
    317317    }
    318318#endif
     319#ifndef QT_NO_IM
    319320    static QInputContext *inputContext;
    320 
     321#endif
    321322    static Qt::MouseButtons mouse_buttons;
    322323    static Qt::KeyboardModifiers modifier_buttons;
  • trunk/src/gui/kernel/qapplication_pm.cpp

    r92 r95  
    8282static bool     qt_try_modal(QWidget *, QMSG *, int& ret);
    8383
    84 static QWidget *qt_button_down = 0; // widget got last button-down
     84QWidget *qt_button_down = 0; // widget got last button-down
     85QPointer<QWidget> qt_last_mouse_receiver = 0;
    8586
    8687static HWND autoCaptureWnd = NULLHANDLE;
     
    273274 *****************************************************************************/
    274275
     276void QApplicationPrivate::createEventDispatcher()
     277{
     278    // @todo implement
     279}
     280
    275281/*****************************************************************************
    276282  Platform specific QApplication members
     
    286292}
    287293
     294void  QApplication::setCursorFlashTime(int msecs)
     295{
     296    // @todo implement
     297}
     298
     299
     300int QApplication::cursorFlashTime()
     301{
     302    // @todo implement
     303    return 0;
     304}
     305
     306void QApplication::setDoubleClickInterval(int ms)
     307{
     308    // @todo implement
     309}
     310
     311int QApplication::doubleClickInterval()
     312{
     313    // @todo implement
     314    return 0;
     315}
     316
     317
     318void QApplication::setKeyboardInputInterval(int ms)
     319{
     320    // @todo implement
     321}
     322
     323int QApplication::keyboardInputInterval()
     324{
     325    // @todo implement
     326    return 0;
     327}
     328
     329#ifndef QT_NO_WHEELEVENT
     330void QApplication::setWheelScrollLines(int n)
     331{
     332    // @todo implement
     333}
     334
     335int QApplication::wheelScrollLines()
     336{
     337    // @todo implement
     338    return 0;
     339}
     340#endif //QT_NO_WHEELEVENT
     341
     342void QApplication::setEffectEnabled(Qt::UIEffect effect, bool enable)
     343{
     344    // @todo implement
     345}
     346
     347bool QApplication::isEffectEnabled(Qt::UIEffect effect)
     348{
     349    // @todo implement
     350    return false;
     351}
     352
     353void QApplication::beep()
     354{
     355    // @todo implement
     356}
     357
     358void QApplication::alert(QWidget *widget, int duration)
     359{
     360    // @todo implement
     361}
     362
    288363/*****************************************************************************
    289364  QApplication cursor stack
    290365 *****************************************************************************/
    291366
     367#ifndef QT_NO_CURSOR
     368
     369void QApplication::setOverrideCursor(const QCursor &cursor)
     370{
     371    // @todo implement
     372}
     373
     374void QApplication::restoreOverrideCursor()
     375{
     376    // @todo implement
     377}
     378
     379#endif
     380
    292381/*****************************************************************************
    293382  Routines to find a Qt widget from a screen position
    294383 *****************************************************************************/
    295384
     385QWidget *QApplication::topLevelAt(const QPoint &pos)
     386{
     387    // @todo implement
     388    return 0;
     389}
     390
    296391/*****************************************************************************
    297392  Main event loop
    298393 *****************************************************************************/
     394
     395// QtWndProc() receives all messages from the main event loop
     396
     397extern "C"
     398MRESULT EXPENTRY QtWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2)
     399{
     400    // @todo implement
     401    return FALSE;
     402}
    299403
    300404/*****************************************************************************
     
    315419 *****************************************************************************/
    316420
     421bool QApplicationPrivate::modalState()
     422{
     423    // @todo implement
     424    return false;
     425}
     426
     427void QApplicationPrivate::enterModal_sys(QWidget *widget)
     428{
     429    // @todo implement
     430}
     431
     432void QApplicationPrivate::leaveModal_sys(QWidget *widget)
     433{
     434    // @todo implement
     435}
     436
    317437/*****************************************************************************
    318438  Popup widget mechanism
     
    329449 *****************************************************************************/
    330450
     451void QApplicationPrivate::openPopup(QWidget *popup)
     452{
     453    // @todo implement
     454}
     455
     456void QApplicationPrivate::closePopup(QWidget *popup)
     457{
     458    // @todo implement
     459}
     460
    331461/*****************************************************************************
    332462  Event translation; translates PM events to Qt events
  • trunk/src/gui/kernel/qclipboard.cpp

    r2 r95  
    160160#endif
    161161
    162 #ifndef Q_WS_WIN32
     162#if !defined(Q_WS_WIN32) && !defined(Q_WS_PM)
    163163/*!
    164164    \internal
     
    230230
    231231    \value Selection  indicates that data should be stored and retrieved from
    232     the global mouse selection. Support for \c Selection is provided only on 
     232    the global mouse selection. Support for \c Selection is provided only on
    233233    systems with a global mouse selection (e.g. X11).
    234234
     
    346346    image is retrieved from the global clipboard.  If \a mode is
    347347    QClipboard::Selection, the image is retrieved from the global
    348     mouse selection. 
     348    mouse selection.
    349349
    350350    \sa setImage() pixmap() mimeData(), QImage::isNull()
     
    461461*/
    462462
    463 /*! 
     463/*!
    464464    \fn void QClipboard::clear(Mode mode)
    465465    Clear the clipboard contents.
     
    469469    function clears the the global clipboard contents.  If \a mode is
    470470    QClipboard::Selection, this function clears the global mouse
    471     selection contents. If \a mode is QClipboard::FindBuffer, this 
     471    selection contents. If \a mode is QClipboard::FindBuffer, this
    472472    function clears the search string buffer.
    473473
     
    562562}
    563563
    564 /*! 
     564/*!
    565565    \internal
    566566    \fn bool QClipboard::supportsMode(Mode mode) const;
     
    569569*/
    570570
    571 /*! 
     571/*!
    572572    \internal
    573573    \fn bool QClipboard::ownsMode(Mode mode) const;
     
    576576*/
    577577
    578 /*! 
     578/*!
    579579    \internal
    580580    Emits the appropriate changed signal for \a mode.
  • trunk/src/gui/kernel/qwidget.cpp

    r92 r95  
    298298void QWidget::setInputContext(QInputContext *context)
    299299{
     300#ifndef QT_NO_IM
    300301    Q_D(QWidget);
    301302    if (!testAttribute(Qt::WA_InputMethodEnabled))
    302303        return;
    303 #ifndef QT_NO_IM
    304304    if (d->ic)
    305305        delete d->ic;
     
    323323void QWidget::resetInputContext()
    324324{
     325#ifndef QT_NO_IM
    325326    if (!hasFocus())
    326327        return;
    327 #ifndef QT_NO_IM
    328328    QInputContext *qic = this->inputContext();
    329329    if(qic)
     
    98229822#endif
    98239823    case Qt::WA_NativeWindow: {
     9824#ifndef QT_NO_IM
    98249825        QInputContext *ic = 0;
    98259826        if (on && !internalWinId() && testAttribute(Qt::WA_InputMethodEnabled) && hasFocus()) {
     
    98289829            ic->setFocusWidget(0);
    98299830        }
     9831#endif
    98309832        if (!qApp->testAttribute(Qt::AA_DontCreateNativeWidgetSiblings) && parentWidget())
    98319833            parentWidget()->d_func()->enforceNativeChildren();
    98329834        if (on && !internalWinId() && testAttribute(Qt::WA_WState_Created))
    98339835            d->createWinId();
     9836#ifndef QT_NO_IM
    98349837        if (ic)
    98359838            ic->setFocusWidget(this);
     9839#endif
    98369840        break;
    98379841    }
     
    98679871            QInputContextPrivate::updateImeStatus(this, true);
    98689872#endif
     9873#ifndef QT_NO_IM
    98699874        QInputContext *ic = d->ic;
    98709875        if (!ic) {
     
    98819886            }
    98829887        }
     9888#endif
    98839889        break;
    98849890    }
  • trunk/src/gui/kernel/qwidget_p.h

    r92 r95  
    594594#endif
    595595
    596 #if defined(Q_WS_X11) || defined (Q_WS_WIN)  || defined (Q_WS_PM) || defined(Q_WS_MAC)
     596#if defined(Q_WS_X11) || defined (Q_WS_WIN) || defined (Q_WS_PM) || defined(Q_WS_MAC)
    597597#ifdef Q_WS_MAC
    598598    void setWSGeometry(bool dontShow=false, const QRect &oldRect = QRect());
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r92 r95  
    6464 *****************************************************************************/
    6565
     66void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyOldWindow)
     67{
     68    // @todo implement
     69}
     70
     71void QWidget::destroy(bool destroyWindow, bool destroySubWindows)
     72{
     73    // @todo implement
     74}
     75
     76void QWidgetPrivate::setParent_sys(QWidget *parent, Qt::WindowFlags f)
     77{
     78    // @todo implement
     79}
     80
     81QPoint QWidget::mapToGlobal(const QPoint &pos) const
     82{
     83    // @todo implement
     84    return QPoint();
     85}
     86
     87QPoint QWidget::mapFromGlobal(const QPoint &pos) const
     88{
     89    // @todo implement
     90    return QPoint();
     91}
     92
     93void QWidgetPrivate::updateSystemBackground() {}
     94
     95#ifndef QT_NO_CURSOR
     96void QWidgetPrivate::setCursor_sys(const QCursor &cursor)
     97{
     98    // @todo implement
     99}
     100
     101void QWidgetPrivate::unsetCursor_sys()
     102{
     103    // @todo implement
     104}
     105#endif
     106
     107void QWidgetPrivate::setWindowTitle_sys(const QString &caption)
     108{
     109    // @todo implement
     110}
     111
     112void QWidgetPrivate::setWindowIcon_sys(bool forceReset)
     113{
     114    // @todo implement
     115}
     116
     117void QWidgetPrivate::setWindowIconText_sys(const QString &iconText)
     118{
     119    Q_UNUSED(iconText);
     120}
     121
     122void QWidget::grabMouse()
     123{
     124    // @todo implement
     125}
     126
     127void QWidget::grabMouse(const QCursor &cursor)
     128{
     129    // @todo implement
     130}
     131
     132void QWidget::releaseMouse()
     133{
     134    // @todo implement
     135}
     136
     137void QWidget::grabKeyboard()
     138{
     139    // @todo implement
     140}
     141
     142void QWidget::releaseKeyboard()
     143{
     144    // @todo implement
     145}
     146
     147QWidget *QWidget::mouseGrabber()
     148{
     149    // @todo implement
     150    return 0;
     151}
     152
     153QWidget *QWidget::keyboardGrabber()
     154{
     155    // @todo implement
     156    return 0;
     157}
     158
     159void QWidget::activateWindow()
     160{
     161    // @todo implement
     162}
     163
     164void QWidget::setWindowState(Qt::WindowStates newstate)
     165{
     166    // @todo implement
     167}
     168
     169void QWidgetPrivate::hide_sys()
     170{
     171    // @todo implement
     172}
     173
     174void QWidgetPrivate::show_sys()
     175{
     176    // @todo implement
     177}
     178
     179void QWidgetPrivate::setFocus_sys()
     180{
     181    // @todo implement
     182}
     183
     184void QWidgetPrivate::raise_sys()
     185{
     186    // @todo implement
     187}
     188
     189void QWidgetPrivate::lower_sys()
     190{
     191    // @todo implement
     192}
     193
     194void QWidgetPrivate::stackUnder_sys(QWidget* w)
     195{
     196    // @todo implement
     197}
     198
     199/*
     200  Helper function for non-toplevel widgets. Helps to map Qt's 32bit
     201  coordinate system to Windpws's 16bit coordinate system.
     202
     203  This code is duplicated from the X11 code, so any changes there
     204  should also (most likely) be reflected here.
     205
     206  (In all comments below: s/X/PM/g)
     207 */
     208
     209void QWidgetPrivate::setWSGeometry(bool dontShow)
     210{
     211    // @todo implement
     212}
     213
     214void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
     215{
     216    // @todo implement
     217}
     218
     219void QWidgetPrivate::setConstraints_sys()
     220{
     221    // @todo implement
     222}
     223
     224void QWidgetPrivate::scroll_sys(int dx, int dy)
     225{
     226    // @todo implement
     227}
     228
     229void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
     230{
     231    // @todo implement
     232}
     233
     234int QWidget::metric(PaintDeviceMetric m) const
     235{
     236    // @todo implement
     237    return 0;
     238}
     239
     240void QWidgetPrivate::createSysExtra()
     241{
     242    // @todo implement
     243}
     244
     245void QWidgetPrivate::deleteSysExtra()
     246{
     247    // @todo implement
     248}
     249
     250void QWidgetPrivate::createTLSysExtra()
     251{
     252    // @todo implement
     253}
     254
     255void QWidgetPrivate::deleteTLSysExtra()
     256{
     257    // @todo implement
     258}
     259
     260void QWidgetPrivate::registerDropSite(bool on)
     261{
     262    // @todo implement
     263}
     264
     265void QWidgetPrivate::setMask_sys(const QRegion &region)
     266{
     267    // @todo implement
     268}
     269
     270void QWidgetPrivate::updateFrameStrut()
     271{
     272    // @todo implement
     273}
     274
     275void QWidgetPrivate::setWindowOpacity_sys(qreal level)
     276{
     277    // @todo implement
     278}
     279
     280QPaintEngine *QWidget::paintEngine() const
     281{
     282    // @todo implement
     283    return 0;
     284}
     285
     286QWindowSurface *QWidgetPrivate::createDefaultWindowSurface_sys()
     287{
     288    // @todo implement
     289    return 0;
     290}
     291
     292void QWidgetPrivate::setModal_sys()
     293{
     294    // @todo implement
     295}
     296
    66297QT_END_NAMESPACE
  • trunk/src/gui/painting/painting.pri

    r2 r95  
    112112}
    113113
     114os2 {
     115        SOURCES += \
     116                painting/qcolormap_pm.cpp \
     117                painting/qpaintdevice_pm.cpp \
     118                painting/qregion_pm.cpp
     119}
     120
    114121embedded {
    115122    HEADERS += \
     
    170177}
    171178
    172 win32|x11|mac|embedded {
     179win32|os2|x11|mac|embedded {
    173180        SOURCES += painting/qbackingstore.cpp
    174181        HEADERS += painting/qbackingstore_p.h
  • trunk/src/gui/painting/qgraphicssystem.cpp

    r2 r95  
    4848# include <private/qpixmap_raster_p.h>
    4949#endif
     50#ifdef Q_WS_PM
     51# include <private/qpixmap_raster_p.h> // @todo check this
     52#endif
    5053#ifdef Q_WS_MAC
    5154# include <private/qpixmap_mac_p.h>
     
    6770#elif defined(Q_WS_WIN)
    6871    return new QRasterPixmapData(type);
     72#elif defined(Q_WS_PM)
     73    return new QRasterPixmapData(type); // @todo check this
    6974#elif defined(Q_WS_MAC)
    7075    return new QMacPixmapData(type);
  • trunk/src/gui/painting/qregion.cpp

    r2 r95  
    566566  \sa intersected()
    567567*/
    568 #if !defined(Q_WS_WIN) || defined(Q_OS_WINCE)
     568#if (!defined(Q_WS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_WS_PM)
    569569QRegion& QRegion::operator&=(const QRegion &r)
    570570    { return *this = *this & r; }
     
    596596  \sa subtracted()
    597597*/
    598 #if !defined(Q_WS_WIN) || defined(Q_OS_WINCE)
     598#if (!defined(Q_WS_WIN) || defined(Q_OS_WINCE)) && !defined(Q_WS_PM)
    599599QRegion& QRegion::operator-=(const QRegion &r)
    600600    { return *this = *this - r; }
  • trunk/src/gui/text/qfontdatabase.cpp

    r2 r95  
    876876#elif defined(Q_WS_WIN)
    877877#  include "qfontdatabase_win.cpp"
     878#elif defined(Q_WS_PM)
     879#  include "qfontdatabase_pm.cpp"
    878880#elif defined(Q_WS_QWS)
    879881#  include "qfontdatabase_qws.cpp"
     
    24192421*/
    24202422
    2421 /*! 
     2423/*!
    24222424    \fn bool QFontDatabase::supportsThreadedFontRendering()
    24232425    \since 4.4
  • trunk/src/gui/text/qfontengine_p.h

    r2 r95  
    323323    virtual void recalcAdvances(QGlyphLayout *, QTextEngine::ShaperFlags) const;
    324324
    325 #if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_MAC)
     325#if !defined(Q_WS_X11) && !defined(Q_WS_WIN) && !defined(Q_WS_PM) && !defined(Q_WS_MAC)
    326326    void draw(QPaintEngine *p, qreal x, qreal y, const QTextItemInt &si);
    327327#endif
  • trunk/src/gui/text/text.pri

    r2 r95  
    7474                text/qfontengine_win.cpp
    7575        HEADERS += text/qfontengine_win_p.h
     76}
     77
     78os2 {
     79        SOURCES += \
     80                text/qfont_pm.cpp
    7681}
    7782
Note: See TracChangeset for help on using the changeset viewer.