From b75417b44d5f63ea0ead68cbe8f62bd76df62229 Mon Sep 17 00:00:00 2001 From: Amlal El Mahrouss Date: Tue, 13 Feb 2024 17:20:30 +0100 Subject: HCR-15: Merge to master branch. Important commit and end of ticket. Signed-off-by: Amlal El Mahrouss --- Public/Kits/GKit/Frame.cxx | 16 +++++++++++ Public/Kits/GKit/Frame.hpp | 59 +++++++++++++++++++++++++++++++++++++++++ Public/Kits/GKit/GFrame.cxx | 16 ----------- Public/Kits/GKit/GFrame.hpp | 59 ----------------------------------------- Public/Kits/GKit/Stylesheet.hxx | 35 ++++++++++++++++++++++++ 5 files changed, 110 insertions(+), 75 deletions(-) create mode 100644 Public/Kits/GKit/Frame.cxx create mode 100644 Public/Kits/GKit/Frame.hpp delete mode 100644 Public/Kits/GKit/GFrame.cxx delete mode 100644 Public/Kits/GKit/GFrame.hpp (limited to 'Public') diff --git a/Public/Kits/GKit/Frame.cxx b/Public/Kits/GKit/Frame.cxx new file mode 100644 index 00000000..939dfc5a --- /dev/null +++ b/Public/Kits/GKit/Frame.cxx @@ -0,0 +1,16 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Frame.cpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#include + +namespace HCore {} diff --git a/Public/Kits/GKit/Frame.hpp b/Public/Kits/GKit/Frame.hpp new file mode 100644 index 00000000..f71628a7 --- /dev/null +++ b/Public/Kits/GKit/Frame.hpp @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Frame.hpp + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include +#include +#include + +namespace HCore { +class G_API GFrame { + public: + explicit GFrame(GFrame* parent = nullptr) : m_ParentFrame(parent) {} + ~GFrame() {} + + GFrame& operator=(const GFrame&) = default; + GFrame(const GFrame&) = default; + + virtual void Update() { + if (m_Frames.Count() == 0) return; + + for (int x = 0; x < m_Frames.Count(); ++x) { + if (!m_Frames[x]->ShouldBeUpdated()) continue; + + m_Frames[x]->Update(); + } + + this->Paint(); + } + + virtual void UpdateInput() { + if (m_Frames.Count() == 0) return; + + for (int x = 0; x < m_Frames.Count(); ++x) { + if (!m_Frames[x]->ShouldBeUpdated()) continue; + + m_Frames[x]->UpdateInput(); + } + } + + virtual bool ShouldBeUpdated() { return false; } + + virtual void Paint() = 0; + + private: + HCore::MutableArray m_Frames; + GFrame* m_ParentFrame{nullptr}; +}; +} // namespace HCore diff --git a/Public/Kits/GKit/GFrame.cxx b/Public/Kits/GKit/GFrame.cxx deleted file mode 100644 index 427c95ba..00000000 --- a/Public/Kits/GKit/GFrame.cxx +++ /dev/null @@ -1,16 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - - File: GFrame.cpp - Purpose: - - Revision History: - - 31/01/24: Added file (amlel) - -------------------------------------------- */ - -#include - -namespace HCore {} diff --git a/Public/Kits/GKit/GFrame.hpp b/Public/Kits/GKit/GFrame.hpp deleted file mode 100644 index f70f8f8e..00000000 --- a/Public/Kits/GKit/GFrame.hpp +++ /dev/null @@ -1,59 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - - File: GFrame.hpp - Purpose: - - Revision History: - - 31/01/24: Added file (amlel) - -------------------------------------------- */ - -#pragma once - -#include -#include -#include - -namespace HCore { -class GFrame { - public: - explicit GFrame(GFrame* parent = nullptr) : m_ParentFrame(parent) {} - ~GFrame() {} - - GFrame& operator=(const GFrame&) = default; - GFrame(const GFrame&) = default; - - virtual void Update() { - if (m_Frames.Count() == 0) return; - - for (int x = 0; x < m_Frames.Count(); ++x) { - if (!m_Frames[x]->ShouldBeUpdated()) continue; - - m_Frames[x]->Update(); - } - - this->Paint(); - } - - virtual void UpdateInput() { - if (m_Frames.Count() == 0) return; - - for (int x = 0; x < m_Frames.Count(); ++x) { - if (!m_Frames[x]->ShouldBeUpdated()) continue; - - m_Frames[x]->UpdateInput(); - } - } - - virtual bool ShouldBeUpdated() { return false; } - - virtual void Paint() = 0; - - private: - HCore::MutableArray m_Frames; - GFrame* m_ParentFrame{nullptr}; -}; -} // namespace HCore diff --git a/Public/Kits/GKit/Stylesheet.hxx b/Public/Kits/GKit/Stylesheet.hxx index bd764fcb..a34dd435 100644 --- a/Public/Kits/GKit/Stylesheet.hxx +++ b/Public/Kits/GKit/Stylesheet.hxx @@ -14,3 +14,38 @@ #pragma once /// TODO: Stylesheets for GUI. + +#include +#include +#include + +#include "NewKit/String.hpp" + +namespace HCore { +class G_API Stylesheet final { + public: + explicit Stylesheet() = default; + ~Stylesheet() = default; + + HCORE_COPY_DEFAULT(Stylesheet); + + MutableArray& Props() { return mProps; } + + private: + MutableArray mProps; +}; + +class StylesheetParser final { + public: + static MutableArray FromBlob(WideChar* Blob, SizeT BlobSz) { + MutableArray stylesheet; + + if (!Blob || BlobSz < 1) return stylesheet; + + for (auto BlobIndex = 0UL; BlobIndex < BlobSz; ++BlobIndex) { + } + + return stylesheet; + } +}; +} // namespace HCore -- cgit v1.2.3