]>
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 | |
b1153ed6 | 6 | // RCS-ID: $Id$ |
5cd99866 VZ |
7 | // Copyright: (c) 2009 Vadim Zeitlin <vadim@wxwidgets.org> |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_OSX_EVTLOOPSRC_H_ | |
12 | #define _WX_OSX_EVTLOOPSRC_H_ | |
13 | ||
a25b76f5 | 14 | typedef struct __CFSocket* CFSocketRef; |
5cd99866 VZ |
15 | |
16 | // ---------------------------------------------------------------------------- | |
17 | // wxCFEventLoopSource: CoreFoundation-based wxEventLoopSource for OS X | |
18 | // ---------------------------------------------------------------------------- | |
19 | ||
71e9885b | 20 | class WXDLLIMPEXP_BASE wxCFEventLoopSource : public wxEventLoopSource |
5cd99866 VZ |
21 | { |
22 | public: | |
a25b76f5 VZ |
23 | // Create a new source in uninitialized state, call InitSocketRef() later |
24 | // to associate it with the socket it is going to use. | |
5cd99866 VZ |
25 | wxCFEventLoopSource(wxEventLoopSourceHandler *handler, int flags) |
26 | : wxEventLoopSource(handler, flags) | |
27 | { | |
a25b76f5 | 28 | m_cfSocket = NULL; |
5cd99866 VZ |
29 | } |
30 | ||
a25b76f5 VZ |
31 | // Finish initialization of the event loop source by providing the |
32 | // associated socket. This object takes ownership of it and will release it. | |
33 | void InitSourceSocket(CFSocketRef cfSocket); | |
5cd99866 | 34 | |
a25b76f5 | 35 | // Destructor deletes the associated socket. |
5cd99866 VZ |
36 | virtual ~wxCFEventLoopSource(); |
37 | ||
38 | private: | |
a25b76f5 | 39 | CFSocketRef m_cfSocket; |
5cd99866 VZ |
40 | |
41 | wxDECLARE_NO_COPY_CLASS(wxCFEventLoopSource); | |
42 | }; | |
43 | ||
44 | #endif // _WX_OSX_EVTLOOPSRC_H_ | |
45 |