2 * Acess GUI (AxWin) Version 2
3 * By John Hodge (thePowersGang)
6 * > Main Overarching UI
9 #include "resources/LogoSmall.sif.res.h"
12 int giInterface_Width = 0;
13 int giInterface_HeaderBarSize = 20;
14 int giInterface_TabBarSize = 20;
15 tElement *gpInterface_Sidebar;
16 tElement *gpInterface_ProgramList;
17 tElement *gpInterface_MainArea;
18 tElement *gpInterface_HeaderBar;
19 tElement *gpInterface_TabBar;
20 tElement *gpInterface_TabContent;
21 const char csLogoSmall[] = "base64:///"RESOURCE_LogoSmall_sif;
25 * \brief Initialise the UI
27 void Interface_Init(void)
33 giInterface_Width = giScreenWidth/16;
35 // Set root window to no-border
38 // -- Create Sidebar (Menu and Window List) --
39 gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL, "Sidebar");
40 WM_SetSize( gpInterface_Sidebar, giInterface_Width );
42 // > System Menu Button
43 btn = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemMenu");
44 WM_SetSize(btn, giInterface_Width-4);
45 //text = WM_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE, "MenuLogo");
46 text = WM_CreateElement(btn, ELETYPE_IMAGE, 0, "MenuLogo");
47 //WM_SetText(text, "file:///LogoSmall.sif");
48 WM_SetText(text, csLogoSmall);
50 // > Plain <hr/> style spacer
51 ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top");
54 // > Application List (Window list on most OSs)
55 gpInterface_ProgramList = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList");
57 // > Plain <hr/> style spacer
58 ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Bottom");
62 text = WM_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String");
64 WM_SetText(text, "2.0");
67 // -- Create Main Area and regions within --
70 gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL, "MainArea");
71 // > Header Bar (Title)
72 gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "HeaderBar");
73 WM_SetSize(gpInterface_HeaderBar, giInterface_HeaderBarSize);
74 text = WM_CreateElement(gpInterface_HeaderBar, ELETYPE_TEXT, 0, NULL);
75 WM_SetText(text, "Acess2 GUI - By thePowersGang (John Hodge)");
76 // > Tab Bar (Current windows)
77 gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0, "TabBar");
78 WM_SetSize(gpInterface_TabBar, giInterface_TabBarSize);
79 // > Application Space
80 gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "TabContent");
83 void Interface_Update(void)
85 giInterface_Width = giScreenWidth/16;
86 WM_SetSize( gpInterface_Sidebar, giInterface_Width );
89 void Interface_Render(void)
94 giInterface_Width, giScreenHeight,