source: trunk/src/gui/kernel/qwindowdefs_pm.h@ 1006

Last change on this file since 1006 was 1006, checked in by Dmitry A. Kuminov, 14 years ago

OS/2: Export platform-specific qDebug() helpers.

This lets them be used in application code.

File size: 4.4 KB
Line 
1/****************************************************************************
2**
3** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
4** All rights reserved.
5** Contact: Nokia Corporation ([email protected])
6**
7** Copyright (C) 2010 netlabs.org. OS/2 parts.
8**
9** This file is part of the QtGui module of the Qt Toolkit.
10**
11** $QT_BEGIN_LICENSE:LGPL$
12** Commercial Usage
13** Licensees holding valid Qt Commercial licenses may use this file in
14** accordance with the Qt Commercial License Agreement provided with the
15** Software or, alternatively, in accordance with the terms contained in
16** a written agreement between you and Nokia.
17**
18** GNU Lesser General Public License Usage
19** Alternatively, this file may be used under the terms of the GNU Lesser
20** General Public License version 2.1 as published by the Free Software
21** Foundation and appearing in the file LICENSE.LGPL included in the
22** packaging of this file. Please review the following information to
23** ensure the GNU Lesser General Public License version 2.1 requirements
24** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
25**
26** In addition, as a special exception, Nokia gives you certain additional
27** rights. These rights are described in the Nokia Qt LGPL Exception
28** version 1.1, included in the file LGPL_EXCEPTION.txt in this 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 have questions regarding the use of this file, please contact
39** Nokia at [email protected].
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
50QT_BEGIN_HEADER
51
52QT_BEGIN_NAMESPACE
53
54QT_MODULE(Gui)
55
56QT_END_NAMESPACE
57
58// common typedefs from os2.h to avoid inclusion of qt_os2.h in public headers
59typedef long LONG;
60typedef unsigned long ULONG;
61typedef unsigned short USHORT;
62typedef unsigned long LHANDLE;
63typedef LHANDLE HWND;
64typedef LHANDLE HPS;
65typedef LHANDLE HBITMAP;
66typedef LHANDLE HPOINTER;
67typedef LHANDLE HRGN;
68typedef struct _QMSG QMSG;
69typedef void *MRESULT;
70
71typedef struct _RECTL RECTL;
72typedef RECTL *PRECTL;
73
74typedef HWND WId;
75
76#define NULLHANDLE ((LHANDLE)0)
77
78// constants to address extra window data (nothing so far)
79#define QT_EXTRAWINDATASIZE (sizeof(LONG) * 0)
80
81QT_BEGIN_NAMESPACE
82
83class QWidget;
84
85Q_GUI_EXPORT HPS qt_display_ps();
86
87Q_GUI_EXPORT int qt_display_width();
88Q_GUI_EXPORT int qt_display_height();
89
90Q_GUI_EXPORT QWidget *qt_widget_from_hwnd(HWND hwnd);
91
92/** \internal flags for qt_WinProcessWindowObstacles() */
93enum {
94 PWO_Children = 0x01,
95 PWO_Sibings = 0x02,
96 PWO_Ancestors = 0x04,
97 PWO_Screen = 0x08,
98 PWO_TopLevel = 0x80000000,
99 // PWO_Default is suitable in most cases (for simple paint operations)
100 PWO_Default = PWO_Children | PWO_Sibings | PWO_Ancestors | PWO_Screen,
101};
102
103Q_GUI_EXPORT LONG qt_WinProcessWindowObstacles(HWND hwnd, RECTL *prcl, HRGN hrgn,
104 LONG op, LONG flags = PWO_Default);
105
106// QDebug helpers for debugging various API types
107
108// don't drag qdebug.h but require it to be included first
109#if defined(QDEBUG_H) && !defined(QT_NO_DEBUG_STREAM)
110
111struct QDebugHWND { HWND hwnd; };
112inline QDebugHWND qDebugHWND(HWND hwnd) { QDebugHWND d = { hwnd }; return d; }
113Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QDebugHWND &d);
114
115struct QDebugHRGN { HRGN hrgn; };
116inline QDebugHRGN qDebugHRGN(HRGN hrgn) { QDebugHRGN d = { hrgn }; return d; }
117Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QDebugHRGN &d);
118
119// the following declarations require OS/2 types not defined here,
120// don't drag them in as well but require qt_os2.h to be included first
121#if defined(QT_OS2_H)
122
123Q_GUI_EXPORT QDebug operator<<(QDebug debug, const RECTL &rcl);
124Q_GUI_EXPORT QDebug operator<<(QDebug debug, const SWP &swp);
125Q_GUI_EXPORT QDebug operator<<(QDebug debug, const QMSG &qmsg);
126
127#endif // defined(QT_OS2_H)
128
129#endif // defined(QDEBUG_H) && !defined(QT_NO_DEBUG_STREAM)
130
131QT_END_NAMESPACE
132
133QT_END_HEADER
134
135#endif // QWINDOWDEFS_PM_H
Note: See TracBrowser for help on using the repository browser.