1 ///////////////////////////////////////////////////////////////////////////////
2 // Name:        wx/gtk/evtloop.h
3 // Purpose:     wxGTK event loop implementation
4 // Author:      Vadim Zeitlin
5 // Created:     2008-12-27
6 // Copyright:   (c) 2008 Vadim Zeitlin <vadim@wxwidgets.org>
7 // Licence:     wxWindows licence
8 ///////////////////////////////////////////////////////////////////////////////
9 
10 #ifndef _WX_GTK_EVTLOOP_H_
11 #define _WX_GTK_EVTLOOP_H_
12 
13 // ----------------------------------------------------------------------------
14 // wxGUIEventLoop for wxGTK
15 // ----------------------------------------------------------------------------
16 
17 typedef union  _GdkEvent        GdkEvent;
18 
19 class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase
20 {
21 public:
22     wxGUIEventLoop();
23 
24     virtual void ScheduleExit(int rc = 0) wxOVERRIDE;
25     virtual bool Pending() const wxOVERRIDE;
26     virtual bool Dispatch() wxOVERRIDE;
27     virtual int DispatchTimeout(unsigned long timeout) wxOVERRIDE;
28     virtual void WakeUp() wxOVERRIDE;
29 
StoreGdkEventForLaterProcessing(GdkEvent * ev)30     void StoreGdkEventForLaterProcessing(GdkEvent* ev)
31         { m_arrGdkEvents.Add(ev); }
32 
33 protected:
34     virtual int DoRun() wxOVERRIDE;
35     virtual void DoYieldFor(long eventsToProcess) wxOVERRIDE;
36 
37 private:
38     // the exit code of this event loop
39     int m_exitcode;
40 
41     // used to temporarily store events in DoYield()
42     wxArrayPtrVoid m_arrGdkEvents;
43 
44     wxDECLARE_NO_COPY_CLASS(wxGUIEventLoop);
45 };
46 
47 #endif // _WX_GTK_EVTLOOP_H_
48