metaforce/Runtime/GuiSys/CTextExecuteBuffer.hpp

73 lines
2.0 KiB
C++
Raw Normal View History

2016-03-19 00:07:31 +00:00
#ifndef __URDE_CTEXTEXECUTEBUFFER_HPP__
#define __URDE_CTEXTEXECUTEBUFFER_HPP__
#include "CSaveableState.hpp"
#include "CGuiTextSupport.hpp"
#include <list>
namespace urde
{
class CInstruction;
class CFontImageDef;
2016-03-19 03:58:01 +00:00
class CTextRenderBuffer;
class CBlockInstruction;
class CLineInstruction;
2016-03-19 00:07:31 +00:00
class CTextExecuteBuffer
{
2016-03-21 22:01:19 +00:00
friend class CGuiTextSupport;
2016-12-30 06:37:01 +00:00
friend class CTextRenderBufferPages;
2016-03-21 22:01:19 +00:00
2016-03-19 03:58:01 +00:00
std::list<std::shared_ptr<CInstruction>> x0_instList;
2016-03-19 00:07:31 +00:00
u32 x14_ = 0;
2016-03-20 00:32:30 +00:00
CSaveableState x18_textState;
2016-12-16 23:05:29 +00:00
CBlockInstruction* xa0_curBlock = nullptr;
CLineInstruction* xa4_curLine = nullptr;
std::list<std::shared_ptr<CInstruction>>::iterator xa8_curWordIt;
s32 xac_curY;
s32 xb0_curX;
s32 xb4_ = 0;
s32 xb8_ = 0;
s32 xbc_spaceDistance = 0;
bool xc0_ = false;
std::list<CSaveableState> xc4_stateStack;
u32 xd8_ = 0;
2016-03-19 00:07:31 +00:00
public:
CTextExecuteBuffer()
{
2016-12-16 23:05:29 +00:00
xa8_curWordIt = x0_instList.begin();
2016-03-19 00:07:31 +00:00
}
2016-03-19 03:58:01 +00:00
CTextRenderBuffer CreateTextRenderBuffer() const;
2016-03-20 00:32:30 +00:00
std::vector<CToken> GetAssets() const;
2016-03-20 06:37:08 +00:00
void AddString(const wchar_t* str, int len);
void AddStringFragment(const wchar_t* str, int len);
int WrapOneLTR(const wchar_t* str, int len);
2016-03-19 00:07:31 +00:00
void MoveWordLTR();
void StartNewLine();
void StartNewWord();
void TerminateLine();
void TerminateLineLTR();
void AddPopState();
void AddPushState();
2016-03-20 06:37:08 +00:00
void AddVerticalJustification(EVerticalJustification vjust);
void AddJustification(EJustification just);
2016-03-20 00:32:30 +00:00
void AddLineExtraSpace(s32 space);
2016-03-20 06:37:08 +00:00
void AddLineSpacing(float spacing);
void AddRemoveColorOverride(int idx);
void AddColorOverride(int idx, const CTextColor& color);
2016-03-19 00:07:31 +00:00
void AddColor(EColorType, const CTextColor& color);
void AddImage(const CFontImageDef& image);
2016-03-21 00:25:53 +00:00
void AddFont(const TToken<CRasterFont>& font);
2016-03-19 00:07:31 +00:00
void EndBlock();
2016-03-20 06:37:08 +00:00
void BeginBlock(s32 offX, s32 offY, s32 padX, s32 padY,
ETextDirection dir, EJustification just,
EVerticalJustification vjust);
2016-03-19 00:07:31 +00:00
void Clear();
};
}
#endif // __URDE_CTEXTEXECUTEBUFFER_HPP__