evtloop.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  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. #ifndef _WX_GTK_EVTLOOP_H_
  10. #define _WX_GTK_EVTLOOP_H_
  11. // ----------------------------------------------------------------------------
  12. // wxGUIEventLoop for wxGTK
  13. // ----------------------------------------------------------------------------
  14. typedef union _GdkEvent GdkEvent;
  15. class WXDLLIMPEXP_CORE wxGUIEventLoop : public wxEventLoopBase
  16. {
  17. public:
  18. wxGUIEventLoop();
  19. virtual void ScheduleExit(int rc = 0);
  20. virtual bool Pending() const;
  21. virtual bool Dispatch();
  22. virtual int DispatchTimeout(unsigned long timeout);
  23. virtual void WakeUp();
  24. virtual bool YieldFor(long eventsToProcess);
  25. void StoreGdkEventForLaterProcessing(GdkEvent* ev)
  26. { m_arrGdkEvents.Add(ev); }
  27. protected:
  28. virtual int DoRun();
  29. private:
  30. // the exit code of this event loop
  31. int m_exitcode;
  32. // used to temporarily store events in DoYield()
  33. wxArrayPtrVoid m_arrGdkEvents;
  34. wxDECLARE_NO_COPY_CLASS(wxGUIEventLoop);
  35. };
  36. #endif // _WX_GTK_EVTLOOP_H_