summaryrefslogtreecommitdiffhomepage
path: root/Public/Developer/System.Core/Sources/Window.c
diff options
context:
space:
mode:
Diffstat (limited to 'Public/Developer/System.Core/Sources/Window.c')
-rw-r--r--Public/Developer/System.Core/Sources/Window.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/Public/Developer/System.Core/Sources/Window.c b/Public/Developer/System.Core/Sources/Window.c
new file mode 100644
index 00000000..2b589402
--- /dev/null
+++ b/Public/Developer/System.Core/Sources/Window.c
@@ -0,0 +1,62 @@
+/* -------------------------------------------
+
+ Copyright Mahrouss Logic
+
+------------------------------------------- */
+
+#include <System.Core/Headers/Window.h>
+
+/// invalid resource handle, they always start from 1.
+#define kInvalidRsrc 0
+
+/////////////////////////////////////////////////////////////////////////
+
+CA_EXTERN_C WindowPort* WmCreateWindow(const CharacterTypeUTF8* name,
+ const DWordType rsrcId) {
+ CA_MUST_PASS(name);
+ CA_MUST_PASS(rsrcId != kInvalidRsrc);
+
+ return (WindowPort*)kApplicationObject->Invoke(
+ kApplicationObject, kCallCreateWindow, name, rsrcId);
+}
+
+/////////////////////////////////////////////////////////////////////////
+
+CA_EXTERN_C VoidType WmReleaseWindow(WindowPort* winPort) {
+ CA_MUST_PASS(winPort);
+
+ kApplicationObject->Invoke(kApplicationObject, kCallCloseWindow, winPort);
+}
+
+/////////////////////////////////////////////////////////////////////////
+
+CA_EXTERN_C WindowPort* WmCreateMenu(const CharacterTypeUTF8* name,
+ const DWordType rsrcId) {
+ CA_MUST_PASS(name);
+ CA_MUST_PASS(rsrcId != kInvalidRsrc);
+
+ return (WindowPort*)kApplicationObject->Invoke(kApplicationObject,
+ kCallCreateMenu, name, rsrcId);
+}
+
+/////////////////////////////////////////////////////////////////////////
+
+CA_EXTERN_C VoidType WmReleaseMenu(WindowPort* winPort) {
+ CA_MUST_PASS(winPort);
+
+ kApplicationObject->Invoke(kApplicationObject, kCallCloseMenu, winPort);
+}
+
+/////////////////////////////////////////////////////////////////////////
+
+CA_EXTERN_C Int32Type WmMoveWindow(WindowPort* id, WmPoint where) {
+ if (!id) {
+ return kWmErrInvalidArg;
+ }
+
+ id->windowPosition.X = where.X;
+ id->windowPosition.Y = where.Y;
+ id->windowMoving = True;
+
+ return 0;
+} \ No newline at end of file