diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 17:01:55 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-29 17:06:28 +0100 |
| commit | 7e5be1572c043484293ee0cdd840dd41f54e87ee (patch) | |
| tree | 171427b27eb240d4006fda89e485ce6da28fd749 /Public/Developer/System.Core | |
| parent | d7eb7affee3733dfeee6864045da4c2f5df2e919 (diff) | |
Kernel and SystemLib: See below.
What has been done:
- Rename most System.Core to SystemLib.
- Reworked it's API and the concept of ObjectRef to become the
ApplicationRef object.
- Remove unused ODF and XIFF file format from tree, ODF will be part of
the text editing program.
- Update Readme for SystemLib.
- Add Support folder on NewFS partitions.
What is next:
- NewFS filesystem support.
- Program loading.
- Preemptive scheduler on non-SMP systems using timers.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Developer/System.Core')
19 files changed, 0 insertions, 757 deletions
diff --git a/Public/Developer/System.Core/.gitkeep b/Public/Developer/System.Core/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/Public/Developer/System.Core/.gitkeep +++ /dev/null diff --git a/Public/Developer/System.Core/AMD64/HCoreAssemblyRoutines.s b/Public/Developer/System.Core/AMD64/HCoreAssemblyRoutines.s deleted file mode 100644 index 58bb1260..00000000 --- a/Public/Developer/System.Core/AMD64/HCoreAssemblyRoutines.s +++ /dev/null @@ -1,24 +0,0 @@ -/** =========================================== - (C) Mahrouss Logic - ===========================================*/ - -.section .text - -.globl RtGetAppObject -.globl __assert_chk_fail - -/* @brief Process object getter */ -/* @throws: ApptError: appartement error. */ -RtGetAppObject: - mov $0x10, %rcx /* sysGetProcessObject */ - int $0x21 - - /* rax gets saved and returned. */ - ret - -__assert_chk_fail: - mov $0x11, %rcx /* sysTerminateCurrentProcess */ - int $0x21 - - ret - diff --git a/Public/Developer/System.Core/ARM64/.gitkeep b/Public/Developer/System.Core/ARM64/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/Public/Developer/System.Core/ARM64/.gitkeep +++ /dev/null diff --git a/Public/Developer/System.Core/Headers/Defines.h b/Public/Developer/System.Core/Headers/Defines.h deleted file mode 100644 index 56367cff..00000000 --- a/Public/Developer/System.Core/Headers/Defines.h +++ /dev/null @@ -1,207 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#ifdef CA_MUST_PASS -#undef CA_MUST_PASS -#endif - -#ifdef _DEBUG -#define CA_MUST_PASS(e) { if (!e) { DlgMsgBox("Sorry, an assertion failed.\nFile: %s\nLine: %i", __FILE__, __LINE__) __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_UNREFERENCED_PARAMETER(e) ((VoidType)(e)) - -#ifdef __x86_64__ - -# define CA_FAR __far -# define CA_NEAR __near - -# define _M_AMD64 2 -#else - -# define CA_FAR -# define CA_NEAR - -#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 RtProcessCall { - kCallAllocPtr = 1, - kCallFreePtr, - kCallSizePtr, - kCallCheckPtr, - kCallAllocStack, - /// @brief Open a specific handle (can be used as sel to call methods related to it.) - kCallOpenFile, - kCallCloseFile, - kCallCreateWindow, - kCallCloseWindow, - kCallCreateMenu, - kCallCloseMenu, - kCallGetArgsCount, - kCallGetArgsPtr, - /// @brief Number of process calls. - kCallsCount, -}; - -#include <System.Core/Headers/Hint.h> -#include <System.Core/Headers/Dialog.h> - -#define kObjectGlobalNamespace ":\\" - -enum { - kObjectTypeGeneric, - kObjectTypeFile, - kObjectTypeDevice, - kObjectTypeNetwork, - kObjectTypeInvalid, - kObjectTypeCount = 5, -}; - -/** - * @brief GUID type, something you can also find in CFKit. - * @author Amlal El Mahrouss - */ -typedef struct GUID { - DWordType Data1; - WordType Data2; - WordType Data3; - ByteType Data4[8]; -} GUIDType, *PtrGUIDType; - -/// \brief Object handle. -/// \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; - -#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 RtGetAppObject(VoidType); -CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType); -CA_EXTERN_C CharacterTypeUTF8* RtGetAppArgumentsPtr(VoidType); - -CA_EXTERN_C ObjectRef kApplicationObject; - -typedef CharacterTypeUTF8 Str255Type[255]; - -#define True 1 -#define False 0 -#define Bool BooleanType - -#define NULL ((PtrVoidType)0) diff --git a/Public/Developer/System.Core/Headers/Dialog.h b/Public/Developer/System.Core/Headers/Dialog.h deleted file mode 100644 index 9d4521cf..00000000 --- a/Public/Developer/System.Core/Headers/Dialog.h +++ /dev/null @@ -1,16 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include <System.Core/Headers/Window.h> - -/// @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 this function returns nothing. -CA_EXTERN_C VoidType DlgMsgBox(CharacterTypeUTF8* title, CharacterTypeUTF8* format, ...); diff --git a/Public/Developer/System.Core/Headers/File.h b/Public/Developer/System.Core/Headers/File.h deleted file mode 100644 index 13bc7a00..00000000 --- a/Public/Developer/System.Core/Headers/File.h +++ /dev/null @@ -1,44 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include <System.Core/Headers/Defines.h> - -/// @brief Filesystem wrapper. - -typedef QWordTyp FSRef; - -/// @brief Opens a new file. -/// @param path where to find it. -/// @param r the restrict (rw, rwe, r+, w+, r, w) -/// @return -CA_EXTERN_C FSRef FsOpenFile(const CharacterTypeUTF8* path, const CharacterTypeUTF8* r); - -/// @brief Closes the file and flushes it to the said file. -/// @param refFs the filesystem reference. -/// @return -CA_EXTERN_C VoidType FsCloseFile(FSRef refFs); - -typedef QWordTyp FSForkRef; - -/// @brief A fork information header. -typedef struct _Fork { - PtrVoidType forkData; - SizeType forkSize; - Int32Type forkFlags; - Int32Type forkKind; - CharacterTypeUTF8 forkName[256]; -} ForkType; - -/// @brief Gets the fork inside a file. -/// @param refFs the filesystem ref -/// @param forkName the fork's name -/// @return the fork data. -CA_EXTERN_C FSForkRef FsGetFork(FSRef refFs, const CharacterTypeUTF8* forkName); - -#define FsGetDataFork(refFs) FsGetFork(refFs, "data") -#define FsGetRsrcFork(refFs) FsGetFork(refFs, "rsrc") diff --git a/Public/Developer/System.Core/Headers/Heap.h b/Public/Developer/System.Core/Headers/Heap.h deleted file mode 100644 index 9f3215db..00000000 --- a/Public/Developer/System.Core/Headers/Heap.h +++ /dev/null @@ -1,38 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include <System.Core/Headers/Defines.h> - -#define kAllocationTypes 2 - -enum RtAllocationKind { - kStandardAllocation = 0xC, - kArrayAllocation = 0xD, -}; - -/// @brief Allocates a new pointer from process pool. -/// @param sz the size -/// @param flags the allocation flags. -/// @return -CA_EXTERN_C PtrVoidType RtAllocateProcessPtr(QWordType sz, - DWordType flags); - -/// @brief Check if the pointer exists. -/// @param ptr the pointer to free. -/// @return -CA_EXTERN_C BooleanType RtProcessPtrExists(PtrVoidType ptr); - -/// @brief Gets the size of the process' pointer. -/// @param ptr the pointer to free. -/// @return -CA_EXTERN_C QWordType RtProcessPtrSize(PtrVoidType ptr); - -/// @brief Frees the process pointer. -/// @param ptr the pointer to free. -/// @return -CA_EXTERN_C VoidType RtFreeProcessPtr(PtrVoidType ptr); diff --git a/Public/Developer/System.Core/Headers/Hint.h b/Public/Developer/System.Core/Headers/Hint.h deleted file mode 100644 index 86faf455..00000000 --- a/Public/Developer/System.Core/Headers/Hint.h +++ /dev/null @@ -1,18 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#define _Input -#define _Output - -#define _Optional - -#define _StrictCheckInput -#define _StrictCheckOutput - -#define _InOut -#define _StrictInOut diff --git a/Public/Developer/System.Core/Headers/Thread.h b/Public/Developer/System.Core/Headers/Thread.h deleted file mode 100644 index 7d2bfe3c..00000000 --- a/Public/Developer/System.Core/Headers/Thread.h +++ /dev/null @@ -1,43 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -// -// Created by Amlal on 3/18/24 -// - -#ifndef __THREAD__ -#define __THREAD__ - -#include <System.Core/Headers/Defines.h> - -#define kThreadErrorExit -33 - -/// @brief Thread Information Block, which holds information about the running -/// thread. -typedef QWordType ThreadRef; - -/// @brief Main application thread. -CA_EXTERN_C ThreadRef kMainThread; - -typedef VoidType(*ThreadEntrypointKind)(VoidType); - -/// @brief Creates a new thread, and runs the code. -/// @param threadName the thread's name. -/// @param threadStart where to start. -/// @return -CA_EXTERN_C ThreadRef TmCreateThread(const CharacterTypeUTF8* threadName, ThreadEntrypointKind threadStart); - -/// @brief Dispoes the thread, and exits with code kThreadErrorExit -/// @param ref the thread reference. -/// @return nothing. -CA_EXTERN_C VoidType TmDisposeThread(ThreadRef ref); - -/// @brief Waits for the thread to complete. -/// @param ref the thread reference. -/// @return nothing. -CA_EXTERN_C VoidType TmWaitForCompletion(ThreadRef ref); - -#endif // __THREAD__ diff --git a/Public/Developer/System.Core/Headers/TrueType.h b/Public/Developer/System.Core/Headers/TrueType.h deleted file mode 100644 index 2e8f4142..00000000 --- a/Public/Developer/System.Core/Headers/TrueType.h +++ /dev/null @@ -1,32 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include <System.Core/Headers/Window.h> - -/************************************************************* - * - * File: TrueType.hxx - * Purpose: TrueType font implementation for NewOS. - * Date: 3/26/24 - * - * Copyright Mahrouss Logic, all rights reserved. - * - *************************************************************/ - -typedef QWordType TTFFontRef; - -/// @brief Loads a new font into app's memory. -/// @param name -/// @return -CA_EXTERN_C TTFFontRef FnCreateFont(const CharacterTypeUTF8* name); - -/// @brief Dispose an allocated font. -/// @param fon -/// @return -CA_EXTERN_C VoidType FnDisposeFont(TTFFontRef fon); - diff --git a/Public/Developer/System.Core/Headers/Window.h b/Public/Developer/System.Core/Headers/Window.h deleted file mode 100644 index 846d5cff..00000000 --- a/Public/Developer/System.Core/Headers/Window.h +++ /dev/null @@ -1,153 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#pragma once - -#include <System.Core/Headers/Defines.h> - -/************************************************************* - * - * File: Window.hxx - * Purpose: Window Manager API for NewOS. - * Date: 3/26/24 - * - * Copyright Mahrouss Logic, all rights reserved. - * - *************************************************************/ - -struct _WmPoint; -struct _WindowPort; - -#ifdef __SINGLE_PRECISION__ -typedef float PositionType; -#else -typedef double PositionType; -#endif - -typedef QWordType DCRef; - -/// @brief A point, can represent the size, position of a window. -typedef struct _WmPoint { - PositionType X, Y; -} WmPoint; - -/// @brief Window port type, can be used to control the window. -typedef struct _WindowPort { - WordType windowPort; - WordType windowKind; - BooleanType windowVisible; - BooleanType windowMaximized; - BooleanType windowMinimized; - BooleanType windowMoving; - BooleanType windowDisableClose; - BooleanType windowDisableMinimize; - WmPoint windowPosition; - WmPoint windowSize; - BooleanType windowInvalidate; - DWordType windowClearColor; - struct _WindowPort* menuPort; - struct _WindowPort* parentPort; -} WindowPort; - -typedef struct _ControlPort { - WordType controlPort; - WordType controlKind; - BooleanType controlVisible; - BooleanType controlMoving; - WmPoint controlPosition; - WindowPort* parentPort; -} ControlPort; - -typedef UInt32Type ColorRef; - -/***********************************************************************************/ -/// Color utils. -/***********************************************************************************/ - -CA_EXTERN_C const ColorRef kRgbRed; -CA_EXTERN_C const ColorRef kRgbGreen; -CA_EXTERN_C const ColorRef kRgbBlue; -CA_EXTERN_C const ColorRef kRgbBlack; -CA_EXTERN_C const ColorRef kRgbWhite; - -/***********************************************************************************/ -/// Color macro. -/***********************************************************************************/ - -#define WmMakeColorRef(R, G, B) (ColorRef)(0x##R##G##B) - -#define kControlKindWindow 0 -#define kControlKindDialog 1 -#define kControlKindMenu 2 -#define kControlKindButton 3 -#define kControlKindLabel 4 -#define kControlKindDropdown 5 -#define kControlKindIcon 6 -#define kControlKindRadio 7 -#define kControlKindCheck 7 - -/// @brief Creates a new control -/// @param id the control rsrc fork. -/// @return -CA_EXTERN_C ControlPort* WmCreateControl(DWordType id); - -/// @brief Releases the control -/// @param id the control ref. -/// @return -CA_EXTERN_C VoidType WmReleaseControl(ControlPort* id); - -/// @brief Moves a control inside a ControlPort. -/// @param id the control ref. -/// @param where where to move at. -/// @return -CA_EXTERN_C Int32Type WmSetControlPosition(ControlPort* id, WmPoint where); - -/// @brief Enable control. -/// @param id -/// @param enabled -/// @return -CA_EXTERN_C Int32Type WmSetControlEnabled(ControlPort* id, BooleanType enabled); - -/// @brief Make control visible. -/// @param id -/// @param visible -/// @return -CA_EXTERN_C Int32Type WmMakeControlVisible(ControlPort* id, BooleanType visible); - -/// @brief Creates a new window. -/// @param name the window name -/// @param rsrcId the window fork rsrc id. -/// @return the window graphics port. -CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name, const DWordType rsrcId); - -/// @brief Creates a new menu -/// @param name the menu's name -/// @param rsrcId the menu fork rsrc id. -/// @return the menu graphics port. -CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name, const DWordType rsrcId); - -/// @brief Releases the window. -/// @param port the window port. -/// @return void -CA_EXTERN_C VoidType WmReleaseWindow(WindowPort* port); - -/// @brief Releases the menu -/// @param port the menu port. -/// @return void -CA_EXTERN_C VoidType WmReleaseMenu(WindowPort* port); - -/// @brief Moves a window on the desktop. (menu arent movable, will return kErrIncompatible is menu is provided.) -/// @param id the gfx port. -/// @param where to move. -/// @return error code. -CA_EXTERN_C Int32Type WmMoveWindow(WindowPort* id, WmPoint where); - -enum { - kWmErrIncompatible = 0x74, - kWmErrOutOfMemory, - kWmErrInvalidArg, - kWmErrNotImplemented, -}; diff --git a/Public/Developer/System.Core/Makefile b/Public/Developer/System.Core/Makefile deleted file mode 100644 index b9a0a663..00000000 --- a/Public/Developer/System.Core/Makefile +++ /dev/null @@ -1,23 +0,0 @@ -################################################## -# (C) Mahrouss Logic, all rights reserved. -# This is the SystemLib Makefile. -################################################## - -CC=x86_64-w64-mingw32-gcc -AR=x86_64-w64-mingw32-ar -ARFLAGS=-rcs -CCINC=-I../ -CCFLAGS=-D__SINGLE_PRECISION__ -nostdlib -std=c17 -ffreestanding -Xlinker --subsystem=17 -shared -OUTPUT=SystemLib.lib - -.PHONY: all -all: build-core-amd64 - @echo "[SystemLib.lib] Build done." - -.PHONY: build-core-amd64 -build-core-amd64: - $(CC) $(CCINC) $(CCFLAGS) $(wildcard Sources/*.c) $(wildcard AMD64/*.s) -o $(OUTPUT) - -.PHONY: clean -clean: - rm -f $(wildcard *.o) diff --git a/Public/Developer/System.Core/RISCV/.gitkeep b/Public/Developer/System.Core/RISCV/.gitkeep deleted file mode 100644 index e69de29b..00000000 --- a/Public/Developer/System.Core/RISCV/.gitkeep +++ /dev/null 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/Heap.c b/Public/Developer/System.Core/Sources/Heap.c deleted file mode 100644 index db4a16bf..00000000 --- a/Public/Developer/System.Core/Sources/Heap.c +++ /dev/null @@ -1,42 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include <System.Core/Headers/Heap.h> - -/// @brief Allocate from the user's heap. -/// @param sz size of object. -/// @param flags flags. -/// @return -CA_EXTERN_C PtrVoidType RtAllocateProcessPtr(QWordType sz, - DWordType flags) { - CA_MUST_PASS(sz); - CA_MUST_PASS(flags); - - return (PtrVoidType)kApplicationObject->Invoke(kApplicationObject, 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)); -} - -/// @brief Get pointer size. -/// @param ptr the pointer to find. -/// @return the size. -CA_EXTERN_C QWordType RtProcessPtrSize(PtrVoidType ptr) { - CA_MUST_PASS(ptr); - return kApplicationObject->Invoke(kApplicationObject, kCallSizePtr, ptr); -} - -/// @brief Check if the pointer exists. -/// @param ptr the pointer to check. -/// @return if it exists -CA_EXTERN_C BooleanType RtProcessPtrExists(PtrVoidType ptr) { - CA_MUST_PASS(ptr); - return kApplicationObject->Invoke(kApplicationObject, kCallCheckPtr, ptr); -} 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.Core/Sources/Window.c b/Public/Developer/System.Core/Sources/Window.c deleted file mode 100644 index b68c1afb..00000000 --- a/Public/Developer/System.Core/Sources/Window.c +++ /dev/null @@ -1,70 +0,0 @@ -/* ------------------------------------------- - - Copyright Mahrouss Logic - -------------------------------------------- */ - -#include <System.Core/Headers/Window.h> - -/// invalid resource handle, they always start from 1. -#define kInvalidRsrc 0 - -///////////////////////////////////////////////////////////////////////// - -CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name, - const DWordType rsrcId) { - CA_MUST_PASS(name); - CA_MUST_PASS(rsrcId != kInvalidRsrc); - - return (WindowPort*)kApplicationObject->Invoke( - kApplicationObject, kCallCreateWindow, name, rsrcId); -} - -///////////////////////////////////////////////////////////////////////// - -CA_EXTERN_C VoidType WmReleaseWindow(WindowPort* winPort) { - CA_MUST_PASS(winPort); - - kApplicationObject->Invoke(kApplicationObject, kCallCloseWindow, winPort); -} - -///////////////////////////////////////////////////////////////////////// - -CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name, - const DWordType rsrcId) { - CA_MUST_PASS(name); - CA_MUST_PASS(rsrcId != kInvalidRsrc); - - return (WindowPort*)kApplicationObject->Invoke(kApplicationObject, - kCallCreateMenu, name, rsrcId); -} - -///////////////////////////////////////////////////////////////////////// - -CA_EXTERN_C VoidType WmReleaseMenu(WindowPort* winPort) { - CA_MUST_PASS(winPort); - - kApplicationObject->Invoke(kApplicationObject, kCallCloseMenu, winPort); -} - -///////////////////////////////////////////////////////////////////////// - -CA_EXTERN_C Int32Type WmMoveWindow(WindowPort* id, WmPoint where) { - if (!id) { - return kWmErrInvalidArg; - } - - id->windowPosition.X = where.X; - id->windowPosition.Y = where.Y; - id->windowMoving = True; - - return 0; -} - -/// Colors! - -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; diff --git a/Public/Developer/System.Core/compile_flags.txt b/Public/Developer/System.Core/compile_flags.txt deleted file mode 100644 index 6e721e73..00000000 --- a/Public/Developer/System.Core/compile_flags.txt +++ /dev/null @@ -1,4 +0,0 @@ --I./ --I../ --I../../../Private --std=c++20 |
