]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/app.h
backport wxRegConfig enumeration fix
[wxWidgets.git] / include / wx / os2 / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: app.h
3 // Purpose: wxApp class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/13/99
7 // RCS-ID: $Id$
8 // Copyright: (c) David Webster
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11
12 #ifndef _WX_APP_H_
13 #define _WX_APP_H_
14
15 #ifdef __WATCOMC__
16
17 #include <sys/ioctl.h>
18 #include <sys/select.h>
19
20 #else
21
22 #include <sys/time.h>
23 #include <sys/types.h>
24
25 #ifdef __EMX__
26 #include <unistd.h>
27 #else
28 #include <utils.h>
29 #undef BYTE_ORDER
30 #include <types.h>
31 #define INCL_ORDERS
32 #endif
33
34 #endif
35
36 #include "wx/event.h"
37 #include "wx/icon.h"
38
39 class WXDLLEXPORT wxFrame;
40 class WXDLLEXPORT wxWindow;
41 class WXDLLEXPORT wxApp;
42 class WXDLLEXPORT wxKeyEvent;
43 class WXDLLEXPORT wxLog;
44
45 WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
46 WXDLLEXPORT_DATA(extern HAB) vHabmain;
47
48 // Force an exit from main loop
49 void WXDLLEXPORT wxExit(void);
50
51 // Yield to other apps/messages
52 bool WXDLLEXPORT wxYield(void);
53
54 extern MRESULT EXPENTRY wxWndProc( HWND
55 ,ULONG
56 ,MPARAM
57 ,MPARAM
58 );
59
60
61 // Represents the application. Derive OnInit and declare
62 // a new App object to start application
63 class WXDLLEXPORT wxApp : public wxAppBase
64 {
65 DECLARE_DYNAMIC_CLASS(wxApp)
66
67 public:
68 wxApp();
69 virtual ~wxApp();
70
71 // override base class (pure) virtuals
72 virtual bool Initialize(int& argc, wxChar **argv);
73 virtual void CleanUp(void);
74
75 virtual bool OnInitGui(void);
76
77 virtual bool Yield(bool onlyIfNeeded = FALSE);
78 virtual void WakeUpIdle(void);
79
80 virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
81 virtual int GetPrintMode(void) const { return m_nPrintMode; }
82
83 // implementation only
84 void OnIdle(wxIdleEvent& rEvent);
85 void OnEndSession(wxCloseEvent& rEvent);
86 void OnQueryEndSession(wxCloseEvent& rEvent);
87
88 int AddSocketHandler(int handle, int mask,
89 void (*callback)(void*), void * gsock);
90 void RemoveSocketHandler(int handle);
91 void HandleSockets();
92
93 protected:
94 bool m_bShowOnInit;
95 int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
96
97 //
98 // PM-specific wxApp definitions */
99 //
100 private:
101 int m_maxSocketHandles;
102 int m_maxSocketNr;
103 int m_lastUsedHandle;
104 fd_set m_readfds;
105 fd_set m_writefds;
106 void* m_sockCallbackInfo;
107
108 public:
109
110 // Implementation
111 static bool RegisterWindowClasses(HAB vHab);
112
113 public:
114 int m_nCmdShow;
115 HMQ m_hMq;
116
117 protected:
118 DECLARE_EVENT_TABLE()
119 DECLARE_NO_COPY_CLASS(wxApp)
120 };
121 #endif
122 // _WX_APP_H_
123