diff options
| author | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-27 09:22:59 +0200 |
|---|---|---|
| committer | Amlal EL Mahrouss <amlalelmahrouss@icloud.com> | 2024-08-27 09:22:59 +0200 |
| commit | 1f9b7e979f656c255bb1bf51743f1001c613b963 (patch) | |
| tree | cb460c3a71828d2a8119c75389a1fadf23c3760f /dev/ZKA/Modules/CoreCG | |
| parent | 1f9473c6b591eead87405d2e1861ee48f9a38c0e (diff) | |
[IMP] Add log window when booting.
Signed-off-by: Amlal EL Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'dev/ZKA/Modules/CoreCG')
| -rw-r--r-- | dev/ZKA/Modules/CoreCG/WindowRenderer.hxx | 25 |
1 files changed, 19 insertions, 6 deletions
diff --git a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx index b377d7d0..1a7d1660 100644 --- a/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx +++ b/dev/ZKA/Modules/CoreCG/WindowRenderer.hxx @@ -51,6 +51,16 @@ namespace CG typedef struct UI_WINDOW_STRUCT UI_WINDOW_STRUCT; + inline Void CGDrawBackground() noexcept + { + CGInit(); + + CGDrawInRegion(CGColor(0x45, 0x00, 0x06), CG::UIAccessibilty::The().Height(), CG::UIAccessibilty::The().Width(), + 0, 0); + + CGFini(); + } + inline struct UI_WINDOW_STRUCT* CGCreateWindow(Int32 kind, const Char* window_name, const Char* class_name, Int32 x, Int32 y, Int32 width, Int32 height, UI_WINDOW_STRUCT* parent = nullptr) { UI_WINDOW_STRUCT* wnd = new UI_WINDOW_STRUCT(); @@ -106,9 +116,15 @@ namespace CG inline Kernel::Void CGDrawStringToWnd(UI_WINDOW_STRUCT* wnd, const Kernel::Char* text, Kernel::Int32 y_dst, Kernel::Int32 x_dst, Kernel::Int32 color) { + y_dst += wnd->w_y + FLATCONTROLS_HEIGHT; + x_dst += wnd->w_x; + + if (y_dst > (wnd->w_h + wnd->w_y)) + return; + for (Kernel::SizeT i = 0; text[i] != 0; ++i) { - if (x_dst > wnd->w_w) + if (x_dst > (wnd->w_w + wnd->w_x)) break; CGRenderStringFromBitMap(&cFontBitmap[text[i]][0], FONT_SIZE_X, FONT_SIZE_Y, y_dst, x_dst, color); @@ -209,11 +225,8 @@ namespace CG for (SizeT child = 0; child < wnd[index]->w_child_count; ++child) { - if (wnd[index]->w_child_elements[child]->w_x < wnd[index]->w_x + FLATCONTROLS_WIDTH) - wnd[index]->w_child_elements[child]->w_x += wnd[index]->w_x + FLATCONTROLS_WIDTH; - - if (wnd[index]->w_child_elements[child]->w_y < (wnd[index]->w_y + FLATCONTROLS_HEIGHT)) - wnd[index]->w_child_elements[child]->w_y += wnd[index]->w_y + FLATCONTROLS_HEIGHT; + wnd[index]->w_child_elements[child]->w_x += wnd[index]->w_x; + wnd[index]->w_child_elements[child]->w_y += wnd[index]->w_y + FLATCONTROLS_HEIGHT; if ((wnd[index]->w_child_elements[child]->w_w + wnd[index]->w_child_elements[child]->w_x) > (wnd[index]->w_x + wnd[index]->w_w) || (wnd[index]->w_child_elements[child]->w_h + wnd[index]->w_child_elements[child]->w_y) > (wnd[index]->w_y + wnd[index]->w_h)) |
