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 | |
| 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')
| -rw-r--r-- | dev/CRT/crt.json (renamed from dev/CRT/build.json) | 0 | ||||
| -rw-r--r-- | dev/DDK/KernelStd.h | 21 | ||||
| -rw-r--r-- | dev/DDK/ddk.json (renamed from dev/DDK/build.json) | 1 | ||||
| -rw-r--r-- | dev/SCI/sci.json (renamed from dev/SCI/build.json) | 0 | ||||
| -rw-r--r-- | dev/ZKA/Modules/CoreCG/WindowRenderer.hxx | 32 | ||||
| -rw-r--r-- | dev/ZWM/.keepme | 0 | ||||
| -rw-r--r-- | dev/ZWM/Sources/zwm_main.cxx | 32 | ||||
| -rw-r--r-- | dev/ZWM/zwm.json | 22 |
8 files changed, 98 insertions, 10 deletions
diff --git a/dev/CRT/build.json b/dev/CRT/crt.json index d91b6131..d91b6131 100644 --- a/dev/CRT/build.json +++ b/dev/CRT/crt.json diff --git a/dev/DDK/KernelStd.h b/dev/DDK/KernelStd.h index da15f269..4270229b 100644 --- a/dev/DDK/KernelStd.h +++ b/dev/DDK/KernelStd.h @@ -13,15 +13,28 @@ #include <stddef.h> #if defined(__cplusplus) -#define DK_EXTERN extern "C" +#define DK_EXTERN extern "C" __declspec(dllexport) #define nil nullptr +#undef NULL +#define NULL 0 #define DK_FINAL final #else -#define DK_EXTERN extern +#define DK_EXTERN extern __declspec(dllexport) #define nil ((void*)0) +#undef NULL +#define NULL ((void*)0) #define DK_FINAL #endif // defined(__cplusplus) +#ifndef __DDK__ +#undef DK_EXTERN +#if defined(__cplusplus) +#define DK_EXTERN extern "C" __declspec(dllimport) +#else +#define DK_EXTERN __declspec(dllimport) +#endif +#endif + #define ATTRIBUTE(X) __attribute__((X)) #ifndef __NEWOSKRNL__ @@ -33,9 +46,9 @@ struct DDK_OBJECT_MANIFEST; struct DDK_OBJECT_MANIFEST DK_FINAL { - char* p_name; + char* p_name; int32_t p_kind; - void* p_object; + void* p_object; }; /// \brief DDK status structure (__at_enable, __at_disable...) diff --git a/dev/DDK/build.json b/dev/DDK/ddk.json index a9a3b895..b930f99c 100644 --- a/dev/DDK/build.json +++ b/dev/DDK/ddk.json @@ -16,6 +16,7 @@ "cpp_macros": [ "__NEWOSKRNL__", "__DDK_AMD64__", + "__DDK__", "cDDKVersionHighest=0x0100", "cDDKVersionLowest=0x0100", "cDDKVersion=0x0100" diff --git a/dev/SCI/build.json b/dev/SCI/sci.json index 0c367bd6..0c367bd6 100644 --- a/dev/SCI/build.json +++ b/dev/SCI/sci.json 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; diff --git a/dev/ZWM/.keepme b/dev/ZWM/.keepme new file mode 100644 index 00000000..e69de29b --- /dev/null +++ b/dev/ZWM/.keepme diff --git a/dev/ZWM/Sources/zwm_main.cxx b/dev/ZWM/Sources/zwm_main.cxx new file mode 100644 index 00000000..38d441bd --- /dev/null +++ b/dev/ZWM/Sources/zwm_main.cxx @@ -0,0 +1,32 @@ +/* ------------------------------------------- + + Copyright ZKA Technologies. + + FILE: IFSMain.cxx + PURPOSE: HPFS IFS entrypoint. + +------------------------------------------- */ + +#include <DDK/KernelStd.h> +#include <cstdint> + +static uint32_t cGPUIndexHW = 0U; +static struct DDK_OBJECT_MANIFEST* cGPUObject = nullptr; + +/** @brief ZWM main, ZWM acts a proxy to the Installed GPU Driver. */ +int32_t ModuleMain(void) +{ + int index_gpu = 0; + struct DDK_OBJECT_MANIFEST* gpu_object = nullptr; + + while (!gpu_object) + { + gpu_object = KernelGetObject(index_gpu, "GPU_OBJECT"); + ++index_gpu; + } + + cGPUIndexHW = index_gpu; + cGPUObject = gpu_object; + + return 0; +} diff --git a/dev/ZWM/zwm.json b/dev/ZWM/zwm.json new file mode 100644 index 00000000..2f759c56 --- /dev/null +++ b/dev/ZWM/zwm.json @@ -0,0 +1,22 @@ +{ + "compiler_path": "x86_64-w64-mingw32-g++", + "compiler_std": "c++20", + "headers_path": ["../"], + "sources_path": ["Sources/*.cxx"], + "output_name": "zwm.sys", + "compiler_flags": [ + "-fPIC", + "-ffreestanding", + "-shared", + "-fno-rtti", + "-fno-exceptions", + "-Wl,--subsystem=17" + ], + "cpp_macros": [ + "__ZWM_IMPL__", + "__NEWOSKRNL__", + "cZWMVersion=0x0100", + "cZWMVersionHighest=0x0100", + "cZWMVersionLowest=0x0100" + ] +} |
