app.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/x11/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_X11_APP_H_
  11. #define _WX_X11_APP_H_
  12. // ----------------------------------------------------------------------------
  13. // headers
  14. // ----------------------------------------------------------------------------
  15. #include "wx/gdicmn.h"
  16. #include "wx/event.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 wxXVisualInfo;
  26. // ----------------------------------------------------------------------------
  27. // the wxApp class for wxX11 - see wxAppBase for more details
  28. // ----------------------------------------------------------------------------
  29. class WXDLLIMPEXP_CORE wxApp : public wxAppBase
  30. {
  31. public:
  32. wxApp();
  33. virtual ~wxApp();
  34. // override base class (pure) virtuals
  35. // -----------------------------------
  36. virtual void Exit();
  37. virtual void WakeUpIdle();
  38. virtual bool OnInitGui();
  39. // implementation from now on
  40. // --------------------------
  41. // Processes an X event.
  42. virtual bool ProcessXEvent(WXEvent* event);
  43. public:
  44. // Implementation
  45. virtual bool Initialize(int& argc, wxChar **argv);
  46. virtual void CleanUp();
  47. WXWindow GetTopLevelWidget() const { return m_topLevelWidget; }
  48. WXColormap GetMainColormap(WXDisplay* display);
  49. long GetMaxRequestSize() const { return m_maxRequestSize; }
  50. // This handler is called when a property change event occurs
  51. virtual bool HandlePropertyChange(WXEvent *event);
  52. // Values that can be passed on the command line.
  53. // Returns -1, -1 if none specified.
  54. const wxSize& GetInitialSize() const { return m_initialSize; }
  55. bool GetShowIconic() const { return m_showIconic; }
  56. #if wxUSE_UNICODE
  57. // Global context for Pango layout. Either use X11
  58. // or use Xft rendering according to GDK_USE_XFT
  59. // environment variable
  60. PangoContext* GetPangoContext();
  61. #endif
  62. wxXVisualInfo* GetVisualInfo(WXDisplay* WXUNUSED(display))
  63. {
  64. // this should be implemented correctly for wxBitmap to work
  65. // with multiple display
  66. return m_visualInfo;
  67. }
  68. public:
  69. static long sm_lastMessageTime;
  70. bool m_showIconic;
  71. wxSize m_initialSize;
  72. #if !wxUSE_NANOX
  73. wxXVisualInfo* m_visualInfo;
  74. #endif
  75. protected:
  76. WXWindow m_topLevelWidget;
  77. WXColormap m_mainColormap;
  78. long m_maxRequestSize;
  79. DECLARE_DYNAMIC_CLASS(wxApp)
  80. };
  81. #endif // _WX_X11_APP_H_