]>
Commit | Line | Data |
---|---|---|
0e320a79 | 1 | ///////////////////////////////////////////////////////////////////////////// |
80fdcdb9 | 2 | // Name: wx/os2/app.h |
0e320a79 | 3 | // Purpose: wxApp class |
d88de032 | 4 | // Author: David Webster |
0e320a79 | 5 | // Modified by: |
d88de032 | 6 | // Created: 10/13/99 |
d88de032 | 7 | // Copyright: (c) David Webster |
65571936 | 8 | // Licence: wxWindows licence |
0e320a79 DW |
9 | ///////////////////////////////////////////////////////////////////////////// |
10 | ||
11 | #ifndef _WX_APP_H_ | |
12 | #define _WX_APP_H_ | |
13 | ||
19193a2c KB |
14 | #ifdef __WATCOMC__ |
15 | ||
7e1e6965 | 16 | #include <types.h> |
19193a2c KB |
17 | #include <sys/ioctl.h> |
18 | #include <sys/select.h> | |
19 | ||
20 | #else | |
21 | ||
3958ae62 SN |
22 | #include <sys/time.h> |
23 | #include <sys/types.h> | |
29108552 DW |
24 | |
25 | #ifdef __EMX__ | |
3958ae62 | 26 | #include <unistd.h> |
29108552 DW |
27 | #else |
28 | #include <utils.h> | |
29 | #undef BYTE_ORDER | |
30 | #include <types.h> | |
29108552 DW |
31 | #define INCL_ORDERS |
32 | #endif | |
3958ae62 | 33 | |
19193a2c KB |
34 | #endif |
35 | ||
0e320a79 | 36 | #include "wx/event.h" |
d88de032 | 37 | #include "wx/icon.h" |
0e320a79 | 38 | |
b5dbe15d VS |
39 | class WXDLLIMPEXP_FWD_CORE wxFrame; |
40 | class WXDLLIMPEXP_FWD_CORE wxWindow; | |
41 | class WXDLLIMPEXP_FWD_CORE wxApp; | |
42 | class WXDLLIMPEXP_FWD_CORE wxKeyEvent; | |
4f7d425f | 43 | class WXDLLIMPEXP_FWD_BASE wxLog; |
0e320a79 | 44 | |
53a2db12 FM |
45 | WXDLLIMPEXP_DATA_CORE(extern wxApp*) wxTheApp; |
46 | WXDLLIMPEXP_DATA_CORE(extern HAB) vHabmain; | |
0e320a79 DW |
47 | |
48 | // Force an exit from main loop | |
53a2db12 | 49 | void WXDLLIMPEXP_CORE wxExit(void); |
0e320a79 DW |
50 | |
51 | // Yield to other apps/messages | |
53a2db12 | 52 | bool WXDLLIMPEXP_CORE wxYield(void); |
0e320a79 | 53 | |
8c5907ce DW |
54 | extern MRESULT EXPENTRY wxWndProc( HWND |
55 | ,ULONG | |
56 | ,MPARAM | |
57 | ,MPARAM | |
58 | ); | |
59 | ||
3958ae62 | 60 | |
0e320a79 DW |
61 | // Represents the application. Derive OnInit and declare |
62 | // a new App object to start application | |
53a2db12 | 63 | class WXDLLIMPEXP_CORE wxApp : public wxAppBase |
0e320a79 | 64 | { |
d88de032 | 65 | DECLARE_DYNAMIC_CLASS(wxApp) |
0e320a79 | 66 | |
d88de032 DW |
67 | public: |
68 | wxApp(); | |
69 | virtual ~wxApp(); | |
0e320a79 | 70 | |
d88de032 | 71 | // override base class (pure) virtuals |
598dc9b7 SN |
72 | virtual bool Initialize(int& argc, wxChar **argv); |
73 | virtual void CleanUp(void); | |
e2478fde | 74 | |
598dc9b7 | 75 | virtual bool OnInitGui(void); |
e2478fde | 76 | |
e2478fde | 77 | virtual void WakeUpIdle(void); |
0e320a79 | 78 | |
9ed0fac8 DW |
79 | virtual void SetPrintMode(int mode) { m_nPrintMode = mode; } |
80 | virtual int GetPrintMode(void) const { return m_nPrintMode; } | |
0e320a79 | 81 | |
d88de032 | 82 | // implementation only |
9ed0fac8 DW |
83 | void OnIdle(wxIdleEvent& rEvent); |
84 | void OnEndSession(wxCloseEvent& rEvent); | |
85 | void OnQueryEndSession(wxCloseEvent& rEvent); | |
0e320a79 | 86 | |
3958ae62 SN |
87 | int AddSocketHandler(int handle, int mask, |
88 | void (*callback)(void*), void * gsock); | |
89 | void RemoveSocketHandler(int handle); | |
90 | void HandleSockets(); | |
91 | ||
0e320a79 | 92 | protected: |
9ed0fac8 DW |
93 | bool m_bShowOnInit; |
94 | int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT | |
0e320a79 | 95 | |
9ed0fac8 DW |
96 | // |
97 | // PM-specific wxApp definitions */ | |
98 | // | |
3958ae62 | 99 | private: |
29108552 DW |
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; | |
3958ae62 | 106 | |
d88de032 | 107 | public: |
0e320a79 | 108 | |
d88de032 | 109 | // Implementation |
9ed0fac8 | 110 | static bool RegisterWindowClasses(HAB vHab); |
0e320a79 DW |
111 | |
112 | public: | |
9ed0fac8 | 113 | int m_nCmdShow; |
3958ae62 | 114 | HMQ m_hMq; |
0e320a79 DW |
115 | |
116 | protected: | |
d88de032 | 117 | DECLARE_EVENT_TABLE() |
c0c133e1 | 118 | wxDECLARE_NO_COPY_CLASS(wxApp); |
0e320a79 | 119 | }; |
0e320a79 DW |
120 | #endif |
121 | // _WX_APP_H_ |