app.h 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. #ifndef _WX_APP_H_
  11. #define _WX_APP_H_
  12. // ----------------------------------------------------------------------------
  13. // headers
  14. // ----------------------------------------------------------------------------
  15. #include "wx/event.h"
  16. #include "wx/hashmap.h"
  17. // ----------------------------------------------------------------------------
  18. // forward declarations
  19. // ----------------------------------------------------------------------------
  20. class WXDLLIMPEXP_FWD_CORE wxFrame;
  21. class WXDLLIMPEXP_FWD_CORE wxWindow;
  22. class WXDLLIMPEXP_FWD_CORE wxApp;
  23. class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
  24. class WXDLLIMPEXP_FWD_BASE wxLog;
  25. class WXDLLIMPEXP_FWD_CORE wxEventLoop;
  26. class WXDLLIMPEXP_FWD_CORE wxXVisualInfo;
  27. class WXDLLIMPEXP_FWD_CORE wxPerDisplayData;
  28. // ----------------------------------------------------------------------------
  29. // the wxApp class for Motif - see wxAppBase for more details
  30. // ----------------------------------------------------------------------------
  31. WX_DECLARE_VOIDPTR_HASH_MAP( wxPerDisplayData*, wxPerDisplayDataMap );
  32. class WXDLLIMPEXP_CORE wxApp : public wxAppBase
  33. {
  34. DECLARE_DYNAMIC_CLASS(wxApp)
  35. public:
  36. wxApp();
  37. virtual ~wxApp();
  38. // override base class (pure) virtuals
  39. // -----------------------------------
  40. virtual int MainLoop();
  41. virtual void Exit();
  42. virtual void WakeUpIdle(); // implemented in motif/evtloop.cpp
  43. // implementation from now on
  44. // --------------------------
  45. protected:
  46. bool m_showOnInit;
  47. public:
  48. // Implementation
  49. virtual bool Initialize(int& argc, wxChar **argv);
  50. virtual void CleanUp();
  51. // Motif-specific
  52. WXAppContext GetAppContext() const { return m_appContext; }
  53. WXWidget GetTopLevelWidget();
  54. WXWidget GetTopLevelRealizedWidget();
  55. WXColormap GetMainColormap(WXDisplay* display);
  56. WXDisplay* GetInitialDisplay() const { return m_initialDisplay; }
  57. void SetTopLevelWidget(WXDisplay* display, WXWidget widget);
  58. void SetTopLevelRealizedWidget(WXDisplay* display,
  59. WXWidget widget);
  60. // This handler is called when a property change event occurs
  61. virtual void HandlePropertyChange(WXEvent *event);
  62. wxXVisualInfo* GetVisualInfo(WXDisplay* display);
  63. private:
  64. // Motif-specific
  65. WXAppContext m_appContext;
  66. WXColormap m_mainColormap;
  67. WXDisplay* m_initialDisplay;
  68. wxPerDisplayDataMap* m_perDisplayData;
  69. };
  70. #endif
  71. // _WX_APP_H_