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