]> git.saurik.com Git - wxWidgets.git/blob - include/wx/os2/app.h
Replaced typedef with #define for VC++ 1.5, to prevent 'no constructor' error
[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 #include <sys/time.h>
16 #include <sys/types.h>
17
18 #ifdef __EMX__
19 #include <unistd.h>
20 #else
21 #include <utils.h>
22 #undef BYTE_ORDER
23 #include <types.h>
24 #include <nerrno.h>
25 #define INCL_ORDERS
26 #endif
27
28 #include "wx/event.h"
29 #include "wx/icon.h"
30
31 class WXDLLEXPORT wxFrame;
32 class WXDLLEXPORT wxWindow;
33 class WXDLLEXPORT wxApp;
34 class WXDLLEXPORT wxKeyEvent;
35 class WXDLLEXPORT wxLog;
36
37 WXDLLEXPORT_DATA(extern wxApp*) wxTheApp;
38 WXDLLEXPORT_DATA(extern HAB) vHabmain;
39
40 // Force an exit from main loop
41 void WXDLLEXPORT wxExit(void);
42
43 // Yield to other apps/messages
44 bool WXDLLEXPORT wxYield(void);
45
46 extern MRESULT EXPENTRY wxWndProc( HWND
47 ,ULONG
48 ,MPARAM
49 ,MPARAM
50 );
51
52
53 // Represents the application. Derive OnInit and declare
54 // a new App object to start application
55 class WXDLLEXPORT wxApp : public wxAppBase
56 {
57 DECLARE_DYNAMIC_CLASS(wxApp)
58
59 public:
60 wxApp();
61 virtual ~wxApp();
62
63 virtual bool OnInitGui(void);
64
65 // override base class (pure) virtuals
66 virtual int MainLoop(void);
67 virtual void ExitMainLoop(void);
68 virtual bool Initialized(void);
69 virtual bool Pending(void) ;
70 virtual void Dispatch(void);
71
72 virtual wxIcon GetStdIcon(int which) const;
73
74 virtual void SetPrintMode(int mode) { m_nPrintMode = mode; }
75 virtual int GetPrintMode(void) const { return m_nPrintMode; }
76
77 // implementation only
78 void OnIdle(wxIdleEvent& rEvent);
79 void OnEndSession(wxCloseEvent& rEvent);
80 void OnQueryEndSession(wxCloseEvent& rEvent);
81
82 // Send idle event to all top-level windows.
83 // Returns TRUE if more idle time is requested.
84 bool SendIdleEvents(void);
85
86 // Send idle event to window and all subwindows
87 // Returns TRUE if more idle time is requested.
88 bool SendIdleEvents(wxWindow* pWin);
89
90 void SetAuto3D(bool bFlag) { m_bAuto3D = bFlag; }
91 bool GetAuto3D(void) const { return m_bAuto3D; }
92
93 int AddSocketHandler(int handle, int mask,
94 void (*callback)(void*), void * gsock);
95 void RemoveSocketHandler(int handle);
96 void HandleSockets();
97
98 protected:
99 bool m_bShowOnInit;
100 int m_nPrintMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT
101 bool m_bAuto3D ; // Always use 3D controls, except where overriden
102
103 //
104 // PM-specific wxApp definitions */
105 //
106 private:
107 int m_maxSocketHandles;
108 int m_maxSocketNr;
109 int m_lastUsedHandle;
110 fd_set m_readfds;
111 fd_set m_writefds;
112 void* m_sockCallbackInfo;
113
114 public:
115
116 // Implementation
117 static bool Initialize(HAB vHab);
118 static void CleanUp(void);
119
120 static bool RegisterWindowClasses(HAB vHab);
121 virtual bool DoMessage(void);
122 virtual bool ProcessMessage(WXMSG* pMsg);
123 void DeletePendingObjects(void);
124 bool ProcessIdle(void);
125
126 public:
127 int m_nCmdShow;
128 HMQ m_hMq;
129
130 protected:
131 bool m_bKeepGoing ;
132
133 DECLARE_EVENT_TABLE()
134 };
135
136 int WXDLLEXPORT wxEntry( int argc, char *argv[] );
137 #endif
138 // _WX_APP_H_
139