diff options
Diffstat (limited to 'Public/Developer/SystemLib/Sources')
| -rw-r--r-- | Public/Developer/SystemLib/Sources/App.c | 2 | ||||
| -rw-r--r-- | Public/Developer/SystemLib/Sources/TrueType.c | 42 | ||||
| -rw-r--r-- | Public/Developer/SystemLib/Sources/Wm.c | 100 |
3 files changed, 1 insertions, 143 deletions
diff --git a/Public/Developer/SystemLib/Sources/App.c b/Public/Developer/SystemLib/Sources/App.c index c85b2dd8..7778c064 100644 --- a/Public/Developer/SystemLib/Sources/App.c +++ b/Public/Developer/SystemLib/Sources/App.c @@ -7,7 +7,7 @@ #include <Headers/Defines.h> /// @brief Main Application object, retrieved from the RtGetAppPointer symbol. -ApplicationRef kSharedApplication = NullPtr; +ApplicationInterfaceRef kSharedApplication = NullPtr; /// @brief Gets the app arguments count. /// @param void no arguments. diff --git a/Public/Developer/SystemLib/Sources/TrueType.c b/Public/Developer/SystemLib/Sources/TrueType.c deleted file mode 100644 index 49b1c2e8..00000000 --- a/Public/Developer/SystemLib/Sources/TrueType.c +++ /dev/null @@ -1,42 +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 607e7dcf..00000000 --- a/Public/Developer/SystemLib/Sources/Wm.c +++ /dev/null @@ -1,100 +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; - } -} |
