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/Sources | |
| 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/Sources')
| -rw-r--r-- | Public/Developer/System.Core/Sources/App.c | 20 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Sources/Heap.c | 42 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Sources/Start.c | 15 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Sources/Window.c | 70 |
4 files changed, 0 insertions, 147 deletions
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; |
