64671a28ee5ab0583c740e53ae4a67177c0f7d77
[tpg/acess2.git] / widget_decorator.c
1 /*
2  * Acess2 Window Manager v3
3  * - By John Hodge (thePowersGang)
4  * 
5  * renderer_widget_decorator.c
6  * - Widget Decorator
7  */
8 #include <common.h>
9 #include <wm.h>
10 #include <renderer_widget.h>
11
12 #include "./colours.h"
13
14 // === CODE ===
15 void Widget_Decorator_RenderWidget(tWindow *Window, tElement *Element)
16 {
17 //      _SysDebug("Widget_Decorator_RenderWidget: (Element={Type:%i,(%i,%i) %ix%i})",
18 //              Element->Type,
19 //              Element->CachedX, Element->CachedY,
20 //              Element->CachedW, Element->CachedH
21 //              );
22         
23         switch(Element->Type)
24         {
25         case ELETYPE_NONE:
26         case ELETYPE_BOX:       break;  // Box is a meta-element
27         
28         case ELETYPE_TABBAR:    // Tab Bar
29                 WM_Render_DrawRect(
30                         Window,
31                         Element->CachedX, Element->CachedY,
32                         Element->CachedW, Element->CachedH,
33                         BOX_BORDER
34                         );
35                 WM_Render_FillRect(
36                         Window,
37                         Element->CachedX+1, Element->CachedY+1,
38                         Element->CachedW-2, Element->CachedH-2,
39                         BOX_BGCOLOUR
40                         );
41                 // Enumerate Items.
42                 break;
43         case ELETYPE_TOOLBAR:   // Tool Bar
44                 WM_Render_DrawRect(
45                         Window,
46                         Element->CachedX, Element->CachedY,
47                         Element->CachedW, Element->CachedH,
48                         BOX_BORDER
49                         );
50                 WM_Render_FillRect(
51                         Window,
52                         Element->CachedX+1, Element->CachedY+1,
53                         Element->CachedW-2, Element->CachedH-2,
54                         BOX_BGCOLOUR
55                         );
56                 break;
57         
58         case ELETYPE_SPACER:    // Spacer (subtle line)
59                 WM_Render_FillRect(
60                         Window,
61                         Element->CachedX+3, Element->CachedY+3,
62                         Element->CachedW-6, Element->CachedH-6,
63                         BOX_BORDER
64                         );
65                 break;
66         
67         case ELETYPE_BUTTON:    // Button
68                 break;
69
70         // Text input field / Text Box
71         case ELETYPE_TEXTINPUT:
72         case ELETYPE_TEXTBOX:
73                 break;
74         
75         case ELETYPE_TEXT:
76                 break;
77         
78         case ELETYPE_IMAGE:
79                 break;
80                 
81         default:
82                 _SysDebug(" ERROR: Unknown type %i", Element->Type);
83                 break;
84         }
85 }

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