Many changes, bugfixes to user vsnprintf and to escape code handling
[tpg/acess2.git] / Usermode / Applications / axwin2_src / WM / interface.c
1 /*
2  * Acess GUI (AxWin) Version 2
3  * By John Hodge (thePowersGang)
4  */
5 #include "common.h"
6
7 // === GLOBALS ==
8  int    giInterface_Width = 0;
9 tElement        *gpInterface_Sidebar;
10 tElement        *gpInterface_MainArea;
11 tElement        *gpInterface_HeaderBar;
12 tElement        *gpInterface_TabBar;
13 tElement        *gpInterface_TabContent;
14
15 // === CODE ===
16 void Interface_Init(void)
17 {
18         tElement        *area;
19         tElement        *btn, *text;
20         
21         giInterface_Width = giScreenWidth/16;
22         
23         WM_SetFlags(NULL, 0);
24         
25         // Create Sidebar
26         gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL);
27         WM_SetSize( gpInterface_Sidebar, giInterface_Width );
28         // Create Main Area and regions within
29         gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL);
30         gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0);
31         gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0);
32         gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0);
33         
34         // Main segment of the "taskbar"
35         area = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL);
36         // Menu Button
37         btn = WM_CreateElement(area, ELETYPE_BUTTON, ELEFLAG_NOEXPAND);
38         WM_SetSize(btn, giInterface_Width);
39         //text = WM_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE);
40         //WM_SetText(text, "asset://LogoSmall.sif");
41         text = WM_CreateElement(btn, ELETYPE_TEXT, 0);
42         WM_SetText(text, "Acess");
43         
44         // Plain <hr/> style spacer
45         WM_CreateElement(area, ELETYPE_SPACER, 0);
46         
47         // Windows Go Here
48         
49         // Bottom Segment
50         area = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL|ELEFLAG_ALIGN_END);
51         
52         // Plain <hr/> style spacer
53         WM_CreateElement(area, ELETYPE_SPACER, 0);
54         
55         // Version String
56         text = WM_CreateElement(area, ELETYPE_TEXT, ELEFLAG_WRAP);
57         WM_SetText(text, "AxWin 1.0");
58 }
59
60 void Interface_Update(void)
61 {
62         giInterface_Width = giScreenWidth/16;
63         WM_SetSize( gpInterface_Sidebar, giInterface_Width );
64 }
65
66 void Interface_Render(void)
67 {
68         
69         Video_FillRect(
70                 0, 0,
71                 giInterface_Width, giScreenHeight,
72                 0xDDDDDD);
73         
74         Video_Update();
75 }

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