summaryrefslogtreecommitdiffhomepage
path: root/Public
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-25 08:06:38 +0100
committerAmlal El Mahrouss <amlalelmahrouss@icloud.com>2024-02-25 08:06:38 +0100
commit9be51d883414584db0926ab854d6026e1785048b (patch)
tree6afb5cec25c48ac76a8e26b2cc0b09dd1dc2c1ea /Public
parent27e0af3ecfe0be226f88837634111299121e5ddb (diff)
Kernel: Morning bump.
Signed-off-by: Amlal El Mahrouss <amlalelmahrouss@icloud.com>
Diffstat (limited to 'Public')
-rw-r--r--Public/Kits/GKit/Core.cxx2
-rw-r--r--Public/Kits/GKit/Core.hxx (renamed from Public/Kits/GKit/Core.hpp)31
-rw-r--r--Public/Kits/GKit/Dim2d.hpp2
-rw-r--r--Public/Kits/GKit/Frame.cxx2
-rw-r--r--Public/Kits/GKit/Frame.hxx (renamed from Public/Kits/GKit/Frame.hpp)4
-rw-r--r--Public/Kits/GKit/Makefile2
-rw-r--r--Public/Kits/GKit/Stylesheet.hxx4
-rw-r--r--Public/Kits/SystemKit/CoreAPI.hxx1
-rw-r--r--Public/Kits/SystemKit/ThreadAPI.hxx2
9 files changed, 36 insertions, 14 deletions
diff --git a/Public/Kits/GKit/Core.cxx b/Public/Kits/GKit/Core.cxx
index 1e694734..4030041f 100644
--- a/Public/Kits/GKit/Core.cxx
+++ b/Public/Kits/GKit/Core.cxx
@@ -11,4 +11,4 @@
------------------------------------------- */
-#include <GKit/Core.hpp>
+#include <GKit/Core.hxx>
diff --git a/Public/Kits/GKit/Core.hpp b/Public/Kits/GKit/Core.hxx
index 39eb341b..98a25f72 100644
--- a/Public/Kits/GKit/Core.hpp
+++ b/Public/Kits/GKit/Core.hxx
@@ -2,7 +2,7 @@
Copyright Mahrouss Logic
- File: Core.hpp
+ File: Core.hxx
Purpose:
Revision History:
@@ -23,9 +23,9 @@
#define $() HCore::GApplication::Shared()->Document()
#ifdef __EXPORT_LIB
-#define G_API __attribute__((container(".EXPORT")))
+#define G_API __attribute__((pef_container(".EXPORT")))
#else
-#define G_API __attribute__((container(".IMPORT")))
+#define G_API __attribute__((pef_container(".IMPORT")))
#endif // ifdef __EXPORT_LIB
namespace HCore {
@@ -157,4 +157,29 @@ class G_API GDocument final {
GFrame* mFrame{nullptr};
GString mString;
};
+
+class GException final {
+ public:
+ explicit GException() = default;
+ ~GException() = default;
+
+ public:
+ HCORE_COPY_DEFAULT(GException);
+
+ public:
+ const char* Name() { return "GUI Error"; }
+ const char* Reason() { return mReason; }
+
+ private:
+ const char* mReason{"CoreAPI: GUI Exception!"};
+};
+
+template <typename GFrameType, typename GFrameBase>
+inline GFrameType* frame_cast(GFrameBase* Frame) {
+ if (!dynamic_cast<GFrameType*>(Frame)) {
+ throw GException();
+ }
+
+ return dynamic_cast<GFrameType*>(Frame);
+}
} // namespace HCore
diff --git a/Public/Kits/GKit/Dim2d.hpp b/Public/Kits/GKit/Dim2d.hpp
index 9ae01aa0..23d1e100 100644
--- a/Public/Kits/GKit/Dim2d.hpp
+++ b/Public/Kits/GKit/Dim2d.hpp
@@ -14,7 +14,7 @@
#ifndef __GORG__DIM2D_HPP__
#define __GORG__DIM2D_HPP__
-#include <GKit/Core.hpp>
+#include <GKit/Core.hxx>
namespace HCore {
class Dim2d final {
diff --git a/Public/Kits/GKit/Frame.cxx b/Public/Kits/GKit/Frame.cxx
index 939dfc5a..c1f1df2c 100644
--- a/Public/Kits/GKit/Frame.cxx
+++ b/Public/Kits/GKit/Frame.cxx
@@ -11,6 +11,6 @@
------------------------------------------- */
-#include <GKit/Frame.hpp>
+#include <GKit/Frame.hxx>
namespace HCore {}
diff --git a/Public/Kits/GKit/Frame.hpp b/Public/Kits/GKit/Frame.hxx
index f71628a7..efa46fa3 100644
--- a/Public/Kits/GKit/Frame.hpp
+++ b/Public/Kits/GKit/Frame.hxx
@@ -2,7 +2,7 @@
Copyright Mahrouss Logic
- File: Frame.hpp
+ File: Frame.hxx
Purpose:
Revision History:
@@ -13,7 +13,7 @@
#pragma once
-#include <GKit/Core.hpp>
+#include <GKit/Core.hxx>
#include <GKit/Dim2d.hpp>
#include <NewKit/MutableArray.hpp>
diff --git a/Public/Kits/GKit/Makefile b/Public/Kits/GKit/Makefile
index be1586d9..2873f91b 100644
--- a/Public/Kits/GKit/Makefile
+++ b/Public/Kits/GKit/Makefile
@@ -5,8 +5,6 @@
CC=x86_64-w64-mingw32-g++
CCFLAGS=-shared -ffreestanding -fno-rtti -fno-exceptions -std=c++20
-ASM=nasm
-ASMFLAGS=-f elf64
OUTPUT=GKit.dll
.PHONY: build-gkit
diff --git a/Public/Kits/GKit/Stylesheet.hxx b/Public/Kits/GKit/Stylesheet.hxx
index a34dd435..55291f73 100644
--- a/Public/Kits/GKit/Stylesheet.hxx
+++ b/Public/Kits/GKit/Stylesheet.hxx
@@ -15,12 +15,10 @@
/// TODO: Stylesheets for GUI.
-#include <GKit/Core.hpp>
+#include <GKit/Core.hxx>
#include <GKit/Dim2d.hpp>
#include <NewKit/MutableArray.hpp>
-#include "NewKit/String.hpp"
-
namespace HCore {
class G_API Stylesheet final {
public:
diff --git a/Public/Kits/SystemKit/CoreAPI.hxx b/Public/Kits/SystemKit/CoreAPI.hxx
index 8fc2d770..46af0cef 100644
--- a/Public/Kits/SystemKit/CoreAPI.hxx
+++ b/Public/Kits/SystemKit/CoreAPI.hxx
@@ -26,6 +26,7 @@
#define CA_CDECL __attribute__((cdecl))
#define CA_MSCALL __attribute__((ms_abi))
+typedef __UINT8_TYPE__ BYTE;
typedef __UINT16_TYPE__ WORD;
typedef __UINT32_TYPE__ DWORD;
typedef __UINT64_TYPE__ QWORD;
diff --git a/Public/Kits/SystemKit/ThreadAPI.hxx b/Public/Kits/SystemKit/ThreadAPI.hxx
index 80742ab9..bbdf4779 100644
--- a/Public/Kits/SystemKit/ThreadAPI.hxx
+++ b/Public/Kits/SystemKit/ThreadAPI.hxx
@@ -24,7 +24,7 @@ struct ThreadInformationBlock final {
const UIntPtr StartAddress; // Start Address
const UIntPtr StartHeap; // Allocation Heap
const UIntPtr StartStack; // Stack Pointer.
- const Int32 ARCH; // Architecture and/or platform.
+ const Int32 Arch; // Architecture and/or platform.
};
enum {