metaforce/Runtime/CIOWin.hpp

42 lines
966 B
C++
Raw Normal View History

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