]>
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 | |
65571936 | 9 | // Licence: wxWindows licence |
9b6dbb09 JS |
10 | ///////////////////////////////////////////////////////////////////////////// |
11 | ||
12 | #ifndef _WX_APP_H_ | |
13 | #define _WX_APP_H_ | |
14 | ||
ee31c392 VZ |
15 | // ---------------------------------------------------------------------------- |
16 | // headers | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
9b6dbb09 | 19 | #include "wx/event.h" |
bdcade0a | 20 | #include "wx/hashmap.h" |
9b6dbb09 | 21 | |
ee31c392 VZ |
22 | // ---------------------------------------------------------------------------- |
23 | // forward declarations | |
24 | // ---------------------------------------------------------------------------- | |
25 | ||
9b6dbb09 JS |
26 | class WXDLLEXPORT wxFrame; |
27 | class WXDLLEXPORT wxWindow; | |
72cdf4c9 | 28 | class WXDLLEXPORT wxApp; |
9b6dbb09 JS |
29 | class WXDLLEXPORT wxKeyEvent; |
30 | class WXDLLEXPORT wxLog; | |
7e1bcfa8 | 31 | class WXDLLEXPORT wxEventLoop; |
9ce8d6a2 | 32 | class WXDLLEXPORT wxXVisualInfo; |
bdcade0a | 33 | class WXDLLEXPORT wxPerDisplayData; |
9b6dbb09 | 34 | |
ee31c392 VZ |
35 | // ---------------------------------------------------------------------------- |
36 | // the wxApp class for Motif - see wxAppBase for more details | |
37 | // ---------------------------------------------------------------------------- | |
9b6dbb09 | 38 | |
bdcade0a MB |
39 | WX_DECLARE_VOIDPTR_HASH_MAP( wxPerDisplayData*, wxPerDisplayDataMap ); |
40 | ||
ee31c392 | 41 | class WXDLLEXPORT wxApp : public wxAppBase |
9b6dbb09 | 42 | { |
83df96d6 JS |
43 | DECLARE_DYNAMIC_CLASS(wxApp) |
44 | ||
ee31c392 VZ |
45 | public: |
46 | wxApp(); | |
7e1bcfa8 | 47 | virtual ~wxApp(); |
83df96d6 | 48 | |
ee31c392 VZ |
49 | // override base class (pure) virtuals |
50 | // ----------------------------------- | |
83df96d6 | 51 | |
ee31c392 | 52 | virtual int MainLoop(); |
e2478fde VZ |
53 | |
54 | virtual void Exit(); | |
55 | ||
96be256b | 56 | virtual bool Yield(bool onlyIfNeeded = false); |
e2478fde | 57 | virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp |
83df96d6 | 58 | |
ee31c392 | 59 | virtual bool OnInitGui(); |
83df96d6 | 60 | |
ee31c392 VZ |
61 | // implementation from now on |
62 | // -------------------------- | |
83df96d6 | 63 | |
9b6dbb09 | 64 | protected: |
ee31c392 | 65 | bool m_showOnInit; |
83df96d6 | 66 | |
9b6dbb09 | 67 | public: |
ee31c392 | 68 | // Implementation |
05e2b077 | 69 | virtual bool Initialize(int& argc, wxChar **argv); |
94826170 | 70 | virtual void CleanUp(); |
83df96d6 | 71 | |
ee31c392 VZ |
72 | // Motif-specific |
73 | WXAppContext GetAppContext() const { return m_appContext; } | |
eb6fa4b4 | 74 | WXWidget GetTopLevelWidget(); |
5a2e3d8c | 75 | WXWidget GetTopLevelRealizedWidget(); |
72cdf4c9 | 76 | WXColormap GetMainColormap(WXDisplay* display); |
ee31c392 | 77 | WXDisplay* GetInitialDisplay() const { return m_initialDisplay; } |
eb6fa4b4 MB |
78 | |
79 | void SetTopLevelWidget(WXDisplay* display, WXWidget widget); | |
5a2e3d8c MB |
80 | void SetTopLevelRealizedWidget(WXDisplay* display, |
81 | WXWidget widget); | |
eb6fa4b4 | 82 | |
ee31c392 VZ |
83 | // This handler is called when a property change event occurs |
84 | virtual void HandlePropertyChange(WXEvent *event); | |
9ce8d6a2 MB |
85 | |
86 | wxXVisualInfo* GetVisualInfo(WXDisplay* display); | |
87 | ||
7e1bcfa8 | 88 | private: |
ee31c392 VZ |
89 | // Motif-specific |
90 | WXAppContext m_appContext; | |
ee31c392 VZ |
91 | WXColormap m_mainColormap; |
92 | WXDisplay* m_initialDisplay; | |
eb6fa4b4 | 93 | wxPerDisplayDataMap* m_perDisplayData; |
9ce8d6a2 | 94 | |
ee31c392 | 95 | DECLARE_EVENT_TABLE() |
9b6dbb09 JS |
96 | }; |
97 | ||
9b6dbb09 | 98 | #endif |
83df96d6 | 99 | // _WX_APP_H_ |
9b6dbb09 | 100 |