X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/5c33522fca7cddc441a316f5b9fb50d7685435ba..058f225a44d83d42ba9d773efc705badbf0e5e3c:/include/wx/app.h?ds=sidebyside diff --git a/include/wx/app.h b/include/wx/app.h index 2efde737db..d4ff103779 100644 --- a/include/wx/app.h +++ b/include/wx/app.h @@ -221,6 +221,16 @@ public: virtual int FilterEvent(wxEvent& event); #if wxUSE_EXCEPTIONS + // execute the functor to handle the given event + // + // this is a generalization of HandleEvent() below and the base class + // implementation of CallEventHandler() still calls HandleEvent() for + // compatibility for functors which are just wxEventFunctions (i.e. methods + // of wxEvtHandler) + virtual void CallEventHandler(wxEvtHandler *handler, + wxEventFunctor& functor, + wxEvent& event) const; + // call the specified handler on the given object with the given event // // this method only exists to allow catching the exceptions thrown by any @@ -244,8 +254,8 @@ public: // (already) be dispatched static bool IsMainLoopRunning(); - // process all events in the wxPendingEvents list -- it is necessary to - // call this function to process posted events. This happens during each + // process all events in the wxHandlersWithPendingEvents list -- it is necessary + // to call this function to process posted events. This happens during each // event loop iteration in GUI mode but if there is no main loop, it may be // also called directly. virtual void ProcessPendingEvents(); @@ -454,6 +464,10 @@ public: // with _extreme_ care or, better, don't use at all! virtual bool Yield(bool onlyIfNeeded = false) = 0; + // returns true if the main thread is inside a Yield() call + bool IsYielding() const + { return m_isInsideYield; } + // this virtual function is called in the GUI mode when the application // becomes idle and normally just sends wxIdleEvent to all interested // parties @@ -576,6 +590,7 @@ protected: // does any of our windows have focus? bool m_isActive; + bool m_isInsideYield; DECLARE_NO_COPY_CLASS(wxAppBase) }; @@ -643,7 +658,7 @@ protected: // ------------------------------------------------------ // Force an exit from main loop -extern void WXDLLIMPEXP_BASE wxExit(); +WXDLLIMPEXP_BASE void wxExit(); // avoid redeclaring this function here if it had been already declated by // wx/utils.h, this results in warnings from g++ with -Wredundant-decls @@ -651,12 +666,12 @@ extern void WXDLLIMPEXP_BASE wxExit(); #define wx_YIELD_DECLARED // Yield to other apps/messages -extern bool WXDLLIMPEXP_BASE wxYield(); +WXDLLIMPEXP_CORE bool wxYield(); #endif // wx_YIELD_DECLARED // Yield to other apps/messages -extern void WXDLLIMPEXP_BASE wxWakeUpIdle(); +WXDLLIMPEXP_BASE void wxWakeUpIdle(); // ---------------------------------------------------------------------------- // macros for dynamic creation of the application object