1 | /****************************************************************************
|
---|
2 | ** $Id: qwindowdefs_pm.h 113 2006-08-10 17:50:03Z dmik $
|
---|
3 | **
|
---|
4 | ** Definition of OS/2 functions, types and constants for the PM
|
---|
5 | ** window system
|
---|
6 | **
|
---|
7 | ** Copyright (C) 1992-2002 Trolltech AS. All rights reserved.
|
---|
8 | ** Copyright (C) 2004 Norman ASA. Initial OS/2 Port.
|
---|
9 | ** Copyright (C) 2005 netlabs.org. Further OS/2 Development.
|
---|
10 | **
|
---|
11 | ** This file is part of the kernel module of the Qt GUI Toolkit.
|
---|
12 | **
|
---|
13 | ** This file may be distributed under the terms of the Q Public License
|
---|
14 | ** as defined by Trolltech AS of Norway and appearing in the file
|
---|
15 | ** LICENSE.QPL included in the packaging of this file.
|
---|
16 | **
|
---|
17 | ** This file may be distributed and/or modified under the terms of the
|
---|
18 | ** GNU General Public License version 2 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
---|
20 | ** packaging of this file.
|
---|
21 | **
|
---|
22 | ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
|
---|
23 | ** licenses may use this file in accordance with the Qt Commercial License
|
---|
24 | ** Agreement provided with the Software.
|
---|
25 | **
|
---|
26 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
|
---|
27 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
|
---|
28 | **
|
---|
29 | ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
|
---|
30 | ** information about Qt Commercial License Agreements.
|
---|
31 | ** See http://www.trolltech.com/qpl/ for QPL licensing information.
|
---|
32 | ** See http://www.trolltech.com/gpl/ for GPL licensing information.
|
---|
33 | **
|
---|
34 | ** Contact info@trolltech.com if any conditions of this licensing are
|
---|
35 | ** not clear to you.
|
---|
36 | **
|
---|
37 | **********************************************************************/
|
---|
38 |
|
---|
39 | #ifndef QWINDOWDEFS_PM_H
|
---|
40 | #ifndef QT_H
|
---|
41 | #endif // QT_H
|
---|
42 | #define QWINDOWDEFS_PM_H
|
---|
43 |
|
---|
44 | #ifndef QT_H
|
---|
45 | #endif // QT_H
|
---|
46 |
|
---|
47 | #ifdef __cplusplus
|
---|
48 | extern "C" {
|
---|
49 | #endif
|
---|
50 |
|
---|
51 | #if defined(Q_CC_GNU) && !defined(USE_OS2_TOOLKIT_HEADERS)
|
---|
52 |
|
---|
53 | #define OS2EMX_PLAIN_CHAR
|
---|
54 | #define INCL_BASE
|
---|
55 | #define INCL_PM
|
---|
56 | #include <os2.h>
|
---|
57 |
|
---|
58 | // Innotek GCC lacks some API functions in its version of OS/2 Toolkit headers
|
---|
59 |
|
---|
60 | #define QCRGN_ERROR 0
|
---|
61 | #define QCRGN_OK 1
|
---|
62 | #define QCRGN_NO_CLIP_REGION 2
|
---|
63 |
|
---|
64 | LONG APIENTRY WinQueryClipRegion( HWND hwnd, HRGN hrgnClip );
|
---|
65 | BOOL APIENTRY WinSetClipRegion( HWND hwnd, HRGN hrgnClip );
|
---|
66 |
|
---|
67 | #else
|
---|
68 |
|
---|
69 | #ifndef _Seg16
|
---|
70 | #define _Seg16
|
---|
71 | #endif
|
---|
72 | #include <os2def.h>
|
---|
73 |
|
---|
74 | #endif
|
---|
75 |
|
---|
76 | #ifdef __cplusplus
|
---|
77 | }
|
---|
78 | #endif
|
---|
79 |
|
---|
80 | /*
|
---|
81 | * Undoc'd DC_PREPAREITEM, see
|
---|
82 | * http://lxr.mozilla.org/seamonkey/source/widget/src/os2/nsDragService.cpp
|
---|
83 | */
|
---|
84 | #if !defined (DC_PREPAREITEM)
|
---|
85 | #define DC_PREPAREITEM 0x40
|
---|
86 | #endif
|
---|
87 |
|
---|
88 | typedef HWND WId;
|
---|
89 |
|
---|
90 | Q_EXPORT HPS qt_display_ps();
|
---|
91 |
|
---|
92 | // special LCID values for font and bitmap handling
|
---|
93 | const LONG LCID_QTPixmapBrush = 1;
|
---|
94 | const LONG LCID_QTFont = 2;
|
---|
95 |
|
---|
96 | // constants to address extra window data
|
---|
97 | const LONG QWL_QTCLIPRGN = QWL_USER;
|
---|
98 | const LONG QWL_QTMODAL = QWL_USER + sizeof(LONG);
|
---|
99 | const ULONG QT_EXTRAWINDATASIZE = sizeof(LONG) * 2;
|
---|
100 |
|
---|
101 | #ifdef __cplusplus
|
---|
102 | class Q_EXPORT QPMObjectWindow
|
---|
103 | {
|
---|
104 | public:
|
---|
105 | QPMObjectWindow( bool deferred = FALSE );
|
---|
106 | virtual ~QPMObjectWindow();
|
---|
107 |
|
---|
108 | bool create();
|
---|
109 | bool destroy();
|
---|
110 | HWND hwnd() const { return w; }
|
---|
111 |
|
---|
112 | MRESULT send( ULONG msg, MPARAM mp1, MPARAM mp2 ) const {
|
---|
113 | return WinSendMsg( w, msg, mp1, mp2 );
|
---|
114 | }
|
---|
115 | bool post( ULONG msg, MPARAM mp1, MPARAM mp2 ) const {
|
---|
116 | return WinPostMsg( w, msg, mp1, mp2 );
|
---|
117 | }
|
---|
118 |
|
---|
119 | virtual MRESULT message( ULONG msg, MPARAM mp1, MPARAM mp2 ) = 0;
|
---|
120 |
|
---|
121 | private:
|
---|
122 | static MRESULT EXPENTRY windowProc( HWND, ULONG, MPARAM, MPARAM );
|
---|
123 |
|
---|
124 | HWND w;
|
---|
125 | };
|
---|
126 | #endif
|
---|
127 |
|
---|
128 | #endif
|
---|