]> git.saurik.com Git - wxWidgets.git/blob - include/wx/motif/app.h
use base class implementation
[wxWidgets.git] / include / wx / motif / app.h
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/event.h"
24
25 // ----------------------------------------------------------------------------
26 // forward declarations
27 // ----------------------------------------------------------------------------
28
29 class WXDLLEXPORT wxFrame;
30 class WXDLLEXPORT wxWindow;
31 class WXDLLEXPORT wxApp;
32 class WXDLLEXPORT wxKeyEvent;
33 class WXDLLEXPORT wxLog;
34 class WXDLLEXPORT wxEventLoop;
35 class WXDLLEXPORT wxXVisualInfo;
36 class wxPerDisplayDataMap;
37
38 // ----------------------------------------------------------------------------
39 // the wxApp class for Motif - see wxAppBase for more details
40 // ----------------------------------------------------------------------------
41
42 class WXDLLEXPORT wxApp : public wxAppBase
43 {
44 DECLARE_DYNAMIC_CLASS(wxApp)
45
46 public:
47 wxApp();
48 virtual ~wxApp();
49
50 // override base class (pure) virtuals
51 // -----------------------------------
52
53 virtual int MainLoop();
54
55 virtual void Exit();
56
57 virtual bool Yield(bool onlyIfNeeded = FALSE);
58 virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp
59
60 virtual bool OnInitGui();
61
62 // implementation from now on
63 // --------------------------
64
65 protected:
66 bool m_showOnInit;
67
68 public:
69 // Implementation
70 virtual bool Initialize(int& argc, wxChar **argv);
71 virtual void CleanUp();
72
73 // Motif-specific
74 WXAppContext GetAppContext() const { return m_appContext; }
75 WXWidget GetTopLevelWidget();
76 WXColormap GetMainColormap(WXDisplay* display);
77 WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
78
79 void SetTopLevelWidget(WXDisplay* display, WXWidget widget);
80
81 // This handler is called when a property change event occurs
82 virtual void HandlePropertyChange(WXEvent *event);
83
84 wxXVisualInfo* GetVisualInfo(WXDisplay* display);
85
86 private:
87 // Motif-specific
88 WXAppContext m_appContext;
89 WXColormap m_mainColormap;
90 WXDisplay* m_initialDisplay;
91 wxPerDisplayDataMap* m_perDisplayData;
92
93 DECLARE_EVENT_TABLE()
94 };
95
96 #endif
97 // _WX_APP_H_
98