| 1 | /****************************************************************************
 | 
|---|
| 2 | **
 | 
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
 | 
|---|
| 4 | ** Contact: Qt Software Information (qt-info@nokia.com)
 | 
|---|
| 5 | **
 | 
|---|
| 6 | ** Copyright (C) 2009 netlabs.org. OS/2 parts.
 | 
|---|
| 7 | **
 | 
|---|
| 8 | ** This file is part of the QtGui module of the Qt Toolkit.
 | 
|---|
| 9 | **
 | 
|---|
| 10 | ** $QT_BEGIN_LICENSE:LGPL$
 | 
|---|
| 11 | ** Commercial Usage
 | 
|---|
| 12 | ** Licensees holding valid Qt Commercial licenses may use this file in
 | 
|---|
| 13 | ** accordance with the Qt Commercial License Agreement provided with the
 | 
|---|
| 14 | ** Software or, alternatively, in accordance with the terms contained in
 | 
|---|
| 15 | ** a written agreement between you and Nokia.
 | 
|---|
| 16 | **
 | 
|---|
| 17 | ** GNU Lesser General Public License Usage
 | 
|---|
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser
 | 
|---|
| 19 | ** General Public License version 2.1 as published by the Free Software
 | 
|---|
| 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the
 | 
|---|
| 21 | ** packaging of this file.  Please review the following information to
 | 
|---|
| 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements
 | 
|---|
| 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 | 
|---|
| 24 | **
 | 
|---|
| 25 | ** In addition, as a special exception, Nokia gives you certain
 | 
|---|
| 26 | ** additional rights. These rights are described in the Nokia Qt LGPL
 | 
|---|
| 27 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
 | 
|---|
| 28 | ** package.
 | 
|---|
| 29 | **
 | 
|---|
| 30 | ** GNU General Public License Usage
 | 
|---|
| 31 | ** Alternatively, this file may be used under the terms of the GNU
 | 
|---|
| 32 | ** General Public License version 3.0 as published by the Free Software
 | 
|---|
| 33 | ** Foundation and appearing in the file LICENSE.GPL included in the
 | 
|---|
| 34 | ** packaging of this file.  Please review the following information to
 | 
|---|
| 35 | ** ensure the GNU General Public License version 3.0 requirements will be
 | 
|---|
| 36 | ** met: http://www.gnu.org/copyleft/gpl.html.
 | 
|---|
| 37 | **
 | 
|---|
| 38 | ** If you are unsure which license is appropriate for your use, please
 | 
|---|
| 39 | ** contact the sales department at qt-sales@nokia.com.
 | 
|---|
| 40 | ** $QT_END_LICENSE$
 | 
|---|
| 41 | **
 | 
|---|
| 42 | ****************************************************************************/
 | 
|---|
| 43 | 
 | 
|---|
| 44 | #ifndef QWINDOWDEFS_PM_H
 | 
|---|
| 45 | #define QWINDOWDEFS_PM_H
 | 
|---|
| 46 | 
 | 
|---|
| 47 | #include <QtCore/qglobal.h>
 | 
|---|
| 48 | #include <QtCore/qstring.h>
 | 
|---|
| 49 | 
 | 
|---|
| 50 | QT_BEGIN_HEADER
 | 
|---|
| 51 | 
 | 
|---|
| 52 | QT_BEGIN_NAMESPACE
 | 
|---|
| 53 | 
 | 
|---|
| 54 | QT_MODULE(Gui)
 | 
|---|
| 55 | 
 | 
|---|
| 56 | QT_END_NAMESPACE
 | 
|---|
| 57 | 
 | 
|---|
| 58 | // typedefs to avoid inclusion of qt_os2.h in public headers
 | 
|---|
| 59 | typedef unsigned long LHANDLE;
 | 
|---|
| 60 | typedef LHANDLE HWND;
 | 
|---|
| 61 | typedef LHANDLE HPS;
 | 
|---|
| 62 | typedef LHANDLE HBITMAP;
 | 
|---|
| 63 | typedef LHANDLE HPOINTER;
 | 
|---|
| 64 | typedef LHANDLE HRGN;
 | 
|---|
| 65 | typedef struct _QMSG QMSG;
 | 
|---|
| 66 | typedef void *MRESULT;
 | 
|---|
| 67 | 
 | 
|---|
| 68 | typedef HWND WId;
 | 
|---|
| 69 | 
 | 
|---|
| 70 | #define NULLHANDLE ((LHANDLE)0)
 | 
|---|
| 71 | 
 | 
|---|
| 72 | // constants to address extra window data
 | 
|---|
| 73 | #define QWL_QTCLIPRGN       (QWL_USER)
 | 
|---|
| 74 | #define QWL_QTMODAL         (QWL_USER + sizeof(ULONG))
 | 
|---|
| 75 | #define QT_EXTRAWINDATASIZE (sizeof(LONG) * 2)
 | 
|---|
| 76 | 
 | 
|---|
| 77 | QT_BEGIN_NAMESPACE
 | 
|---|
| 78 | 
 | 
|---|
| 79 | class QWidget;
 | 
|---|
| 80 | 
 | 
|---|
| 81 | Q_GUI_EXPORT HPS qt_display_ps();
 | 
|---|
| 82 | 
 | 
|---|
| 83 | Q_GUI_EXPORT QWidget *qWidgetFromHWND(HWND hwnd);
 | 
|---|
| 84 | 
 | 
|---|
| 85 | // For printing non-quoted QString's with QDebug
 | 
|---|
| 86 | struct Q_CORE_EXPORT QDbgStr: public QString
 | 
|---|
| 87 | {
 | 
|---|
| 88 |     inline QDbgStr(const QString &str) : QString(str) {}
 | 
|---|
| 89 | };
 | 
|---|
| 90 | 
 | 
|---|
| 91 | Q_GUI_EXPORT QDbgStr qWidgetName(QWidget *w);
 | 
|---|
| 92 | inline QDbgStr qWidgetName(HWND hwnd)
 | 
|---|
| 93 | { return qWidgetName(qWidgetFromHWND(hwnd)); }
 | 
|---|
| 94 | 
 | 
|---|
| 95 | Q_CORE_EXPORT QDbgStr qStrHWND(HWND hwnd);
 | 
|---|
| 96 | Q_CORE_EXPORT QDbgStr qStrHPS(HPS hps);
 | 
|---|
| 97 | Q_CORE_EXPORT QDbgStr qStrHPOINTER(HPOINTER hptr);
 | 
|---|
| 98 | Q_CORE_EXPORT QDbgStr qStrHRGN(HRGN hrgn);
 | 
|---|
| 99 | 
 | 
|---|
| 100 | Q_CORE_EXPORT QDbgStr qStrQMSG(const QMSG &qmsg);
 | 
|---|
| 101 | 
 | 
|---|
| 102 | // the following declarations require OS/2 types not defined here,
 | 
|---|
| 103 | // we don't drag them in but require qt_os2.h to be included before
 | 
|---|
| 104 | #if defined(QT_OS2_H)
 | 
|---|
| 105 | 
 | 
|---|
| 106 | Q_CORE_EXPORT QDbgStr qStrRECTL(const RECTL &rcl);
 | 
|---|
| 107 | Q_CORE_EXPORT QDbgStr qStrSWP(const SWP &swp);
 | 
|---|
| 108 | 
 | 
|---|
| 109 | #endif // defined(QT_OS2_H)
 | 
|---|
| 110 | 
 | 
|---|
| 111 | // don't drag qdebug.h as well but require it to be included before
 | 
|---|
| 112 | #if defined(QDEBUG_H) && !defined(QT_NO_DEBUG_STREAM)
 | 
|---|
| 113 | 
 | 
|---|
| 114 | // Prints a non-quoted QString
 | 
|---|
| 115 | inline QDebug operator<<(QDebug dbg, const QDbgStr &str)
 | 
|---|
| 116 | { dbg << str.toUtf8().constData(); return dbg; }
 | 
|---|
| 117 | 
 | 
|---|
| 118 | #if defined(QT_OS2_H)
 | 
|---|
| 119 | 
 | 
|---|
| 120 | inline QDebug operator<<(QDebug dbg, const RECTL &rcl)
 | 
|---|
| 121 | { dbg << qStrRECTL(rcl); return dbg; }
 | 
|---|
| 122 | 
 | 
|---|
| 123 | inline QDebug operator<<(QDebug dbg, const SWP &swp)
 | 
|---|
| 124 | { dbg << qStrSWP(swp); return dbg; }
 | 
|---|
| 125 | 
 | 
|---|
| 126 | #endif // defined(QT_OS2_H)
 | 
|---|
| 127 | 
 | 
|---|
| 128 | #endif // defined(QDEBUG_H) && !defined(QT_NO_DEBUG_STREAM)
 | 
|---|
| 129 | 
 | 
|---|
| 130 | QT_END_NAMESPACE
 | 
|---|
| 131 | 
 | 
|---|
| 132 | QT_END_HEADER
 | 
|---|
| 133 | 
 | 
|---|
| 134 | #endif // QWINDOWDEFS_WIN_H
 | 
|---|