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