Merge branch 'master' of git://git.ucc.asn.au/tpg/acess2
[tpg/acess2.git] / Usermode / Applications / axwin3_src / WM / renderers / widget / spacer.c
1 /*
2  * Acess2 Window Manager v3
3  * - By John Hodge (thePowersGang)
4  * 
5  * renderer/widget/spacer.
6  * - Horizontal / Verical Line
7  */
8 #include <common.h>
9 #include "./common.h"
10 #include "./colours.h"
11
12 #define SPACER_RULE_SIZE        3
13 #define SPACER_RULE_OFFSET      1
14
15 void Widget_Spacer_Render(tWindow *Window, tElement *Element)
16 {
17 //      _SysDebug("Spacer at (%i,%i) %ix%i",
18 //              Element->CachedX, Element->CachedY,
19 //              Element->CachedW, Element->CachedH
20 //              );
21         if( Element->Parent && (Element->Parent->Flags & ELEFLAG_VERTICAL) )
22         {
23                 WM_Render_DrawRect(
24                         Window,
25                         Element->CachedX+1, Element->CachedY+1,
26                         Element->CachedW-2, SPACER_RULE_SIZE,
27                         BOX_BORDER
28                         );
29         }
30         else
31         {
32                 WM_Render_DrawRect(
33                         Window,
34                         Element->CachedX+1, Element->CachedY+1,
35                         SPACER_RULE_SIZE, Element->CachedH-2,
36                         BOX_BORDER
37                         );
38         }
39 }
40
41 void Widget_Spacer_Init(tElement *Element)
42 {
43         Element->MinH = SPACER_RULE_SIZE+1;
44         Element->MinW = SPACER_RULE_SIZE+1;
45 }
46
47 DEFWIDGETTYPE(ELETYPE_SPACER,
48         WIDGETTYPE_FLAG_NOCHILDREN,
49         .Render = Widget_Spacer_Render,
50         .Init = Widget_Spacer_Init
51         );
52
53

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