]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/app.h
compilation fix for VC6 after last change; use wx naming conventions
[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 <types.h>
18 #include <sys/ioctl.h>
19 #include <sys/select.h>
20
21 #else
22
23 #include <sys/time.h>
24 #include <sys/types.h>
25
26 #ifdef __EMX__
27 #include <unistd.h>
28 #else
29 #include <utils.h>
30 #undef BYTE_ORDER
31 #include <types.h>
32 #define INCL_ORDERS
33 #endif
34
35 #endif
36
37 #include "wx/event.h"
38 #include "wx/icon.h"
39
40 class WXDLLIMPEXP_FWD_CORE wxFrame;
41 class WXDLLIMPEXP_FWD_CORE wxWindow;
42 class WXDLLIMPEXP_FWD_CORE wxApp;
43 class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
44 class WXDLLIMPEXP_FWD_BASE wxLog;
45
46 WXDLLIMPEXP_DATA_CORE(extern wxApp*) wxTheApp;
47 WXDLLIMPEXP_DATA_CORE(extern HAB) vHabmain;
48
49 // Force an exit from main loop
50 void WXDLLIMPEXP_CORE wxExit(void);
51
52 // Yield to other apps/messages
53 bool WXDLLIMPEXP_CORE wxYield(void);
54
55 extern MRESULT EXPENTRY wxWndProc( HWND
56 ,ULONG
57 ,MPARAM
58 ,MPARAM
59 );
60
61
62 // Represents the application. Derive OnInit and declare
63 // a new App object to start application
64 class WXDLLIMPEXP_CORE wxApp : public wxAppBase
65 {
66 DECLARE_DYNAMIC_CLASS(wxApp)
67
68 public:
69 wxApp();
70 virtual ~wxApp();
71
72 // override base class (pure) virtuals
73 virtual bool Initialize(int& argc, wxChar **argv);
74 virtual void CleanUp(void);
75
76 virtual bool OnInitGui(void);
77
78 virtual bool Yield(bool onlyIfNeeded = false);
79 virtual void WakeUpIdle(void);
80
81 virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
82 virtual int GetPrintMode(void) const { return m_nPrintMode; }
83
84 // implementation only
85 void OnIdle(wxIdleEvent& rEvent);
86 void OnEndSession(wxCloseEvent& rEvent);
87 void OnQueryEndSession(wxCloseEvent& rEvent);
88
89 int AddSocketHandler(int handle, int mask,
90 void (*callback)(void*), void * gsock);
91 void RemoveSocketHandler(int handle);
92 void HandleSockets();
93
94 protected:
95 bool m_bShowOnInit;
96 int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
97
98 //
99 // PM-specific wxApp definitions */
100 //
101 private:
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;
108
109 public:
110
111 // Implementation
112 static bool RegisterWindowClasses(HAB vHab);
113
114 public:
115 int m_nCmdShow;
116 HMQ m_hMq;
117
118 protected:
119 DECLARE_EVENT_TABLE()
120 DECLARE_NO_COPY_CLASS(wxApp)
121 };
122 #endif
123 // _WX_APP_H_