summaryrefslogtreecommitdiffhomepage
path: root/dev/Modules/FB/WS.h
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-11-21 10:19:17 +0100
committerAmlal El Mahrouss <amlal.elmahrouss@icloud.com>2024-11-21 10:19:17 +0100
commitdc008570233d0dbfac32eb87367b7e4a08302e32 (patch)
tree37e3282f17e41297f35d0de9b8248120e3a4e855 /dev/Modules/FB/WS.h
parent6ed8a39c1bd3083297b41e981a2bf4bdbe2abd1f (diff)
META: 10:00 AM bump.
Diffstat (limited to 'dev/Modules/FB/WS.h')
-rw-r--r--dev/Modules/FB/WS.h58
1 files changed, 58 insertions, 0 deletions
diff --git a/dev/Modules/FB/WS.h b/dev/Modules/FB/WS.h
new file mode 100644
index 00000000..72259eb4
--- /dev/null
+++ b/dev/Modules/FB/WS.h
@@ -0,0 +1,58 @@
+/* -------------------------------------------
+
+ Copyright (C) 2024, EL Mahrouss Logic, all rights reserved.
+
+------------------------------------------- */
+
+#pragma once
+
+#include <ArchKit/ArchKit.h>
+#include <Modules/FB/FB.h>
+#include <Modules/FB/Text.h>
+#include <NewKit/Utils.h>
+
+/// @file WS.h
+/// @brief WindowServer's endpoint implementation. (within the zka-dev subsystem)
+
+namespace WS
+{
+ using namespace Kernel;
+
+ struct WSWindowContainer;
+
+ typedef UInt32* WSBackBufferKind;
+
+ class WSWindowContainer final
+ {
+ public:
+ WSWindowContainer() = default;
+ ~WSWindowContainer() = default;
+
+ ZKA_COPY_DEFAULT(WSWindowContainer);
+
+ /// @note the trick is, it could be GPU processed data, that's the cool thing.
+ BOOL PopulateWindow(WSBackBufferKind contents_buf, SizeT contents_len)
+ {
+ if (contents_len > BackBufferLength)
+ return NO;
+
+ if (!contents_buf)
+ return NO;
+
+ if (!BackBuffer ||
+ !BackBufferLength)
+ return NO;
+
+ rt_copy_memory(contents_buf, BackBuffer, contents_len);
+ return YES;
+ }
+
+ public:
+ WSBackBufferKind BackBuffer{nullptr};
+ SizeT BackBufferLength{0UL};
+
+ };
+}
+
+#define rtl_allocate_backbuffer(width, height) new WS::WSBackBufferKind[width * height]
+#define rtl_compute_fb_geometry(width, height) (width * height)