fixed compile for mouse button handling on wince
[profile/ivi/qtbase.git] / src / plugins / platforms / windows / qplatformfunctions_wince.h
1 /****************************************************************************
2 **
3 ** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
4 ** Contact: http://www.qt-project.org/
5 **
6 ** This file is part of the plugins of the Qt Toolkit.
7 **
8 ** $QT_BEGIN_LICENSE:LGPL$
9 ** GNU Lesser General Public License Usage
10 ** This file may be used under the terms of the GNU Lesser General Public
11 ** License version 2.1 as published by the Free Software Foundation and
12 ** appearing in the file LICENSE.LGPL included in the packaging of this
13 ** file. Please review the following information to ensure the GNU Lesser
14 ** General Public License version 2.1 requirements will be met:
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
16 **
17 ** In addition, as a special exception, Nokia gives you certain additional
18 ** rights. These rights are described in the Nokia Qt LGPL Exception
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
20 **
21 ** GNU General Public License Usage
22 ** Alternatively, this file may be used under the terms of the GNU General
23 ** Public License version 3.0 as published by the Free Software Foundation
24 ** and appearing in the file LICENSE.GPL included in the packaging of this
25 ** file. Please review the following information to ensure the GNU General
26 ** Public License version 3.0 requirements will be met:
27 ** http://www.gnu.org/copyleft/gpl.html.
28 **
29 ** Other Usage
30 ** Alternatively, this file may be used in accordance with the terms and
31 ** conditions contained in a signed written agreement between you and Nokia.
32 **
33 **
34 **
35 **
36 **
37 **
38 ** $QT_END_LICENSE$
39 **
40 ****************************************************************************/
41
42 #ifndef QPLATFORMFUNCTIONS_WCE_H
43 #define QPLATFORMFUNCTIONS_WCE_H
44 //
45 //  W A R N I N G
46 //  -------------
47 //
48 // This file is part of the QPA API and is not meant to be used
49 // in applications. Usage of this API may make your code
50 // source and binary incompatible with future versions of Qt.
51 //
52
53 #ifdef Q_OS_WINCE
54 #include <QtCore/qfunctions_wince.h>
55 #define UNDER_NT
56 #include <wingdi.h>
57 #include <objidl.h>
58
59 #ifndef WM_MOUSELEAVE
60 # define WM_MOUSELEAVE                   0x02A3
61 #endif
62
63 #ifndef WM_TOUCH
64 # define WM_TOUCH 0x0240
65 #endif
66
67 #ifndef WM_GETOBJECT
68 #define WM_GETOBJECT                    0x003D
69 #endif
70
71 #define GetWindowLongPtr GetWindowLong
72 #define SetWindowLongPtr SetWindowLong
73 #define GWLP_USERDATA GWL_USERDATA
74
75 #ifndef CWP_SKIPINVISIBLE
76 #define CWP_SKIPINVISIBLE   0x0001
77 #define findPlatformWindowAt(a, b, c) findPlatformWindowAt(a, b)
78 #endif
79
80 #ifndef CS_OWNDC
81 #define CS_OWNDC  0x0020
82 #endif
83
84 #ifndef HWND_MESSAGE
85 #define HWND_MESSAGE 0
86 #endif
87
88 #ifndef CAPTUREBLT
89 #define CAPTUREBLT                   (DWORD)0x40000000
90 #endif
91
92 #define SW_SHOWMINIMIZED SW_MINIMIZE
93 #define SW_SHOWMINNOACTIVE SW_MINIMIZE
94
95 #ifndef ChildWindowFromPointEx
96 #define ChildWindowFromPointEx(a, b, c) ChildWindowFromPoint(a, b)
97 #endif
98
99 #ifndef CF_DIBV5
100 #define CF_DIBV5            17
101 #endif
102
103 #ifndef WM_MOUSEACTIVATE
104 #define WM_MOUSEACTIVATE 0x0021
105 #endif
106
107 #ifndef WM_CHILDACTIVATE
108 #define WM_CHILDACTIVATE 0x0022
109 #endif
110
111 #ifndef WM_PARENTNOTIFY
112 #define WM_PARENTNOTIFY 0x0210
113 #endif
114
115 #ifndef WM_ENTERIDLE
116 #define WM_ENTERIDLE 0x0121
117 #endif
118
119 #ifndef WM_GETMINMAXINFO
120 #define WM_GETMINMAXINFO 0x0024
121 #endif
122
123 #ifndef WM_WINDOWPOSCHANGING
124 #define WM_WINDOWPOSCHANGING 0x0046
125 #endif
126
127 #ifndef WM_NCMOUSEMOVE
128 #define WM_NCMOUSEMOVE 0x00A0
129 #endif
130
131 #ifndef WM_NCMBUTTONDBLCLK
132 #define WM_NCMBUTTONDBLCLK 0x00A
133 #endif
134
135 #ifndef WM_NCCREATE
136 #define WM_NCCREATE 0x0081
137 #endif
138
139 #ifndef WM_NCCALCSIZE
140 #define WM_NCCALCSIZE 0x0083
141 #endif
142
143 #ifndef WM_NCACTIVATE
144 #define WM_NCACTIVATE 0x0086
145 #endif
146
147 #ifndef WM_NCMOUSELEAVE
148 #define WM_NCMOUSELEAVE 0x02A2
149 #endif
150
151 #ifndef WM_NCLBUTTONDOWN
152 #define WM_NCLBUTTONDOWN 0x00A1
153 #endif
154
155 #ifndef WM_NCLBUTTONUP
156 #define WM_NCLBUTTONUP 0x00A2
157 #endif
158
159 #ifndef WM_NCPAINT
160 #define WM_NCPAINT 0x0085
161 #endif
162
163 #ifndef WM_NCHITTEST
164 #define WM_NCHITTEST 0x0084
165 #endif
166
167 #ifndef WM_THEMECHANGED
168 #define WM_THEMECHANGED 0x031A
169 #endif
170
171 #ifndef WM_DISPLAYCHANGE
172 #define WM_DISPLAYCHANGE 0x007E
173 #endif
174
175 #ifndef VREFRESH
176 #define VREFRESH 116
177 #endif
178
179 #ifndef SM_SWAPBUTTON
180 #define SM_SWAPBUTTON 23
181 #endif
182
183 // application defines
184 #define SPI_SETNONCLIENTMETRICS 72
185 #define SPI_SETICONTITLELOGFONT 0x0022
186 #define WM_ACTIVATEAPP 0x001c
187 #define SW_PARENTCLOSING    1
188 #define SW_OTHERMAXIMIZED   2
189 #define SW_PARENTOPENING    3
190 #define SW_OTHERRESTORED    4
191 #define GET_XBUTTON_WPARAM(wParam)      (HIWORD(wParam))
192
193 // drag n drop
194 #ifndef CFSTR_PERFORMEDDROPEFFECT
195 #define CFSTR_PERFORMEDDROPEFFECT TEXT("Performed DropEffect")
196 #endif
197
198 // QWidget
199 #define SW_SHOWMINIMIZED SW_MINIMIZE
200
201 // QRegion
202 #define ALTERNATE 0
203 #define WINDING 1
204
205 // QFontEngine
206 typedef struct _FIXED {
207   WORD  fract;
208   short value;
209 } FIXED;
210
211 typedef struct tagPOINTFX {
212   FIXED x;
213   FIXED y;
214 } POINTFX;
215
216 typedef struct _MAT2 {
217   FIXED eM11;
218   FIXED eM12;
219   FIXED eM21;
220   FIXED eM22;
221 } MAT2;
222
223 typedef struct _GLYPHMETRICS {
224     UINT    gmBlackBoxX;
225     UINT    gmBlackBoxY;
226     POINT   gmptGlyphOrigin;
227     short   gmCellIncX;
228     short   gmCellIncY;
229 } GLYPHMETRICS;
230
231 typedef struct tagTTPOLYGONHEADER
232 {
233     DWORD   cb;
234     DWORD   dwType;
235     POINTFX pfxStart;
236 } TTPOLYGONHEADER;
237
238 typedef struct tagTTPOLYCURVE
239 {
240     WORD    wType;
241     WORD    cpfx;
242     POINTFX apfx[1];
243 } TTPOLYCURVE;
244
245 #define GGO_NATIVE 2
246 #define GGO_GLYPH_INDEX 0x0080
247 #define TT_PRIM_LINE 1
248 #define TT_PRIM_QSPLINE 2
249 #define TT_PRIM_CSPLINE 3
250 #define ANSI_VAR_FONT 12
251
252 #ifndef OleInitialize
253 #define OleInitialize(a) 0
254 #endif
255
256 #ifndef SPI_GETSNAPTODEFBUTTON
257 #define SPI_GETSNAPTODEFBUTTON  95
258 #endif
259
260 #ifndef WS_EX_LAYERED
261 #define WS_EX_LAYERED 0x00080000
262 #endif
263
264 // Clipboard --------------------------------------------------------
265 #ifndef WM_CHANGECBCHAIN
266 #define WM_CHANGECBCHAIN 0x030D
267 #endif
268
269 #ifndef WM_DRAWCLIPBOARD
270 #define WM_DRAWCLIPBOARD 0x0308
271 #endif
272
273 inline bool IsIconic( HWND /*hWnd*/ )
274 {
275     return false;
276 }
277
278 inline bool IsZoomed( HWND /*hWnd*/ )
279 {
280     return true;
281 }
282
283 inline int AddFontResourceExW( LPCWSTR /*name*/, DWORD /*fl*/, PVOID /*res*/)
284 {
285     return 0;
286 }
287
288 inline bool RemoveFontResourceExW( LPCWSTR /*name*/, DWORD /*fl*/, PVOID /*pdv*/)
289 {
290     return 0;
291 }
292
293 inline void OleUninitialize()
294 {
295 }
296
297 inline DWORD GetGlyphOutline( HDC /*hdc*/, UINT /*uChar*/, INT /*fuFormat*/, GLYPHMETRICS * /*lpgm*/,
298                        DWORD /*cjBuffer*/, LPVOID /*pvBuffer*/, CONST MAT2 * /*lpmat2*/ )
299 {
300     return GDI_ERROR;
301 }
302
303 #ifndef SPI_SETFONTSMOOTHINGTYPE
304 #  define SPI_SETFONTSMOOTHINGTYPE 0x200B
305 #endif
306 #ifndef SPI_GETFONTSMOOTHINGTYPE
307 #  define SPI_GETFONTSMOOTHINGTYPE 0x200A
308 #endif
309 #ifndef FE_FONTSMOOTHINGCLEARTYPE
310 #  define FE_FONTSMOOTHINGCLEARTYPE 0x0002
311 #endif
312
313 #ifndef DEVICE_FONTTYPE
314 #define DEVICE_FONTTYPE 0x0002
315 #endif
316
317 #ifndef RASTER_FONTTYPE
318 #define RASTER_FONTTYPE 0x0001
319 #endif
320
321 #ifndef WM_DISPLAYCHANGE
322 #define WM_DISPLAYCHANGE 0x007E
323 #endif
324
325 BOOL qt_wince_ChangeClipboardChain(
326     HWND hWndRemove,  // handle to window to remove
327     HWND hWndNewNext  // handle to next window
328 );
329 #define ChangeClipboardChain(a,b) qt_wince_ChangeClipboardChain(a,b);
330
331 HWND qt_wince_SetClipboardViewer(
332     HWND hWndNewViewer   // handle to clipboard viewer window
333 );
334 #define SetClipboardViewer(a) qt_wince_SetClipboardViewer(a)
335
336 #endif // Q_OS_WINCE
337 #endif // QPLATFORMFUNCTIONS_WCE_H