X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;ds=inline;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Finterface.c;h=8d62c67da697211d034284e51ae9adcbfdc7251e;hb=889b379627388811c630aad3214efcaee1ac9885;hp=af02429a562dc577bb4ed26f26482595fb7a0d81;hpb=d5834686ad14b66420060192445f06bce85db389;p=tpg%2Facess2.git
diff --git a/Usermode/Applications/axwin2_src/WM/interface.c b/Usermode/Applications/axwin2_src/WM/interface.c
index af02429a..8d62c67d 100644
--- a/Usermode/Applications/axwin2_src/WM/interface.c
+++ b/Usermode/Applications/axwin2_src/WM/interface.c
@@ -6,14 +6,19 @@
* > Main Overarching UI
*/
#include "common.h"
+#include "resources/LogoSmall.sif.res.h"
// === GLOBALS ==
int giInterface_Width = 0;
+ int giInterface_HeaderBarSize = 20;
+ int giInterface_TabBarSize = 20;
tElement *gpInterface_Sidebar;
+tElement *gpInterface_ProgramList;
tElement *gpInterface_MainArea;
tElement *gpInterface_HeaderBar;
tElement *gpInterface_TabBar;
tElement *gpInterface_TabContent;
+const char csLogoSmall[] = "base64:///"RESOURCE_LogoSmall_sif;
// === CODE ===
/**
@@ -21,49 +26,58 @@ tElement *gpInterface_TabContent;
*/
void Interface_Init(void)
{
- tElement *area;
tElement *btn, *text;
-
+ tElement *ele;
+
// Calculate sizes
giInterface_Width = giScreenWidth/16;
// Set root window to no-border
WM_SetFlags(NULL, 0);
- // -- Create Sidebar --
- gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL);
+ // -- Create Sidebar (Menu and Window List) --
+ gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL, "Sidebar");
WM_SetSize( gpInterface_Sidebar, giInterface_Width );
- // --- Top segment ---
- area = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL);
- // ---- Menu Button ----
- btn = WM_CreateElement(area, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH);
- WM_SetSize(btn, giInterface_Width);
- //text = WM_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE);
- //WM_SetText(text, "asset://LogoSmall.sif");
- text = WM_CreateElement(btn, ELETYPE_TEXT, 0);
- WM_SetText(text, "Acess");
-
- // ---- Plain
style spacer ----
- WM_CreateElement(area, ELETYPE_SPACER, 0);
+ // > System Menu Button
+ btn = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemMenu");
+ WM_SetSize(btn, giInterface_Width-4);
+ //text = WM_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE, "MenuLogo");
+ text = WM_CreateElement(btn, ELETYPE_IMAGE, 0, "MenuLogo");
+ //WM_SetText(text, "file:///LogoSmall.sif");
+ WM_SetText(text, csLogoSmall);
- // Open Windows Go Here
+ // > Plain
style spacer
+ ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top");
+ WM_SetSize(ele, 4);
- // --- Bottom Segment ---
- area = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL|ELEFLAG_ALIGN_END);
+ // > Application List (Window list on most OSs)
+ gpInterface_ProgramList = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList");
- // ---- Plain
style spacer ----
- WM_CreateElement(area, ELETYPE_SPACER, 0);
+ // > Plain
style spacer
+ ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Bottom");
+ WM_SetSize(ele, 4);
- // ---- Version String ----
- text = WM_CreateElement(area, ELETYPE_TEXT, ELEFLAG_WRAP);
- WM_SetText(text, "AxWin 1.0");
+ // > Version/Time
+ text = WM_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String");
+ WM_SetSize(text, 20);
+ WM_SetText(text, "2.0");
+ // --
// -- Create Main Area and regions within --
- gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL);
- gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0);
- gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0);
- gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0);
+ // --
+ // > Righthand Area
+ gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL, "MainArea");
+ // > Header Bar (Title)
+ gpInterface_HeaderBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "HeaderBar");
+ WM_SetSize(gpInterface_HeaderBar, giInterface_HeaderBarSize);
+ text = WM_CreateElement(gpInterface_HeaderBar, ELETYPE_TEXT, 0, NULL);
+ WM_SetText(text, "Acess2 GUI - By thePowersGang (John Hodge)");
+ // > Tab Bar (Current windows)
+ gpInterface_TabBar = WM_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0, "TabBar");
+ WM_SetSize(gpInterface_TabBar, giInterface_TabBarSize);
+ // > Application Space
+ gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "TabContent");
}
void Interface_Update(void)