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
;
36 // ----------------------------------------------------------------------------
37 // the wxApp class for Motif - see wxAppBase for more details
38 // ----------------------------------------------------------------------------
40 class WXDLLEXPORT wxApp
: public wxAppBase
42 DECLARE_DYNAMIC_CLASS(wxApp
)
48 // override base class (pure) virtuals
49 // -----------------------------------
51 virtual int MainLoop();
52 virtual void ExitMainLoop();
53 virtual bool Initialized();
54 virtual bool Pending();
55 virtual void Dispatch();
56 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
57 virtual bool ProcessIdle();
59 virtual bool OnInitGui();
61 // implementation from now on
62 // --------------------------
64 void OnIdle(wxIdleEvent
& event
);
66 // Send idle event to all top-level windows.
67 // Returns TRUE if more idle time is requested.
68 bool SendIdleEvents();
70 // Send idle event to window and all subwindows
71 // Returns TRUE if more idle time is requested.
72 bool SendIdleEvents(wxWindow
* win
);
79 static bool Initialize();
80 static void CleanUp();
82 void DeletePendingObjects();
85 WXAppContext
GetAppContext() const { return m_appContext
; }
86 WXWidget
GetTopLevelWidget() const { return m_topLevelWidget
; }
87 WXColormap
GetMainColormap(WXDisplay
* display
);
88 WXDisplay
* GetInitialDisplay() const { return m_initialDisplay
; }
89 long GetMaxRequestSize() const { return m_maxRequestSize
; }
91 // This handler is called when a property change event occurs
92 virtual void HandlePropertyChange(WXEvent
*event
);
95 static long sm_lastMessageTime
;
98 wxEventLoop
* m_eventLoop
;
101 WXAppContext m_appContext
;
102 WXWidget m_topLevelWidget
;
103 WXColormap m_mainColormap
;
104 WXDisplay
* m_initialDisplay
;
105 long m_maxRequestSize
;
107 DECLARE_EVENT_TABLE()
110 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );