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/Application.c4
-rw-r--r--Public/Developer/SystemLib/Sources/ApplicationStart.c14
-rw-r--r--Public/Developer/SystemLib/Sources/Window.c28
3 files changed, 19 insertions, 27 deletions
diff --git a/Public/Developer/SystemLib/Sources/Application.c b/Public/Developer/SystemLib/Sources/Application.c
index f1391975..69f178af 100644
--- a/Public/Developer/SystemLib/Sources/Application.c
+++ b/Public/Developer/SystemLib/Sources/Application.c
@@ -21,5 +21,5 @@ CA_EXTERN_C SizeType RtGetAppArgumentsCount(VoidType) {
/// @return
CA_EXTERN_C CharacterTypeUTF8** RtGetAppArgumentsPtr(VoidType) {
return (CharacterTypeUTF8**)kSharedApplication->Invoke(kSharedApplication,
- kCallGetArgsPtr);
-} \ No newline at end of file
+ kCallGetArgsPtr);
+}
diff --git a/Public/Developer/SystemLib/Sources/ApplicationStart.c b/Public/Developer/SystemLib/Sources/ApplicationStart.c
deleted file mode 100644
index 0960388e..00000000
--- a/Public/Developer/SystemLib/Sources/ApplicationStart.c
+++ /dev/null
@@ -1,14 +0,0 @@
-/* -------------------------------------------
-
- Copyright Mahrouss Logic
-
-------------------------------------------- */
-
-#include <Headers/Defines.h>
-
-/// @brief Inits the system library.
-/// @return if it was succesful or not.
-CA_EXTERN_C VoidType __start(VoidType) {
- kSharedApplication = RtGetApp();
- CA_MUST_PASS(kSharedApplication);
-}
diff --git a/Public/Developer/SystemLib/Sources/Window.c b/Public/Developer/SystemLib/Sources/Window.c
index 2527e041..196ac537 100644
--- a/Public/Developer/SystemLib/Sources/Window.c
+++ b/Public/Developer/SystemLib/Sources/Window.c
@@ -9,6 +9,14 @@
/// 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,
@@ -16,6 +24,9 @@ CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name,
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);
}
@@ -24,6 +35,7 @@ CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name,
CA_EXTERN_C VoidType WmReleaseWindow(WindowPort* winPort) {
CA_MUST_PASS(winPort);
+ if (!winPort) return;
kSharedApplication->Invoke(kSharedApplication, kCallCloseWindow, winPort);
}
@@ -35,6 +47,9 @@ CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name,
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);
}
@@ -44,15 +59,14 @@ CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name,
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* id, WmPoint where) {
- if (!id) {
- return kWmErrInvalidArg;
- }
+ if (!id) return kWmErrInvalidArg;
id->windowPosition.X = where.X;
id->windowPosition.Y = where.Y;
@@ -60,11 +74,3 @@ CA_EXTERN_C Int32Type WmMoveWindow(WindowPort* id, WmPoint where) {
return 0;
}
-
-/// @brief Color refs.
-
-const ColorRef kRgbRed = 0x000000FF;
-const ColorRef kRgbGreen = 0x0000FF00;
-const ColorRef kRgbBlue = 0x00FF0000;
-const ColorRef kRgbBlack = 0x00000000;
-const ColorRef kRgbWhite = 0xFFFFFFFF;