diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-10 15:41:08 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-10 15:41:08 +0100 |
| commit | 5468ca71a59c9e24c1d392554e8f97f0c1705394 (patch) | |
| tree | 1e8af47da852d4ad02a2ea48a967694c7bfc19c3 /Public/Kits/System.Graphics/Frame.hxx | |
| parent | 94d7585ae766d777f41d07b1a98051d12a6a0256 (diff) | |
Kernel: Reworked StorageKit to add AHCI support.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Kits/System.Graphics/Frame.hxx')
| -rw-r--r-- | Public/Kits/System.Graphics/Frame.hxx | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/Public/Kits/System.Graphics/Frame.hxx b/Public/Kits/System.Graphics/Frame.hxx new file mode 100644 index 00000000..e0d52a4c --- /dev/null +++ b/Public/Kits/System.Graphics/Frame.hxx @@ -0,0 +1,59 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + + File: Frame.hxx + Purpose: + + Revision History: + + 31/01/24: Added file (amlel) + +------------------------------------------- */ + +#pragma once + +#include <System.Graphics/Core.hxx> +#include <System.Graphics/Dim2d.hxx> +#include <NewKit/MutableArray.hpp> + +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<GFrame*> m_Frames; + GFrame* m_ParentFrame{nullptr}; +}; +} // namespace HCore |
