1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: wxApp class
4 // Author: Julian Smart
8 // Copyright: (c) Julian Smart
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
16 #pragma interface "app.h"
19 // ----------------------------------------------------------------------------
21 // ----------------------------------------------------------------------------
25 // ----------------------------------------------------------------------------
26 // forward declarations
27 // ----------------------------------------------------------------------------
29 class WXDLLEXPORT wxFrame
;
30 class WXDLLEXPORT wxWindow
;
31 class WXDLLEXPORT wxApp
;
32 class WXDLLEXPORT wxKeyEvent
;
33 class WXDLLEXPORT wxLog
;
34 class WXDLLEXPORT wxEventLoop
;
35 class WXDLLEXPORT wxXVisualInfo
;
36 class wxXVisualInfoMap
;
38 // ----------------------------------------------------------------------------
39 // the wxApp class for Motif - 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();
58 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
59 virtual bool ProcessIdle();
61 virtual bool OnInitGui();
63 // implementation from now on
64 // --------------------------
66 void OnIdle(wxIdleEvent
& event
);
68 // Send idle event to all top-level windows.
69 // Returns TRUE if more idle time is requested.
70 bool SendIdleEvents();
72 // Send idle event to window and all subwindows
73 // Returns TRUE if more idle time is requested.
74 bool SendIdleEvents(wxWindow
* win
);
81 static bool Initialize();
82 static void CleanUp();
84 void DeletePendingObjects();
87 WXAppContext
GetAppContext() const { return m_appContext
; }
88 WXWidget
GetTopLevelWidget() const { return m_topLevelWidget
; }
89 WXColormap
GetMainColormap(WXDisplay
* display
);
90 WXDisplay
* GetInitialDisplay() const { return m_initialDisplay
; }
91 long GetMaxRequestSize() const { return m_maxRequestSize
; }
93 // This handler is called when a property change event occurs
94 virtual void HandlePropertyChange(WXEvent
*event
);
96 wxXVisualInfo
* GetVisualInfo(WXDisplay
* display
);
99 static long sm_lastMessageTime
;
102 wxEventLoop
* m_eventLoop
;
105 WXAppContext m_appContext
;
106 WXWidget m_topLevelWidget
;
107 WXColormap m_mainColormap
;
108 WXDisplay
* m_initialDisplay
;
109 long m_maxRequestSize
;
110 wxXVisualInfoMap
* m_visualInfoMap
;
112 DECLARE_EVENT_TABLE()
115 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );