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