2015-08-18 05:54:43 +00:00
|
|
|
#ifndef __RETRO_CIOWIN_HPP__
|
|
|
|
#define __RETRO_CIOWIN_HPP__
|
|
|
|
|
2015-08-20 02:52:07 +00:00
|
|
|
#include <string>
|
2016-02-05 01:27:03 +00:00
|
|
|
#include <memory>
|
2015-08-20 02:52:07 +00:00
|
|
|
|
2015-08-18 05:54:43 +00:00
|
|
|
namespace Retro
|
|
|
|
{
|
2015-08-22 01:58:41 +00:00
|
|
|
class CArchitectureMessage;
|
|
|
|
class CArchitectureQueue;
|
2015-08-18 05:54:43 +00:00
|
|
|
|
|
|
|
class CIOWin
|
|
|
|
{
|
2015-08-26 01:34:56 +00:00
|
|
|
std::string m_name;
|
|
|
|
size_t m_nameHash;
|
2015-08-20 02:52:07 +00:00
|
|
|
public:
|
2015-11-21 01:16:07 +00:00
|
|
|
enum class EMessageReturn
|
2015-08-26 01:34:56 +00:00
|
|
|
{
|
2015-11-21 01:16:07 +00:00
|
|
|
Normal = 0,
|
|
|
|
Exit = 1,
|
|
|
|
RemoveIOWinAndExit = 2,
|
|
|
|
RemoveIOWin = 3
|
2015-08-26 01:34:56 +00:00
|
|
|
};
|
2015-08-20 02:52:07 +00:00
|
|
|
virtual ~CIOWin() {}
|
2015-08-27 00:23:46 +00:00
|
|
|
CIOWin(const char* name) : m_name(name) {m_nameHash = std::hash<std::string>()(m_name);}
|
2015-08-26 01:34:56 +00:00
|
|
|
virtual EMessageReturn OnMessage(const CArchitectureMessage&, CArchitectureQueue&)=0;
|
2015-08-20 02:52:07 +00:00
|
|
|
virtual bool GetIsContinueDraw() const {return true;}
|
|
|
|
virtual void Draw() const {}
|
|
|
|
virtual void PreDraw() const {}
|
2015-08-26 01:34:56 +00:00
|
|
|
const std::string& GetName() const {return m_name;}
|
|
|
|
size_t GetNameHash() const {return m_nameHash;}
|
2015-08-18 05:54:43 +00:00
|
|
|
};
|
|
|
|
|
2016-02-05 01:27:03 +00:00
|
|
|
static bool operator==(std::shared_ptr<CIOWin> a, std::shared_ptr<CIOWin> b)
|
2015-08-26 01:34:56 +00:00
|
|
|
{
|
|
|
|
return a.get() == b.get();
|
|
|
|
}
|
|
|
|
|
2015-08-18 05:54:43 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
#endif // __RETRO_CIOWIN_HPP__
|