diff options
| author | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-13 10:52:28 +0200 |
|---|---|---|
| committer | Amlal <amlal@el-mahrouss-logic.com> | 2024-09-13 10:52:28 +0200 |
| commit | 69d628dd02df81e64dfd9a2e730a44c5c5a0e5a8 (patch) | |
| tree | 90edf6a872632770a8825b76cb0b72d47675ee84 /dev/ZKA/Modules/CoreCG | |
| parent | 409e2b3911af1368bfbb4e965ca0484274215d16 (diff) | |
DDK: Export DDK symbols by default.
ADD: Add ZWM (ZKA Window Manager).
META: The rest are refactors.
Signed-off-by: Amlal <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'dev/ZKA/Modules/CoreCG')
| -rw-r--r-- | dev/ZKA/Modules/CoreCG/WindowRenderer.hxx | 32 |
1 files changed, 26 insertions, 6 deletions
diff --git a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx index 153cb64f..8dab7925 100644 --- a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx +++ b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx @@ -53,12 +53,23 @@ namespace CG typedef struct UI_WINDOW_STRUCT UI_WINDOW_STRUCT; - inline Void CGDrawBackground() noexcept + /// \brief Draw background (either image or solid color) + inline Void CGDrawBackground(UInt32* raw_bmp, SizeT width, SizeT height) noexcept { CGInit(); - CGDrawInRegion(CGColor(0x45, 0x00, 0x06), CG::UIAccessibilty::The().Height(), CG::UIAccessibilty::The().Width(), - 0, 0); + if (!raw_bmp) + { + const auto cColorBackground = CGColor(0x45, 0x00, 0x06); + + CGDrawInRegion(cColorBackground, CG::UIAccessibilty::The().Height(), CG::UIAccessibilty::The().Width(), + 0, 0); + } + else + { + CGDrawBitMapInRegion(raw_bmp, height, width, + 0, 0); + } CGFini(); } @@ -98,19 +109,28 @@ namespace CG return wnd; } - inline bool CGDestroyWindow(struct UI_WINDOW_STRUCT* wnd) + /// \brief Destroys a window and it's contents. + inline Bool CGDestroyWindow(struct UI_WINDOW_STRUCT* wnd) { if (wnd) { - delete wnd; - if (!mm_is_valid_heap(wnd)) { wnd = nullptr; return true; } + wnd->w_needs_repaint = No; + + for (SizeT index = 0UL; index < wnd->w_child_count; ++index) + { + CGDestroyWindow(wnd->w_child_elements[index]); + } + + delete wnd; wnd = nullptr; + + return true; } return false; |
