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 // ----------------------------------------------------------------------------
23 #include "wx/gdicmn.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 wxXVisualInfo
;
37 // ----------------------------------------------------------------------------
38 // the wxApp class for wxX11 - see wxAppBase for more details
39 // ----------------------------------------------------------------------------
41 class WXDLLEXPORT wxApp
: public wxAppBase
43 DECLARE_DYNAMIC_CLASS(wxApp
)
49 // override base class (pure) virtuals
50 // -----------------------------------
52 virtual bool Initialized();
56 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
57 virtual void WakeUpIdle();
59 virtual bool OnInitGui();
61 // implementation from now on
62 // --------------------------
64 // Processes an X event.
65 virtual bool ProcessXEvent(WXEvent
* event
);
68 virtual void OnAssert(const wxChar
*file
, int line
, const wxChar
* cond
, const wxChar
*msg
);
76 virtual bool Initialize(int& argc
, wxChar
**argv
);
77 virtual void CleanUp();
79 WXWindow
GetTopLevelWidget() const { return m_topLevelWidget
; }
80 WXColormap
GetMainColormap(WXDisplay
* display
);
81 long GetMaxRequestSize() const { return m_maxRequestSize
; }
83 // This handler is called when a property change event occurs
84 virtual bool HandlePropertyChange(WXEvent
*event
);
86 // Values that can be passed on the command line.
87 // Returns -1, -1 if none specified.
88 const wxSize
& GetInitialSize() const { return m_initialSize
; }
89 bool GetShowIconic() const { return m_showIconic
; }
92 // Global context for Pango layout. Either use X11
93 // or use Xft rendering according to GDK_USE_XFT
94 // environment variable
95 PangoContext
* GetPangoContext();
98 wxXVisualInfo
* GetVisualInfo(WXDisplay
* display
)
100 // this should be implemented correctly for wxBitmap to work
101 // with multiple display
105 // We need this before creating the app
106 static WXDisplay
* GetDisplay() { return ms_display
; }
107 static WXDisplay
* ms_display
;
110 static long sm_lastMessageTime
;
112 wxSize m_initialSize
;
115 wxXVisualInfo
* m_visualInfo
;
121 WXWindow m_topLevelWidget
;
122 WXColormap m_mainColormap
;
123 long m_maxRequestSize
;
125 DECLARE_EVENT_TABLE()