metaforce/Runtime/CIOWin.hpp

44 lines
993 B
C++
Raw Normal View History

2016-04-13 06:07:23 +00:00
#ifndef __URDE_CIOWIN_HPP__
#define __URDE_CIOWIN_HPP__
2015-08-18 05:54:43 +00:00
2015-08-20 02:52:07 +00:00
#include <string>
#include <memory>
2015-08-20 02:52:07 +00:00
2016-08-05 23:48:53 +00:00
#include "RetroTypes.hpp"
2016-03-04 23:04:53 +00:00
namespace urde
2015-08-18 05:54:43 +00:00
{
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
};
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
}
2016-04-13 06:07:23 +00:00
#endif // __URDE_CIOWIN_HPP__