1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 #include "wx/gdicmn.h"
22 // ----------------------------------------------------------------------------
23 // forward declarations
24 // ----------------------------------------------------------------------------
26 class WXDLLEXPORT wxFrame
;
27 class WXDLLEXPORT wxWindow
;
28 class WXDLLEXPORT wxApp
;
29 class WXDLLEXPORT wxKeyEvent
;
30 class WXDLLEXPORT wxLog
;
31 class WXDLLEXPORT wxXVisualInfo
;
33 // ----------------------------------------------------------------------------
34 // the wxApp class for wxX11 - see wxAppBase for more details
35 // ----------------------------------------------------------------------------
37 class WXDLLEXPORT wxApp
: public wxAppBase
39 DECLARE_DYNAMIC_CLASS(wxApp
)
45 // override base class (pure) virtuals
46 // -----------------------------------
50 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
51 virtual void WakeUpIdle();
53 virtual bool OnInitGui();
55 // implementation from now on
56 // --------------------------
58 // Processes an X event.
59 virtual bool ProcessXEvent(WXEvent
* event
);
62 virtual void OnAssert(const wxChar
*file
, int line
, const wxChar
* cond
, const wxChar
*msg
);
70 virtual bool Initialize(int& argc
, wxChar
**argv
);
71 virtual void CleanUp();
73 WXWindow
GetTopLevelWidget() const { return m_topLevelWidget
; }
74 WXColormap
GetMainColormap(WXDisplay
* display
);
75 long GetMaxRequestSize() const { return m_maxRequestSize
; }
77 // This handler is called when a property change event occurs
78 virtual bool HandlePropertyChange(WXEvent
*event
);
80 // Values that can be passed on the command line.
81 // Returns -1, -1 if none specified.
82 const wxSize
& GetInitialSize() const { return m_initialSize
; }
83 bool GetShowIconic() const { return m_showIconic
; }
86 // Global context for Pango layout. Either use X11
87 // or use Xft rendering according to GDK_USE_XFT
88 // environment variable
89 PangoContext
* GetPangoContext();
92 wxXVisualInfo
* GetVisualInfo(WXDisplay
* display
)
94 // this should be implemented correctly for wxBitmap to work
95 // with multiple display
99 // We need this before creating the app
100 static WXDisplay
* GetDisplay() { return ms_display
; }
101 static WXDisplay
* ms_display
;
104 static long sm_lastMessageTime
;
106 wxSize m_initialSize
;
109 wxXVisualInfo
* m_visualInfo
;
115 WXWindow m_topLevelWidget
;
116 WXColormap m_mainColormap
;
117 long m_maxRequestSize
;
119 DECLARE_EVENT_TABLE()