From: John Hodge Date: Wed, 17 Aug 2011 03:46:11 +0000 (+0800) Subject: Usermode/axwin3 - Designing AxWin3 API X-Git-Tag: rel0.11~150 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=21d938f9041683280a2d5ed44ef0bca278210829;p=tpg%2Facess2.git Usermode/axwin3 - Designing AxWin3 API --- diff --git a/Usermode/Applications/axwin3_src/WM/include/common.h b/Usermode/Applications/axwin3_src/WM/include/common.h index e69de29b..ffaff330 100644 --- a/Usermode/Applications/axwin3_src/WM/include/common.h +++ b/Usermode/Applications/axwin3_src/WM/include/common.h @@ -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/messages.h b/Usermode/Applications/axwin3_src/WM/include/messages.h index 24731405..840ad684 100644 --- a/Usermode/Applications/axwin3_src/WM/include/messages.h +++ b/Usermode/Applications/axwin3_src/WM/include/messages.h @@ -7,6 +7,7 @@ enum eMessages { MSG_NULL, + MSG_CREATEWIN }; #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 index 00000000..56118f61 --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/include/wm.h @@ -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 index 00000000..f870290e --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/include/wm_renderer.h @@ -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 index 00000000..8e581935 --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/renderer_classes.c @@ -0,0 +1,24 @@ +/* + * Acess2 Window Manager v3 + * - By John Hodge (thePowersGang) + * + * render_classes.c + * - Simple class based window renderer + */ +#include +#include + +// === 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 index 00000000..4eefd7cd --- /dev/null +++ b/Usermode/Applications/axwin3_src/WM/renderer_passthru.c @@ -0,0 +1,24 @@ +/* + * Acess2 Window Manager v3 + * - By John Hodge (thePowersGang) + * + * renderer_passthru.c + * - Passthrough window render (framebuffer essentially) + */ +#include +#include + +// === GLOBALS === +tWMRenderer gRenderer_Passthru = { + .CreateWindow = Renderer_Passthru_Create, + .Redraw = Renderer_Passthru_Redraw, + .SendMessage = Renderer_Passthru_SendMessage +}; + +// === CODE === +int Renderer_Passthru_Init(void) +{ + return 0; +} + + diff --git a/Usermode/Applications/axwin3_src/notes.txt b/Usermode/Applications/axwin3_src/notes.txt index cea9d36c..212b321e 100644 --- a/Usermode/Applications/axwin3_src/notes.txt +++ b/Usermode/Applications/axwin3_src/notes.txt @@ -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