From d9477b8a80ee0dc9a6d05c0353aa989ceaedae8a Mon Sep 17 00:00:00 2001 From: amlal Date: Sat, 23 Mar 2024 16:56:06 +0100 Subject: unstable, secret: bump. Signed-off-by: amlal --- Public/SDK/System.Core/Headers/Containers/ODF.hxx | 2 +- Public/SDK/System.Core/Headers/Containers/XIFF.hxx | 2 +- Public/SDK/System.Core/Headers/Defines.hxx | 250 +++++++++++++++++++++ Public/SDK/System.Core/Headers/Defs.hxx | 250 --------------------- Public/SDK/System.Core/Headers/File.hxx | 2 +- Public/SDK/System.Core/Headers/Heap.hxx | 2 +- Public/SDK/System.Core/Headers/Thread.hxx | 32 +-- Public/SDK/System.Core/Headers/UI/.gitkeep | 0 Public/SDK/System.Core/Headers/UI/Dialog.hxx | 8 + Public/SDK/System.Core/Headers/UI/Imaging.hxx | 8 + Public/SDK/System.Core/Headers/UI/Menu.hxx | 8 + Public/SDK/System.Core/Headers/UI/Rsrc.hxx | 8 + Public/SDK/System.Core/Headers/UI/Window.hxx | 8 + 13 files changed, 295 insertions(+), 285 deletions(-) create mode 100644 Public/SDK/System.Core/Headers/Defines.hxx delete mode 100644 Public/SDK/System.Core/Headers/Defs.hxx create mode 100644 Public/SDK/System.Core/Headers/UI/.gitkeep create mode 100644 Public/SDK/System.Core/Headers/UI/Dialog.hxx create mode 100644 Public/SDK/System.Core/Headers/UI/Imaging.hxx create mode 100644 Public/SDK/System.Core/Headers/UI/Menu.hxx create mode 100644 Public/SDK/System.Core/Headers/UI/Rsrc.hxx create mode 100644 Public/SDK/System.Core/Headers/UI/Window.hxx (limited to 'Public') diff --git a/Public/SDK/System.Core/Headers/Containers/ODF.hxx b/Public/SDK/System.Core/Headers/Containers/ODF.hxx index 9bf61296..e0cb0bc1 100644 --- a/Public/SDK/System.Core/Headers/Containers/ODF.hxx +++ b/Public/SDK/System.Core/Headers/Containers/ODF.hxx @@ -5,7 +5,7 @@ #ifndef __ODF__ #define __ODF__ -#include +#include /** * @brief Open Document Format diff --git a/Public/SDK/System.Core/Headers/Containers/XIFF.hxx b/Public/SDK/System.Core/Headers/Containers/XIFF.hxx index e14868a6..2531abce 100644 --- a/Public/SDK/System.Core/Headers/Containers/XIFF.hxx +++ b/Public/SDK/System.Core/Headers/Containers/XIFF.hxx @@ -12,7 +12,7 @@ ------------------------------------------------------- */ -#include +#include /// @brief four-character code for XIFF. #define kFourCCLength_XIFF 4 diff --git a/Public/SDK/System.Core/Headers/Defines.hxx b/Public/SDK/System.Core/Headers/Defines.hxx new file mode 100644 index 00000000..3cbf22fd --- /dev/null +++ b/Public/SDK/System.Core/Headers/Defines.hxx @@ -0,0 +1,250 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#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() } } +#else +#define CA_MUST_PASS(e) CA_UNREFERENCED_PARAMETER(e) +#endif + +#ifdef __cplusplus + +#define CA_EXTERN_C extern "C" + +#else + +#define CA_EXTERN_C extern + +#endif + +CA_EXTERN_C void __assert_chk_fail(void); + +#define CA_STDCALL __attribute__((stdcall)) +#define CA_CDECL __attribute__((cdecl)) +#define CA_MSCALL __attribute__((ms_abi)) + +#define PACKED __attribute__((packed)) + +#define CA_PASCAL CA_STDCALL + +typedef __UINT8_TYPE__ ByteType; +typedef __UINT16_TYPE__ WordType; +typedef __UINT32_TYPE__ DWordType; +typedef __UINT64_TYPE__ QWordType; +typedef __SIZE_TYPE__ SizeType; + +typedef char CharacterTypeUTF8; +typedef CharacterTypeUTF8* PtrCharacterType; + +typedef void* PtrVoidType; +typedef void VoidType; + +typedef __UINTPTR_TYPE__ UIntPtrType; +typedef __INTPTR_TYPE__ IntPtrType; +typedef __UINT64_TYPE__ UInt64Type; +typedef __INT64_TYPE__ Int64Type; +typedef __UINT32_TYPE__ UInt32Type; +typedef __INT32_TYPE__ Int32Type; + +typedef CharacterTypeUTF8 BooleanType; + +#define CA_COPY_DELETE(KLASS) \ + KLASS &operator=(const KLASS &) = delete; \ + KLASS(const KLASS &) = delete; + + +#define CA_COPY_DEFAULT(KLASS) \ + KLASS &operator=(const KLASS &) = default; \ + KLASS(const KLASS &) = default; + + +#define CA_MOVE_DELETE(KLASS) \ + KLASS &operator=(KLASS &&) = delete; \ + KLASS(KLASS &&) = delete; + + +#define CA_MOVE_DEFAULT(KLASS) \ + KLASS &operator=(KLASS &&) = default; \ + KLASS(KLASS &&) = default; + + +#define Yes 1 +#define No 0 + +#define CA_PTR * + +#define CA_FAR __far +#define CA_NEAR __near + +#define CA_UNREFERENCED_PARAMETER(e) ((VoidType)e) + +#ifdef __x86_64__ +# define _M_AMD64 2 +#endif + +#ifdef __aarch64__ +# define _M_AARCH64 3 +#endif + +#ifdef __powerpc64__ +# define _M_PPC64 4 +#endif + +#ifdef __64x0__ +# define _M_64000 5 +#endif + +#ifdef __riscv__ +# define _M_RISCV 6 +#endif + +#define CA_STATIC static +#define CA_INLINE inline +#define CA_CONST const + +#ifdef __cplusplus +#define CA_CONSTEXPR constexpr +#else +#define CA_CONSTEXPR +#endif // __cplusplus + +enum HcProcessCall { + kProcessCallAllocPtr = 1, + kProcessCallFreePtr, + kProcessCallSizePtr, + kProcessCallCheckPtr, + kProcessCallAllocStack, + /// @brief Open a specific handle (can be used as sel to call methods related to it.) + kProcessCallOpenHandle, + kProcessCallCloseHandle, + /// @brief Number of process calls. + kProcessCallsCount = 7, +}; + +#include + +class SystemException { + public: + explicit SystemException() = default; + virtual ~SystemException() = default; + + public: + CA_COPY_DEFAULT(SystemException); + + public: + virtual const char *Name() = 0; + virtual const char *Reason() = 0; + +}; + +/// @brief Object exception +/// Throws when the object isn't found. +class ObjectNotFoundException : public SystemException { + public: + explicit ObjectNotFoundException() = default; + virtual ~ObjectNotFoundException() = default; + + public: + CA_COPY_DEFAULT(ObjectNotFoundException); + + public: + const char *Name() override { return "ObjectNotFoundException"; } + const char *Reason() override { return mReason; } + + private: + const char *mReason{ + "System.Core: ObjectNotFoundException: Catastrophic failure!"}; +}; + +/// @brief pointer exception +/// Throws when the object isn't found. +class PointerException : public SystemException { + public: + explicit PointerException() = default; + virtual ~PointerException() = default; + + public: + CA_COPY_DEFAULT(PointerException); + + public: + const char *Name() override { return "PointerException"; } + const char *Reason() override { return mReason; } + + private: + const char *mReason{ + "System.Core: PointerException: Catastrophic failure!"}; +}; + +/// @brief pointer exception +/// Throws when the object isn't found. +class NullPointerException : public SystemException { + public: + explicit NullPointerException() = default; + virtual ~NullPointerException() = default; + + public: + CA_COPY_DEFAULT(NullPointerException); + + public: + const char *Name() override { return "NullPointerException"; } + const char *Reason() override { return mReason; } + + private: + const char *mReason{ + "System.Core: NullPointerException: Catastrophic failure!"}; +}; + +#define kObjectGlobalNamespaceSystem "HCORE_ROOT\\" +#define kObjectGlobalNamespaceUser "HCORE_USER_ROOT\\" + +enum { + kObjectTypeProcess, + kObjectTypeFile, + kObjectTypeDevice, + kObjectTypeNetwork, + kObjectTypeInvalid, + KObjectTypeUserDefined = 0xCF, + kObjectTypeCount = 5, +}; + +/** + * @brief GUID type, something you can also find in CFKit. + * @author AMlal El Mahrouss + */ +typedef struct GUID final { + DWordType Data1; + WordType Data2; + WordType Data3; + ByteType Data4[8]; +} GUIDType, *PtrGUIDType; + +/// \brief Object handle. +/// \author Amlal El Mahrouss +typedef struct Object final { + CharacterTypeUTF8 ObjectName[255]; + DWordType ObjectType; + CharacterTypeUTF8 ObjectNamespace[255]; + + VoidType(*Release)(struct Object* Self); + IntPtrType(*Invoke)(struct Object* Self, DWordType Sel, ...); + VoidType(*Query)(struct Object* Self, PtrVoidType* Dst, SizeType SzDst, struct GUID* GuidOf); +} Object, *ObjectPtr; + +#define object_cast reinterpret_cast + +CA_EXTERN_C ObjectPtr HcGetInstanceObject(void); + +CA_INLINE ObjectPtr kInstanceObject; diff --git a/Public/SDK/System.Core/Headers/Defs.hxx b/Public/SDK/System.Core/Headers/Defs.hxx deleted file mode 100644 index 3cbf22fd..00000000 --- a/Public/SDK/System.Core/Headers/Defs.hxx +++ /dev/null @@ -1,250 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#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() } } -#else -#define CA_MUST_PASS(e) CA_UNREFERENCED_PARAMETER(e) -#endif - -#ifdef __cplusplus - -#define CA_EXTERN_C extern "C" - -#else - -#define CA_EXTERN_C extern - -#endif - -CA_EXTERN_C void __assert_chk_fail(void); - -#define CA_STDCALL __attribute__((stdcall)) -#define CA_CDECL __attribute__((cdecl)) -#define CA_MSCALL __attribute__((ms_abi)) - -#define PACKED __attribute__((packed)) - -#define CA_PASCAL CA_STDCALL - -typedef __UINT8_TYPE__ ByteType; -typedef __UINT16_TYPE__ WordType; -typedef __UINT32_TYPE__ DWordType; -typedef __UINT64_TYPE__ QWordType; -typedef __SIZE_TYPE__ SizeType; - -typedef char CharacterTypeUTF8; -typedef CharacterTypeUTF8* PtrCharacterType; - -typedef void* PtrVoidType; -typedef void VoidType; - -typedef __UINTPTR_TYPE__ UIntPtrType; -typedef __INTPTR_TYPE__ IntPtrType; -typedef __UINT64_TYPE__ UInt64Type; -typedef __INT64_TYPE__ Int64Type; -typedef __UINT32_TYPE__ UInt32Type; -typedef __INT32_TYPE__ Int32Type; - -typedef CharacterTypeUTF8 BooleanType; - -#define CA_COPY_DELETE(KLASS) \ - KLASS &operator=(const KLASS &) = delete; \ - KLASS(const KLASS &) = delete; - - -#define CA_COPY_DEFAULT(KLASS) \ - KLASS &operator=(const KLASS &) = default; \ - KLASS(const KLASS &) = default; - - -#define CA_MOVE_DELETE(KLASS) \ - KLASS &operator=(KLASS &&) = delete; \ - KLASS(KLASS &&) = delete; - - -#define CA_MOVE_DEFAULT(KLASS) \ - KLASS &operator=(KLASS &&) = default; \ - KLASS(KLASS &&) = default; - - -#define Yes 1 -#define No 0 - -#define CA_PTR * - -#define CA_FAR __far -#define CA_NEAR __near - -#define CA_UNREFERENCED_PARAMETER(e) ((VoidType)e) - -#ifdef __x86_64__ -# define _M_AMD64 2 -#endif - -#ifdef __aarch64__ -# define _M_AARCH64 3 -#endif - -#ifdef __powerpc64__ -# define _M_PPC64 4 -#endif - -#ifdef __64x0__ -# define _M_64000 5 -#endif - -#ifdef __riscv__ -# define _M_RISCV 6 -#endif - -#define CA_STATIC static -#define CA_INLINE inline -#define CA_CONST const - -#ifdef __cplusplus -#define CA_CONSTEXPR constexpr -#else -#define CA_CONSTEXPR -#endif // __cplusplus - -enum HcProcessCall { - kProcessCallAllocPtr = 1, - kProcessCallFreePtr, - kProcessCallSizePtr, - kProcessCallCheckPtr, - kProcessCallAllocStack, - /// @brief Open a specific handle (can be used as sel to call methods related to it.) - kProcessCallOpenHandle, - kProcessCallCloseHandle, - /// @brief Number of process calls. - kProcessCallsCount = 7, -}; - -#include - -class SystemException { - public: - explicit SystemException() = default; - virtual ~SystemException() = default; - - public: - CA_COPY_DEFAULT(SystemException); - - public: - virtual const char *Name() = 0; - virtual const char *Reason() = 0; - -}; - -/// @brief Object exception -/// Throws when the object isn't found. -class ObjectNotFoundException : public SystemException { - public: - explicit ObjectNotFoundException() = default; - virtual ~ObjectNotFoundException() = default; - - public: - CA_COPY_DEFAULT(ObjectNotFoundException); - - public: - const char *Name() override { return "ObjectNotFoundException"; } - const char *Reason() override { return mReason; } - - private: - const char *mReason{ - "System.Core: ObjectNotFoundException: Catastrophic failure!"}; -}; - -/// @brief pointer exception -/// Throws when the object isn't found. -class PointerException : public SystemException { - public: - explicit PointerException() = default; - virtual ~PointerException() = default; - - public: - CA_COPY_DEFAULT(PointerException); - - public: - const char *Name() override { return "PointerException"; } - const char *Reason() override { return mReason; } - - private: - const char *mReason{ - "System.Core: PointerException: Catastrophic failure!"}; -}; - -/// @brief pointer exception -/// Throws when the object isn't found. -class NullPointerException : public SystemException { - public: - explicit NullPointerException() = default; - virtual ~NullPointerException() = default; - - public: - CA_COPY_DEFAULT(NullPointerException); - - public: - const char *Name() override { return "NullPointerException"; } - const char *Reason() override { return mReason; } - - private: - const char *mReason{ - "System.Core: NullPointerException: Catastrophic failure!"}; -}; - -#define kObjectGlobalNamespaceSystem "HCORE_ROOT\\" -#define kObjectGlobalNamespaceUser "HCORE_USER_ROOT\\" - -enum { - kObjectTypeProcess, - kObjectTypeFile, - kObjectTypeDevice, - kObjectTypeNetwork, - kObjectTypeInvalid, - KObjectTypeUserDefined = 0xCF, - kObjectTypeCount = 5, -}; - -/** - * @brief GUID type, something you can also find in CFKit. - * @author AMlal El Mahrouss - */ -typedef struct GUID final { - DWordType Data1; - WordType Data2; - WordType Data3; - ByteType Data4[8]; -} GUIDType, *PtrGUIDType; - -/// \brief Object handle. -/// \author Amlal El Mahrouss -typedef struct Object final { - CharacterTypeUTF8 ObjectName[255]; - DWordType ObjectType; - CharacterTypeUTF8 ObjectNamespace[255]; - - VoidType(*Release)(struct Object* Self); - IntPtrType(*Invoke)(struct Object* Self, DWordType Sel, ...); - VoidType(*Query)(struct Object* Self, PtrVoidType* Dst, SizeType SzDst, struct GUID* GuidOf); -} Object, *ObjectPtr; - -#define object_cast reinterpret_cast - -CA_EXTERN_C ObjectPtr HcGetInstanceObject(void); - -CA_INLINE ObjectPtr kInstanceObject; diff --git a/Public/SDK/System.Core/Headers/File.hxx b/Public/SDK/System.Core/Headers/File.hxx index 4a8d57dd..f8efd75a 100644 --- a/Public/SDK/System.Core/Headers/File.hxx +++ b/Public/SDK/System.Core/Headers/File.hxx @@ -7,7 +7,7 @@ #ifndef __FILE_API__ #define __FILE_API__ -#include +#include namespace System { class FileInterface; diff --git a/Public/SDK/System.Core/Headers/Heap.hxx b/Public/SDK/System.Core/Headers/Heap.hxx index 5c93456e..14ee0e6c 100644 --- a/Public/SDK/System.Core/Headers/Heap.hxx +++ b/Public/SDK/System.Core/Headers/Heap.hxx @@ -6,7 +6,7 @@ #pragma once -#include +#include namespace System { class MemoryException; diff --git a/Public/SDK/System.Core/Headers/Thread.hxx b/Public/SDK/System.Core/Headers/Thread.hxx index ae6ba057..c32c6047 100644 --- a/Public/SDK/System.Core/Headers/Thread.hxx +++ b/Public/SDK/System.Core/Headers/Thread.hxx @@ -11,41 +11,11 @@ #ifndef __THREAD_API__ #define __THREAD_API__ -#include +#include /// @brief Thread Information Block, which holds information about the running thread. typedef PtrVoidType PtrThread; -/// @brief Creates a new thread. -/// @param StartProc -/// @param OptionalHeap -/// @param OptionalStack -/// @param Detach -/// @param Join -/// @return -PtrThread HcCreateThread(_Input PtrVoidType StartProc, - _Optional _InOut PtrVoidType OptionalHeap, - _Optional _InOut PtrVoidType OptionalStack, - _Optional _Input BooleanType Detach, - _Optional _Input BooleanType Join); - -/// @brief Destroys the thread object. -/// @param ThreadPtr -/// @return -BooleanType HcDestroyThread(_Input PtrThread ThreadPtr); - -/// @brief Stops the thread. -/// @param ThreadPtr -/// @return -BooleanType HcStopThread(_Input PtrThread ThreadPtr); - -/// @brief Resumes it. -/// @param ThreadPtr -/// @return -BooleanType HcResumeThread(_Input PtrThread ThreadPtr); - -QWordType HcProcessIdThread(_Input PtrThread ThreadPtr); - /// @brief Main application thread. CA_EXTERN_C PtrThread kMainThread; diff --git a/Public/SDK/System.Core/Headers/UI/.gitkeep b/Public/SDK/System.Core/Headers/UI/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/Public/SDK/System.Core/Headers/UI/Dialog.hxx b/Public/SDK/System.Core/Headers/UI/Dialog.hxx new file mode 100644 index 00000000..2a02b434 --- /dev/null +++ b/Public/SDK/System.Core/Headers/UI/Dialog.hxx @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + diff --git a/Public/SDK/System.Core/Headers/UI/Imaging.hxx b/Public/SDK/System.Core/Headers/UI/Imaging.hxx new file mode 100644 index 00000000..2a02b434 --- /dev/null +++ b/Public/SDK/System.Core/Headers/UI/Imaging.hxx @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + diff --git a/Public/SDK/System.Core/Headers/UI/Menu.hxx b/Public/SDK/System.Core/Headers/UI/Menu.hxx new file mode 100644 index 00000000..2a02b434 --- /dev/null +++ b/Public/SDK/System.Core/Headers/UI/Menu.hxx @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + diff --git a/Public/SDK/System.Core/Headers/UI/Rsrc.hxx b/Public/SDK/System.Core/Headers/UI/Rsrc.hxx new file mode 100644 index 00000000..2a02b434 --- /dev/null +++ b/Public/SDK/System.Core/Headers/UI/Rsrc.hxx @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + diff --git a/Public/SDK/System.Core/Headers/UI/Window.hxx b/Public/SDK/System.Core/Headers/UI/Window.hxx new file mode 100644 index 00000000..2a02b434 --- /dev/null +++ b/Public/SDK/System.Core/Headers/UI/Window.hxx @@ -0,0 +1,8 @@ +/* ------------------------------------------- + + Copyright Mahrouss Logic + +------------------------------------------- */ + +#pragma once + -- cgit v1.2.3