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 // ----------------------------------------------------------------------------
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
;
37 // ----------------------------------------------------------------------------
38 // the wxApp class for Motif - 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();
57 virtual bool Yield(bool onlyIfNeeded
= FALSE
);
59 virtual bool OnInitGui();
61 virtual wxIcon
GetStdIcon(int which
) const;
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
);
76 // Processes an X event.
77 virtual void ProcessXEvent(WXEvent
* event
);
79 // Returns TRUE if an accelerator has been processed
80 virtual bool CheckForAccelerator(WXEvent
* event
);
87 static bool Initialize();
88 static void CleanUp();
90 void DeletePendingObjects();
93 WXWindow
GetTopLevelWidget() const { return m_topLevelWidget
; }
94 WXColormap
GetMainColormap(WXDisplay
* display
);
95 WXDisplay
* GetInitialDisplay() const { return m_initialDisplay
; }
96 long GetMaxRequestSize() const { return m_maxRequestSize
; }
98 // This handler is called when a property change event occurs
99 virtual void HandlePropertyChange(WXEvent
*event
);
102 static long sm_lastMessageTime
;
108 WXWindow m_topLevelWidget
;
109 WXColormap m_mainColormap
;
110 WXDisplay
* m_initialDisplay
;
111 long m_maxRequestSize
;
112 wxEventLoop
* m_mainLoop
;
114 DECLARE_EVENT_TABLE()
117 int WXDLLEXPORT
wxEntry( int argc
, char *argv
[] );