1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/osx/evtloopsrc.h
3 // Purpose: wxCFEventLoopSource class
4 // Author: Vadim Zeitlin
6 // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_OSX_EVTLOOPSRC_H_
11 #define _WX_OSX_EVTLOOPSRC_H_
13 typedef struct __CFSocket
* CFSocketRef
;
15 // ----------------------------------------------------------------------------
16 // wxCFEventLoopSource: CoreFoundation-based wxEventLoopSource for OS X
17 // ----------------------------------------------------------------------------
19 class WXDLLIMPEXP_BASE wxCFEventLoopSource
: public wxEventLoopSource
22 // Create a new source in uninitialized state, call InitSocketRef() later
23 // to associate it with the socket it is going to use.
24 wxCFEventLoopSource(wxEventLoopSourceHandler
*handler
, int flags
)
25 : wxEventLoopSource(handler
, flags
)
30 // Finish initialization of the event loop source by providing the
31 // associated socket. This object takes ownership of it and will release it.
32 void InitSourceSocket(CFSocketRef cfSocket
);
34 // Destructor deletes the associated socket.
35 virtual ~wxCFEventLoopSource();
38 CFSocketRef m_cfSocket
;
40 wxDECLARE_NO_COPY_CLASS(wxCFEventLoopSource
);
43 #endif // _WX_OSX_EVTLOOPSRC_H_