]>
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; |
9ce8d6a2 | 35 | class WXDLLEXPORT wxXVisualInfo; |
eb6fa4b4 | 36 | class wxPerDisplayDataMap; |
9b6dbb09 | 37 | |
ee31c392 VZ |
38 | // ---------------------------------------------------------------------------- |
39 | // the wxApp class for Motif - see wxAppBase for more details | |
40 | // ---------------------------------------------------------------------------- | |
9b6dbb09 | 41 | |
ee31c392 | 42 | class WXDLLEXPORT wxApp : public wxAppBase |
9b6dbb09 | 43 | { |
83df96d6 JS |
44 | DECLARE_DYNAMIC_CLASS(wxApp) |
45 | ||
ee31c392 VZ |
46 | public: |
47 | wxApp(); | |
7e1bcfa8 | 48 | virtual ~wxApp(); |
83df96d6 | 49 | |
ee31c392 VZ |
50 | // override base class (pure) virtuals |
51 | // ----------------------------------- | |
83df96d6 | 52 | |
ee31c392 VZ |
53 | virtual int MainLoop(); |
54 | virtual void ExitMainLoop(); | |
55 | virtual bool Initialized(); | |
72cdf4c9 VZ |
56 | virtual bool Pending(); |
57 | virtual void Dispatch(); | |
e2478fde VZ |
58 | |
59 | virtual void Exit(); | |
60 | ||
8461e4c2 | 61 | virtual bool Yield(bool onlyIfNeeded = FALSE); |
90a1a975 | 62 | virtual bool ProcessIdle(); |
e2478fde | 63 | virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp |
83df96d6 | 64 | |
ee31c392 | 65 | virtual bool OnInitGui(); |
83df96d6 | 66 | |
ee31c392 VZ |
67 | // implementation from now on |
68 | // -------------------------- | |
83df96d6 | 69 | |
ee31c392 | 70 | void OnIdle(wxIdleEvent& event); |
83df96d6 | 71 | |
ee31c392 VZ |
72 | // Send idle event to all top-level windows. |
73 | // Returns TRUE if more idle time is requested. | |
74 | bool SendIdleEvents(); | |
83df96d6 | 75 | |
ee31c392 VZ |
76 | // Send idle event to window and all subwindows |
77 | // Returns TRUE if more idle time is requested. | |
78 | bool SendIdleEvents(wxWindow* win); | |
83df96d6 | 79 | |
9b6dbb09 | 80 | protected: |
ee31c392 | 81 | bool m_showOnInit; |
83df96d6 | 82 | |
9b6dbb09 | 83 | public: |
ee31c392 | 84 | // Implementation |
05e2b077 | 85 | virtual bool Initialize(int& argc, wxChar **argv); |
94826170 | 86 | virtual void CleanUp(); |
83df96d6 | 87 | |
ee31c392 VZ |
88 | // Motif-specific |
89 | WXAppContext GetAppContext() const { return m_appContext; } | |
eb6fa4b4 | 90 | WXWidget GetTopLevelWidget(); |
72cdf4c9 | 91 | WXColormap GetMainColormap(WXDisplay* display); |
ee31c392 | 92 | WXDisplay* GetInitialDisplay() const { return m_initialDisplay; } |
eb6fa4b4 MB |
93 | |
94 | void SetTopLevelWidget(WXDisplay* display, WXWidget widget); | |
95 | ||
ee31c392 VZ |
96 | // This handler is called when a property change event occurs |
97 | virtual void HandlePropertyChange(WXEvent *event); | |
9ce8d6a2 MB |
98 | |
99 | wxXVisualInfo* GetVisualInfo(WXDisplay* display); | |
100 | ||
7e1bcfa8 | 101 | private: |
7e1bcfa8 | 102 | wxEventLoop* m_eventLoop; |
83df96d6 | 103 | |
ee31c392 VZ |
104 | // Motif-specific |
105 | WXAppContext m_appContext; | |
ee31c392 VZ |
106 | WXColormap m_mainColormap; |
107 | WXDisplay* m_initialDisplay; | |
eb6fa4b4 | 108 | wxPerDisplayDataMap* m_perDisplayData; |
9ce8d6a2 | 109 | |
ee31c392 | 110 | DECLARE_EVENT_TABLE() |
9b6dbb09 JS |
111 | }; |
112 | ||
9b6dbb09 | 113 | #endif |
83df96d6 | 114 | // _WX_APP_H_ |
9b6dbb09 | 115 |