1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
15 #if defined(__GNUG__) && !defined(__APPLE__)
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 wxEventLoop
;
36 class WXDLLEXPORT wxXVisualInfo
;
38 // ----------------------------------------------------------------------------
39 // the wxApp class for wxX11 - see wxAppBase for more details
40 // ----------------------------------------------------------------------------
42 class WXDLLEXPORT wxApp
: public wxAppBase
44 DECLARE_DYNAMIC_CLASS(wxApp
)
50 // override base class (pure) virtuals
51 // -----------------------------------
53 virtual int MainLoop();
54 virtual void ExitMainLoop();
55 virtual bool Initialized();
56 virtual bool Pending();
57 virtual void Dispatch();
61 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
62 virtual void WakeUpIdle();
64 virtual bool OnInitGui();
66 // implementation from now on
67 // --------------------------
69 void OnIdle(wxIdleEvent
& event
);
71 // Processes an X event.
72 virtual bool ProcessXEvent(WXEvent
* event
);
75 virtual void OnAssert(const wxChar
*file
, int line
, const wxChar
* cond
, const wxChar
*msg
);
83 virtual bool Initialize(int& argc
, wxChar
**argv
);
84 virtual void CleanUp();
86 WXWindow
GetTopLevelWidget() const { return m_topLevelWidget
; }
87 WXColormap
GetMainColormap(WXDisplay
* display
);
88 long GetMaxRequestSize() const { return m_maxRequestSize
; }
90 // This handler is called when a property change event occurs
91 virtual bool HandlePropertyChange(WXEvent
*event
);
93 // Values that can be passed on the command line.
94 // Returns -1, -1 if none specified.
95 const wxSize
& GetInitialSize() const { return m_initialSize
; }
96 bool GetShowIconic() const { return m_showIconic
; }
99 // Global context for Pango layout. Either use X11
100 // or use Xft rendering according to GDK_USE_XFT
101 // environment variable
102 PangoContext
* GetPangoContext();
105 wxXVisualInfo
* GetVisualInfo(WXDisplay
* display
)
107 // this should be implemented correctly for wxBitmap to work
108 // with multiple display
112 // We need this before creating the app
113 static WXDisplay
* GetDisplay() { return ms_display
; }
114 static WXDisplay
* ms_display
;
117 static long sm_lastMessageTime
;
119 wxSize m_initialSize
;
122 wxXVisualInfo
* m_visualInfo
;
128 WXWindow m_topLevelWidget
;
129 WXColormap m_mainColormap
;
130 long m_maxRequestSize
;
131 wxEventLoop
* m_mainLoop
;
133 DECLARE_EVENT_TABLE()