1 ///////////////////////////////////////////////////////////////////////////////
2 // Name: wx/unix/evtloop.h
3 // Purpose: declares wxEventLoop class
4 // Author: Lukasz Michalski (lm@zork.pl)
6 // Copyright: (c) 2007 Lukasz Michalski
7 // Licence: wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
10 #ifndef _WX_UNIX_EVTLOOP_H_
11 #define _WX_UNIX_EVTLOOP_H_
13 #if wxUSE_CONSOLE_EVENTLOOP
15 // ----------------------------------------------------------------------------
17 // ----------------------------------------------------------------------------
19 class wxEventLoopSource
;
20 class wxFDIODispatcher
;
23 class WXDLLIMPEXP_BASE wxConsoleEventLoop
25 : public wxCFEventLoop
27 : public wxEventLoopManual
31 // initialize the event loop, use IsOk() to check if we were successful
33 virtual ~wxConsoleEventLoop();
35 // implement base class pure virtuals
36 virtual bool Pending() const;
37 virtual bool Dispatch();
38 virtual int DispatchTimeout(unsigned long timeout
);
39 virtual void WakeUp();
40 virtual bool IsOk() const { return m_dispatcher
!= NULL
; }
41 virtual bool YieldFor(long WXUNUSED(eventsToProcess
)) { return true; }
44 virtual void OnNextIteration();
47 // pipe used for wake up messages: when a child thread wants to wake up
48 // the event loop in the main thread it writes to this pipe
49 wxWakeUpPipeMT
*m_wakeupPipe
;
51 // the event loop source used to monitor this pipe
52 wxEventLoopSource
* m_wakeupSource
;
54 // either wxSelectDispatcher or wxEpollDispatcher
55 wxFDIODispatcher
*m_dispatcher
;
57 wxDECLARE_NO_COPY_CLASS(wxConsoleEventLoop
);
60 #endif // wxUSE_CONSOLE_EVENTLOOP
62 #endif // _WX_UNIX_EVTLOOP_H_