Merge branch 'master' of git://localhost/acess2
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / renderers / background.c
1 /*
2  * Acess2 Window Manager v3
3  * - By John Hodge (thePowersGang)
4  *
5  * render_widget.c
6  * - AxWin2 Background port
7  */
8 #include <common.h>
9 #include <wm_renderer.h>
10
11 // === TYPES ===
12
13 // === STRUCTURES ===
14 struct sBgWin
15 {
16         uint32_t        Colour;
17 };
18
19 // === PROTOTYPES ===
20 tWindow *Renderer_Background_Create(int Flags);
21 void    Renderer_Background_Redraw(tWindow *Window);
22 int     Renderer_Background_HandleMessage(tWindow *Target, int Msg, int Len, const void *Data);
23
24 // === GLOBALS ===
25 tWMRenderer     gRenderer_Background = {
26         .Name = "Background",
27         .CreateWindow = Renderer_Background_Create,
28         .Redraw = Renderer_Background_Redraw,
29         .HandleMessage = Renderer_Background_HandleMessage
30 };
31
32 // === CODE ===
33 int Renderer_Background_Init(void)
34 {
35         WM_RegisterRenderer(&gRenderer_Background);     
36
37         return 0;
38 }
39
40 tWindow *Renderer_Background_Create(int Arg)
41 {
42         tWindow *ret;
43         ret = WM_CreateWindowStruct( sizeof(struct sBgWin) );
44         
45         ((struct sBgWin*)ret->RendererInfo)->Colour = Arg;
46         
47         return ret;
48 }
49
50 void Renderer_Background_Redraw(tWindow *Window)
51 {
52         struct sBgWin   *info = Window->RendererInfo;
53         
54         WM_Render_FillRect(Window, 0, 0, 0xFFFF, 0xFFFF, info->Colour);
55 }
56
57 int Renderer_Background_HandleMessage(tWindow *Target, int Msg, int Len, const void *Data)
58 {
59         switch(Msg)
60         {
61         // TODO: Handle resize
62         
63         default:
64                 break;
65         }
66         return 0;
67 }
68
69
70
71

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