mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
fix(ui): improve const correctness across xml loading functions in ui
This commit is contained in:
parent
d51ea7e0e0
commit
6732199eab
@ -1 +1 @@
|
||||
Subproject commit ddaf9b9ba2b30a9adcfc4a9dd1c5015f9d151640
|
||||
Subproject commit 4393798b9b783dca7d670b583bb2c02463797f0d
|
||||
@ -1 +1 @@
|
||||
Subproject commit d590e2e94ffb7b75af0a86a7790372c9c2ba1823
|
||||
Subproject commit 5cdbd74e01dff8a48ab4617013e526ad62987b61
|
||||
@ -86,7 +86,7 @@ void CBackdropGenerator::Generate(const CRect* rect) {
|
||||
this->SetBorderVertexColor(this->m_borderColor);
|
||||
}
|
||||
|
||||
void CBackdropGenerator::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CBackdropGenerator::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
const char* bgFileAttr = node->GetAttributeByName("bgFile");
|
||||
const char* edgeFileAttr = node->GetAttributeByName("edgeFile");
|
||||
const char* tileAttr = node->GetAttributeByName("tile");
|
||||
|
||||
@ -41,7 +41,7 @@ class CBackdropGenerator {
|
||||
// Member functions
|
||||
CBackdropGenerator();
|
||||
void Generate(const CRect* rect);
|
||||
void LoadXML(XMLNode* node, CStatus* status);
|
||||
void LoadXML(const XMLNode* node, CStatus* status);
|
||||
void SetBorderVertexColor(const CImVector& borderColor);
|
||||
void SetOutput(CSimpleFrame* frame);
|
||||
void SetVertexColor(const CImVector& color);
|
||||
|
||||
@ -438,8 +438,8 @@ float CLayoutFrame::Left() {
|
||||
return left;
|
||||
}
|
||||
|
||||
void CLayoutFrame::LoadXML(XMLNode* node, CStatus* status) {
|
||||
XMLNode* size = node->GetChildByName("Size");
|
||||
void CLayoutFrame::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
auto size = node->GetChildByName("Size");
|
||||
float width;
|
||||
float height;
|
||||
|
||||
@ -533,7 +533,7 @@ void CLayoutFrame::LoadXML(XMLNode* node, CStatus* status) {
|
||||
}
|
||||
}
|
||||
|
||||
XMLNode* offsetNode = anchorNode->GetChildByName("Offset");
|
||||
auto offsetNode = anchorNode->GetChildByName("Offset");
|
||||
|
||||
float offsetX = 0.0f;
|
||||
float offsetY = 0.0f;
|
||||
|
||||
@ -44,7 +44,7 @@ class CLayoutFrame {
|
||||
|
||||
// Virtual member functions
|
||||
virtual ~CLayoutFrame();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual CLayoutFrame* GetLayoutParent();
|
||||
virtual bool SetLayoutScale(float scale, bool force);
|
||||
virtual void SetWidth(float width);
|
||||
|
||||
@ -99,7 +99,7 @@ char* CScriptObject::GetName() {
|
||||
return this->m_name.m_str;
|
||||
}
|
||||
|
||||
void CScriptObject::PreLoadXML(XMLNode* node, CStatus* status) {
|
||||
void CScriptObject::PreLoadXML(const XMLNode* node, CStatus* status) {
|
||||
const char* name = node->GetAttributeByName("name");
|
||||
|
||||
if (name && *name) {
|
||||
|
||||
@ -32,7 +32,7 @@ class CScriptObject : public FrameScript_Object {
|
||||
|
||||
// Member functions
|
||||
void CreateName(const char* source, char* dest, uint32_t destsize);
|
||||
void PreLoadXML(XMLNode* node, CStatus* status);
|
||||
void PreLoadXML(const XMLNode* node, CStatus* status);
|
||||
void SetName(const char* name);
|
||||
};
|
||||
|
||||
|
||||
@ -64,7 +64,7 @@ bool CScriptRegion::IsDragging() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void CScriptRegion::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CScriptRegion::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
CLayoutFrame::LoadXML(node, status);
|
||||
|
||||
const char* parentKey = node->GetAttributeByName("parentKey");
|
||||
@ -95,7 +95,7 @@ void CScriptRegion::LoadXML(XMLNode* node, CStatus* status) {
|
||||
this->LoadXML_Animations(node, status);
|
||||
}
|
||||
|
||||
void CScriptRegion::LoadXML_Animations(XMLNode* node, CStatus* status) {
|
||||
void CScriptRegion::LoadXML_Animations(const XMLNode* node, CStatus* status) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
|
||||
@ -40,12 +40,12 @@ class CScriptRegion : public CScriptObject, public CLayoutFrame {
|
||||
virtual void AddAnimRotation(CScriptRegion*, FRAMEPOINT, const C2Vector&, float) {};
|
||||
virtual void AddAnimScale(CScriptRegion*, FRAMEPOINT, const C2Vector&, const C2Vector&) {};
|
||||
virtual void AddAnimAlpha(CScriptRegion*, int16_t) {};
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual CLayoutFrame* GetLayoutParent();
|
||||
virtual CLayoutFrame* GetLayoutFrameByName(const char* name);
|
||||
|
||||
// Member functions
|
||||
void LoadXML_Animations(XMLNode* node, CStatus* status);
|
||||
void LoadXML_Animations(const XMLNode* node, CStatus* status);
|
||||
bool ProtectedFunctionsAllowed();
|
||||
void SetParent(CSimpleFrame* parent);
|
||||
};
|
||||
|
||||
@ -6,7 +6,7 @@
|
||||
#include <common/XML.hpp>
|
||||
#include <storm/String.hpp>
|
||||
|
||||
int32_t LoadXML_Color(XMLNode* node, CImVector& color) {
|
||||
int32_t LoadXML_Color(const XMLNode* node, CImVector& color) {
|
||||
float r = 0.0f;
|
||||
float g = 0.0f;
|
||||
float b = 0.0f;
|
||||
@ -61,7 +61,7 @@ int32_t LoadXML_Color(XMLNode* node, CImVector& color) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t LoadXML_Dimensions(XMLNode* node, float& x, float& y, CStatus* status) {
|
||||
int32_t LoadXML_Dimensions(const XMLNode* node, float& x, float& y, CStatus* status) {
|
||||
const char* xAttr = node->GetAttributeByName("x");
|
||||
|
||||
if (xAttr && *xAttr) {
|
||||
@ -128,7 +128,7 @@ int32_t LoadXML_Dimensions(XMLNode* node, float& x, float& y, CStatus* status) {
|
||||
}
|
||||
}
|
||||
|
||||
int32_t LoadXML_Gradient(XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status) {
|
||||
int32_t LoadXML_Gradient(const XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status) {
|
||||
orientation = ORIENTATION_HORIZONTAL;
|
||||
|
||||
// Orientation
|
||||
@ -150,7 +150,7 @@ int32_t LoadXML_Gradient(XMLNode* node, ORIENTATION& orientation, CImVector& min
|
||||
return 1;
|
||||
}
|
||||
|
||||
int32_t LoadXML_Insets(XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status) {
|
||||
int32_t LoadXML_Insets(const XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status) {
|
||||
left = 0.0f;
|
||||
right = 0.0f;
|
||||
top = 0.0f;
|
||||
@ -265,7 +265,7 @@ int32_t LoadXML_Insets(XMLNode* node, float& left, float& right, float& top, flo
|
||||
return 0;
|
||||
}
|
||||
|
||||
CSimpleFontString* LoadXML_String(XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
||||
CSimpleFontString* LoadXML_String(const XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
||||
// TODO
|
||||
// auto m = CDataAllocator::GetData(CSimpleFontString::s_allocator, 0, a__avcsimplefon, -2);
|
||||
|
||||
@ -279,7 +279,7 @@ CSimpleFontString* LoadXML_String(XMLNode* node, CSimpleFrame* frame, CStatus* s
|
||||
return fontString;
|
||||
}
|
||||
|
||||
CSimpleTexture* LoadXML_Texture(XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
||||
CSimpleTexture* LoadXML_Texture(const XMLNode* node, CSimpleFrame* frame, CStatus* status) {
|
||||
// TODO
|
||||
// auto m = (CSimpleTexture *)CDataAllocator::GetData((int)CSimpleTexture::s_allocator, 0, a__avcsimpletex, -2);
|
||||
|
||||
@ -293,7 +293,7 @@ CSimpleTexture* LoadXML_Texture(XMLNode* node, CSimpleFrame* frame, CStatus* sta
|
||||
return texture;
|
||||
}
|
||||
|
||||
int32_t LoadXML_Value(XMLNode* node, float& value, CStatus* status) {
|
||||
int32_t LoadXML_Value(const XMLNode* node, float& value, CStatus* status) {
|
||||
value = 0.0;
|
||||
|
||||
const char* v4 = node->GetAttributeByName("val");
|
||||
|
||||
@ -11,18 +11,18 @@ class CSimpleTexture;
|
||||
class CStatus;
|
||||
class XMLNode;
|
||||
|
||||
int32_t LoadXML_Color(XMLNode* node, CImVector& color);
|
||||
int32_t LoadXML_Color(const XMLNode* node, CImVector& color);
|
||||
|
||||
int32_t LoadXML_Dimensions(XMLNode* node, float& x, float& y, CStatus* status);
|
||||
int32_t LoadXML_Dimensions(const XMLNode* node, float& x, float& y, CStatus* status);
|
||||
|
||||
int32_t LoadXML_Gradient(XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status);
|
||||
int32_t LoadXML_Gradient(const XMLNode* node, ORIENTATION& orientation, CImVector& minColor, CImVector& maxColor, CStatus* status);
|
||||
|
||||
int32_t LoadXML_Insets(XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status);
|
||||
int32_t LoadXML_Insets(const XMLNode* node, float& left, float& right, float& top, float& bottom, CStatus* status);
|
||||
|
||||
CSimpleFontString* LoadXML_String(XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
||||
CSimpleFontString* LoadXML_String(const XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
||||
|
||||
CSimpleTexture* LoadXML_Texture(XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
||||
CSimpleTexture* LoadXML_Texture(const XMLNode* node, CSimpleFrame* frame, CStatus* status);
|
||||
|
||||
int32_t LoadXML_Value(XMLNode* node, float& value, CStatus* status);
|
||||
int32_t LoadXML_Value(const XMLNode* node, float& value, CStatus* status);
|
||||
|
||||
#endif
|
||||
|
||||
@ -128,7 +128,7 @@ bool CSimpleButton::IsA(int32_t type) {
|
||||
|| type == CScriptObject::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleButton::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleButton::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
CSimpleFrame::LoadXML(node, status);
|
||||
|
||||
CSimpleFontString* buttonText = nullptr;
|
||||
|
||||
@ -48,7 +48,7 @@ class CSimpleButton : public CSimpleFrame {
|
||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void OnLayerHide();
|
||||
virtual void OnLayerCursorEnter(int32_t a2);
|
||||
virtual void OnLayerCursorExit(int32_t a2, int32_t a3);
|
||||
|
||||
@ -48,7 +48,7 @@ int32_t CSimpleCheckbox::GetChecked() {
|
||||
return this->m_checked;
|
||||
}
|
||||
|
||||
void CSimpleCheckbox::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleCheckbox::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
CSimpleButton::LoadXML(node, status);
|
||||
|
||||
auto checkedAttr = node->GetAttributeByName("checked");
|
||||
|
||||
@ -22,7 +22,7 @@ class CSimpleCheckbox : public CSimpleButton {
|
||||
// Virtual member functions
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void Enable(int32_t enabled);
|
||||
virtual void OnClick(const char* btn, int32_t a3);
|
||||
|
||||
|
||||
@ -594,7 +594,7 @@ int32_t CSimpleEditBox::IsCurrentFocus() {
|
||||
return this == CSimpleEditBox::s_currentFocus;
|
||||
}
|
||||
|
||||
void CSimpleEditBox::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleEditBox::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
CSimpleFrame::LoadXML(node, status);
|
||||
|
||||
const char* fontAttr = node->GetAttributeByName("font");
|
||||
|
||||
@ -82,7 +82,7 @@ class CSimpleEditBox : public CSimpleFrame, CSimpleFontedFrame {
|
||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void OnLayerUpdate(float elapsedSec);
|
||||
virtual void OnFrameSizeChanged(float width, float height);
|
||||
virtual int32_t OnLayerKeyDownRepeat(const CKeyEvent& evt);
|
||||
|
||||
@ -86,7 +86,7 @@ bool CSimpleFont::IsA(int32_t type) {
|
||||
return type == CSimpleFont::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleFont::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFont::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
||||
if (inheritsAttr && *inheritsAttr) {
|
||||
auto font = CSimpleFont::GetFont(inheritsAttr, 0);
|
||||
@ -111,7 +111,7 @@ void CSimpleFont::LoadXML(XMLNode* node, CStatus* status) {
|
||||
} else {
|
||||
float fontHeight = 0.0f;
|
||||
|
||||
XMLNode* fontHeightNode = node->GetChildByName("FontHeight");
|
||||
auto fontHeightNode = node->GetChildByName("FontHeight");
|
||||
if (fontHeightNode) {
|
||||
LoadXML_Value(fontHeightNode, fontHeight, status);
|
||||
}
|
||||
|
||||
@ -47,7 +47,7 @@ class CSimpleFont : public FrameScript_Object, public CSimpleFontable {
|
||||
|
||||
// Member functions
|
||||
CSimpleFont();
|
||||
void LoadXML(XMLNode* node, CStatus* status);
|
||||
void LoadXML(const XMLNode* node, CStatus* status);
|
||||
void UpdateObjects();
|
||||
};
|
||||
|
||||
|
||||
@ -375,7 +375,7 @@ float CSimpleFontString::GetWidth() {
|
||||
return v9 <= v4 ? v4 : v9;
|
||||
}
|
||||
|
||||
void CSimpleFontString::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFontString::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
||||
if (inheritsAttr && *inheritsAttr) {
|
||||
auto font = CSimpleFont::GetFont(inheritsAttr, 0);
|
||||
@ -451,7 +451,7 @@ void CSimpleFontString::LoadXML(XMLNode* node, CStatus* status) {
|
||||
} else {
|
||||
float fontHeight = 0.0f;
|
||||
|
||||
XMLNode* fontHeightNode = node->GetChildByName("FontHeight");
|
||||
auto fontHeightNode = node->GetChildByName("FontHeight");
|
||||
if (fontHeightNode) {
|
||||
LoadXML_Value(fontHeightNode, fontHeight, status);
|
||||
}
|
||||
@ -634,7 +634,7 @@ void CSimpleFontString::OnFrameSizeChanged(const CRect& rect) {
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleFontString::PostLoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFontString::PostLoadXML(const XMLNode* node, CStatus* status) {
|
||||
if (this->m_parent) {
|
||||
int32_t hasPoint = 0;
|
||||
|
||||
|
||||
@ -44,7 +44,7 @@ class CSimpleFontString : public CSimpleRegion, public CSimpleFontable {
|
||||
virtual ~CSimpleFontString();
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void OnColorChanged(bool a2);
|
||||
virtual void OnScreenSizeChanged();
|
||||
virtual void Draw(CRenderBatch* batch);
|
||||
@ -70,7 +70,7 @@ class CSimpleFontString : public CSimpleRegion, public CSimpleFontable {
|
||||
float GetStringWidth();
|
||||
const char* GetText();
|
||||
float GetTextWidth(const char* text, uint32_t textBytes);
|
||||
void PostLoadXML(XMLNode* node, CStatus* status);
|
||||
void PostLoadXML(const XMLNode* node, CStatus* status);
|
||||
void RefreshEmbeddedTextures();
|
||||
void RemoveShadow();
|
||||
int32_t SetFont(const char* fontName, float fontHeight, uint32_t fontFlags, bool force);
|
||||
|
||||
@ -89,7 +89,7 @@ void CSimpleFrame::EnableDrawLayer(uint32_t drawlayer) {
|
||||
this->NotifyDrawLayerChanged(drawlayer);
|
||||
}
|
||||
|
||||
void CSimpleFrame::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFrame::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
const char* inherits = node->GetAttributeByName("inherits");
|
||||
|
||||
const char** v68 = &inherits;
|
||||
@ -288,7 +288,7 @@ void CSimpleFrame::LoadXML(XMLNode* node, CStatus* status) {
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleFrame::PostLoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFrame::PostLoadXML(const XMLNode* node, CStatus* status) {
|
||||
this->m_loading = 0;
|
||||
|
||||
if (this->m_visible) {
|
||||
@ -708,11 +708,11 @@ int32_t CSimpleFrame::HideThis() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
void CSimpleFrame::LoadXML_Attributes(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFrame::LoadXML_Attributes(const XMLNode* node, CStatus* status) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CSimpleFrame::LoadXML_Backdrop(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFrame::LoadXML_Backdrop(const XMLNode* node, CStatus* status) {
|
||||
auto m = SMemAlloc(sizeof(CBackdropGenerator), __FILE__, __LINE__, 0x0);
|
||||
auto backdrop = new (m) CBackdropGenerator();
|
||||
|
||||
@ -720,7 +720,7 @@ void CSimpleFrame::LoadXML_Backdrop(XMLNode* node, CStatus* status) {
|
||||
this->SetBackdrop(backdrop);
|
||||
}
|
||||
|
||||
void CSimpleFrame::LoadXML_Layers(XMLNode* node, CStatus* status) {
|
||||
void CSimpleFrame::LoadXML_Layers(const XMLNode* node, CStatus* status) {
|
||||
if (!node->m_child) {
|
||||
return;
|
||||
}
|
||||
@ -776,7 +776,7 @@ void CSimpleFrame::LoadXML_Layers(XMLNode* node, CStatus* status) {
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleFrame::LoadXML_Scripts(XMLNode* root, CStatus* status) {
|
||||
void CSimpleFrame::LoadXML_Scripts(const XMLNode* root, CStatus* status) {
|
||||
lua_State* L = FrameScript_GetContext();
|
||||
|
||||
const char* scriptName;
|
||||
@ -1210,7 +1210,7 @@ void CSimpleFrame::ParentFrame(CSimpleFrame* frame) {
|
||||
node->frame = frame;
|
||||
}
|
||||
|
||||
void CSimpleFrame::PostLoadXML_Frames(XMLNode *node, CStatus* status) {
|
||||
void CSimpleFrame::PostLoadXML_Frames(const XMLNode* node, CStatus* status) {
|
||||
// Call this function with all inherited nodes
|
||||
|
||||
const char* inheritNames = node->GetAttributeByName("inherits");
|
||||
@ -1265,7 +1265,7 @@ void CSimpleFrame::PostLoadXML_Frames(XMLNode *node, CStatus* status) {
|
||||
|
||||
// Create child frames
|
||||
|
||||
XMLNode* framesNode = node->GetChildByName("Frames");
|
||||
auto framesNode = node->GetChildByName("Frames");
|
||||
|
||||
if (framesNode) {
|
||||
XMLNode* frameNode;
|
||||
|
||||
@ -88,7 +88,7 @@ class CSimpleFrame : public CScriptRegion {
|
||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void PreOnAnimUpdate();
|
||||
virtual void OnLayerShow();
|
||||
virtual void OnLayerHide();
|
||||
@ -106,7 +106,7 @@ class CSimpleFrame : public CScriptRegion {
|
||||
virtual int32_t OnLayerKeyUp(const CKeyEvent& evt);
|
||||
virtual int32_t OnLayerMouseDown(const CMouseEvent& evt, const char* btn);
|
||||
virtual int32_t OnLayerMouseUp(const CMouseEvent& evt, const char* btn);
|
||||
virtual void PostLoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void PostLoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void UnregisterRegion(CSimpleRegion* region);
|
||||
virtual int32_t GetBoundsRect(CRect& bounds);
|
||||
virtual void PreLoadXML(XMLNode* node, CStatus* status);
|
||||
@ -127,13 +127,13 @@ class CSimpleFrame : public CScriptRegion {
|
||||
void EnableEvent(CSimpleEventType eventType, int32_t priority);
|
||||
int32_t GetHitRect(CRect& rect);
|
||||
void Hide();
|
||||
void LoadXML_Attributes(XMLNode* node, CStatus* status);
|
||||
void LoadXML_Backdrop(XMLNode* node, CStatus* status);
|
||||
void LoadXML_Layers(XMLNode* node, CStatus* status);
|
||||
void LoadXML_Scripts(XMLNode* node, CStatus* status);
|
||||
void LoadXML_Attributes(const XMLNode* node, CStatus* status);
|
||||
void LoadXML_Backdrop(const XMLNode* node, CStatus* status);
|
||||
void LoadXML_Layers(const XMLNode* node, CStatus* status);
|
||||
void LoadXML_Scripts(const XMLNode* node, CStatus* status);
|
||||
void NotifyDrawLayerChanged(uint32_t drawlayer);
|
||||
void NotifyScrollParent();
|
||||
void PostLoadXML_Frames(XMLNode* node, CStatus* status);
|
||||
void PostLoadXML_Frames(const XMLNode* node, CStatus* status);
|
||||
void Raise();
|
||||
void RegisterForEvents(int32_t a2);
|
||||
void RegisterRegion(CSimpleRegion* region);
|
||||
|
||||
@ -119,7 +119,7 @@ bool CSimpleHTML::IsA(int32_t type) {
|
||||
|| type == CScriptObject::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleHTML::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleHTML::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
CSimpleFrame::LoadXML(node, status);
|
||||
|
||||
const char* fontAttr = node->GetAttributeByName("font");
|
||||
@ -163,7 +163,7 @@ void CSimpleHTML::LoadXML(XMLNode* node, CStatus* status) {
|
||||
// TODO hyperlinkFormat
|
||||
}
|
||||
|
||||
void CSimpleHTML::ParseBODY(XMLNode* node, CStatus* status) {
|
||||
void CSimpleHTML::ParseBODY(const XMLNode* node, CStatus* status) {
|
||||
for (auto child = node->m_child; child; child = child->m_next) {
|
||||
if (!SStrCmpI(child->GetName(), "H1", STORM_MAX_STR)) {
|
||||
this->ParseP(child, HTML_TEXT_HEADER1, status);
|
||||
@ -194,11 +194,11 @@ void CSimpleHTML::ParseBODY(XMLNode* node, CStatus* status) {
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleHTML::ParseIMG(XMLNode* node, CStatus* status) {
|
||||
void CSimpleHTML::ParseIMG(const XMLNode* node, CStatus* status) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
void CSimpleHTML::ParseP(XMLNode* node, HTML_TEXT_TYPE type, CStatus* status) {
|
||||
void CSimpleHTML::ParseP(const XMLNode* node, HTML_TEXT_TYPE type, CStatus* status) {
|
||||
uint32_t justify = 1;
|
||||
auto justifyAttr = node->GetAttributeByName("align");
|
||||
if (justifyAttr && *justifyAttr) {
|
||||
|
||||
@ -35,16 +35,16 @@ class CSimpleHTML : public CSimpleHyperlinkedFrame, CSimpleFontedFrame {
|
||||
// Virtual member functions
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void FontUpdated(CSimpleFontedFrameFont* font, int32_t a3);
|
||||
|
||||
// Member functions
|
||||
CSimpleHTML(CSimpleFrame* parent);
|
||||
void AddText(const char* text, HTML_TEXT_TYPE type, uint32_t justify);
|
||||
void ClearContent();
|
||||
void ParseBODY(XMLNode* node, CStatus* status);
|
||||
void ParseIMG(XMLNode* node, CStatus* status);
|
||||
void ParseP(XMLNode* node, HTML_TEXT_TYPE type, CStatus* status);
|
||||
void ParseBODY(const XMLNode* node, CStatus* status);
|
||||
void ParseIMG(const XMLNode* node, CStatus* status);
|
||||
void ParseP(const XMLNode* node, HTML_TEXT_TYPE type, CStatus* status);
|
||||
bool SetText(const char* text, CStatus* status);
|
||||
};
|
||||
|
||||
|
||||
@ -172,7 +172,7 @@ bool CSimpleModel::IsA(int32_t type) {
|
||||
|| type == CScriptObject::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleModel::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleModel::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
CSimpleFrame::LoadXML(node, status);
|
||||
|
||||
const char* fileAttr = node->GetAttributeByName("file");
|
||||
|
||||
@ -46,7 +46,7 @@ class CSimpleModel : public CSimpleFrame {
|
||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void OnLayerUpdate(float elapsedSec);
|
||||
virtual void OnFrameRender(CRenderBatch*, uint32_t);
|
||||
virtual void UpdateModel();
|
||||
|
||||
@ -240,10 +240,10 @@ bool CSimpleScrollFrame::IsA(int32_t type) {
|
||||
|| type == CScriptObject::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleScrollFrame::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleScrollFrame::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
CSimpleFrame::LoadXML(node, status);
|
||||
|
||||
XMLNode* scrollChildNode = node->GetChildByName("ScrollChild");
|
||||
auto scrollChildNode = node->GetChildByName("ScrollChild");
|
||||
|
||||
if (scrollChildNode) {
|
||||
XMLNode* childNode = scrollChildNode->m_child;
|
||||
|
||||
@ -32,7 +32,7 @@ class CSimpleScrollFrame : public CSimpleFrame {
|
||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual int32_t GetBoundsRect(CRect& bounds);
|
||||
virtual void OnLayerUpdate(float elapsedSec);
|
||||
virtual void OnFrameRender(CRenderBatch* batch, uint32_t layer);
|
||||
|
||||
@ -61,7 +61,7 @@ bool CSimpleSlider::IsA(int32_t type) {
|
||||
|| type == CScriptObject::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleSlider::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleSlider::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
this->CSimpleFrame::LoadXML(node, status);
|
||||
|
||||
// Thumb
|
||||
|
||||
@ -32,7 +32,7 @@ class CSimpleSlider : public CSimpleFrame {
|
||||
virtual ScriptIx* GetScriptByName(const char* name, ScriptData& data);
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual void UnregisterRegion(CSimpleRegion* region);
|
||||
virtual void OnLayerHide();
|
||||
virtual void OnLayerUpdate(float elapsedSec);
|
||||
|
||||
@ -153,7 +153,7 @@ bool CSimpleTexture::IsA(int32_t type) {
|
||||
|| type == CScriptObject::s_objectType;
|
||||
}
|
||||
|
||||
void CSimpleTexture::LoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleTexture::LoadXML(const XMLNode* node, CStatus* status) {
|
||||
const char* inheritsAttr = node->GetAttributeByName("inherits");
|
||||
|
||||
if (inheritsAttr && *inheritsAttr) {
|
||||
@ -438,7 +438,7 @@ void CSimpleTexture::OnFrameSizeChanged(const CRect& rect) {
|
||||
}
|
||||
}
|
||||
|
||||
void CSimpleTexture::PostLoadXML(XMLNode* node, CStatus* status) {
|
||||
void CSimpleTexture::PostLoadXML(const XMLNode* node, CStatus* status) {
|
||||
if (this->m_parent) {
|
||||
for (int32_t i = 0; i < FRAMEPOINT_NUMPOINTS; i++) {
|
||||
if (this->m_points[i] && !(this->m_points[i]->m_flags & 0x8)) {
|
||||
|
||||
@ -42,7 +42,7 @@ class CSimpleTexture : public CSimpleRegion {
|
||||
virtual ~CSimpleTexture();
|
||||
virtual int32_t GetScriptMetaTable();
|
||||
virtual bool IsA(int32_t type);
|
||||
virtual void LoadXML(XMLNode* node, CStatus* status);
|
||||
virtual void LoadXML(const XMLNode* node, CStatus* status);
|
||||
virtual float GetWidth();
|
||||
virtual float GetHeight();
|
||||
virtual void Draw(CRenderBatch* batch);
|
||||
@ -51,7 +51,7 @@ class CSimpleTexture : public CSimpleRegion {
|
||||
// Member functions
|
||||
CSimpleTexture(CSimpleFrame* frame, uint32_t drawlayer, int32_t show);
|
||||
void GetTexCoord(C2Vector* texCoord);
|
||||
void PostLoadXML(XMLNode* node, CStatus* status);
|
||||
void PostLoadXML(const XMLNode* node, CStatus* status);
|
||||
void SetAlpha(float alpha);
|
||||
void SetBlendMode(EGxBlend blend);
|
||||
void SetPosition(const CRect& rect, C3Vector* position);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user