1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/unix/evtloop.h
3 // Purpose: declares wxEventLoop class
4 // Author: Lukasz Michalski (lm@zork.pl)
7 // Copyright: (c) 2007 Lukasz Michalski
8 // Licence: wxWindows licence
9 ///////////////////////////////////////////////////////////////////////////////
11 #ifndef _WX_UNIX_EVTLOOP_H_
12 #define _WX_UNIX_EVTLOOP_H_
14 #if wxUSE_CONSOLE_EVENTLOOP
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 class wxEventLoopSource
;
21 class wxFDIODispatcher
;
24 class WXDLLIMPEXP_BASE wxConsoleEventLoop
26 : public wxCFEventLoop
28 : public wxEventLoopManual
32 // initialize the event loop, use IsOk() to check if we were successful
34 virtual ~wxConsoleEventLoop();
36 // implement base class pure virtuals
37 virtual bool Pending() const;
38 virtual bool Dispatch();
39 virtual int DispatchTimeout(unsigned long timeout
);
40 virtual void WakeUp();
41 virtual bool IsOk() const { return m_dispatcher
!= NULL
; }
42 virtual bool YieldFor(long WXUNUSED(eventsToProcess
)) { return true; }
45 virtual void OnNextIteration();
48 // pipe used for wake up messages: when a child thread wants to wake up
49 // the event loop in the main thread it writes to this pipe
50 wxWakeUpPipeMT
*m_wakeupPipe
;
52 // the event loop source used to monitor this pipe
53 wxEventLoopSource
* m_wakeupSource
;
55 // either wxSelectDispatcher or wxEpollDispatcher
56 wxFDIODispatcher
*m_dispatcher
;
58 wxDECLARE_NO_COPY_CLASS(wxConsoleEventLoop
);
61 #endif // wxUSE_CONSOLE_EVENTLOOP
63 #endif // _WX_UNIX_EVTLOOP_H_