metaforce/Runtime/CIOWinManager.hpp

45 lines
1.4 KiB
C++
Raw Normal View History

2015-08-18 05:54:43 +00:00
#ifndef __RETRO_CIOWINMANAGER_HPP__
#define __RETRO_CIOWINMANAGER_HPP__
2015-08-20 02:52:07 +00:00
#include <memory>
2015-08-26 01:34:56 +00:00
#include <list>
2015-08-20 02:52:07 +00:00
#include "CIOWin.hpp"
2015-08-26 01:34:56 +00:00
#include "rstl.hpp"
#include "CArchitectureQueue.hpp"
2015-08-20 02:52:07 +00:00
2015-08-18 05:54:43 +00:00
namespace Retro
{
class CIOWinManager
{
2015-08-20 02:52:07 +00:00
struct IOWinPQNode
{
2015-08-26 01:34:56 +00:00
rstl::rc_ptr<CIOWin> x0_iowin;
int x4_prio;
CIOWinManager::IOWinPQNode* x8_next;
IOWinPQNode(rstl::ncrc_ptr<CIOWin> iowin, int prio,
CIOWinManager::IOWinPQNode* next)
: x0_iowin(iowin), x4_prio(prio), x8_next(next) {}
rstl::rc_ptr<CIOWin> ShareIOWin() const {return rstl::rc_ptr<CIOWin>(x0_iowin);}
CIOWin* GetIOWin() const {return x0_iowin.get();}
2015-08-20 02:52:07 +00:00
};
IOWinPQNode* x0_drawRoot = nullptr;
IOWinPQNode* x4_pumpRoot = nullptr;
2015-08-27 00:23:46 +00:00
CArchitectureQueue x8_localGatherQueue;
2015-08-26 01:34:56 +00:00
public:
2015-08-20 02:52:07 +00:00
bool OnIOWinMessage(const CArchitectureMessage& msg);
2015-08-26 01:34:56 +00:00
void Draw() const;
bool DistributeOneMessage(const CArchitectureMessage& msg, CArchitectureQueue& queue);
void PumpMessages(CArchitectureQueue& queue);
CIOWin* FindIOWin(const std::string& name);
rstl::rc_ptr<CIOWin> FindAndShareIOWin(const std::string& name);
void ChangeIOWinPriority(CIOWin* toChange, int pumpPrio, int drawPrio);
2015-08-26 01:34:56 +00:00
void RemoveAllIOWins();
void RemoveIOWin(CIOWin* toRemove);
void AddIOWin(rstl::ncrc_ptr<CIOWin> toAdd, int pumpPrio, int drawPrio);
2015-08-18 05:54:43 +00:00
};
}
#endif // __RETRO_CIOWINMANAGER_HPP__