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