]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/app.h
Destroy the wxDialog::ShowWindowModalThenDo() functor a.s.a.p.
[wxWidgets.git] / include / wx / os2 / app.h
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: wx/os2/app.h
3 // Purpose: wxApp class
4 // Author: David Webster
5 // Modified by:
6 // Created: 10/13/99
7 // Copyright: (c) David Webster
8 // Licence: wxWindows licence
9 /////////////////////////////////////////////////////////////////////////////
10
11 #ifndef _WX_APP_H_
12 #define _WX_APP_H_
13
14 #ifdef __WATCOMC__
15
16 #include <types.h>
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 WXDLLIMPEXP_FWD_CORE wxFrame;
40 class WXDLLIMPEXP_FWD_CORE wxWindow;
41 class WXDLLIMPEXP_FWD_CORE wxApp;
42 class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
43 class WXDLLIMPEXP_FWD_BASE wxLog;
44
45 WXDLLIMPEXP_DATA_CORE(extern wxApp*) wxTheApp;
46 WXDLLIMPEXP_DATA_CORE(extern HAB) vHabmain;
47
48 // Force an exit from main loop
49 void WXDLLIMPEXP_CORE wxExit(void);
50
51 // Yield to other apps/messages
52 bool WXDLLIMPEXP_CORE 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 WXDLLIMPEXP_CORE 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 void WakeUpIdle(void);
78
79 virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
80 virtual int GetPrintMode(void) const { return m_nPrintMode; }
81
82 // implementation only
83 void OnIdle(wxIdleEvent& rEvent);
84 void OnEndSession(wxCloseEvent& rEvent);
85 void OnQueryEndSession(wxCloseEvent& rEvent);
86
87 int AddSocketHandler(int handle, int mask,
88 void (*callback)(void*), void * gsock);
89 void RemoveSocketHandler(int handle);
90 void HandleSockets();
91
92 protected:
93 bool m_bShowOnInit;
94 int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
95
96 //
97 // PM-specific wxApp definitions */
98 //
99 private:
100 int m_maxSocketHandles;
101 int m_maxSocketNr;
102 int m_lastUsedHandle;
103 fd_set m_readfds;
104 fd_set m_writefds;
105 void* m_sockCallbackInfo;
106
107 public:
108
109 // Implementation
110 static bool RegisterWindowClasses(HAB vHab);
111
112 public:
113 int m_nCmdShow;
114 HMQ m_hMq;
115
116 protected:
117 DECLARE_EVENT_TABLE()
118 wxDECLARE_NO_COPY_CLASS(wxApp);
119 };
120 #endif
121 // _WX_APP_H_