summaryrefslogtreecommitdiffhomepage
path: root/Public
diff options
context:
space:
mode:
authorAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-26 18:36:09 +0100
committerAmlal El Mahrouss <amlal@el-mahrouss-logic.com>2024-03-26 18:36:09 +0100
commit9a0c2664b0ca5634aa557b0761139cccfb0fe753 (patch)
tree004c49f89076c8b1f6f5ab9db031c4e010bfe95f /Public
parent66e4f909bd1a495d3f1c34d2e1b5cd71099ab1ae (diff)
Kernel: Add NewFS support: initial commit.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public')
-rw-r--r--Public/Developer/System.Core/Headers/Defines.hxx35
-rw-r--r--Public/Developer/System.Core/Headers/Dialog.hxx (renamed from Public/Developer/System.Core/Headers/Window/Dialog.hxx)2
-rw-r--r--Public/Developer/System.Core/Headers/Image.hxx (renamed from Public/Developer/System.Core/Headers/Window/Image.hxx)2
-rw-r--r--Public/Developer/System.Core/Headers/Menu.hxx (renamed from Public/Developer/System.Core/Headers/Window/Menu.hxx)2
-rw-r--r--Public/Developer/System.Core/Headers/Rsrc.hxx (renamed from Public/Developer/System.Core/Headers/Window/Rsrc.hxx)2
-rw-r--r--Public/Developer/System.Core/Headers/TrueType.hxx19
-rw-r--r--Public/Developer/System.Core/Headers/Window.hxx (renamed from Public/Developer/System.Core/Headers/Window/Window.hxx)15
-rw-r--r--Public/Developer/System.Core/Headers/Window/TrueType.hxx9
-rw-r--r--Public/Developer/System.Core/Sources/CRT0.cxx4
9 files changed, 60 insertions, 30 deletions
diff --git a/Public/Developer/System.Core/Headers/Defines.hxx b/Public/Developer/System.Core/Headers/Defines.hxx
index 9d6d84ee..55810d9d 100644
--- a/Public/Developer/System.Core/Headers/Defines.hxx
+++ b/Public/Developer/System.Core/Headers/Defines.hxx
@@ -6,16 +6,12 @@
#pragma once
-#ifndef __cplusplus
-#error This API is meant to be used with C++.
-#endif
-
#ifdef CA_MUST_PASS
#undef CA_MUST_PASS
#endif
#ifdef _DEBUG
-#define CA_MUST_PASS(e) { if (!e) { __assert_chk_fail() } }
+#define CA_MUST_PASS(e) { if (!e) { MsgBox("Sorry, ssertion failed.\nFile: %s\nLine: %i", __FILE__, __LINE__) __assert_chk_fail() } }
#else
#define CA_MUST_PASS(e) CA_UNREFERENCED_PARAMETER(e)
#endif
@@ -153,7 +149,7 @@ enum {
* @brief GUID type, something you can also find in CFKit.
* @author AMlal El Mahrouss
*/
-typedef struct GUID final {
+typedef struct GUID {
DWordType Data1;
WordType Data2;
WordType Data3;
@@ -162,23 +158,38 @@ typedef struct GUID final {
/// \brief Object handle.
/// \author Amlal El Mahrouss
-typedef struct Object final {
- CharacterTypeUTF8 ObjectName[255];
- DWordType ObjectType;
- CharacterTypeUTF8 ObjectNamespace[255];
+typedef struct Object {
+ CharacterTypeUTF8 Name[255];
+ DWordType Kind;
+ DWordType Flags;
VoidType(*Release)(struct Object* Self);
IntPtrType(*Invoke)(struct Object* Self, DWordType Sel, ...);
VoidType(*Query)(struct Object* Self, PtrVoidType* Dst, SizeType SzDst, struct GUID* GuidOf);
} *ObjectRef;
+#ifdef __cplusplus
+
#define object_cast reinterpret_cast<ObjectRef>
+template <SizeType N>
+using StrType = CharacterTypeUTF8[N];
+
+#else
+
+#define object_cast (ObjectRef)
+
+#endif // ifdef C++
+
CA_EXTERN_C ObjectRef HcGetAppObject(VoidType);
CA_INLINE ObjectRef kApplicationObject;
typedef CharacterTypeUTF8 Str255Type[255];
-template <SizeType N>
-using StrType = CharacterTypeUTF8[N];
+/// @brief Shows an message box with a formatting.
+/// @param title the message box title
+/// @param format the format
+/// @param va_list the va args, that goes along with it.
+/// @return void
+CA_EXTERN_C VoidType MsgBox(CharacterTypeUTF8* title, CharacterTypeUTF8* format, ...);
diff --git a/Public/Developer/System.Core/Headers/Window/Dialog.hxx b/Public/Developer/System.Core/Headers/Dialog.hxx
index 3e445532..0fc4e738 100644
--- a/Public/Developer/System.Core/Headers/Window/Dialog.hxx
+++ b/Public/Developer/System.Core/Headers/Dialog.hxx
@@ -6,4 +6,4 @@
#pragma once
-#include <System.Core/Headers/Window/Window.hxx>
+#include <System.Core/Headers/Window.hxx>
diff --git a/Public/Developer/System.Core/Headers/Window/Image.hxx b/Public/Developer/System.Core/Headers/Image.hxx
index 3e445532..0fc4e738 100644
--- a/Public/Developer/System.Core/Headers/Window/Image.hxx
+++ b/Public/Developer/System.Core/Headers/Image.hxx
@@ -6,4 +6,4 @@
#pragma once
-#include <System.Core/Headers/Window/Window.hxx>
+#include <System.Core/Headers/Window.hxx>
diff --git a/Public/Developer/System.Core/Headers/Window/Menu.hxx b/Public/Developer/System.Core/Headers/Menu.hxx
index 3e445532..0fc4e738 100644
--- a/Public/Developer/System.Core/Headers/Window/Menu.hxx
+++ b/Public/Developer/System.Core/Headers/Menu.hxx
@@ -6,4 +6,4 @@
#pragma once
-#include <System.Core/Headers/Window/Window.hxx>
+#include <System.Core/Headers/Window.hxx>
diff --git a/Public/Developer/System.Core/Headers/Window/Rsrc.hxx b/Public/Developer/System.Core/Headers/Rsrc.hxx
index 3e445532..0fc4e738 100644
--- a/Public/Developer/System.Core/Headers/Window/Rsrc.hxx
+++ b/Public/Developer/System.Core/Headers/Rsrc.hxx
@@ -6,4 +6,4 @@
#pragma once
-#include <System.Core/Headers/Window/Window.hxx>
+#include <System.Core/Headers/Window.hxx>
diff --git a/Public/Developer/System.Core/Headers/TrueType.hxx b/Public/Developer/System.Core/Headers/TrueType.hxx
new file mode 100644
index 00000000..14a85823
--- /dev/null
+++ b/Public/Developer/System.Core/Headers/TrueType.hxx
@@ -0,0 +1,19 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#pragma once
+
+#include <System.Core/Headers/Window.hxx>
+
+/*************************************************************
+ *
+ * File: TrueType.hxx
+ * Purpose: TrueType font implementation for System Software.
+ * Date: 3/26/24
+ *
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ *************************************************************/
diff --git a/Public/Developer/System.Core/Headers/Window/Window.hxx b/Public/Developer/System.Core/Headers/Window.hxx
index 4c79d50b..02be0681 100644
--- a/Public/Developer/System.Core/Headers/Window/Window.hxx
+++ b/Public/Developer/System.Core/Headers/Window.hxx
@@ -8,9 +8,18 @@
#include <System.Core/Headers/Defines.hxx>
-/// @file Window.hxx
-/// @brief Tracker window protocol.
-/// @author Amlal El Mahrouss.
+/*************************************************************
+ *
+ * File: Window.hxx
+ * Purpose: Window Manager implementation for System Software.
+ * Date: 3/26/24
+ *
+ * Copyright Mahrouss Logic, all rights reserved.
+ *
+ *************************************************************/
+
+struct _GraphicsPoint;
+struct _GraphicsPort;
typedef float PositionType;
diff --git a/Public/Developer/System.Core/Headers/Window/TrueType.hxx b/Public/Developer/System.Core/Headers/Window/TrueType.hxx
deleted file mode 100644
index 3e445532..00000000
--- a/Public/Developer/System.Core/Headers/Window/TrueType.hxx
+++ /dev/null
@@ -1,9 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#pragma once
-
-#include <System.Core/Headers/Window/Window.hxx>
diff --git a/Public/Developer/System.Core/Sources/CRT0.cxx b/Public/Developer/System.Core/Sources/CRT0.cxx
index a0235e68..b6fb9de1 100644
--- a/Public/Developer/System.Core/Sources/CRT0.cxx
+++ b/Public/Developer/System.Core/Sources/CRT0.cxx
@@ -4,9 +4,9 @@
#include <System.Core/Headers/Heap.hxx>
-/// @brief Inits the DLL.
+/// @brief Inits the library.
/// @return if it was succesful or not.
-CA_EXTERN_C DWordType __DllMain(VoidType) {
+CA_EXTERN_C DWordType __start(VoidType) {
kApplicationObject = HcGetAppObject();
CA_MUST_PASS(kApplicationObject);