]>
Commit | Line | Data |
---|---|---|
2bda0e17 KB |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: app.h | |
3 | // Purpose: wxApp class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 01/02/97 | |
7 | // RCS-ID: $Id$ | |
bbcdf8bc JS |
8 | // Copyright: (c) Julian Smart |
9 | // Licence: wxWindows licence | |
2bda0e17 KB |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
bbcdf8bc JS |
12 | #ifndef _WX_APP_H_ |
13 | #define _WX_APP_H_ | |
2bda0e17 KB |
14 | |
15 | #ifdef __GNUG__ | |
16 | #pragma interface "app.h" | |
17 | #endif | |
18 | ||
a3ef5bf5 | 19 | #include "wx/event.h" |
ebea0891 | 20 | #include "wx/icon.h" |
2bda0e17 KB |
21 | |
22 | class WXDLLEXPORT wxFrame; | |
23 | class WXDLLEXPORT wxWindow; | |
24 | class WXDLLEXPORT wxApp ; | |
25 | class WXDLLEXPORT wxKeyEvent; | |
26 | class WXDLLEXPORT wxLog; | |
27 | ||
2bda0e17 KB |
28 | // Represents the application. Derive OnInit and declare |
29 | // a new App object to start application | |
094637f6 | 30 | class WXDLLEXPORT wxApp : public wxAppBase |
2bda0e17 | 31 | { |
094637f6 | 32 | DECLARE_DYNAMIC_CLASS(wxApp) |
c085e333 | 33 | |
094637f6 VZ |
34 | public: |
35 | wxApp(); | |
36 | virtual ~wxApp(); | |
580c10e3 | 37 | |
094637f6 | 38 | // override base class (pure) virtuals |
05e2b077 | 39 | virtual bool Initialize(int& argc, wxChar **argv); |
94826170 VZ |
40 | virtual void CleanUp(); |
41 | ||
094637f6 VZ |
42 | virtual int MainLoop(); |
43 | virtual void ExitMainLoop(); | |
44 | virtual bool Initialized(); | |
1e6feb95 VZ |
45 | virtual bool Pending(); |
46 | virtual void Dispatch(); | |
e2478fde | 47 | |
8461e4c2 | 48 | virtual bool Yield(bool onlyIfNeeded = FALSE); |
90a1a975 | 49 | virtual bool ProcessIdle(); |
e2478fde | 50 | virtual void WakeUpIdle(); |
2bda0e17 | 51 | |
094637f6 VZ |
52 | virtual void SetPrintMode(int mode) { m_printMode = mode; } |
53 | virtual int GetPrintMode() const { return m_printMode; } | |
2bda0e17 | 54 | |
094637f6 VZ |
55 | // implementation only |
56 | void OnIdle(wxIdleEvent& event); | |
57 | void OnEndSession(wxCloseEvent& event); | |
58 | void OnQueryEndSession(wxCloseEvent& event); | |
2bda0e17 | 59 | |
094637f6 VZ |
60 | // Send idle event to all top-level windows. |
61 | // Returns TRUE if more idle time is requested. | |
62 | bool SendIdleEvents(); | |
2bda0e17 | 63 | |
094637f6 VZ |
64 | // Send idle event to window and all subwindows |
65 | // Returns TRUE if more idle time is requested. | |
66 | bool SendIdleEvents(wxWindow* win); | |
4e066dd2 | 67 | |
2bda0e17 | 68 | protected: |
1e6feb95 | 69 | int m_printMode; // wxPRINT_WINDOWS, wxPRINT_POSTSCRIPT |
094637f6 VZ |
70 | |
71 | /* Windows-specific wxApp definitions */ | |
2bda0e17 KB |
72 | |
73 | public: | |
74 | ||
094637f6 | 75 | // Implementation |
094637f6 | 76 | static bool RegisterWindowClasses(); |
9787a4b6 | 77 | static bool UnregisterWindowClasses(); |
ed45e263 | 78 | |
ed45e263 VZ |
79 | // message processing |
80 | // ------------------ | |
81 | ||
82 | // process the given message | |
83 | virtual void DoMessage(WXMSG *pMsg); | |
84 | ||
85 | // retrieve the next message from the queue and process it | |
094637f6 | 86 | virtual bool DoMessage(); |
ed45e263 VZ |
87 | |
88 | // preprocess the message | |
094637f6 | 89 | virtual bool ProcessMessage(WXMSG* pMsg); |
ed45e263 VZ |
90 | |
91 | // idle processing | |
92 | // --------------- | |
93 | ||
6d167489 VZ |
94 | #if wxUSE_RICHEDIT |
95 | // initialize the richedit DLL of (at least) given version, return TRUE if | |
96 | // ok (Win95 has version 1, Win98/NT4 has 1 and 2, W2K has 3) | |
97 | static bool InitRichEdit(int version = 2); | |
98 | #endif // wxUSE_RICHEDIT | |
99 | ||
100 | // returns 400, 470, 471 for comctl32.dll 4.00, 4.70, 4.71 or 0 if it | |
101 | // wasn't found at all | |
102 | static int GetComCtl32Version(); | |
2bda0e17 KB |
103 | |
104 | public: | |
94826170 VZ |
105 | // the SW_XXX value to be used for the frames opened by the application |
106 | // (currently seems unused which is a bug -- TODO) | |
107 | static int m_nCmdShow; | |
2bda0e17 KB |
108 | |
109 | protected: | |
94826170 VZ |
110 | // we exit the main event loop when this flag becomes false |
111 | bool m_keepGoing; | |
2bda0e17 | 112 | |
094637f6 | 113 | DECLARE_EVENT_TABLE() |
2bda0e17 KB |
114 | }; |
115 | ||
8f177c8e | 116 | int WXDLLEXPORT wxEntry(WXHINSTANCE hInstance, WXHINSTANCE hPrevInstance, |
94826170 | 117 | char *lpszCmdLine, int nCmdShow); |
2bda0e17 | 118 | |
94826170 | 119 | #endif // _WX_APP_H_ |
2bda0e17 | 120 |