]>
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 | |
0e320a79 | 46 | WXDLLEXPORT_DATA(extern wxApp*) wxTheApp; |
43543d98 | 47 | WXDLLEXPORT_DATA(extern HAB) vHabmain; |
0e320a79 DW |
48 | |
49 | // Force an exit from main loop | |
9ed0fac8 | 50 | void WXDLLEXPORT wxExit(void); |
0e320a79 DW |
51 | |
52 | // Yield to other apps/messages | |
9ed0fac8 | 53 | bool WXDLLEXPORT 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 | |
d88de032 | 64 | class WXDLLEXPORT 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 | |
7e1e6965 | 78 | virtual bool Yield(bool onlyIfNeeded = false); |
e2478fde | 79 | virtual void WakeUpIdle(void); |
0e320a79 | 80 | |
9ed0fac8 DW |
81 | virtual void SetPrintMode(int mode) { m_nPrintMode = mode; } |
82 | virtual int GetPrintMode(void) const { return m_nPrintMode; } | |
0e320a79 | 83 | |
d88de032 | 84 | // implementation only |
9ed0fac8 DW |
85 | void OnIdle(wxIdleEvent& rEvent); |
86 | void OnEndSession(wxCloseEvent& rEvent); | |
87 | void OnQueryEndSession(wxCloseEvent& rEvent); | |
0e320a79 | 88 | |
3958ae62 SN |
89 | int AddSocketHandler(int handle, int mask, |
90 | void (*callback)(void*), void * gsock); | |
91 | void RemoveSocketHandler(int handle); | |
92 | void HandleSockets(); | |
93 | ||
0e320a79 | 94 | protected: |
9ed0fac8 DW |
95 | bool m_bShowOnInit; |
96 | int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT | |
0e320a79 | 97 | |
9ed0fac8 DW |
98 | // |
99 | // PM-specific wxApp definitions */ | |
100 | // | |
3958ae62 | 101 | private: |
29108552 DW |
102 | int m_maxSocketHandles; |
103 | int m_maxSocketNr; | |
104 | int m_lastUsedHandle; | |
105 | fd_set m_readfds; | |
106 | fd_set m_writefds; | |
107 | void* m_sockCallbackInfo; | |
3958ae62 | 108 | |
d88de032 | 109 | public: |
0e320a79 | 110 | |
d88de032 | 111 | // Implementation |
9ed0fac8 | 112 | static bool RegisterWindowClasses(HAB vHab); |
0e320a79 DW |
113 | |
114 | public: | |
9ed0fac8 | 115 | int m_nCmdShow; |
3958ae62 | 116 | HMQ m_hMq; |
0e320a79 DW |
117 | |
118 | protected: | |
d88de032 | 119 | DECLARE_EVENT_TABLE() |
598dc9b7 | 120 | DECLARE_NO_COPY_CLASS(wxApp) |
0e320a79 | 121 | }; |
0e320a79 DW |
122 | #endif |
123 | // _WX_APP_H_ |