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