X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Usermode%2FApplications%2Faxwin2_src%2FWM%2Finterface.c;h=91396ee697f452afb3f3e8823030bfcbab9c3d3f;hb=e02f66c7125bf18f77c6c53587238cbd49da2c89;hp=8d62c67da697211d034284e51ae9adcbfdc7251e;hpb=338ddf3c1dc87e9e6f872e241e3f4486e80fe136;p=tpg%2Facess2.git diff --git a/Usermode/Applications/axwin2_src/WM/interface.c b/Usermode/Applications/axwin2_src/WM/interface.c index 8d62c67d..91396ee6 100644 --- a/Usermode/Applications/axwin2_src/WM/interface.c +++ b/Usermode/Applications/axwin2_src/WM/interface.c @@ -19,6 +19,15 @@ tElement *gpInterface_HeaderBar; tElement *gpInterface_TabBar; tElement *gpInterface_TabContent; const char csLogoSmall[] = "base64:///"RESOURCE_LogoSmall_sif; +tApplication *gpInterface_CurrentApp; + +typedef struct sApplicationLink tApplicationLink; + +struct sApplicationLink { + tApplication *App; + tElement *Button; + char Name[]; +}; // === CODE === /** @@ -33,62 +42,72 @@ void Interface_Init(void) giInterface_Width = giScreenWidth/16; // Set root window to no-border - WM_SetFlags(NULL, 0); + AxWin_SetFlags(NULL, 0); // -- Create Sidebar (Menu and Window List) -- - gpInterface_Sidebar = WM_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL, "Sidebar"); - WM_SetSize( gpInterface_Sidebar, giInterface_Width ); + gpInterface_Sidebar = AxWin_CreateElement(NULL, ELETYPE_TOOLBAR, ELEFLAG_VERTICAL, "Sidebar"); + AxWin_SetSize( gpInterface_Sidebar, giInterface_Width ); // > 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); + btn = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_BUTTON, ELEFLAG_NOSTRETCH, "SystemMenu"); + AxWin_SetSize(btn, giInterface_Width-4); + //text = AxWin_CreateElement(btn, ELETYPE_IMAGE, ELEFLAG_SCALE, "MenuLogo"); + text = AxWin_CreateElement(btn, ELETYPE_IMAGE, 0, "MenuLogo"); + //AxWin_SetText(text, "file:///LogoSmall.sif"); + AxWin_SetText(text, csLogoSmall); // > Plain
style spacer - ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top"); - WM_SetSize(ele, 4); + ele = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Top"); + AxWin_SetSize(ele, 4); // > Application List (Window list on most OSs) - gpInterface_ProgramList = WM_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList"); + gpInterface_ProgramList = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_BOX, ELEFLAG_VERTICAL, "ProgramList"); // > Plain
style spacer - ele = WM_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Bottom"); - WM_SetSize(ele, 4); + ele = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_SPACER, ELEFLAG_NOSTRETCH, "SideBar Spacer Bottom"); + AxWin_SetSize(ele, 4); // > Version/Time - text = WM_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String"); - WM_SetSize(text, 20); - WM_SetText(text, "2.0"); + text = AxWin_CreateElement(gpInterface_Sidebar, ELETYPE_TEXT, ELEFLAG_NOSTRETCH, "Version String"); + AxWin_SetSize(text, 20); + AxWin_SetText(text, "2.0"); // -- // -- Create Main Area and regions within -- // -- // > Righthand Area - gpInterface_MainArea = WM_CreateElement(NULL, ELETYPE_BOX, ELEFLAG_VERTICAL, "MainArea"); + gpInterface_MainArea = AxWin_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)"); + gpInterface_HeaderBar = AxWin_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "HeaderBar"); + AxWin_SetSize(gpInterface_HeaderBar, giInterface_HeaderBarSize); + text = AxWin_CreateElement(gpInterface_HeaderBar, ELETYPE_TEXT, 0, NULL); + AxWin_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); + gpInterface_TabBar = AxWin_CreateElement(gpInterface_MainArea, ELETYPE_TABBAR, 0, "TabBar"); + AxWin_SetSize(gpInterface_TabBar, giInterface_TabBarSize); // > Application Space - gpInterface_TabContent = WM_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "TabContent"); + gpInterface_TabContent = AxWin_CreateElement(gpInterface_MainArea, ELETYPE_BOX, 0, "TabContent"); } void Interface_Update(void) { +// tApplication *app; +// tApplicationLink *lnk; giInterface_Width = giScreenWidth/16; - WM_SetSize( gpInterface_Sidebar, giInterface_Width ); + AxWin_SetSize( gpInterface_Sidebar, giInterface_Width ); + + // Scan application list for changes + // - HACK for now, just directly access it +// for( app = gWM_Applications; app; app = app->Next ) +// { +// AxWin_CreateElement(); +// } + + // Update current tab list } void Interface_Render(void) { - Video_FillRect( 0, 0, giInterface_Width, giScreenHeight,