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