diff options
| author | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-27 17:38:23 +0100 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal@el-mahrouss-logic.com> | 2024-03-27 17:38:23 +0100 |
| commit | 1ce16b83dba0326b13dfa3399c1497ac6b1af14d (patch) | |
| tree | 8a5e4063b5d4cf6ce4f42dd500073994e9ef8954 /Public/Developer/System.Core | |
| parent | 6a18e607ffc4e83f2bd953c9de5c14f18e077df8 (diff) | |
Kernel && Developer:
Developer:
- Rework System API to use C instead of C++
- Add new calls in Thread.h
- Documented code.
Kernel:
- Rework handover stage, separated the Processor specific code from
the cross platform code.
Signed-off-by: Amlal El Mahrouss <amlal@el-mahrouss-logic.com>
Diffstat (limited to 'Public/Developer/System.Core')
| -rw-r--r-- | Public/Developer/System.Core/Headers/Defines.h (renamed from Public/Developer/System.Core/Headers/Defines.hxx) | 4 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Headers/Dialog.h (renamed from Public/Developer/System.Core/Headers/Dialog.hxx) | 4 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Headers/File.h (renamed from Public/Developer/System.Core/Headers/FS.hxx) | 4 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Headers/Heap.h (renamed from Public/Developer/System.Core/Headers/Heap.hxx) | 2 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Headers/Hint.h (renamed from Public/Developer/System.Core/Headers/Hint.hxx) | 0 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Headers/Thread.h (renamed from Public/Developer/System.Core/Headers/Thread.hxx) | 17 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Headers/TrueType.h (renamed from Public/Developer/System.Core/Headers/TrueType.hxx) | 7 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Headers/Window.h (renamed from Public/Developer/System.Core/Headers/Window.hxx) | 39 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Makefile | 2 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Sources/CRT0.c (renamed from Public/Developer/System.Core/Sources/CRT0.cxx) | 2 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Sources/Heap.c (renamed from Public/Developer/System.Core/Sources/Heap.cxx) | 2 | ||||
| -rw-r--r-- | Public/Developer/System.Core/Sources/New+Delete.cxx | 2 |
12 files changed, 49 insertions, 36 deletions
diff --git a/Public/Developer/System.Core/Headers/Defines.hxx b/Public/Developer/System.Core/Headers/Defines.h index 64b1295e..612f0462 100644 --- a/Public/Developer/System.Core/Headers/Defines.hxx +++ b/Public/Developer/System.Core/Headers/Defines.h @@ -130,8 +130,8 @@ enum RtProcessCall { kProcessCallsCount = 7, }; -#include <System.Core/Headers/Hint.hxx> -#include <System.Core/Headers/Dialog.hxx> +#include <System.Core/Headers/Hint.h> +#include <System.Core/Headers/Dialog.h> enum { kObjectTypeProcess, diff --git a/Public/Developer/System.Core/Headers/Dialog.hxx b/Public/Developer/System.Core/Headers/Dialog.h index 0faaae67..9d4521cf 100644 --- a/Public/Developer/System.Core/Headers/Dialog.hxx +++ b/Public/Developer/System.Core/Headers/Dialog.h @@ -6,11 +6,11 @@ #pragma once -#include <System.Core/Headers/Window.hxx> +#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 +/// @return void this function returns nothing. CA_EXTERN_C VoidType DlgMsgBox(CharacterTypeUTF8* title, CharacterTypeUTF8* format, ...); diff --git a/Public/Developer/System.Core/Headers/FS.hxx b/Public/Developer/System.Core/Headers/File.h index 62ed1255..bd1d8d3f 100644 --- a/Public/Developer/System.Core/Headers/FS.hxx +++ b/Public/Developer/System.Core/Headers/File.h @@ -5,3 +5,7 @@ ------------------------------------------- */ #pragma once + +#include <System.Core/Headers/Defines.h> + +/// @brief Filesystem wrapper. diff --git a/Public/Developer/System.Core/Headers/Heap.hxx b/Public/Developer/System.Core/Headers/Heap.h index c6252c04..90f15aa5 100644 --- a/Public/Developer/System.Core/Headers/Heap.hxx +++ b/Public/Developer/System.Core/Headers/Heap.h @@ -6,7 +6,7 @@ #pragma once -#include <System.Core/Headers/Defines.hxx> +#include <System.Core/Headers/Defines.h> #define kAllocationTypes 2 diff --git a/Public/Developer/System.Core/Headers/Hint.hxx b/Public/Developer/System.Core/Headers/Hint.h index 86faf455..86faf455 100644 --- a/Public/Developer/System.Core/Headers/Hint.hxx +++ b/Public/Developer/System.Core/Headers/Hint.h diff --git a/Public/Developer/System.Core/Headers/Thread.hxx b/Public/Developer/System.Core/Headers/Thread.h index 6118ea21..7d2bfe3c 100644 --- a/Public/Developer/System.Core/Headers/Thread.hxx +++ b/Public/Developer/System.Core/Headers/Thread.h @@ -8,10 +8,10 @@ // Created by Amlal on 3/18/24 // -#ifndef __THREAD_API__ -#define __THREAD_API__ +#ifndef __THREAD__ +#define __THREAD__ -#include <System.Core/Headers/Defines.hxx> +#include <System.Core/Headers/Defines.h> #define kThreadErrorExit -33 @@ -31,8 +31,13 @@ typedef VoidType(*ThreadEntrypointKind)(VoidType); CA_EXTERN_C ThreadRef TmCreateThread(const CharacterTypeUTF8* threadName, ThreadEntrypointKind threadStart); /// @brief Dispoes the thread, and exits with code kThreadErrorExit -/// @param ref -/// @return +/// @param ref the thread reference. +/// @return nothing. CA_EXTERN_C VoidType TmDisposeThread(ThreadRef ref); -#endif // __THREAD_API__ +/// @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.hxx b/Public/Developer/System.Core/Headers/TrueType.h index 185bbc78..5ad9d7a7 100644 --- a/Public/Developer/System.Core/Headers/TrueType.hxx +++ b/Public/Developer/System.Core/Headers/TrueType.h @@ -6,12 +6,12 @@ #pragma once -#include <System.Core/Headers/Window.hxx> +#include <System.Core/Headers/Window.h> /************************************************************* * * File: TrueType.hxx - * Purpose: TrueType font implementation for System Software. + * Purpose: TrueType font implementation for HCore. * Date: 3/26/24 * * Copyright Mahrouss Logic, all rights reserved. @@ -28,4 +28,5 @@ CA_EXTERN_C TTFFontRef FnCreateFont(const char* name); /// @brief Dispose an allocated font. /// @param fon /// @return -CA_EXTERN_C VoidType FnDisposeFont(TTFFontRef fon);
\ No newline at end of file +CA_EXTERN_C VoidType FnDisposeFont(TTFFontRef fon); + diff --git a/Public/Developer/System.Core/Headers/Window.hxx b/Public/Developer/System.Core/Headers/Window.h index 39d5eb47..121ac502 100644 --- a/Public/Developer/System.Core/Headers/Window.hxx +++ b/Public/Developer/System.Core/Headers/Window.h @@ -6,20 +6,20 @@ #pragma once -#include <System.Core/Headers/Defines.hxx> +#include <System.Core/Headers/Defines.h> /************************************************************* * * File: Window.hxx - * Purpose: Window Manager implementation for System Software. + * Purpose: Window Manager API for HCore. * Date: 3/26/24 * * Copyright Mahrouss Logic, all rights reserved. * *************************************************************/ -struct _GraphicsPoint; -struct _GraphicsPort; +struct _WmPoint; +struct _WindowPort; #ifdef __SINGLE_PRECISION__ typedef float PositionType; @@ -27,13 +27,15 @@ typedef float PositionType; typedef double PositionType; #endif +typedef QWordType DCRef; + /// @brief A point, can represent the size, position of a window. -typedef struct _GraphicsPoint { +typedef struct _WmPoint { PositionType X, Y; -} GraphicsPoint; +} WmPoint; -/// @brief Tracker Graphics port. -typedef struct _GraphicsPort { +/// @brief Window port type, can be used to control the window. +typedef struct _WindowPort { WordType windowPort; WordType windowKind; BooleanType windowVisible; @@ -42,13 +44,14 @@ typedef struct _GraphicsPort { BooleanType windowMoving; BooleanType windowDisableClose; BooleanType windowDisableMinimize; - GraphicsPoint windowPosition; - GraphicsPoint windowSize; + WmPoint windowPosition; + WmPoint windowSize; BooleanType windowInvalidate; DWordType windowClearColor; WordType menuPort; WordType parentPort; -} GraphicsPort; + DCRef windowDeviceContext; +} WindowPort; typedef UInt32Type ColorRef; @@ -90,11 +93,11 @@ CA_EXTERN_C ControlRef WmCreateControl(const DWordType id); /// @return CA_EXTERN_C VoidType WmReleaseControl(const ControlRef id); -/// @brief Moves a control inside a GraphicsPort. +/// @brief Moves a control inside a WindowPort. /// @param id the control ref. /// @param where where to move at. /// @return -CA_EXTERN_C Int32Type WmSetControlPosition(const ControlRef id, GraphicsPoint where); +CA_EXTERN_C Int32Type WmSetControlPosition(const ControlRef id, WmPoint where); /// @brief Enable control. /// @param id @@ -112,29 +115,29 @@ CA_EXTERN_C Int32Type WmMakeControlVisible(const ControlRef id, BooleanType visi /// @param name the window name /// @param rsrcId the window fork rsrc id. /// @return the window graphics port. -CA_EXTERN_C GraphicsPort* WmCreateWindow(const char* name, const DWordType rsrcId); +CA_EXTERN_C WindowPort* WmCreateWindow(const char* 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 GraphicsPort* WmCreateMenu(const char* name, const DWordType rsrcId); +CA_EXTERN_C WindowPort* WmCreateMenu(const char* name, const DWordType rsrcId); /// @brief Releases the window. /// @param port the window port. /// @return void -CA_EXTERN_C VoidType WmReleaseWindow(GraphicsPort* port); +CA_EXTERN_C VoidType WmReleaseWindow(WindowPort* port); /// @brief Releases the menu /// @param port the menu port. /// @return void -CA_EXTERN_C VoidType WmReleaseMenu(GraphicsPort* port); +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(const GraphicsPort* id, GraphicsPoint where); +CA_EXTERN_C Int32Type WmMoveWindow(const WindowPort* id, WmPoint where); enum { kWmErrIncompatible = 0x74, diff --git a/Public/Developer/System.Core/Makefile b/Public/Developer/System.Core/Makefile index 11e4760f..0f20cc72 100644 --- a/Public/Developer/System.Core/Makefile +++ b/Public/Developer/System.Core/Makefile @@ -9,7 +9,7 @@ OUTPUT=System.Core.lib .PHONY: build-core-amd64 build-core-amd64: - $(CC) -I../ -I$(HOME) -I../../../Private/ $(CCFLAGS) $(wildcard Sources/*.cxx) $(wildcard AMD64/*.s) -o $(OUTPUT) + $(CC) -I../ -I$(HOME) -I../../../Private/ $(CCFLAGS) $(wildcard Sources/*.c) $(wildcard Sources/*.cxx) $(wildcard AMD64/*.s) -o $(OUTPUT) .PHONY: all all: build-core diff --git a/Public/Developer/System.Core/Sources/CRT0.cxx b/Public/Developer/System.Core/Sources/CRT0.c index 244e62d5..03aa62b8 100644 --- a/Public/Developer/System.Core/Sources/CRT0.cxx +++ b/Public/Developer/System.Core/Sources/CRT0.c @@ -2,7 +2,7 @@ (C) Mahrouss Logic ===========================================*/ -#include <System.Core/Headers/Heap.hxx> +#include <System.Core/Headers/Heap.h> /// @brief Inits the library. /// @return if it was succesful or not. diff --git a/Public/Developer/System.Core/Sources/Heap.cxx b/Public/Developer/System.Core/Sources/Heap.c index 991987ca..390ae072 100644 --- a/Public/Developer/System.Core/Sources/Heap.cxx +++ b/Public/Developer/System.Core/Sources/Heap.c @@ -4,7 +4,7 @@ ------------------------------------------- */ -#include <System.Core/Headers/Heap.hxx> +#include <System.Core/Headers/Heap.h> /// @brief Allocate from the user's heap. /// @param refObj Process object. diff --git a/Public/Developer/System.Core/Sources/New+Delete.cxx b/Public/Developer/System.Core/Sources/New+Delete.cxx index 3901aed1..3e2942c5 100644 --- a/Public/Developer/System.Core/Sources/New+Delete.cxx +++ b/Public/Developer/System.Core/Sources/New+Delete.cxx @@ -4,7 +4,7 @@ ------------------------------------------- */ -#include <System.Core/Headers/Heap.hxx> +#include <System.Core/Headers/Heap.h> typedef SizeType size_t; |
