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