]>
Commit | Line | Data |
---|---|---|
b46b1d59 VZ |
1 | /////////////////////////////////////////////////////////////////////////////// |
2 | // Name: wx/unix/evtloop.h | |
3 | // Purpose: declares wxEventLoop class | |
4 | // Author: Lukasz Michalski (lm@zork.pl) | |
5 | // Created: 2007-05-07 | |
6 | // RCS-ID: $Id$ | |
7 | // Copyright: (c) 2007 Lukasz Michalski | |
8 | // Licence: wxWindows licence | |
9 | /////////////////////////////////////////////////////////////////////////////// | |
10 | ||
11 | #ifndef _WX_UNIX_EVTLOOP_H_ | |
12 | #define _WX_UNIX_EVTLOOP_H_ | |
13 | ||
a1873279 VZ |
14 | #if wxUSE_CONSOLE_EVENTLOOP |
15 | ||
b46b1d59 | 16 | // ---------------------------------------------------------------------------- |
3f8cdda4 | 17 | // wxConsoleEventLoop |
b46b1d59 VZ |
18 | // ---------------------------------------------------------------------------- |
19 | ||
3f8cdda4 VS |
20 | class wxFDIODispatcher; |
21 | ||
22 | namespace wxPrivate | |
23 | { | |
24 | class PipeIOHandler; | |
25 | }; | |
26 | ||
b46b1d59 VZ |
27 | class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxEventLoopManual |
28 | { | |
29 | public: | |
30 | // initialize the event loop, use IsOk() to check if we were successful | |
31 | wxConsoleEventLoop(); | |
3f8cdda4 | 32 | virtual ~wxConsoleEventLoop(); |
b46b1d59 VZ |
33 | |
34 | // implement base class pure virtuals | |
35 | virtual bool Pending() const; | |
36 | virtual bool Dispatch(); | |
9af42efd | 37 | virtual int DispatchTimeout(unsigned long timeout); |
b46b1d59 VZ |
38 | virtual void WakeUp(); |
39 | virtual bool IsOk() const { return m_dispatcher != NULL; } | |
40 | ||
41 | protected: | |
42 | virtual void OnNextIteration(); | |
43 | ||
44 | private: | |
45 | // pipe used for wake up messages: when a child thread wants to wake up | |
46 | // the event loop in the main thread it writes to this pipe | |
3f8cdda4 | 47 | wxPrivate::PipeIOHandler *m_wakeupPipe; |
b46b1d59 VZ |
48 | |
49 | // either wxSelectDispatcher or wxEpollDispatcher | |
50 | wxFDIODispatcher *m_dispatcher; | |
51 | ||
52 | DECLARE_NO_COPY_CLASS(wxConsoleEventLoop) | |
53 | }; | |
54 | ||
a1873279 VZ |
55 | #endif // wxUSE_CONSOLE_EVENTLOOP |
56 | ||
b46b1d59 | 57 | #endif // _WX_UNIX_EVTLOOP_H_ |