source: trunk/include/qt_os2.h

Last change on this file was 189, checked in by abwillis, 14 years ago

Ticket #52

  • Property svn:keywords set to Id
File size: 3.9 KB
Line 
1/****************************************************************************
2** $Id: qt_os2.h 189 2011-06-16 16:08:06Z abwillis $
3**
4** Includes OS/2 system header files.
5**
6** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
7** Copyright (C) 2004 Norman ASA. Initial OS/2 Port.
8** Copyright (C) 2005 netlabs.org. Further OS/2 Development.
9**
10** This file is part of the kernel module of the Qt GUI Toolkit.
11**
12** This file may be distributed under the terms of the Q Public License
13** as defined by Trolltech AS of Norway and appearing in the file
14** LICENSE.QPL included in the packaging of this file.
15**
16** This file may be distributed and/or modified under the terms of the
17** GNU General Public License version 2 as published by the Free Software
18** Foundation and appearing in the file LICENSE.GPL included in the
19** packaging of this file.
20**
21** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
22** licenses may use this file in accordance with the Qt Commercial License
23** Agreement provided with the Software.
24**
25** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
26** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
27**
28** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
29** information about Qt Commercial License Agreements.
30** See http://www.trolltech.com/qpl/ for QPL licensing information.
31** See http://www.trolltech.com/gpl/ for GPL licensing information.
32**
33** Contact info@trolltech.com if any conditions of this licensing are
34** not clear to you.
35**
36**********************************************************************/
37
38#ifndef QT_OS2_H
39#define QT_OS2_H
40
41#include "qwindowdefs.h"
42
43#define INCL_BASE
44#define INCL_PM
45#include <os2.h>
46
47// wrappers for each Win* and Gpi* call that restore the FPU Control Word
48#include <API_FPU_CW_Wrappers.h>
49
50// OS/2 system exception handler callback interface
51
52#if !defined(QT_OS2_NO_SYSEXCEPTIONS)
53
54enum QtOS2SysXcptReq
55{
56 QtOS2SysXcptReq_AppName = 0,
57 QtOS2SysXcptReq_AppVer = 1,
58 QtOS2SysXcptReq_ReportTo = 2,
59 QtOS2SysXcptReq_ReportSubj = 3,
60};
61
62typedef void (*QtOS2SysXcptWriter)( const char *str );
63typedef int (*QtOS2SysXcptCallback)( QtOS2SysXcptReq req,
64 QtOS2SysXcptWriter writer,
65 int reserved );
66
67class Q_EXPORT QtOS2SysXcptMainHandler
68{
69public:
70 QtOS2SysXcptMainHandler( QtOS2SysXcptCallback cb = NULL );
71 ~QtOS2SysXcptMainHandler();
72
73 class Private;
74
75private:
76 EXCEPTIONREGISTRATIONRECORD rec;
77
78 static bool installed;
79 static QtOS2SysXcptCallback callback;
80 static ERR libcHandler;
81
82 // @todo (r=dmik) Inntotek GCC/kLIBC v0.6.1 and earlier have a problem with
83 // __attribute__((__system__)) (see http://svn.netlabs.org/libc/ticket/129)
84 // so we have to temporarily comment out APIENTRY below, based on the fact
85 // that the OS/2 _System calling convention corresponds to cdecl in terms
86 // of argument order and stack cleanup. Once it's fixed, this should be
87 // guarded by #if __INNOTEK_LIBC__<=0x006...
88 static ULONG /* APIENTRY */ handler( PEXCEPTIONREPORTRECORD pReportRec,
89 PEXCEPTIONREGISTRATIONRECORD pRegRec,
90 PCONTEXTRECORD pContextRec,
91 PVOID pv );
92
93 friend class QtOS2SysXcptMainHandlerInternal;
94 friend class QThreadInstance;
95
96 // these are private to allow stack-based instances only
97 QtOS2SysXcptMainHandler( QtOS2SysXcptMainHandler &/*that*/ ) {}
98 QtOS2SysXcptMainHandler &operator =( QtOS2SysXcptMainHandler &/*that*/) {
99 return *this;
100 }
101 static void *operator new( size_t /*size*/ ) throw() { return NULL; }
102 static void operator delete( void */*memory*/ ) {}
103};
104
105#endif // !defined(QT_OS2_NO_SYSEXCEPTIONS)
106
107#endif // QT_OS2_H
Note: See TracBrowser for help on using the repository browser.