1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
16 #pragma interface "app.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
24 #include "wx/hashmap.h"
26 // ----------------------------------------------------------------------------
27 // forward declarations
28 // ----------------------------------------------------------------------------
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
;
39 // ----------------------------------------------------------------------------
40 // the wxApp class for Motif - see wxAppBase for more details
41 // ----------------------------------------------------------------------------
43 WX_DECLARE_VOIDPTR_HASH_MAP( wxPerDisplayData
*, wxPerDisplayDataMap
);
45 class WXDLLEXPORT wxApp
: public wxAppBase
47 DECLARE_DYNAMIC_CLASS(wxApp
)
53 // override base class (pure) virtuals
54 // -----------------------------------
56 virtual int MainLoop();
60 virtual bool Yield(bool onlyIfNeeded
= false);
61 virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp
63 virtual bool OnInitGui();
65 // implementation from now on
66 // --------------------------
73 virtual bool Initialize(int& argc
, wxChar
**argv
);
74 virtual void CleanUp();
77 WXAppContext
GetAppContext() const { return m_appContext
; }
78 WXWidget
GetTopLevelWidget();
79 WXWidget
GetTopLevelRealizedWidget();
80 WXColormap
GetMainColormap(WXDisplay
* display
);
81 WXDisplay
* GetInitialDisplay() const { return m_initialDisplay
; }
83 void SetTopLevelWidget(WXDisplay
* display
, WXWidget widget
);
84 void SetTopLevelRealizedWidget(WXDisplay
* display
,
87 // This handler is called when a property change event occurs
88 virtual void HandlePropertyChange(WXEvent
*event
);
90 wxXVisualInfo
* GetVisualInfo(WXDisplay
* display
);
94 WXAppContext m_appContext
;
95 WXColormap m_mainColormap
;
96 WXDisplay
* m_initialDisplay
;
97 wxPerDisplayDataMap
* m_perDisplayData
;