summaryrefslogtreecommitdiffhomepage
path: root/Public/Developer/SystemLib/Sources
diff options
context:
space:
mode:
Diffstat (limited to 'Public/Developer/SystemLib/Sources')
-rw-r--r--Public/Developer/SystemLib/Sources/App.c29
-rw-r--r--Public/Developer/SystemLib/Sources/File.c40
-rw-r--r--Public/Developer/SystemLib/Sources/Heap.c51
-rw-r--r--Public/Developer/SystemLib/Sources/Math.c7
-rw-r--r--Public/Developer/SystemLib/Sources/TrueType.c39
-rw-r--r--Public/Developer/SystemLib/Sources/Wm.c86
6 files changed, 0 insertions, 252 deletions
diff --git a/Public/Developer/SystemLib/Sources/App.c b/Public/Developer/SystemLib/Sources/App.c
deleted file mode 100644
index 36e53c7e..00000000
--- a/Public/Developer/SystemLib/Sources/App.c
+++ /dev/null
@@ -1,29 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#include <Headers/Defines.h>
-
-/// @brief Main Application object, retrieved from the RtGetAppPointer symbol.
-ApplicationRef kSharedApplication = NullPtr;
-
-/// @brief Gets the app arguments count.
-/// @param void no arguments.
-/// @return The number of arguments given to the application.
-CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) {
- CA_MUST_PASS(kSharedApplication);
-
- return kSharedApplication->Invoke(kSharedApplication, kCallGetArgsCount);
-}
-
-/// @brief Gets the app arguments pointer.
-/// @param void no arguments.
-/// @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
deleted file mode 100644
index 6e4a7440..00000000
--- a/Public/Developer/SystemLib/Sources/File.c
+++ /dev/null
@@ -1,40 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#include <Headers/Defines.h>
-#include <Headers/File.h>
-
-enum FileOp {
- kFlushFile,
- kReadFork,
- kWriteFork,
- kOpenFork,
- kCloseFork,
-};
-
-/// @brief Opens a new file.
-/// @param path where to find it.
-/// @param rest the restrict (rw, rwe, r+, w+, r, w)
-/// @return FSRef the file.
-CA_EXTERN_C FSRef FsOpenFile(const CharacterTypeUTF8* path,
- const CharacterTypeUTF8* rest) {
- CA_MUST_PASS(kSharedApplication);
- CA_MUST_PASS(path && FsIsValidPath(path) == Yes);
- CA_MUST_PASS(rest);
-
- return kSharedApplication->Invoke(kSharedApplication, kCallOpenFile, path,
- rest);
-}
-
-/// @brief Closes the file and flushes it to the said file.
-/// @param refFs the filesystem reference.
-/// @return
-CA_EXTERN_C VoidType FsCloseFile(FSRef refFs) {
- CA_MUST_PASS(kSharedApplication);
-
- kSharedApplication->Invoke(kSharedApplication, refFs, kFlushFile);
- kSharedApplication->Invoke(kSharedApplication, kCallCloseFile, refFs);
-}
diff --git a/Public/Developer/SystemLib/Sources/Heap.c b/Public/Developer/SystemLib/Sources/Heap.c
deleted file mode 100644
index 3db7a374..00000000
--- a/Public/Developer/SystemLib/Sources/Heap.c
+++ /dev/null
@@ -1,51 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#include <Headers/Defines.h>
-#include <Headers/Heap.h>
-
-/// @brief Allocate from the user's heap.
-/// @param sz size of object.
-/// @param flags flags.
-/// @return
-CA_EXTERN_C PtrVoidType RtTlsAllocate(QWordType sz, DWordType flags) {
- CA_MUST_PASS(kSharedApplication);
- CA_MUST_PASS(sz);
- CA_MUST_PASS(flags);
-
- return (PtrVoidType)kSharedApplication->Invoke(kSharedApplication,
- kCallAllocPtr, sz, flags);
-}
-
-/// @brief Free pointer from the user's heap.
-/// @param ptr the pointer to free.
-CA_EXTERN_C VoidType RtTlsFree(PtrVoidType ptr) {
- CA_MUST_PASS(kSharedApplication);
- CA_MUST_PASS(ptr);
-
- CA_UNREFERENCED_PARAMETER(
- kSharedApplication->Invoke(kSharedApplication, kCallFreePtr, ptr));
-}
-
-/// @brief Get pointer size.
-/// @param ptr the pointer to find.
-/// @return the size.
-CA_EXTERN_C QWordType RtTlsGetSize(PtrVoidType ptr) {
- CA_MUST_PASS(kSharedApplication);
-
- CA_MUST_PASS(ptr);
- return kSharedApplication->Invoke(kSharedApplication, kCallSizePtr, ptr);
-}
-
-/// @brief Check if the pointer exists.
-/// @param ptr the pointer to check.
-/// @return if it exists
-CA_EXTERN_C BooleanType RtTlsPtrExists(PtrVoidType ptr) {
- CA_MUST_PASS(kSharedApplication);
-
- CA_MUST_PASS(ptr);
- return kSharedApplication->Invoke(kSharedApplication, kCallCheckPtr, ptr);
-}
diff --git a/Public/Developer/SystemLib/Sources/Math.c b/Public/Developer/SystemLib/Sources/Math.c
deleted file mode 100644
index 20919711..00000000
--- a/Public/Developer/SystemLib/Sources/Math.c
+++ /dev/null
@@ -1,7 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#include <Headers/Math.h>
diff --git a/Public/Developer/SystemLib/Sources/TrueType.c b/Public/Developer/SystemLib/Sources/TrueType.c
deleted file mode 100644
index d23ce4f9..00000000
--- a/Public/Developer/SystemLib/Sources/TrueType.c
+++ /dev/null
@@ -1,39 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#include <Headers/Defines.h>
-#include <Headers/TrueType.h>
-#include <Headers/File.h>
-#include <Headers/Heap.h>
-
-#define kTTFFork "fon " /* TrueType */
-
-/// @brief TrueType container reader
-typedef struct TTFReader {
- FSForkRef fFork;
- FSRef fFile;
- PtrVoidType fBlob; // cached blob
- SizeType fBlobSize; // cached blob size
- VoidType(*__fReadBytes)(SizeType count);
- VoidType(*__fSkipBytes)(SizeType count);
-} TTFReader;
-
-/// @brief Grab a TTF reader reference.
-/// @param fs filesystem reference.
-/// @return TTFReader* the new TTFReader type.
-CA_STATIC TTFReader* GrabTTFReader(FSRef fs) {
- FSForkRef forkRef = FsGetFork(fs, kTTFFork);
-
- if (forkRef = kInvalidRef) return NullPtr;
-
- TTFReader* reader = RtTlsAllocate(sizeof(TTFReader), kStandardAllocation);
-
- reader->fFile = fs;
- reader->fFork = forkRef;
-
- return reader;
-}
-/// EOF.
diff --git a/Public/Developer/SystemLib/Sources/Wm.c b/Public/Developer/SystemLib/Sources/Wm.c
deleted file mode 100644
index a1f4d051..00000000
--- a/Public/Developer/SystemLib/Sources/Wm.c
+++ /dev/null
@@ -1,86 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#include <Headers/Wm.h>
-#include <Headers/Math.h>
-
-/// invalid resource handle, they always start from 1.
-#define kInvalidRsrc (0U)
-
-/// @brief Color refs.
-
-const ColorRef kRgbRed = 0x000000FF;
-const ColorRef kRgbGreen = 0x0000FF00;
-const ColorRef kRgbBlue = 0x00FF0000;
-const ColorRef kRgbBlack = 0x00000000;
-const ColorRef kRgbWhite = 0xFFFFFFFF;
-
-/////////////////////////////////////////////////////////////////////////
-
-CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name,
- const DWordType rsrcId) {
- CA_MUST_PASS(name);
- CA_MUST_PASS(rsrcId != kInvalidRsrc);
-
- if (!name) return NullPtr;
- if (rsrcId == kInvalidRsrc) return NullPtr;
-
- return (WindowPort*)kSharedApplication->Invoke(
- kSharedApplication, kCallCreateWindow, name, rsrcId);
-}
-
-/////////////////////////////////////////////////////////////////////////
-
-CA_EXTERN_C VoidType WmReleaseWindow(WindowPort* winPort) {
- CA_MUST_PASS(winPort);
- if (!winPort) return;
-
- kSharedApplication->Invoke(kSharedApplication, kCallCloseWindow, winPort);
-}
-
-/////////////////////////////////////////////////////////////////////////
-
-CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name,
- const DWordType rsrcId) {
- CA_MUST_PASS(name);
- CA_MUST_PASS(rsrcId != kInvalidRsrc);
-
- if (!name) return NullPtr;
- if (rsrcId == kInvalidRsrc) return NullPtr;
-
- return (WindowPort*)kSharedApplication->Invoke(kSharedApplication,
- kCallCreateMenu, name, rsrcId);
-}
-
-/////////////////////////////////////////////////////////////////////////
-
-CA_EXTERN_C VoidType WmReleaseMenu(WindowPort* winPort) {
- CA_MUST_PASS(winPort);
-
- if (!winPort) return;
- kSharedApplication->Invoke(kSharedApplication, kCallCloseMenu, winPort);
-}
-
-/////////////////////////////////////////////////////////////////////////
-
-CA_EXTERN_C Int32Type WmMoveWindow(WindowPort* wndPort, WmPoint where) {
- if (!wndPort) return kWmErrInvalidArg;
-
- wndPort->windowPosition.X = where.X;
- wndPort->windowPosition.Y = where.Y;
- wndPort->windowMoving = True;
-
- return 0;
-}
-
-/// @brief Causes the window to invalidate and redraw.
-/// @param wndPort The Window port.
-/// @return nothing.
-CA_EXTERN_C VoidType WmInvalidateGfx(WindowPort* wndPort) {
- if (wndPort) {
- wndPort->windowInvalidate = Yes;
- }
-}