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