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 int MainLoop();
53 virtual void ExitMainLoop();
54 virtual bool Initialized();
55 virtual bool Pending();
56 virtual void Dispatch();
60 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
61 virtual void WakeUpIdle();
63 virtual bool OnInitGui();
65 // implementation from now on
66 // --------------------------
68 // Processes an X event.
69 virtual bool ProcessXEvent(WXEvent
* event
);
72 virtual void OnAssert(const wxChar
*file
, int line
, const wxChar
* cond
, const wxChar
*msg
);
80 virtual bool Initialize(int& argc
, wxChar
**argv
);
81 virtual void CleanUp();
83 WXWindow
GetTopLevelWidget() const { return m_topLevelWidget
; }
84 WXColormap
GetMainColormap(WXDisplay
* display
);
85 long GetMaxRequestSize() const { return m_maxRequestSize
; }
87 // This handler is called when a property change event occurs
88 virtual bool HandlePropertyChange(WXEvent
*event
);
90 // Values that can be passed on the command line.
91 // Returns -1, -1 if none specified.
92 const wxSize
& GetInitialSize() const { return m_initialSize
; }
93 bool GetShowIconic() const { return m_showIconic
; }
96 // Global context for Pango layout. Either use X11
97 // or use Xft rendering according to GDK_USE_XFT
98 // environment variable
99 PangoContext
* GetPangoContext();
102 wxXVisualInfo
* GetVisualInfo(WXDisplay
* display
)
104 // this should be implemented correctly for wxBitmap to work
105 // with multiple display
109 // We need this before creating the app
110 static WXDisplay
* GetDisplay() { return ms_display
; }
111 static WXDisplay
* ms_display
;
114 static long sm_lastMessageTime
;
116 wxSize m_initialSize
;
119 wxXVisualInfo
* m_visualInfo
;
125 WXWindow m_topLevelWidget
;
126 WXColormap m_mainColormap
;
127 long m_maxRequestSize
;
129 DECLARE_EVENT_TABLE()