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;
22 tApplication *gpInterface_CurrentApp;
24 typedef struct sApplicationLink tApplicationLink;
26 struct sApplicationLink {
34 * \brief Initialise the UI
36 void Interface_Init(void)
42 giInterface_Width = giScreenWidth/16;
44 // Set root window to no-border
45 AxWin_SetFlags(NULL, 0);
47 // -- Create Sidebar (Menu and Window List) --
48 gpInterface_Sidebar = AxWin_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL, "Sidebar");
49 AxWin_SetSize( gpInterface_Sidebar, giInterface_Width );
51 // > System Menu Button
52 btn = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemMenu");
53 AxWin_SetSize(btn, giInterface_Width-4);
54 //text = AxWin_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE, "MenuLogo");
55 text = AxWin_CreateElement(btn, ELETYPE_IMAGE, 0, "MenuLogo");
56 //AxWin_SetText(text, "file:///LogoSmall.sif");
57 AxWin_SetText(text, csLogoSmall);
59 // > Plain <hr/> style spacer
60 ele = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top");
61 AxWin_SetSize(ele, 4);
63 // > Application List (Window list on most OSs)
64 gpInterface_ProgramList = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList");
66 // > Plain <hr/> style spacer
67 ele = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Bottom");
68 AxWin_SetSize(ele, 4);
71 text = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String");
72 AxWin_SetSize(text, 20);
73 AxWin_SetText(text, "2.0");
76 // -- Create Main Area and regions within --
79 gpInterface_MainArea = AxWin_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL, "MainArea");
80 // > Header Bar (Title)
81 gpInterface_HeaderBar = AxWin_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "HeaderBar");
82 AxWin_SetSize(gpInterface_HeaderBar, giInterface_HeaderBarSize);
83 text = AxWin_CreateElement(gpInterface_HeaderBar, ELETYPE_TEXT, 0, NULL);
84 AxWin_SetText(text, "Acess2 GUI - By thePowersGang (John Hodge)");
85 // > Tab Bar (Current windows)
86 gpInterface_TabBar = AxWin_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0, "TabBar");
87 AxWin_SetSize(gpInterface_TabBar, giInterface_TabBarSize);
88 // > Application Space
89 gpInterface_TabContent = AxWin_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "TabContent");
92 void Interface_Update(void)
95 // tApplicationLink *lnk;
96 giInterface_Width = giScreenWidth/16;
97 AxWin_SetSize( gpInterface_Sidebar, giInterface_Width );
99 // Scan application list for changes
100 // - HACK for now, just directly access it
101 // for( app = gWM_Applications; app; app = app->Next )
103 // AxWin_CreateElement();
106 // Update current tab list
109 void Interface_Render(void)
113 giInterface_Width, giScreenHeight,