summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.vscode/c_cpp_properties.json2
-rw-r--r--Private/NewKit/Application.hxx29
-rw-r--r--Private/ObjectKit/ObjectKit.hxx35
-rw-r--r--Private/Root/Support/.gitkeep (renamed from Private/Root/Frameworks/.gitkeep)0
-rw-r--r--Private/Root/Users/.USERHASH0
-rw-r--r--Private/Root/Users/User.script3
-rw-r--r--Public/Developer/CxxLib/.gitkeep (renamed from Public/Developer/System.Containers/.gitkeep)0
-rw-r--r--Public/Developer/CxxLib/Sources/New+Delete.cxx (renamed from Public/Developer/System.Cxx/Sources/New+Delete.cxx)2
-rw-r--r--Public/Developer/DriverLib/.gitkeep (renamed from Public/Developer/System.Core/.gitkeep)0
-rw-r--r--Public/Developer/System.Containers/Headers/ODF.h41
-rw-r--r--Public/Developer/System.Containers/Headers/XIFF.h62
-rw-r--r--Public/Developer/System.Core/ReadMe.md8
-rw-r--r--Public/Developer/System.Core/Sources/App.c20
-rw-r--r--Public/Developer/System.Core/Sources/Start.c15
-rw-r--r--Public/Developer/System.Driver/.gitkeep0
-rw-r--r--Public/Developer/SystemLib/.gitkeep (renamed from Public/Developer/System.Core/ARM64/.gitkeep)0
-rw-r--r--Public/Developer/SystemLib/AMD64/HCoreAssemblyRoutines.s (renamed from Public/Developer/System.Core/AMD64/HCoreAssemblyRoutines.s)0
-rw-r--r--Public/Developer/SystemLib/ARM64/.gitkeep (renamed from Public/Developer/System.Core/RISCV/.gitkeep)0
-rw-r--r--Public/Developer/SystemLib/Headers/Defines.h (renamed from Public/Developer/System.Core/Headers/Defines.h)47
-rw-r--r--Public/Developer/SystemLib/Headers/Dialog.h (renamed from Public/Developer/System.Core/Headers/Dialog.h)2
-rw-r--r--Public/Developer/SystemLib/Headers/File.h (renamed from Public/Developer/System.Core/Headers/File.h)2
-rw-r--r--Public/Developer/SystemLib/Headers/Heap.h (renamed from Public/Developer/System.Core/Headers/Heap.h)2
-rw-r--r--Public/Developer/SystemLib/Headers/Hint.h (renamed from Public/Developer/System.Core/Headers/Hint.h)0
-rw-r--r--Public/Developer/SystemLib/Headers/Thread.h (renamed from Public/Developer/System.Core/Headers/Thread.h)2
-rw-r--r--Public/Developer/SystemLib/Headers/TrueType.h (renamed from Public/Developer/System.Core/Headers/TrueType.h)3
-rw-r--r--Public/Developer/SystemLib/Headers/Window.h (renamed from Public/Developer/System.Core/Headers/Window.h)2
-rw-r--r--Public/Developer/SystemLib/Makefile (renamed from Public/Developer/System.Core/Makefile)2
-rw-r--r--Public/Developer/SystemLib/RISCV/.gitkeep (renamed from Public/Developer/System.Cxx/.gitkeep)0
-rw-r--r--Public/Developer/SystemLib/ReadMe.md14
-rw-r--r--Public/Developer/SystemLib/Sources/Application.c25
-rw-r--r--Public/Developer/SystemLib/Sources/ApplicationStart.c14
-rw-r--r--Public/Developer/SystemLib/Sources/Heap.c (renamed from Public/Developer/System.Core/Sources/Heap.c)10
-rw-r--r--Public/Developer/SystemLib/Sources/Window.c (renamed from Public/Developer/System.Core/Sources/Window.c)26
-rw-r--r--Public/Developer/SystemLib/compile_flags.txt (renamed from Public/Developer/System.Core/compile_flags.txt)0
34 files changed, 131 insertions, 237 deletions
diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json
index bc577a82..08cf70c4 100644
--- a/.vscode/c_cpp_properties.json
+++ b/.vscode/c_cpp_properties.json
@@ -5,6 +5,7 @@
"includePath": [
"${workspaceFolder}/Private/**",
"${workspaceFolder}/Private/NewBoot/**",
+ "${workspaceFolder}/Public/Developer/SystemLib/**",
"${workspaceFolder}/Public/Developer/**"
],
"defines": [
@@ -34,6 +35,7 @@
"includePath": [
"${workspaceFolder}/Private/**",
"${workspaceFolder}/Private/NewBoot/**",
+ "${workspaceFolder}/Public/Developer/SystemLib/**",
"${workspaceFolder}/Public/Developer/**"
],
"defines": [
diff --git a/Private/NewKit/Application.hxx b/Private/NewKit/Application.hxx
new file mode 100644
index 00000000..292bb434
--- /dev/null
+++ b/Private/NewKit/Application.hxx
@@ -0,0 +1,29 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#pragma once
+
+///
+/// @brief Main application object, given by the OS to interact with the OS.
+/// @file Application.hxx
+/// @author Amlal EL Mahrouss
+///
+
+#include <NewKit/Defines.hpp>
+#include <CFKit/GUIDWrapper.hpp>
+
+/// \brief Application Interface.
+/// \author Amlal El Mahrouss
+typedef struct Application final {
+ /// @brief Releases the object exit the process on main object.
+ NewOS::Void(*Release)(struct Application* Self, NewOS::Int32 ExitCode);
+ /// @brief Invoke a function from the application object.
+ NewOS::IntPtr(*Invoke)(struct Application* Self, NewOS::Int32 Sel, ...);
+ /// @brief Query a new application object from a GUID.
+ NewOS::Void(*Query)(struct Application* Self, NewOS::VoidPtr* Dst, NewOS::SizeT SzDst, NewOS::XRN::GUIDSequence GuidOf);
+} Application, *ApplicationRef;
+
+#define object_cast reinterpret_cast<ApplicationRef>
diff --git a/Private/ObjectKit/ObjectKit.hxx b/Private/ObjectKit/ObjectKit.hxx
deleted file mode 100644
index 384bf145..00000000
--- a/Private/ObjectKit/ObjectKit.hxx
+++ /dev/null
@@ -1,35 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#pragma once
-
-#include <NewKit/Defines.hpp>
-#include <CFKit/GUIDWrapper.hpp>
-
-#define kObjectGlobalNamespace ":\\"
-
-enum {
- kObjectTypeGeneric,
- kObjectTypeFile,
- kObjectTypeDevice,
- kObjectTypeNetwork,
- kObjectTypeInvalid,
- kObjectTypeCount = 5,
-};
-
-/// \brief Object handle.
-/// \author Amlal El Mahrouss
-typedef struct Object final {
- NewOS::Char ObjectName[255];
- NewOS::Int32 ObjectType;
- NewOS::Char ObjectNamespace[255];
-
- NewOS::Void(*Release)(struct Object* Self);
- NewOS::IntPtr(*Invoke)(struct Object* Self, NewOS::Int32 Sel, ...);
- NewOS::Void(*Query)(struct Object* Self, NewOS::VoidPtr* Dst, NewOS::SizeT SzDst, NewOS::XRN::GUIDSequence GuidOf);
-} *ObjectRef;
-
-#define object_cast reinterpret_cast<ObjectRef>
diff --git a/Private/Root/Frameworks/.gitkeep b/Private/Root/Support/.gitkeep
index e69de29b..e69de29b 100644
--- a/Private/Root/Frameworks/.gitkeep
+++ b/Private/Root/Support/.gitkeep
diff --git a/Private/Root/Users/.USERHASH b/Private/Root/Users/.USERHASH
deleted file mode 100644
index e69de29b..00000000
--- a/Private/Root/Users/.USERHASH
+++ /dev/null
diff --git a/Private/Root/Users/User.script b/Private/Root/Users/User.script
new file mode 100644
index 00000000..09cecb8b
--- /dev/null
+++ b/Private/Root/Users/User.script
@@ -0,0 +1,3 @@
+# User script
+
+Guest: true;
diff --git a/Public/Developer/System.Containers/.gitkeep b/Public/Developer/CxxLib/.gitkeep
index e69de29b..e69de29b 100644
--- a/Public/Developer/System.Containers/.gitkeep
+++ b/Public/Developer/CxxLib/.gitkeep
diff --git a/Public/Developer/System.Cxx/Sources/New+Delete.cxx b/Public/Developer/CxxLib/Sources/New+Delete.cxx
index b54b5ea8..c95da3e1 100644
--- a/Public/Developer/System.Cxx/Sources/New+Delete.cxx
+++ b/Public/Developer/CxxLib/Sources/New+Delete.cxx
@@ -4,7 +4,7 @@
------------------------------------------- */
-#include <System.Core/Headers/Heap.h>
+#include <Headers/Heap.h>
typedef SizeType size_t;
diff --git a/Public/Developer/System.Core/.gitkeep b/Public/Developer/DriverLib/.gitkeep
index e69de29b..e69de29b 100644
--- a/Public/Developer/System.Core/.gitkeep
+++ b/Public/Developer/DriverLib/.gitkeep
diff --git a/Public/Developer/System.Containers/Headers/ODF.h b/Public/Developer/System.Containers/Headers/ODF.h
deleted file mode 100644
index 48dc1e1e..00000000
--- a/Public/Developer/System.Containers/Headers/ODF.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/** ===========================================
- (C) Mahrouss Logic
- ===========================================*/
-
-#ifndef __ODF__
-#define __ODF__
-
-#include <System.Core/Headers/Defines.h>
-
-/**
- * @brief Open Document Format
- * @file ODF.hxx
- */
-
-/// @brief four-character code for ODF.
-#define kFourCCLength_ODF 4
-
-/// @brief Document file header.
-typedef struct ODFFileHeader {
- CharacterTypeUTF8 f_Ident[kFourCCLength_ODF];
-
- Int32Type f_DocumentKind;
- Int32Type f_DocumentSize;
-
- Int64Type f_MetaForkOffset;
- Int64Type f_DocumentForkOffset;
-
- CharacterTypeUTF8 f_Padding[4];
-} PACKED ODFFileHeader;
-
-/// @brief ODF Fork header
-typedef struct ODFForkHeader {
- CharacterTypeUTF8 f_MetadataName[255];
-
- Int32Type f_MetadataKind;
- Int32Type f_MetadataSize;
-
- CharacterTypeUTF8 f_Padding;
-} PACKED ODFForkHeader;
-
-#endif // !__ODF__ \ No newline at end of file
diff --git a/Public/Developer/System.Containers/Headers/XIFF.h b/Public/Developer/System.Containers/Headers/XIFF.h
deleted file mode 100644
index dd4880cd..00000000
--- a/Public/Developer/System.Containers/Headers/XIFF.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/** ===========================================
- (C) Mahrouss Logic
- ===========================================*/
-
-#ifndef __XIFF__
-#define __XIFF__
-
-/** ---------------------------------------------------
-
- * The eXtended Information File Format.
- * XIFF is used to make setup programs/audio/video files.
-
-------------------------------------------------------- */
-
-#include <System.Core/Headers/Defines.h>
-
-/// @brief four-character code for XIFF.
-#define kFourCCLength_XIFF 4
-#define kXIFFNameLength 255
-
-#define kXIFFContainerVideo "XVFF"
-#define kXIFFContainerAudio "XAFF"
-#define kXIFFContainerInstaller "XNFF"
-#define kXIFFContainerGeneric "XIFF"
-#define kXIFFContainerBinary "XBFF"
-
-/***
- * @brief Generic XIFF header
- * Used by XIFF based containers.
- */
-
-struct PACKED XiffHeader {
- ByteType f_Magic[kFourCCLength_XIFF]; // XIFF string (includes \0)
- DWordType f_Size; // overall size of header (XiffHeader) in bytes
- DWordType f_FormatType; // format type. generic
- ByteType f_SpecificMag[kFourCCLength_XIFF]; // The sub header magic
- DWordType f_SpecificSize; // length of the format data
- DWordType f_SpecificFormatType; // format type. generic
-};
-
-typedef struct XiffHeader XiffHeader;
-
-/// @brief XIFF metadata header, either located in forks or in file directly.
-/// @author Amlal EL Mahrouss
-struct PACKED XiffMetadataHeader {
- ByteType f_Name[kXIFFNameLength];
- DWordType f_Flags;
- DWordType f_Type;
- QWordType f_Offset;
- SizeType f_Size;
-};
-
-/// Pascal string
-#define kXIFFStringMetadata4CC "strp"
-
-/// TrueType font
-#define kXIFFFontMetadata4CC "font"
-
-/// UI resource
-#define kXIFFResourceMetadata4CC "resx"
-
-#endif // ifndef __XIFF__
diff --git a/Public/Developer/System.Core/ReadMe.md b/Public/Developer/System.Core/ReadMe.md
deleted file mode 100644
index 3867dd3d..00000000
--- a/Public/Developer/System.Core/ReadMe.md
+++ /dev/null
@@ -1,8 +0,0 @@
-# System.Core
-## Core System API.
-
-Currently contains:
-- Heap API.
-- File API.
-- Data types.
-- Threading API. \ No newline at end of file
diff --git a/Public/Developer/System.Core/Sources/App.c b/Public/Developer/System.Core/Sources/App.c
deleted file mode 100644
index 0bd7fd03..00000000
--- a/Public/Developer/System.Core/Sources/App.c
+++ /dev/null
@@ -1,20 +0,0 @@
-/** ===========================================
- (C) Mahrouss Logic
- ===========================================*/
-
-#include <System.Core/Headers/Defines.h>
-
-/// @brief Gets the app arguments count.
-/// @param
-/// @return
-CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) {
- return kApplicationObject->Invoke(kApplicationObject, kCallGetArgsCount);
-}
-
-/// @brief Gets the app arguments pointer.
-/// @param
-/// @return
-CA_EXTERN_C CharacterTypeUTF8* RtGetAppArgumentsPtr(VoidType) {
- return (CharacterTypeUTF8*)kApplicationObject->Invoke(kApplicationObject,
- kCallGetArgsPtr);
-} \ No newline at end of file
diff --git a/Public/Developer/System.Core/Sources/Start.c b/Public/Developer/System.Core/Sources/Start.c
deleted file mode 100644
index 24d41a1e..00000000
--- a/Public/Developer/System.Core/Sources/Start.c
+++ /dev/null
@@ -1,15 +0,0 @@
-/** ===========================================
- (C) Mahrouss Logic
- ===========================================*/
-
-#include <System.Core/Headers/Heap.h>
-
-/// @brief Main Application object, retrieved from __start symbol.
-CA_EXTERN_C ObjectRef kApplicationObject = NULL;
-
-/// @brief Inits the library.
-/// @return if it was succesful or not.
-CA_EXTERN_C VoidType __start(VoidType) {
- kApplicationObject = RtGetAppObject();
- CA_MUST_PASS(kApplicationObject);
-}
diff --git a/Public/Developer/System.Driver/.gitkeep b/Public/Developer/System.Driver/.gitkeep
deleted file mode 100644
index e69de29b..00000000
--- a/Public/Developer/System.Driver/.gitkeep
+++ /dev/null
diff --git a/Public/Developer/System.Core/ARM64/.gitkeep b/Public/Developer/SystemLib/.gitkeep
index e69de29b..e69de29b 100644
--- a/Public/Developer/System.Core/ARM64/.gitkeep
+++ b/Public/Developer/SystemLib/.gitkeep
diff --git a/Public/Developer/System.Core/AMD64/HCoreAssemblyRoutines.s b/Public/Developer/SystemLib/AMD64/HCoreAssemblyRoutines.s
index 58bb1260..58bb1260 100644
--- a/Public/Developer/System.Core/AMD64/HCoreAssemblyRoutines.s
+++ b/Public/Developer/SystemLib/AMD64/HCoreAssemblyRoutines.s
diff --git a/Public/Developer/System.Core/RISCV/.gitkeep b/Public/Developer/SystemLib/ARM64/.gitkeep
index e69de29b..e69de29b 100644
--- a/Public/Developer/System.Core/RISCV/.gitkeep
+++ b/Public/Developer/SystemLib/ARM64/.gitkeep
diff --git a/Public/Developer/System.Core/Headers/Defines.h b/Public/Developer/SystemLib/Headers/Defines.h
index 56367cff..c4cc552b 100644
--- a/Public/Developer/System.Core/Headers/Defines.h
+++ b/Public/Developer/SystemLib/Headers/Defines.h
@@ -142,19 +142,8 @@ enum RtProcessCall {
kCallsCount,
};
-#include <System.Core/Headers/Hint.h>
-#include <System.Core/Headers/Dialog.h>
-
-#define kObjectGlobalNamespace ":\\"
-
-enum {
- kObjectTypeGeneric,
- kObjectTypeFile,
- kObjectTypeDevice,
- kObjectTypeNetwork,
- kObjectTypeInvalid,
- kObjectTypeCount = 5,
-};
+#include <Headers/Hint.h>
+#include <Headers/Dialog.h>
/**
* @brief GUID type, something you can also find in CFKit.
@@ -167,41 +156,41 @@ typedef struct GUID {
ByteType Data4[8];
} GUIDType, *PtrGUIDType;
-/// \brief Object handle.
+/// \brief Application Interface.
/// \author Amlal El Mahrouss
-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;
+typedef struct Application {
+ VoidType(*Release)(struct Application* Self, DWordType ExitCode);
+ IntPtrType(*Invoke)(struct Application* Self, DWordType Sel, ...);
+ VoidType(*Query)(struct Application* Self, PtrVoidType* Dst, SizeType SzDst, struct GUID* GuidOf);
+} Application, *ApplicationRef;
#ifdef __cplusplus
-#define object_cast reinterpret_cast<ObjectRef>
+#define object_cast reinterpret_cast<ApplicationRef>
template <SizeType N>
using StrType = CharacterTypeUTF8[N];
#else
-#define object_cast (ObjectRef)
+#define object_cast (ApplicationRef)
#endif // ifdef C++
-CA_EXTERN_C ObjectRef RtGetAppObject(VoidType);
+CA_EXTERN_C ApplicationRef RtGetAppObject(VoidType);
CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType);
CA_EXTERN_C CharacterTypeUTF8* RtGetAppArgumentsPtr(VoidType);
-CA_EXTERN_C ObjectRef kApplicationObject;
+CA_EXTERN_C ApplicationRef kSharedApplication;
-typedef CharacterTypeUTF8 Str255Type[255];
+typedef CharacterTypeUTF8 StrType255[255];
#define True 1
#define False 0
#define Bool BooleanType
-#define NULL ((PtrVoidType)0)
+#define NullPtr ((PtrVoidType)0)
+
+#ifndef kInvalidRef
+#define kInvalidRef 0
+#endif
diff --git a/Public/Developer/System.Core/Headers/Dialog.h b/Public/Developer/SystemLib/Headers/Dialog.h
index 9d4521cf..d3e8df44 100644
--- a/Public/Developer/System.Core/Headers/Dialog.h
+++ b/Public/Developer/SystemLib/Headers/Dialog.h
@@ -6,7 +6,7 @@
#pragma once
-#include <System.Core/Headers/Window.h>
+#include <Headers/Window.h>
/// @brief Shows an message box with a formatting.
/// @param title the message box title
diff --git a/Public/Developer/System.Core/Headers/File.h b/Public/Developer/SystemLib/Headers/File.h
index 13bc7a00..0bce05f9 100644
--- a/Public/Developer/System.Core/Headers/File.h
+++ b/Public/Developer/SystemLib/Headers/File.h
@@ -6,7 +6,7 @@
#pragma once
-#include <System.Core/Headers/Defines.h>
+#include <Headers/Defines.h>
/// @brief Filesystem wrapper.
diff --git a/Public/Developer/System.Core/Headers/Heap.h b/Public/Developer/SystemLib/Headers/Heap.h
index 9f3215db..2dc13b0f 100644
--- a/Public/Developer/System.Core/Headers/Heap.h
+++ b/Public/Developer/SystemLib/Headers/Heap.h
@@ -6,7 +6,7 @@
#pragma once
-#include <System.Core/Headers/Defines.h>
+#include <Headers/Defines.h>
#define kAllocationTypes 2
diff --git a/Public/Developer/System.Core/Headers/Hint.h b/Public/Developer/SystemLib/Headers/Hint.h
index 86faf455..86faf455 100644
--- a/Public/Developer/System.Core/Headers/Hint.h
+++ b/Public/Developer/SystemLib/Headers/Hint.h
diff --git a/Public/Developer/System.Core/Headers/Thread.h b/Public/Developer/SystemLib/Headers/Thread.h
index 7d2bfe3c..4a54d841 100644
--- a/Public/Developer/System.Core/Headers/Thread.h
+++ b/Public/Developer/SystemLib/Headers/Thread.h
@@ -11,7 +11,7 @@
#ifndef __THREAD__
#define __THREAD__
-#include <System.Core/Headers/Defines.h>
+#include <Headers/Defines.h>
#define kThreadErrorExit -33
diff --git a/Public/Developer/System.Core/Headers/TrueType.h b/Public/Developer/SystemLib/Headers/TrueType.h
index 2e8f4142..0636bf61 100644
--- a/Public/Developer/System.Core/Headers/TrueType.h
+++ b/Public/Developer/SystemLib/Headers/TrueType.h
@@ -6,7 +6,7 @@
#pragma once
-#include <System.Core/Headers/Window.h>
+#include <Headers/Window.h>
/*************************************************************
*
@@ -29,4 +29,3 @@ CA_EXTERN_C TTFFontRef FnCreateFont(const CharacterTypeUTF8* name);
/// @param fon
/// @return
CA_EXTERN_C VoidType FnDisposeFont(TTFFontRef fon);
-
diff --git a/Public/Developer/System.Core/Headers/Window.h b/Public/Developer/SystemLib/Headers/Window.h
index 846d5cff..4d526782 100644
--- a/Public/Developer/System.Core/Headers/Window.h
+++ b/Public/Developer/SystemLib/Headers/Window.h
@@ -6,7 +6,7 @@
#pragma once
-#include <System.Core/Headers/Defines.h>
+#include <Headers/Defines.h>
/*************************************************************
*
diff --git a/Public/Developer/System.Core/Makefile b/Public/Developer/SystemLib/Makefile
index b9a0a663..21b21ad9 100644
--- a/Public/Developer/System.Core/Makefile
+++ b/Public/Developer/SystemLib/Makefile
@@ -6,7 +6,7 @@
CC=x86_64-w64-mingw32-gcc
AR=x86_64-w64-mingw32-ar
ARFLAGS=-rcs
-CCINC=-I../
+CCINC=-I./
CCFLAGS=-D__SINGLE_PRECISION__ -nostdlib -std=c17 -ffreestanding -Xlinker --subsystem=17 -shared
OUTPUT=SystemLib.lib
diff --git a/Public/Developer/System.Cxx/.gitkeep b/Public/Developer/SystemLib/RISCV/.gitkeep
index e69de29b..e69de29b 100644
--- a/Public/Developer/System.Cxx/.gitkeep
+++ b/Public/Developer/SystemLib/RISCV/.gitkeep
diff --git a/Public/Developer/SystemLib/ReadMe.md b/Public/Developer/SystemLib/ReadMe.md
new file mode 100644
index 00000000..ff89e847
--- /dev/null
+++ b/Public/Developer/SystemLib/ReadMe.md
@@ -0,0 +1,14 @@
+# SystemLib
+## System API.
+
+Currently contains:
+- Heap API.
+- File API.
+- Window Manager API.
+- Dialogs API.
+- Data types.
+- Threading API.
+
+Needs:
+- Device API
+- Drive API. \ No newline at end of file
diff --git a/Public/Developer/SystemLib/Sources/Application.c b/Public/Developer/SystemLib/Sources/Application.c
new file mode 100644
index 00000000..d7a83d3e
--- /dev/null
+++ b/Public/Developer/SystemLib/Sources/Application.c
@@ -0,0 +1,25 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#include <Headers/Defines.h>
+
+/// @brief Main Application object, retrieved from the RtGetAppObject symbol.
+ApplicationRef kSharedApplication = NullPtr;
+
+/// @brief Gets the app arguments count.
+/// @param void no arguments.
+/// @return
+CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) {
+ return kSharedApplication->Invoke(kSharedApplication, kCallGetArgsCount);
+}
+
+/// @brief Gets the app arguments pointer.
+/// @param void no arguments.
+/// @return
+CA_EXTERN_C CharacterTypeUTF8* RtGetAppArgumentsPtr(VoidType) {
+ return (CharacterTypeUTF8*)kSharedApplication->Invoke(kSharedApplication,
+ kCallGetArgsPtr);
+} \ No newline at end of file
diff --git a/Public/Developer/SystemLib/Sources/ApplicationStart.c b/Public/Developer/SystemLib/Sources/ApplicationStart.c
new file mode 100644
index 00000000..5b91ba18
--- /dev/null
+++ b/Public/Developer/SystemLib/Sources/ApplicationStart.c
@@ -0,0 +1,14 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#include <Headers/Defines.h>
+
+/// @brief Inits the system library.
+/// @return if it was succesful or not.
+CA_EXTERN_C VoidType __start(VoidType) {
+ kSharedApplication = RtGetAppObject();
+ CA_MUST_PASS(kSharedApplication);
+}
diff --git a/Public/Developer/System.Core/Sources/Heap.c b/Public/Developer/SystemLib/Sources/Heap.c
index db4a16bf..c9b2b938 100644
--- a/Public/Developer/System.Core/Sources/Heap.c
+++ b/Public/Developer/SystemLib/Sources/Heap.c
@@ -4,7 +4,7 @@
------------------------------------------- */
-#include <System.Core/Headers/Heap.h>
+#include <Headers/Heap.h>
/// @brief Allocate from the user's heap.
/// @param sz size of object.
@@ -15,14 +15,14 @@ CA_EXTERN_C PtrVoidType RtAllocateProcessPtr(QWordType sz,
CA_MUST_PASS(sz);
CA_MUST_PASS(flags);
- return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, kCallAllocPtr, sz, flags);
+ return (PtrVoidType)kSharedApplication->Invoke(kSharedApplication, kCallAllocPtr, sz, flags);
}
/// @brief Free pointer from the user's heap.
/// @param ptr the pointer to free.
CA_EXTERN_C VoidType RtFreeProcessPtr(PtrVoidType ptr) {
CA_MUST_PASS(ptr);
- CA_UNREFERENCED_PARAMETER(kApplicationObject->Invoke(kApplicationObject, kCallFreePtr, ptr));
+ CA_UNREFERENCED_PARAMETER(kSharedApplication->Invoke(kSharedApplication, kCallFreePtr, ptr));
}
/// @brief Get pointer size.
@@ -30,7 +30,7 @@ CA_EXTERN_C VoidType RtFreeProcessPtr(PtrVoidType ptr) {
/// @return the size.
CA_EXTERN_C QWordType RtProcessPtrSize(PtrVoidType ptr) {
CA_MUST_PASS(ptr);
- return kApplicationObject->Invoke(kApplicationObject, kCallSizePtr, ptr);
+ return kSharedApplication->Invoke(kSharedApplication, kCallSizePtr, ptr);
}
/// @brief Check if the pointer exists.
@@ -38,5 +38,5 @@ CA_EXTERN_C QWordType RtProcessPtrSize(PtrVoidType ptr) {
/// @return if it exists
CA_EXTERN_C BooleanType RtProcessPtrExists(PtrVoidType ptr) {
CA_MUST_PASS(ptr);
- return kApplicationObject->Invoke(kApplicationObject, kCallCheckPtr, ptr);
+ return kSharedApplication->Invoke(kSharedApplication, kCallCheckPtr, ptr);
}
diff --git a/Public/Developer/System.Core/Sources/Window.c b/Public/Developer/SystemLib/Sources/Window.c
index b68c1afb..2527e041 100644
--- a/Public/Developer/System.Core/Sources/Window.c
+++ b/Public/Developer/SystemLib/Sources/Window.c
@@ -4,10 +4,10 @@
------------------------------------------- */
-#include <System.Core/Headers/Window.h>
+#include <Headers/Window.h>
/// invalid resource handle, they always start from 1.
-#define kInvalidRsrc 0
+#define kInvalidRsrc (0U)
/////////////////////////////////////////////////////////////////////////
@@ -16,8 +16,8 @@ CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name,
CA_MUST_PASS(name);
CA_MUST_PASS(rsrcId != kInvalidRsrc);
- return (WindowPort*)kApplicationObject->Invoke(
- kApplicationObject, kCallCreateWindow, name, rsrcId);
+ return (WindowPort*)kSharedApplication->Invoke(
+ kSharedApplication, kCallCreateWindow, name, rsrcId);
}
/////////////////////////////////////////////////////////////////////////
@@ -25,7 +25,7 @@ CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name,
CA_EXTERN_C VoidType WmReleaseWindow(WindowPort* winPort) {
CA_MUST_PASS(winPort);
- kApplicationObject->Invoke(kApplicationObject, kCallCloseWindow, winPort);
+ kSharedApplication->Invoke(kSharedApplication, kCallCloseWindow, winPort);
}
/////////////////////////////////////////////////////////////////////////
@@ -35,7 +35,7 @@ CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name,
CA_MUST_PASS(name);
CA_MUST_PASS(rsrcId != kInvalidRsrc);
- return (WindowPort*)kApplicationObject->Invoke(kApplicationObject,
+ return (WindowPort*)kSharedApplication->Invoke(kSharedApplication,
kCallCreateMenu, name, rsrcId);
}
@@ -44,7 +44,7 @@ CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name,
CA_EXTERN_C VoidType WmReleaseMenu(WindowPort* winPort) {
CA_MUST_PASS(winPort);
- kApplicationObject->Invoke(kApplicationObject, kCallCloseMenu, winPort);
+ kSharedApplication->Invoke(kSharedApplication, kCallCloseMenu, winPort);
}
/////////////////////////////////////////////////////////////////////////
@@ -61,10 +61,10 @@ CA_EXTERN_C Int32Type WmMoveWindow(WindowPort* id, WmPoint where) {
return 0;
}
-/// Colors!
+/// @brief Color refs.
-CA_EXTERN_C const ColorRef kRgbRed = 0x000000FF;
-CA_EXTERN_C const ColorRef kRgbGreen = 0x0000FF00;
-CA_EXTERN_C const ColorRef kRgbBlue = 0x00FF0000;
-CA_EXTERN_C const ColorRef kRgbBlack = 0x00000000;
-CA_EXTERN_C const ColorRef kRgbWhite = 0xFFFFFFFF;
+const ColorRef kRgbRed = 0x000000FF;
+const ColorRef kRgbGreen = 0x0000FF00;
+const ColorRef kRgbBlue = 0x00FF0000;
+const ColorRef kRgbBlack = 0x00000000;
+const ColorRef kRgbWhite = 0xFFFFFFFF;
diff --git a/Public/Developer/System.Core/compile_flags.txt b/Public/Developer/SystemLib/compile_flags.txt
index 6e721e73..6e721e73 100644
--- a/Public/Developer/System.Core/compile_flags.txt
+++ b/Public/Developer/SystemLib/compile_flags.txt