summaryrefslogtreecommitdiffhomepage
path: root/Public/Developer/SystemLib
diff options
context:
space:
mode:
Diffstat (limited to 'Public/Developer/SystemLib')
-rw-r--r--Public/Developer/SystemLib/Headers/Dialog.h4
-rw-r--r--Public/Developer/SystemLib/Headers/Wm.h59
-rw-r--r--Public/Developer/SystemLib/POWER/CoreAssembly.s (renamed from Public/Developer/SystemLib/PowerPC/CoreAssembly.s)5
-rw-r--r--Public/Developer/SystemLib/Sources/App.c4
-rw-r--r--Public/Developer/SystemLib/Sources/File.c3
-rw-r--r--Public/Developer/SystemLib/amd64.mk (renamed from Public/Developer/SystemLib/Makefile)0
6 files changed, 39 insertions, 36 deletions
diff --git a/Public/Developer/SystemLib/Headers/Dialog.h b/Public/Developer/SystemLib/Headers/Dialog.h
index 800f56db..823b3366 100644
--- a/Public/Developer/SystemLib/Headers/Dialog.h
+++ b/Public/Developer/SystemLib/Headers/Dialog.h
@@ -27,13 +27,13 @@ typedef struct _DialogPort {
DialogPoint dlgPosition;
WmDialogFn dlgProc;
struct _WmGFX* dlgGfx;
- struct _WindowPort* parentPort;
+ struct _WmWindowPort* parentPort;
} DialogPort;
/// @brief Creates a new dialog from a rsrc fork id.
/// @param rsrcId the resource id.
/// @return the dialog port.
-CA_EXTERN_C DialogPort* DlgCreateFromRsrc(QWordType rsrcId);
+CA_EXTERN_C DialogPort* DlgCreateFromRsrc(QWordType rsrcId);
/// @brief Shows an message box according to format.
/// @param title the message box title
diff --git a/Public/Developer/SystemLib/Headers/Wm.h b/Public/Developer/SystemLib/Headers/Wm.h
index 66ed96a3..f6484c29 100644
--- a/Public/Developer/SystemLib/Headers/Wm.h
+++ b/Public/Developer/SystemLib/Headers/Wm.h
@@ -7,21 +7,22 @@
#pragma once
#include <Headers/Defines.h>
+#include "Headers/Dialog.h"
/*************************************************************
- *
- * File: Wm.h
+ *
+ * File: Wm.h
* Purpose: Window Manager API for NewOS.
* Date: 3/26/24
- *
+ *
* Copyright Mahrouss Logic, all rights reserved.
- *
+ *
*************************************************************/
struct _WmPoint;
-struct _WindowPort;
-
-struct _ControlPort;
+struct _WmWindowPort;
+struct _WmGFX;
+struct _WmControlPort;
struct _WmPoint;
/// @brief Window Graphics type.
@@ -33,7 +34,7 @@ typedef struct _WmGFX {
} WmGFX, *WmGFXRef;
/// @brief Window procedure type.
-typedef VoidType(*WmWindowFn)(struct _WindowPort* port, UInt32Type msg, UIntPtrType pParam, UIntPtrType iParam);
+typedef VoidType(*WmWindowFn)(struct _WmWindowPort* port, UInt32Type msg, UIntPtrType pParam, UIntPtrType iParam);
/// @brief A point, can represent the size, position of a window.
typedef struct _WmPoint {
@@ -42,7 +43,7 @@ typedef struct _WmPoint {
/// @brief Window port type, can be used to control the window.
-typedef struct _WindowPort {
+typedef struct _WmWindowPort {
WordType windowPort;
WordType windowKind;
BooleanType windowVisible : 1;
@@ -56,12 +57,12 @@ typedef struct _WindowPort {
WmPoint windowSize;
WmGFXRef windowGfx;
WmWindowFn windowProc;
- struct _WindowPort* windowMenuPort; ///! Attached menu to it.
- struct _WindowPort* windowParentPort;
+ struct _WmWindowPort* windowMenuPort; ///! Attached menu to it.
+ struct _WmWindowPort* windowParentPort;
} WindowPort;
/// @brief Control port type.
-typedef struct _ControlPort {
+typedef struct _WmControlPort {
WordType controlPort;
WordType controlKind;
BooleanType controlVisible : 1;
@@ -70,7 +71,7 @@ typedef struct _ControlPort {
WmWindowFn controlProc;
WmGFXRef controlGfx;
WindowPort* parentPort;
-} ControlPort;
+} WmControlPort;
enum {
kWmErrIncompatible = 0x74,
@@ -111,31 +112,31 @@ CA_EXTERN_C const ColorRef kRgbWhite;
/// @brief Creates a new control
/// @param id the control rsrc fork.
-/// @return
-CA_EXTERN_C ControlPort* WmCreateControl(DWordType id);
+/// @return
+CA_EXTERN_C WmControlPort* WmCreateControl(DWordType id);
/// @brief Releases the control
/// @param ctrlPort the control ref.
-/// @return
-CA_EXTERN_C VoidType WmReleaseControl(ControlPort* ctrlPort);
+/// @return
+CA_EXTERN_C VoidType WmReleaseControl(WmControlPort* ctrlPort);
-/// @brief Moves a control inside a ControlPort.
+/// @brief Moves a control inside a WmControlPort.
/// @param ctrlPort the control ref.
/// @param where where to move at.
-/// @return
-CA_EXTERN_C Int32Type WmSetControlPosition(ControlPort* ctrlPort, WmPoint where);
+/// @return
+CA_EXTERN_C Int32Type WmSetControlPosition(WmControlPort* ctrlPort, WmPoint where);
/// @brief Enable control.
-/// @param ctrlPort
-/// @param enabled
-/// @return
-CA_EXTERN_C Int32Type WmSetControlEnabled(ControlPort* ctrlPort, BooleanType enabled);
+/// @param ctrlPort
+/// @param enabled
+/// @return
+CA_EXTERN_C Int32Type WmSetControlEnabled(WmControlPort* ctrlPort, BooleanType enabled);
/// @brief Make control visible.
-/// @param ctrlPort
-/// @param visible
-/// @return
-CA_EXTERN_C Int32Type WmSetControlVisible(ControlPort* ctrlPort, BooleanType visible);
+/// @param ctrlPort
+/// @param visible
+/// @return
+CA_EXTERN_C Int32Type WmSetControlVisible(WmControlPort* ctrlPort, BooleanType visible);
/// @brief Creates a new window.
/// @param name the window name
@@ -172,4 +173,4 @@ CA_EXTERN_C WindowPort* WmGetOSDlg(void);
/// @brief Draws a blur effect on the window.
/// @param wndPort the window port.
-CA_EXTERN_C VoidType WmBlur(WindowPort* wndPort); \ No newline at end of file
+CA_EXTERN_C VoidType WmBlur(WindowPort* wndPort);
diff --git a/Public/Developer/SystemLib/PowerPC/CoreAssembly.s b/Public/Developer/SystemLib/POWER/CoreAssembly.s
index 7078774e..99605870 100644
--- a/Public/Developer/SystemLib/PowerPC/CoreAssembly.s
+++ b/Public/Developer/SystemLib/POWER/CoreAssembly.s
@@ -2,21 +2,22 @@
;
; Copyright Mahrouss Logic
;
-; Purpose: PowerPC Core assembly routines.
+; Purpose: POWER low level I/O
;
; ------------------------------------------- */
/* @brief Application getter */
/* @throws: ApptError: appartement error. */
export .code64 RtGetAppPointer:
+ mflr r3
stw 0x10, 0(r3) /* sysGetProcessObject */
sc
blr
export .code64 RtAssertTriggerInterrupt:
+ mflr r3
stw 0x11, 0(r3) /* sysTerminateCurrentProcess */
sc
blr
-
diff --git a/Public/Developer/SystemLib/Sources/App.c b/Public/Developer/SystemLib/Sources/App.c
index 9d390795..36e53c7e 100644
--- a/Public/Developer/SystemLib/Sources/App.c
+++ b/Public/Developer/SystemLib/Sources/App.c
@@ -11,7 +11,7 @@ ApplicationRef kSharedApplication = NullPtr;
/// @brief Gets the app arguments count.
/// @param void no arguments.
-/// @return
+/// @return The number of arguments given to the application.
CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) {
CA_MUST_PASS(kSharedApplication);
@@ -23,7 +23,7 @@ CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) {
/// @return
CA_EXTERN_C CharacterTypeUTF8** RtGetAppArgumentsPtr(VoidType) {
CA_MUST_PASS(kSharedApplication);
-
+
return (CharacterTypeUTF8**)kSharedApplication->Invoke(kSharedApplication,
kCallGetArgsPtr);
}
diff --git a/Public/Developer/SystemLib/Sources/File.c b/Public/Developer/SystemLib/Sources/File.c
index 39a4aff0..6e4a7440 100644
--- a/Public/Developer/SystemLib/Sources/File.c
+++ b/Public/Developer/SystemLib/Sources/File.c
@@ -25,7 +25,8 @@ CA_EXTERN_C FSRef FsOpenFile(const CharacterTypeUTF8* path,
CA_MUST_PASS(path && FsIsValidPath(path) == Yes);
CA_MUST_PASS(rest);
- return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path, rest);
+ return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path,
+ rest);
}
/// @brief Closes the file and flushes it to the said file.
diff --git a/Public/Developer/SystemLib/Makefile b/Public/Developer/SystemLib/amd64.mk
index a753ccc8..a753ccc8 100644
--- a/Public/Developer/SystemLib/Makefile
+++ b/Public/Developer/SystemLib/amd64.mk