]>
Commit | Line | Data |
---|---|---|
9b6dbb09 JS |
1 | ///////////////////////////////////////////////////////////////////////////// |
2 | // Name: app.h | |
3 | // Purpose: wxApp class | |
4 | // Author: Julian Smart | |
5 | // Modified by: | |
6 | // Created: 17/09/98 | |
7 | // RCS-ID: $Id$ | |
8 | // Copyright: (c) Julian Smart | |
9 | // Licence: wxWindows licence | |
10 | ///////////////////////////////////////////////////////////////////////////// | |
11 | ||
12 | #ifndef _WX_APP_H_ | |
13 | #define _WX_APP_H_ | |
14 | ||
15 | #ifdef __GNUG__ | |
83df96d6 | 16 | #pragma interface "app.h" |
9b6dbb09 JS |
17 | #endif |
18 | ||
ee31c392 VZ |
19 | // ---------------------------------------------------------------------------- |
20 | // headers | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
9b6dbb09 JS |
23 | #include "wx/event.h" |
24 | ||
ee31c392 VZ |
25 | // ---------------------------------------------------------------------------- |
26 | // forward declarations | |
27 | // ---------------------------------------------------------------------------- | |
28 | ||
9b6dbb09 JS |
29 | class WXDLLEXPORT wxFrame; |
30 | class WXDLLEXPORT wxWindow; | |
72cdf4c9 | 31 | class WXDLLEXPORT wxApp; |
9b6dbb09 JS |
32 | class WXDLLEXPORT wxKeyEvent; |
33 | class WXDLLEXPORT wxLog; | |
7e1bcfa8 | 34 | class WXDLLEXPORT wxEventLoop; |
9b6dbb09 | 35 | |
ee31c392 VZ |
36 | // ---------------------------------------------------------------------------- |
37 | // the wxApp class for Motif - see wxAppBase for more details | |
38 | // ---------------------------------------------------------------------------- | |
9b6dbb09 | 39 | |
ee31c392 | 40 | class WXDLLEXPORT wxApp : public wxAppBase |
9b6dbb09 | 41 | { |
83df96d6 JS |
42 | DECLARE_DYNAMIC_CLASS(wxApp) |
43 | ||
ee31c392 VZ |
44 | public: |
45 | wxApp(); | |
7e1bcfa8 | 46 | virtual ~wxApp(); |
83df96d6 | 47 | |
ee31c392 VZ |
48 | // override base class (pure) virtuals |
49 | // ----------------------------------- | |
83df96d6 | 50 | |
ee31c392 VZ |
51 | virtual int MainLoop(); |
52 | virtual void ExitMainLoop(); | |
53 | virtual bool Initialized(); | |
72cdf4c9 VZ |
54 | virtual bool Pending(); |
55 | virtual void Dispatch(); | |
8461e4c2 | 56 | virtual bool Yield(bool onlyIfNeeded = FALSE); |
90a1a975 | 57 | virtual bool ProcessIdle(); |
83df96d6 | 58 | |
ee31c392 | 59 | virtual bool OnInitGui(); |
83df96d6 | 60 | |
ee31c392 VZ |
61 | // implementation from now on |
62 | // -------------------------- | |
83df96d6 | 63 | |
ee31c392 | 64 | void OnIdle(wxIdleEvent& event); |
83df96d6 | 65 | |
ee31c392 VZ |
66 | // Send idle event to all top-level windows. |
67 | // Returns TRUE if more idle time is requested. | |
68 | bool SendIdleEvents(); | |
83df96d6 | 69 | |
ee31c392 VZ |
70 | // Send idle event to window and all subwindows |
71 | // Returns TRUE if more idle time is requested. | |
72 | bool SendIdleEvents(wxWindow* win); | |
83df96d6 | 73 | |
9b6dbb09 | 74 | protected: |
ee31c392 | 75 | bool m_showOnInit; |
83df96d6 | 76 | |
9b6dbb09 | 77 | public: |
ee31c392 VZ |
78 | // Implementation |
79 | static bool Initialize(); | |
80 | static void CleanUp(); | |
83df96d6 | 81 | |
ee31c392 | 82 | void DeletePendingObjects(); |
83df96d6 | 83 | |
ee31c392 VZ |
84 | // Motif-specific |
85 | WXAppContext GetAppContext() const { return m_appContext; } | |
86 | WXWidget GetTopLevelWidget() const { return m_topLevelWidget; } | |
72cdf4c9 | 87 | WXColormap GetMainColormap(WXDisplay* display); |
ee31c392 VZ |
88 | WXDisplay* GetInitialDisplay() const { return m_initialDisplay; } |
89 | long GetMaxRequestSize() const { return m_maxRequestSize; } | |
83df96d6 | 90 | |
ee31c392 VZ |
91 | // This handler is called when a property change event occurs |
92 | virtual void HandlePropertyChange(WXEvent *event); | |
83df96d6 | 93 | |
7e1bcfa8 | 94 | private: |
ee31c392 VZ |
95 | static long sm_lastMessageTime; |
96 | int m_nCmdShow; | |
7e1bcfa8 MB |
97 | |
98 | wxEventLoop* m_eventLoop; | |
83df96d6 | 99 | |
ee31c392 VZ |
100 | // Motif-specific |
101 | WXAppContext m_appContext; | |
102 | WXWidget m_topLevelWidget; | |
103 | WXColormap m_mainColormap; | |
104 | WXDisplay* m_initialDisplay; | |
105 | long m_maxRequestSize; | |
83df96d6 | 106 | |
ee31c392 | 107 | DECLARE_EVENT_TABLE() |
9b6dbb09 JS |
108 | }; |
109 | ||
110 | int WXDLLEXPORT wxEntry( int argc, char *argv[] ); | |
111 | ||
112 | #endif | |
83df96d6 | 113 | // _WX_APP_H_ |
9b6dbb09 | 114 |