diff options
| author | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-07 14:46:11 +0200 |
|---|---|---|
| committer | Amlal El Mahrouss <amlal.elmahrouss@icloud.com> | 2024-05-07 14:47:44 +0200 |
| commit | e80b274a23cb6bbe83bc48058c779624b16dd556 (patch) | |
| tree | 905578ee29d9c5bad03b28b8381a2c29fb715f0f /Public/Developer/SystemLib/Sources/Wm.c | |
| parent | c4f3bfd671ad8ec5721c3d2c45de4806f34ebb75 (diff) | |
MHR-23: ErrorID error codes are now deprecated in favor of HError.
- Cleanup done in SystemLib.
- Refactor system API.
Signed-off-by: Amlal El Mahrouss <amlal.elmahrouss@icloud.com>
Diffstat (limited to 'Public/Developer/SystemLib/Sources/Wm.c')
| -rw-r--r-- | Public/Developer/SystemLib/Sources/Wm.c | 100 |
1 files changed, 0 insertions, 100 deletions
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; - } -} |
