#ifndef _WX_OSX_EVTLOOP_H_
#define _WX_OSX_EVTLOOP_H_
-typedef struct __CFRunLoop * CFRunLoopRef;
+DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoop );
+DECLARE_WXOSX_OPAQUE_CFREF( CFRunLoopObserver );
class WXDLLIMPEXP_BASE wxCFEventLoop : public wxEventLoopBase
{
// sets the "should exit" flag and wakes up the loop so that it terminates
// soon
virtual void Exit(int rc = 0);
-
+
// return true if any events are available
virtual bool Pending() const;
AddSourceForFD(int fd, wxEventLoopSourceHandler *handler, int flags);
#endif // wxUSE_EVENTLOOP_SOURCE
+ void ObserverCallBack(CFRunLoopObserverRef observer, int activity);
+
protected:
// get the currently executing CFRunLoop
virtual CFRunLoopRef CFGetCurrentRunLoop() const;
virtual int DoDispatchTimeout(unsigned long timeout);
+
+ virtual void DoRun();
- double m_sleepTime;
-
+ virtual void DoStop();
+
// should we exit the loop?
bool m_shouldExit;
// the loop exit code
int m_exitcode;
-
+
+ // cfrunloop
+ CFRunLoopRef m_runLoop;
+
+ // runloop observer
+ CFRunLoopObserverRef m_runLoopObserver;
+
private:
// process all already pending events and dispatch a new one (blocking
// until it appears in the event queue if necessary)
};
#if wxUSE_GUI
- #ifdef __WXOSX_COCOA__
- #include "wx/osx/cocoa/evtloop.h"
- #else
- #include "wx/osx/carbon/evtloop.h"
- #endif
+
+#ifdef __WXOSX_COCOA__
+ #include "wx/osx/cocoa/evtloop.h"
+#else
+ #include "wx/osx/carbon/evtloop.h"
+#endif
+
+class WXDLLIMPEXP_FWD_CORE wxWindow;
+class WXDLLIMPEXP_FWD_CORE wxNonOwnedWindow;
+
+class WXDLLIMPEXP_CORE wxModalEventLoop : public wxGUIEventLoop
+{
+public:
+ wxModalEventLoop(wxWindow *modalWindow);
+ wxModalEventLoop(WXWindow modalNativeWindow);
+
+protected:
+ virtual void DoRun();
+
+ virtual void DoStop();
+
+ // (in case) the modal window for this event loop
+ wxNonOwnedWindow* m_modalWindow;
+ WXWindow m_modalNativeWindow;
+};
+
#endif // wxUSE_GUI
#endif // _WX_OSX_EVTLOOP_H_