1 ///////////////////////////////////////////////////////////////////////////// 2 // Name: wx/motif/app.h 3 // Purpose: wxApp class 4 // Author: Julian Smart 5 // Modified by: 6 // Created: 17/09/98 7 // Copyright: (c) Julian Smart 8 // Licence: wxWindows licence 9 ///////////////////////////////////////////////////////////////////////////// 10 11 #ifndef _WX_APP_H_ 12 #define _WX_APP_H_ 13 14 // ---------------------------------------------------------------------------- 15 // headers 16 // ---------------------------------------------------------------------------- 17 18 #include "wx/event.h" 19 #include "wx/hashmap.h" 20 21 // ---------------------------------------------------------------------------- 22 // forward declarations 23 // ---------------------------------------------------------------------------- 24 25 class WXDLLIMPEXP_FWD_CORE wxFrame; 26 class WXDLLIMPEXP_FWD_CORE wxWindow; 27 class WXDLLIMPEXP_FWD_CORE wxApp; 28 class WXDLLIMPEXP_FWD_CORE wxKeyEvent; 29 class WXDLLIMPEXP_FWD_BASE wxLog; 30 class WXDLLIMPEXP_FWD_CORE wxEventLoop; 31 class WXDLLIMPEXP_FWD_CORE wxXVisualInfo; 32 class WXDLLIMPEXP_FWD_CORE wxPerDisplayData; 33 34 // ---------------------------------------------------------------------------- 35 // the wxApp class for Motif - see wxAppBase for more details 36 // ---------------------------------------------------------------------------- 37 38 WX_DECLARE_VOIDPTR_HASH_MAP( wxPerDisplayData*, wxPerDisplayDataMap ); 39 40 class WXDLLIMPEXP_CORE wxApp : public wxAppBase 41 { 42 DECLARE_DYNAMIC_CLASS(wxApp) 43 44 public: 45 wxApp(); 46 virtual ~wxApp(); 47 48 // override base class (pure) virtuals 49 // ----------------------------------- 50 51 virtual int MainLoop(); 52 53 virtual void Exit(); 54 55 virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp 56 57 // implementation from now on 58 // -------------------------- 59 60 protected: 61 bool m_showOnInit; 62 63 public: 64 // Implementation 65 virtual bool Initialize(int& argc, wxChar **argv); 66 virtual void CleanUp(); 67 68 // Motif-specific GetAppContext()69 WXAppContext GetAppContext() const { return m_appContext; } 70 WXWidget GetTopLevelWidget(); 71 WXWidget GetTopLevelRealizedWidget(); 72 WXColormap GetMainColormap(WXDisplay* display); GetInitialDisplay()73 WXDisplay* GetInitialDisplay() const { return m_initialDisplay; } 74 75 void SetTopLevelWidget(WXDisplay* display, WXWidget widget); 76 void SetTopLevelRealizedWidget(WXDisplay* display, 77 WXWidget widget); 78 79 // This handler is called when a property change event occurs 80 virtual void HandlePropertyChange(WXEvent *event); 81 82 wxXVisualInfo* GetVisualInfo(WXDisplay* display); 83 84 private: 85 // Motif-specific 86 WXAppContext m_appContext; 87 WXColormap m_mainColormap; 88 WXDisplay* m_initialDisplay; 89 wxPerDisplayDataMap* m_perDisplayData; 90 }; 91 92 #endif 93 // _WX_APP_H_ 94