// Author: Vadim Zeitlin
// Copyright: (C) 2008 Vadim Zeitlin
// RCS-ID: $Id$
-// Licence: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
/**
Base class for all event loop implementations.
+ An event loop is a class which queries the queue of native events sent
+ to the wxWidgets application and dispatches them to the appropriate
+ wxEvtHandlers.
+
An object of this class is created by wxAppTraits::CreateEventLoop() and
used by wxApp to run the main application event loop.
+ Temporary event loops are usually created by wxDialog::ShowModal().
+
+ You can create your own event loop if you need, provided that you restore
+ the main event loop once yours is destroyed (see wxEventLoopActivator).
@library{wxbase}
@category{appmanagement}
Called by wxEventLoopActivator, use an instance of this class instead
of calling this method directly to ensure that the previously active
event loop is restored.
+
+ Results in a call to wxAppConsole::OnEventLoopEnter.
*/
static void SetActive(wxEventLoopBase* loop);
+ /**
+ Returns @true if this is the main loop executed by wxApp::OnRun().
+ */
+ bool IsMain() const;
+
/**
@name Dispatch and processing
//@}
- /**
- @name Pending events
- */
- //@{
-
- /**
- Process all pending events; it is necessary to call this function to
- process posted events.
-
- This happens during each event loop iteration in GUI mode but
- it may be also called directly.
- */
- virtual void ProcessPendingEvents();
-
- /**
- Returns @true if there are pending events on the internal pending event list.
- */
- bool HasPendingEvents() const;
-
- /**
- Temporary suspends processing of the pending events.
-
- @see ResumeProcessingOfPendingEvents()
- */
- void SuspendProcessingOfPendingEvents();
-
- /**
- Resume processing of the pending events previously stopped because of a
- call to SuspendProcessingOfPendingEvents().
- */
- void ResumeProcessingOfPendingEvents();
-
- //@}
-
-
/**
@name Idle handling
*/
//@{
/**
- Returns @true if called from inside Yield().
+ Returns @true if called from inside Yield() or from inside YieldFor().
*/
virtual bool IsYielding() const;
happens normally (because of Exit() call) or abnormally (because of an
exception thrown from inside the loop).
- Default version does nothing.
+ The default implementation calls wxAppConsole::OnEventLoopExit.
*/
virtual void OnExit();
};
*/
~wxEventLoopActivator();
};
+
+/**
+ @class wxGUIEventLoop
+
+ A generic implementation of the GUI event loop.
+
+ @library{wxbase}
+ @category{appmanagement}
+*/
+class wxGUIEventLoop : public wxEventLoopBase
+{
+public:
+ wxGUIEventLoop();
+ virtual ~wxGUIEventLoop();
+};
+
+