+/*
+ * Acess2 Window Manager v3 (axwin3)
+ * - By John Hodge (thePowersGang)
+ *
+ * include/common.h
+ * - Common definitions and functions
+ */
+#ifndef _COMMON_H_
+#define _COMMON_H_
+
+#endif
+
enum eMessages
{
MSG_NULL,
+ MSG_CREATEWIN
};
#endif
--- /dev/null
+/*
+ * 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
+
--- /dev/null
+/*
+* 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
--- /dev/null
+/*
+ * 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;
+}
+
+
--- /dev/null
+/*
+ * 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;
+}
+
+
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