]>
Commit | Line | Data |
---|---|---|
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__ | |
16 | #pragma interface "app.h" | |
17 | #endif | |
18 | ||
19 | // ---------------------------------------------------------------------------- | |
20 | // headers | |
21 | // ---------------------------------------------------------------------------- | |
22 | ||
23 | #include "wx/gdicmn.h" | |
24 | #include "wx/event.h" | |
25 | ||
26 | // ---------------------------------------------------------------------------- | |
27 | // forward declarations | |
28 | // ---------------------------------------------------------------------------- | |
29 | ||
30 | class WXDLLEXPORT wxFrame; | |
31 | class WXDLLEXPORT wxWindow; | |
32 | class WXDLLEXPORT wxApp; | |
33 | class WXDLLEXPORT wxKeyEvent; | |
34 | class WXDLLEXPORT wxLog; | |
35 | ||
36 | // ---------------------------------------------------------------------------- | |
37 | // the wxApp class for Motif - see wxAppBase for more details | |
38 | // ---------------------------------------------------------------------------- | |
39 | ||
40 | class WXDLLEXPORT wxApp : public wxAppBase | |
41 | { | |
42 | DECLARE_DYNAMIC_CLASS(wxApp) | |
43 | ||
44 | public: | |
45 | wxApp(); | |
46 | ~wxApp() {} | |
47 | ||
48 | // override base class (pure) virtuals | |
49 | // ----------------------------------- | |
50 | ||
51 | virtual int MainLoop(); | |
52 | virtual void ExitMainLoop(); | |
53 | virtual bool Initialized(); | |
54 | virtual bool Pending(); | |
55 | virtual void Dispatch(); | |
56 | virtual bool Yield(bool onlyIfNeeded = FALSE); | |
57 | virtual bool ProcessIdle(); | |
58 | ||
59 | virtual bool OnInitGui(); | |
60 | ||
61 | // implementation from now on | |
62 | // -------------------------- | |
63 | ||
64 | void OnIdle(wxIdleEvent& event); | |
65 | ||
66 | // Send idle event to all top-level windows. | |
67 | // Returns TRUE if more idle time is requested. | |
68 | bool SendIdleEvents(); | |
69 | ||
70 | // Send idle event to window and all subwindows | |
71 | // Returns TRUE if more idle time is requested. | |
72 | bool SendIdleEvents(wxWindow* win); | |
73 | ||
74 | // Motif implementation. | |
75 | ||
76 | // Processes an X event. | |
77 | virtual void ProcessXEvent(WXEvent* event); | |
78 | ||
79 | // Returns TRUE if an accelerator has been processed | |
80 | virtual bool CheckForAccelerator(WXEvent* event); | |
81 | ||
82 | // Returns TRUE if a key down event has been processed | |
83 | virtual bool CheckForKeyDown(WXEvent* event); | |
84 | ||
85 | // Returns TRUE if a key up event has been processed | |
86 | virtual bool CheckForKeyUp(WXEvent* event); | |
87 | ||
88 | protected: | |
89 | bool m_showOnInit; | |
90 | ||
91 | public: | |
92 | // Implementation | |
93 | static bool Initialize(); | |
94 | static void CleanUp(); | |
95 | ||
96 | void DeletePendingObjects(); | |
97 | ||
98 | // Motif-specific | |
99 | WXAppContext GetAppContext() const { return m_appContext; } | |
100 | WXWidget GetTopLevelWidget() const { return m_topLevelWidget; } | |
101 | WXColormap GetMainColormap(WXDisplay* display); | |
102 | WXDisplay* GetInitialDisplay() const { return m_initialDisplay; } | |
103 | long GetMaxRequestSize() const { return m_maxRequestSize; } | |
104 | ||
105 | // This handler is called when a property change event occurs | |
106 | virtual void HandlePropertyChange(WXEvent *event); | |
107 | ||
108 | public: | |
109 | static long sm_lastMessageTime; | |
110 | int m_nCmdShow; | |
111 | ||
112 | protected: | |
113 | bool m_keepGoing; | |
114 | ||
115 | // Motif-specific | |
116 | WXAppContext m_appContext; | |
117 | WXWidget m_topLevelWidget; | |
118 | WXColormap m_mainColormap; | |
119 | WXDisplay* m_initialDisplay; | |
120 | long m_maxRequestSize; | |
121 | ||
122 | DECLARE_EVENT_TABLE() | |
123 | }; | |
124 | ||
125 | int WXDLLEXPORT wxEntry( int argc, char *argv[] ); | |
126 | ||
127 | #endif | |
128 | // _WX_APP_H_ | |
129 |