wxWidgets/include/wx/msw/evtloopconsole.h
Vadim Zeitlin f740cc3881 Refactor YieldFor() to avoid code duplication among the ports.
Don't repeat the same code in all the ports, move it to the common base class
and add a new virtual DoYieldFor() for the really port-specific code.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2014-03-02 18:58:00 +00:00

54 lines
1.5 KiB
C++

///////////////////////////////////////////////////////////////////////////////
// Name: wx/msw/evtloopconsole.h
// Purpose: wxConsoleEventLoop class for Windows
// Author: Vadim Zeitlin
// Modified by:
// Created: 2004-07-31
// Copyright: (c) 2003-2004 Vadim Zeitlin <vadim@wxwindows.org>
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSW_EVTLOOPCONSOLE_H_
#define _WX_MSW_EVTLOOPCONSOLE_H_
class WXDLLIMPEXP_BASE wxMSWEventLoopBase : public wxEventLoopManual
{
public:
wxMSWEventLoopBase();
// implement base class pure virtuals
virtual bool Pending() const;
protected:
// get the next message from queue and return true or return false if we
// got WM_QUIT or an error occurred
bool GetNextMessage(WXMSG *msg);
// same as above but with a timeout and return value can be -1 meaning that
// time out expired in addition to
int GetNextMessageTimeout(WXMSG *msg, unsigned long timeout);
};
#if wxUSE_CONSOLE_EVENTLOOP
class WXDLLIMPEXP_BASE wxConsoleEventLoop : public wxMSWEventLoopBase
{
public:
wxConsoleEventLoop() { }
// override/implement base class virtuals
virtual bool Dispatch();
virtual int DispatchTimeout(unsigned long timeout);
virtual void WakeUp();
// Windows-specific function to process a single message
virtual void ProcessMessage(WXMSG *msg);
protected:
virtual void DoYieldFor(long eventsToProcess);
};
#endif // wxUSE_CONSOLE_EVENTLOOP
#endif // _WX_MSW_EVTLOOPCONSOLE_H_