evtloopconsole.h 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // Name: wx/msw/evtloopconsole.h
  3. // Purpose: wxConsoleEventLoop class for Windows
  4. // Author: Vadim Zeitlin
  5. // Modified by:
  6. // Created: 2004-07-31
  7. // Copyright: (c) 2003-2004 Vadim Zeitlin <vadim@wxwindows.org>
  8. // Licence: wxWindows licence
  9. ///////////////////////////////////////////////////////////////////////////////
  10. #ifndef _WX_MSW_EVTLOOPCONSOLE_H_
  11. #define _WX_MSW_EVTLOOPCONSOLE_H_
  12. class WXDLLIMPEXP_BASE wxMSWEventLoopBase : public wxEventLoopManual
  13. {
  14. public:
  15. wxMSWEventLoopBase();
  16. // implement base class pure virtuals
  17. virtual bool Pending() const;
  18. protected:
  19. // get the next message from queue and return true or return false if we
  20. // got WM_QUIT or an error occurred
  21. bool GetNextMessage(WXMSG *msg);
  22. // same as above but with a timeout and return value can be -1 meaning that
  23. // time out expired in addition to
  24. int GetNextMessageTimeout(WXMSG *msg, unsigned long timeout);
  25. };
  26. #if wxUSE_CONSOLE_EVENTLOOP
  27. class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxMSWEventLoopBase
  28. {
  29. public:
  30. wxConsoleEventLoop() { }
  31. // override/implement base class virtuals
  32. virtual bool Dispatch();
  33. virtual int DispatchTimeout(unsigned long timeout);
  34. virtual void WakeUp();
  35. virtual bool YieldFor(long WXUNUSED(eventsToProcess)) { return true; }
  36. // Windows-specific function to process a single message
  37. virtual void ProcessMessage(WXMSG *msg);
  38. };
  39. #endif // wxUSE_CONSOLE_EVENTLOOP
  40. #endif // _WX_MSW_EVTLOOPCONSOLE_H_