]>
Commit | Line | Data |
---|---|---|
5cd99866 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/osx/evtloopsrc.h | |
3 | // Purpose: wxCFEventLoopSource class | |
4 | // Author: Vadim Zeitlin | |
5 | // Created: 2009-10-21 | |
5cd99866 VZ |
6 | // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org> |
7 | // Licence: wxWindows licence | |
8 | /////////////////////////////////////////////////////////////////////////////// | |
9 | ||
10 | #ifndef _WX_OSX_EVTLOOPSRC_H_ | |
11 | #define _WX_OSX_EVTLOOPSRC_H_ | |
12 | ||
a25b76f5 | 13 | typedef struct __CFSocket* CFSocketRef; |
5cd99866 VZ |
14 | |
15 | // ---------------------------------------------------------------------------- | |
16 | // wxCFEventLoopSource: CoreFoundation-based wxEventLoopSource for OS X | |
17 | // ---------------------------------------------------------------------------- | |
18 | ||
71e9885b | 19 | class WXDLLIMPEXP_BASE wxCFEventLoopSource : public wxEventLoopSource |
5cd99866 VZ |
20 | { |
21 | public: | |
a25b76f5 VZ |
22 | // Create a new source in uninitialized state, call InitSocketRef() later |
23 | // to associate it with the socket it is going to use. | |
5cd99866 VZ |
24 | wxCFEventLoopSource(wxEventLoopSourceHandler *handler, int flags) |
25 | : wxEventLoopSource(handler, flags) | |
26 | { | |
a25b76f5 | 27 | m_cfSocket = NULL; |
5cd99866 VZ |
28 | } |
29 | ||
a25b76f5 VZ |
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); | |
5cd99866 | 33 | |
a25b76f5 | 34 | // Destructor deletes the associated socket. |
5cd99866 VZ |
35 | virtual ~wxCFEventLoopSource(); |
36 | ||
37 | private: | |
a25b76f5 | 38 | CFSocketRef m_cfSocket; |
5cd99866 VZ |
39 | |
40 | wxDECLARE_NO_COPY_CLASS(wxCFEventLoopSource); | |
41 | }; | |
42 | ||
43 | #endif // _WX_OSX_EVTLOOPSRC_H_ | |
44 |