2 * Acess2 Window Manager v3
3 * - By John Hodge (thePowersGang)
6 * - Simple class based window renderer
9 #include <wm_renderer.h>
10 #include <renderer_classful.h>
13 typedef struct sClassfulInfo
19 tWindow *Renderer_Class_Create(int Flags);
20 void Renderer_Class_Redraw(tWindow *Window);
21 int Renderer_Class_HandleMessage(tWindow *Target, int Msg, int Len, void *Data);
24 tWMRenderer gRenderer_Class = {
26 .CreateWindow = Renderer_Class_Create,
27 .Redraw = Renderer_Class_Redraw,
28 .HandleMessage = Renderer_Class_HandleMessage
32 int Renderer_Class_Init(void)
34 WM_RegisterRenderer(&gRenderer_Class);
39 tWindow *Renderer_Class_Create(int Flags)
41 return WM_CreateWindowStruct(sizeof(tClassfulInfo));
44 void Renderer_Class_Redraw(tWindow *Window)
46 tClassfulInfo *info = Window->RendererInfo;
47 WM_Render_FillRect(Window, 0, 0, Window->W, Window->H, info->BGColour);
50 int Renderer_Class_HandleMessage(tWindow *Target, int Msg, int Len, void *Data)
52 tClassfulInfo *info = Target->RendererInfo;
55 case MSG_CLASSFUL_SETBGCOLOUR:
56 if( Len != sizeof(uint32_t) ) return -1;
57 info->BGColour = *(uint32_t*)Data;
60 case MSG_CLASSFUL_SETTEXT:
64 // Anything else is unhandled