Usermode/axwin3 - Designing AxWin3 API
authorJohn Hodge <[email protected]>
Wed, 17 Aug 2011 03:46:11 +0000 (11:46 +0800)
committerJohn Hodge <[email protected]>
Wed, 17 Aug 2011 03:46:11 +0000 (11:46 +0800)
Usermode/Applications/axwin3_src/WM/include/common.h
Usermode/Applications/axwin3_src/WM/include/messages.h
Usermode/Applications/axwin3_src/WM/include/wm.h [new file with mode: 0644]
Usermode/Applications/axwin3_src/WM/include/wm_renderer.h [new file with mode: 0644]
Usermode/Applications/axwin3_src/WM/renderer_classes.c [new file with mode: 0644]
Usermode/Applications/axwin3_src/WM/renderer_passthru.c [new file with mode: 0644]
Usermode/Applications/axwin3_src/notes.txt

index e69de29..ffaff33 100644 (file)
@@ -0,0 +1,12 @@
+/*
+ * Acess2 Window Manager v3 (axwin3)
+ * - By John Hodge (thePowersGang)
+ *
+ * include/common.h
+ * - Common definitions and functions
+ */
+#ifndef _COMMON_H_
+#define _COMMON_H_
+
+#endif
+
diff --git a/Usermode/Applications/axwin3_src/WM/include/wm.h b/Usermode/Applications/axwin3_src/WM/include/wm.h
new file mode 100644 (file)
index 0000000..56118f6
--- /dev/null
@@ -0,0 +1,30 @@
+/*
+ * Acess2 Window Manager v3 (axwin3)
+ * - By John Hodge (thePowersGang)
+ *
+ * include/wm.h
+ * - Window management functions
+ */
+#ifndef _WM_H_
+#define _WM_H_
+
+// === CONSTANTS ===
+/**
+ * \brief Window Flags
+ * \{
+ */
+#define WINFLAG_SHOW           0x00000001
+#define WINFLAG_RENDER_MASK    0x00FFFF00
+#define WINFLAG_USR_MASK       0xFF000000
+/**
+ * \}
+ */
+
+// === FUNCTIONS ===
+extern tWindow *WM_CreateWindow(tWindow *Parent, int X, int Y, int W, int H, int Flags, tRenderer *Handler);
+extern int     WM_Reposition(tWindow *Window, int X, int Y, int W, int H);
+extern int     WM_SetFlags(tWindow *Window, int Flags);
+extern int     WM_SendMessage(tWindow *Window, int MessageID, int Length, void *Data);
+
+#endif
+
diff --git a/Usermode/Applications/axwin3_src/WM/include/wm_renderer.h b/Usermode/Applications/axwin3_src/WM/include/wm_renderer.h
new file mode 100644 (file)
index 0000000..f870290
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+* Acess2 Window Manager v3 (axwin3)
+* - By John Hodge (thePowersGang)
+*
+* include/wm_renderer.h
+* - Window renderer API
+*/
+#ifndef _WM_RENDERER_H_
+#define _WM_RENDERER_H_
+
+typedef struct
+{
+       tWindow (*InitWindow)(int W, int H, int Flags);
+       void    (*Redraw)(tWindow *Window);
+        int    (*SendMessage)(tWindow *Window, int MessageID, int Length, void *Data);
+}      tWMRenderer;
+
+#endif
diff --git a/Usermode/Applications/axwin3_src/WM/renderer_classes.c b/Usermode/Applications/axwin3_src/WM/renderer_classes.c
new file mode 100644 (file)
index 0000000..8e58193
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Acess2 Window Manager v3
+ * - By John Hodge (thePowersGang)
+ *
+ * render_classes.c
+ * - Simple class based window renderer
+ */
+#include <common.h>
+#include <wm_renderer.h>
+
+// === GLOBALS ===
+tWMRenderer    gRenderer_Class = {
+       .CreateWindow = Renderer_Class_Create,
+       .Redraw = Renderer_Class_Redraw,
+       .SendMessage = Renderer_Class_SendMessage
+};
+
+// === CODE ===
+int Renderer_Class_Init(void)
+{
+       return 0;
+}
+
+
diff --git a/Usermode/Applications/axwin3_src/WM/renderer_passthru.c b/Usermode/Applications/axwin3_src/WM/renderer_passthru.c
new file mode 100644 (file)
index 0000000..4eefd7c
--- /dev/null
@@ -0,0 +1,24 @@
+/*
+ * Acess2 Window Manager v3
+ * - By John Hodge (thePowersGang)
+ *
+ * renderer_passthru.c
+ * - Passthrough window render (framebuffer essentially)
+ */
+#include <common.h>
+#include <wm_renderer.h>
+
+// === GLOBALS ===
+tWMRenderer    gRenderer_Passthru = {
+       .CreateWindow = Renderer_Passthru_Create,
+       .Redraw = Renderer_Passthru_Redraw,
+       .SendMessage = Renderer_Passthru_SendMessage
+};
+
+// === CODE ===
+int Renderer_Passthru_Init(void)
+{
+       return 0;
+}
+
+
index cea9d36..212b321 100644 (file)
@@ -1,4 +1,8 @@
 Window Based GUI
 Every window has a position, size, class and text and three colours (background, text and detail)
 
-Window Classes provide render information in form of a bytecode
+Window Classes provide render information in form of a bytecode?
+- Save for later, maybe as a render handler
+
+Each window can register itself with a render handler
+- Handlers expose IPC methods via message queue

UCC git Repository :: git.ucc.asn.au