From b758b2b64efcf29ebe6594a7f4870c762f8a75aa Mon Sep 17 00:00:00 2001 From: K D Hedger Date: Fri, 12 Jan 2024 15:37:18 +0000 Subject: [PATCH] prefs update see changelogs --- .../LFSApplications/src/lfsbackdropprefs.cpp | 16 +- .../LFSApplications/src/lfsdesktopprefs.cpp | 64 ++--- .../LFSApplications/src/lfsdockprefs.cpp | 40 +-- .../LFSApplications/src/lfspanelprefs.cpp | 66 ++--- .../LFSApplications/src/lfstkprefs.cpp | 148 +++++----- .../LFSApplications/src/lfswm2prefs.cpp | 78 ++--- .../LFSApplications/src/lfswmprefs.cpp | 48 ++-- LFSDesktop/LFSDesktop/src/main.cpp | 6 +- LFSDesktop/LFSDesktop/src/prefs.cpp | 56 ++-- LFSDock/LFSDock/src/calendar.cpp | 2 +- LFSDock/LFSDock/src/clock.cpp | 2 +- LFSDock/LFSDock/src/desktopSwitcher.cpp | 2 +- LFSDock/LFSDock/src/launchers.cpp | 4 +- LFSDock/LFSDock/src/main.cpp | 64 ++--- LFSPanel/LFSPanel/src/main.cpp | 54 ++-- LFSPanel/LFSPanel/src/slider.cpp | 2 +- LFSSetWallpaper/LFSSetWallpaper/src/main.cpp | 8 +- LFSToolKit/ChangeLog | 3 + .../LFSToolKit/lfstk/LFSTKApplication.cpp | 10 +- LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp | 74 ++--- LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp | 2 +- LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp | 2 +- LFSToolKit/LFSToolKit/lfstk/LFSTKMenuItem.cpp | 2 +- .../LFSToolKit/lfstk/LFSTKPrefsClass.cpp | 188 ++++-------- LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.h | 27 +- .../LFSToolKit/lfstk/LFSTKUtilityClass.cpp | 15 + .../LFSToolKit/lfstk/LFSTKUtilityClass.h | 2 + LFSToolKit/LFSToolKit/lfstk/LFSTKWindow.cpp | 7 +- LFSToolKit/devtests/readfromfile.cpp | 63 ++++ LFSWM2/LFSWM2/src/clientClass.cpp | 84 +++--- LFSWM2/LFSWM2/src/eventsClass.cpp | 64 ++--- LFSWM2/LFSWM2/src/lfswm2Class.cpp | 156 +++++----- LFSWM2/LFSWM2/src/windowsClass.cpp | 272 +++++++++--------- LFSWManager/LFSWManager/src/main.cpp | 2 +- 34 files changed, 816 insertions(+), 817 deletions(-) create mode 100755 LFSToolKit/devtests/readfromfile.cpp diff --git a/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp b/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp index f2efa243..524a2617 100644 --- a/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp +++ b/LFSApplications/LFSApplications/src/lfsbackdropprefs.cpp @@ -143,10 +143,10 @@ bool buttonCB(void *p,void* ud) { prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("backdrop"),{TYPESTRING,"backdrop",mainBackdropEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("colour"),{TYPESTRING,"colour",rootColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("mainmode"),{TYPEINT,"mainmode","",false,backdropMode}}, - {prefs.LFSTK_hashFromKey("multimode"),{TYPEBOOL,"multimode","",multipleMonitors->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("backdrop"),{TYPESTRING,"backdrop",mainBackdropEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("colour"),{TYPESTRING,"colour",rootColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("mainmode"),{TYPEINT,"mainmode","",false,backdropMode}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("multimode"),{TYPEBOOL,"multimode","",multipleMonitors->LFSTK_getValue(),0}}, }; prefs.LFSTK_saveVarsToFile(mainPrefs); fd=fopen(monitorPrefs,"w"); @@ -303,10 +303,10 @@ int main(int argc, char **argv) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("backdrop"),{TYPESTRING,"backdrop","",false,0}}, - {prefs.LFSTK_hashFromKey("colour"),{TYPESTRING,"colour","#404040",false,0}}, - {prefs.LFSTK_hashFromKey("mainmode"),{TYPEINT,"mainmode","",false,0}}, - {prefs.LFSTK_hashFromKey("multimode"),{TYPEBOOL,"multimode","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("backdrop"),{TYPESTRING,"backdrop","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("colour"),{TYPESTRING,"colour","#404040",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("mainmode"),{TYPEINT,"mainmode","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("multimode"),{TYPEBOOL,"multimode","",false,0}}, }; prefs.LFSTK_loadVarsFromFile(mainPrefs); diff --git a/LFSApplications/LFSApplications/src/lfsdesktopprefs.cpp b/LFSApplications/LFSApplications/src/lfsdesktopprefs.cpp index 656e1d29..8b2f0900 100644 --- a/LFSApplications/LFSApplications/src/lfsdesktopprefs.cpp +++ b/LFSApplications/LFSApplications/src/lfsdesktopprefs.cpp @@ -109,22 +109,22 @@ bool buttonCB(void *p,void* ud) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("icontheme"),{TYPESTRING,"icontheme",themeEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("iconsize"),{TYPEINT,"iconsize","",false,atoi(iconSizeEditBox->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("gridsize"),{TYPEINT,"gridsize","",false,atoi(gridSizeEditBox->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("gridborderleft"),{TYPEINT,"gridborderleft","",false,atoi(borderLeftEditBox->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("gridborderrite"),{TYPEINT,"gridborderrite","",false,atoi(borderRightEditBox->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,atoi(refreshEditBox->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",termCommandEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("showextension"),{TYPEBOOL,"showextension","",showSuffixCheck->LFSTK_getValue(),0}}, - {prefs.LFSTK_hashFromKey("fontface"),{TYPESTRING,"fontface",fontEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("labelforeground"),{TYPESTRING,"labelforeground",labelColurFEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("labelbackground"),{TYPESTRING,"labelbackground",labelColurBEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("labelalpha"),{TYPESTRING,"labelalpha",labelAlphaColurEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("includelist"),{TYPESTRING,"includelist",includeEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("excludelist"),{TYPESTRING,"excludelist",excludeEditBox->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("doubleclickexe"),{TYPEBOOL,"doubleclickexe","",clickExeCheck->LFSTK_getValue(),0}}, - {prefs.LFSTK_hashFromKey("desknames"),{TYPESTRING,"desknames",desktopNamesEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("icontheme"),{TYPESTRING,"icontheme",themeEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("iconsize"),{TYPEINT,"iconsize","",false,atoi(iconSizeEditBox->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridsize"),{TYPEINT,"gridsize","",false,atoi(gridSizeEditBox->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridborderleft"),{TYPEINT,"gridborderleft","",false,atoi(borderLeftEditBox->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridborderrite"),{TYPEINT,"gridborderrite","",false,atoi(borderRightEditBox->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,atoi(refreshEditBox->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",termCommandEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("showextension"),{TYPEBOOL,"showextension","",showSuffixCheck->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("fontface"),{TYPESTRING,"fontface",fontEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelforeground"),{TYPESTRING,"labelforeground",labelColurFEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelbackground"),{TYPESTRING,"labelbackground",labelColurBEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelalpha"),{TYPESTRING,"labelalpha",labelAlphaColurEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("includelist"),{TYPESTRING,"includelist",includeEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("excludelist"),{TYPESTRING,"excludelist",excludeEditBox->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("doubleclickexe"),{TYPEBOOL,"doubleclickexe","",clickExeCheck->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desknames"),{TYPESTRING,"desknames",desktopNamesEdit->LFSTK_getCStr(),false,0}}, }; prefs.LFSTK_saveVarsToFile(envFile); @@ -237,22 +237,22 @@ int main(int argc, char **argv) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("icontheme"),{TYPESTRING,"icontheme","gnome",false,0}}, - {prefs.LFSTK_hashFromKey("iconsize"),{TYPEINT,"iconsize","",false,32}}, - {prefs.LFSTK_hashFromKey("gridsize"),{TYPEINT,"gridsize","",false,64}}, - {prefs.LFSTK_hashFromKey("gridborderleft"),{TYPEINT,"gridborderleft","",false,2}}, - {prefs.LFSTK_hashFromKey("gridborderrite"),{TYPEINT,"gridborderrite","",false,16}}, - {prefs.LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,2}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, - {prefs.LFSTK_hashFromKey("showextension"),{TYPEBOOL,"showextension","",false,0}}, - {prefs.LFSTK_hashFromKey("fontface"),{TYPESTRING,"fontface","",false,0}}, - {prefs.LFSTK_hashFromKey("labelforeground"),{TYPESTRING,"labelforeground","",false,0}}, - {prefs.LFSTK_hashFromKey("labelbackground"),{TYPESTRING,"labelbackground","",false,0}}, - {prefs.LFSTK_hashFromKey("labelalpha"),{TYPESTRING,"labelalpha","1.0",false,0}}, - {prefs.LFSTK_hashFromKey("includelist"),{TYPESTRING,"includelist","",false,0}}, - {prefs.LFSTK_hashFromKey("excludelist"),{TYPESTRING,"excludelist","",false,0}}, - {prefs.LFSTK_hashFromKey("doubleclickexe"),{TYPEBOOL,"doubleclickexe","",false,0}}, - {prefs.LFSTK_hashFromKey("desknames"),{TYPESTRING,"desknames","Desktop 1,Desktop 2,Desktop 3,Desktop 4,Desktop 5,Desktop 6",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("icontheme"),{TYPESTRING,"icontheme","gnome",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("iconsize"),{TYPEINT,"iconsize","",false,32}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridsize"),{TYPEINT,"gridsize","",false,64}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridborderleft"),{TYPEINT,"gridborderleft","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridborderrite"),{TYPEINT,"gridborderrite","",false,16}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("showextension"),{TYPEBOOL,"showextension","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("fontface"),{TYPESTRING,"fontface","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelforeground"),{TYPESTRING,"labelforeground","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelbackground"),{TYPESTRING,"labelbackground","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelalpha"),{TYPESTRING,"labelalpha","1.0",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("includelist"),{TYPESTRING,"includelist","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("excludelist"),{TYPESTRING,"excludelist","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("doubleclickexe"),{TYPEBOOL,"doubleclickexe","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desknames"),{TYPESTRING,"desknames","Desktop 1,Desktop 2,Desktop 3,Desktop 4,Desktop 5,Desktop 6",false,0}}, }; asprintf(&envFile,"%s/lfsdesktop.rc",apc->configDir.c_str()); diff --git a/LFSApplications/LFSApplications/src/lfsdockprefs.cpp b/LFSApplications/LFSApplications/src/lfsdockprefs.cpp index 9dc7293b..408cdd7e 100644 --- a/LFSApplications/LFSApplications/src/lfsdockprefs.cpp +++ b/LFSApplications/LFSApplications/src/lfsdockprefs.cpp @@ -132,16 +132,16 @@ void getEdits(void) { prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,atoi(dockOnMonitor->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("dockgrav"),{TYPEINT,"dockgrav","",false,dockGravityPref}}, - {prefs.LFSTK_hashFromKey("docksize"),{TYPEINT,"docksize","",false,dockSizePref}}, - {prefs.LFSTK_hashFromKey("dockbgcolour"),{TYPESTRING,"dockbgcolour",dockBGColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour",dockTextColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft",dockGadgets->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",termCommand->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("font"),{TYPESTRING,"font",fontEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("refreshrate"),{TYPESTRING,"refreshrate",dockRefreshEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("usemicroseconds"),{TYPEBOOL,"usemicroseconds","",dockUseMicro->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,atoi(dockOnMonitor->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("dockgrav"),{TYPEINT,"dockgrav","",false,dockGravityPref}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("docksize"),{TYPEINT,"docksize","",false,dockSizePref}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("dockbgcolour"),{TYPESTRING,"dockbgcolour",dockBGColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour",dockTextColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft",dockGadgets->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",termCommand->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font"),{TYPESTRING,"font",fontEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("refreshrate"),{TYPESTRING,"refreshrate",dockRefreshEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usemicroseconds"),{TYPEBOOL,"usemicroseconds","",dockUseMicro->LFSTK_getValue(),0}}, }; } @@ -209,16 +209,16 @@ void getPrefs(void) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("docksize"),{TYPEINT,"docksize","",false,3}}, - {prefs.LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, - {prefs.LFSTK_hashFromKey("dockgrav"),{TYPEINT,"dockgrav","",false,2}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","kkterminal -m -l -e ",false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","LCSD",false,0}}, - {prefs.LFSTK_hashFromKey("dockbgcolour"),{TYPESTRING,"dockbgcolour","#00000000",false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, - {prefs.LFSTK_hashFromKey("font"),{TYPESTRING,"font","Liberation Mono:size=12",false,0}}, - {prefs.LFSTK_hashFromKey("refreshrate"),{TYPESTRING,"refreshrate","1",false,0}}, - {prefs.LFSTK_hashFromKey("usemicroseconds"),{TYPEBOOL,"usemicroseconds","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("docksize"),{TYPEINT,"docksize","",false,3}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("dockgrav"),{TYPEINT,"dockgrav","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","kkterminal -m -l -e ",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","LCSD",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("dockbgcolour"),{TYPESTRING,"dockbgcolour","#00000000",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font"),{TYPESTRING,"font","Liberation Mono:size=12",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("refreshrate"),{TYPESTRING,"refreshrate","1",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usemicroseconds"),{TYPEBOOL,"usemicroseconds","",false,0}}, }; asprintf(&env,"%s/%s",apc->configDir.c_str(),dockName.c_str()); diff --git a/LFSApplications/LFSApplications/src/lfspanelprefs.cpp b/LFSApplications/LFSApplications/src/lfspanelprefs.cpp index 6b75a3a6..e84e0da0 100644 --- a/LFSApplications/LFSApplications/src/lfspanelprefs.cpp +++ b/LFSApplications/LFSApplications/src/lfspanelprefs.cpp @@ -113,27 +113,26 @@ void getEdits(void) { prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("panelheight"),{TYPEINT,"panelheight","",false,atoi(panelHeightEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("panelwidth"),{TYPEINT,"panelwidth","",false,panelWidthPref}}, - {prefs.LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,atoi(panelOnMonitor->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("panelpos"),{TYPEINT,"panelpos","",false,panelPosPref}}, - {prefs.LFSTK_hashFromKey("panelgrav"),{TYPEINT,"panelgrav","",false,panelGravityPref}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",termCommand->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("logoutcommand"),{TYPESTRING,"logoutcommand",logout->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("restartcommand"),{TYPESTRING,"restartcommand",restart->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("shutdowncommand"),{TYPESTRING,"shutdowncommand",shutdown->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsright"),{TYPESTRING,"gadgetsright",panelrightGadgets->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft",panelLeftGadgets->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",useTheme->LFSTK_getValue(),0}}, - {prefs.LFSTK_hashFromKey("nobuttons"),{TYPEBOOL,"nobuttons","",noButtons->LFSTK_getValue(),0}}, - {prefs.LFSTK_hashFromKey("panelcolour"),{TYPESTRING,"panelcolour",panelColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour",panelTextColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelheight"),{TYPEINT,"panelheight","",false,atoi(panelHeightEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelwidth"),{TYPEINT,"panelwidth","",false,panelWidthPref}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,atoi(panelOnMonitor->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelpos"),{TYPEINT,"panelpos","",false,panelPosPref}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelgrav"),{TYPEINT,"panelgrav","",false,panelGravityPref}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",termCommand->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("logoutcommand"),{TYPESTRING,"logoutcommand",logout->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("restartcommand"),{TYPESTRING,"restartcommand",restart->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("shutdowncommand"),{TYPESTRING,"shutdowncommand",shutdown->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsright"),{TYPESTRING,"gadgetsright",panelrightGadgets->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft",panelLeftGadgets->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",useTheme->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("nobuttons"),{TYPEBOOL,"nobuttons","",noButtons->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelcolour"),{TYPESTRING,"panelcolour",panelColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour",panelTextColourEdit->LFSTK_getCStr(),false,0}}, }; } bool applyCB(void *p,void* ud) { - char *env=NULL; std::map::const_iterator it; if(ud!=NULL) @@ -179,11 +178,8 @@ bool applyCB(void *p,void* ud) } getEdits(); - asprintf(&env,"%s/%s",apc->configDir.c_str(),panelNameEdit->LFSTK_getCStr()); - //wc->globalLib->LFSTK_saveVarsToFile(env,panelPrefs); - prefs.LFSTK_saveVarsToFile(env); + prefs.LFSTK_saveVarsToFile(apc->configDir+"/"+panelNameEdit->LFSTK_getBuffer()); //prefs.LFSTK_saveVarsToFile("-"); - free(env); } return(true); } @@ -213,21 +209,21 @@ void getPrefs(void) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("panelheight"),{TYPEINT,"panelheight","",false,0}}, - {prefs.LFSTK_hashFromKey("panelwidth"),{TYPEINT,"panelwidth","",false,0}}, - {prefs.LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, - {prefs.LFSTK_hashFromKey("panelpos"),{TYPEINT,"panelpos","",false,0}}, - {prefs.LFSTK_hashFromKey("panelgrav"),{TYPEINT,"panelgrav","",false,0}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","",false,0}}, - {prefs.LFSTK_hashFromKey("logoutcommand"),{TYPESTRING,"logoutcommand","",false,0}}, - {prefs.LFSTK_hashFromKey("restartcommand"),{TYPESTRING,"restartcommand","",false,0}}, - {prefs.LFSTK_hashFromKey("shutdowncommand"),{TYPESTRING,"shutdowncommand","",false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsright"),{TYPESTRING,"gadgetsright","",false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","",false,0}}, - {prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",true,0}}, - {prefs.LFSTK_hashFromKey("nobuttons"),{TYPEBOOL,"nobuttons","",false,0}}, - {prefs.LFSTK_hashFromKey("panelcolour"),{TYPESTRING,"panelcolour","",false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelheight"),{TYPEINT,"panelheight","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelwidth"),{TYPEINT,"panelwidth","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelpos"),{TYPEINT,"panelpos","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelgrav"),{TYPEINT,"panelgrav","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("logoutcommand"),{TYPESTRING,"logoutcommand","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("restartcommand"),{TYPESTRING,"restartcommand","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("shutdowncommand"),{TYPESTRING,"shutdowncommand","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsright"),{TYPESTRING,"gadgetsright","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",true,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("nobuttons"),{TYPEBOOL,"nobuttons","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelcolour"),{TYPESTRING,"panelcolour","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, }; asprintf(&env,"%s/%s",apc->configDir.c_str(),panelNameEdit->LFSTK_getCStr()); diff --git a/LFSApplications/LFSApplications/src/lfstkprefs.cpp b/LFSApplications/LFSApplications/src/lfstkprefs.cpp index 8091e5ee..65f3656e 100644 --- a/LFSApplications/LFSApplications/src/lfstkprefs.cpp +++ b/LFSApplications/LFSApplications/src/lfstkprefs.cpp @@ -137,43 +137,43 @@ bool menuCB(void *p,void* ud) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("window_normal"),{TYPESTRING,"window_normal","",false,0}}, - {prefs.LFSTK_hashFromKey("window_prelight"),{TYPESTRING,"window_prelight","",false,0}}, - {prefs.LFSTK_hashFromKey("window_active"),{TYPESTRING,"window_active","",false,0}}, - {prefs.LFSTK_hashFromKey("window_inactive"),{TYPESTRING,"window_inactive","",false,0}}, - {prefs.LFSTK_hashFromKey("windowtile"),{TYPESTRING,"windowtile","",false,0}}, - - {prefs.LFSTK_hashFromKey("button_normal"),{TYPESTRING,"button_normal","",false,0}}, - {prefs.LFSTK_hashFromKey("button_prelight"),{TYPESTRING,"button_prelight","",false,0}}, - {prefs.LFSTK_hashFromKey("button_active"),{TYPESTRING,"button_active","",false,0}}, - {prefs.LFSTK_hashFromKey("button_inactive"),{TYPESTRING,"button_inactive","",false,0}}, - {prefs.LFSTK_hashFromKey("buttontile"),{TYPESTRING,"buttontile","",false,0}}, - - {prefs.LFSTK_hashFromKey("menuitem_normal"),{TYPESTRING,"menuitem_normal","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_prelight"),{TYPESTRING,"menuitem_prelight","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_active"),{TYPESTRING,"menuitem_active","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_inactive"),{TYPESTRING,"menuitem_inactive","",false,0}}, - - {prefs.LFSTK_hashFromKey("menuitem_font"),{TYPESTRING,"menuitem_font","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_normal"),{TYPESTRING,"menuitem_font_normal","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_prelight"),{TYPESTRING,"menuitem_font_prelight","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_active"),{TYPESTRING,"menuitem_font_active","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_inactive"),{TYPESTRING,"menuitem_font_inactive","",false,0}}, - {prefs.LFSTK_hashFromKey("menuitemtile"),{TYPESTRING,"menuitemtile","",false,0}}, - - {prefs.LFSTK_hashFromKey("font"),{TYPESTRING,"font","",false,0}}, - {prefs.LFSTK_hashFromKey("font_normal"),{TYPESTRING,"font_normal","",false,0}}, - {prefs.LFSTK_hashFromKey("font_prelight"),{TYPESTRING,"font_prelight","",false,0}}, - {prefs.LFSTK_hashFromKey("font_active"),{TYPESTRING,"font_active","",false,0}}, - {prefs.LFSTK_hashFromKey("font_inactive"),{TYPESTRING,"font_inactive","",false,0}}, - - {prefs.LFSTK_hashFromKey("autotextcolour"),{TYPEBOOL,"autotextcolour","",false,0}}, - {prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, - {prefs.LFSTK_hashFromKey("themepath"),{TYPESTRING,"themepath","",false,0}}, - {prefs.LFSTK_hashFromKey("monofont"),{TYPESTRING,"monofont","",false,0}}, - {prefs.LFSTK_hashFromKey("cursorcolour"),{TYPESTRING,"cursorcolour","",false,0}}, - {prefs.LFSTK_hashFromKey("sbtroughcolour"),{TYPESTRING,"sbtroughcolour","",false,0}}, - {prefs.LFSTK_hashFromKey("listtroughcolour"),{TYPESTRING,"listtroughcolour","",false,0}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_normal"),{TYPESTRING,"window_normal","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_prelight"),{TYPESTRING,"window_prelight","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_active"),{TYPESTRING,"window_active","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_inactive"),{TYPESTRING,"window_inactive","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("windowtile"),{TYPESTRING,"windowtile","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_normal"),{TYPESTRING,"button_normal","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_prelight"),{TYPESTRING,"button_prelight","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_active"),{TYPESTRING,"button_active","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_inactive"),{TYPESTRING,"button_inactive","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("buttontile"),{TYPESTRING,"buttontile","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_normal"),{TYPESTRING,"menuitem_normal","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_prelight"),{TYPESTRING,"menuitem_prelight","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_active"),{TYPESTRING,"menuitem_active","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_inactive"),{TYPESTRING,"menuitem_inactive","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font"),{TYPESTRING,"menuitem_font","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_normal"),{TYPESTRING,"menuitem_font_normal","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_prelight"),{TYPESTRING,"menuitem_font_prelight","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_active"),{TYPESTRING,"menuitem_font_active","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_inactive"),{TYPESTRING,"menuitem_font_inactive","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitemtile"),{TYPESTRING,"menuitemtile","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("font"),{TYPESTRING,"font","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_normal"),{TYPESTRING,"font_normal","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_prelight"),{TYPESTRING,"font_prelight","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_active"),{TYPESTRING,"font_active","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_inactive"),{TYPESTRING,"font_inactive","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("autotextcolour"),{TYPEBOOL,"autotextcolour","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("themepath"),{TYPESTRING,"themepath","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("monofont"),{TYPESTRING,"monofont","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("cursorcolour"),{TYPESTRING,"cursorcolour","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("sbtroughcolour"),{TYPESTRING,"sbtroughcolour","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("listtroughcolour"),{TYPESTRING,"listtroughcolour","",false,0}} }; sprintf(buffer,"%s/window.png",label); @@ -242,43 +242,43 @@ void setVars(void) { prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("window_normal"),{TYPESTRING,"window_normal",windowColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("window_prelight"),{TYPESTRING,"window_prelight",windowColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("window_active"),{TYPESTRING,"window_active",windowColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("window_inactive"),{TYPESTRING,"window_inactive",windowColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("windowtile"),{TYPESTRING,"windowtile",windowTileEdit->LFSTK_getCStr(),false,0}}, - - {prefs.LFSTK_hashFromKey("button_normal"),{TYPESTRING,"button_normal",previeBackColourEdit[0]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("button_prelight"),{TYPESTRING,"button_prelight",previeBackColourEdit[1]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("button_active"),{TYPESTRING,"button_active",previeBackColourEdit[2]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("button_inactive"),{TYPESTRING,"button_inactive",previeBackColourEdit[3]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("buttontile"),{TYPESTRING,"buttontile",buttonTileEdit->LFSTK_getCStr(),false,0}}, - - {prefs.LFSTK_hashFromKey("menuitem_normal"),{TYPESTRING,"menuitem_normal",previeMenuBackColourEdit[0]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_prelight"),{TYPESTRING,"menuitem_prelight",previeMenuBackColourEdit[0]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_active"),{TYPESTRING,"menuitem_active",previeMenuBackColourEdit[2]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_inactive"),{TYPESTRING,"menuitem_inactive",previeMenuBackColourEdit[3]->LFSTK_getCStr(),false,0}}, - - {prefs.LFSTK_hashFromKey("menuitem_font"),{TYPESTRING,"menuitem_font",menuFontEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_normal"),{TYPESTRING,"menuitem_font_normal",previeMenuFontColourEdit[0]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_prelight"),{TYPESTRING,"menuitem_font_prelight",previeMenuFontColourEdit[1]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_active"),{TYPESTRING,"menuitem_font_active",previeMenuFontColourEdit[2]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitem_font_inactive"),{TYPESTRING,"menuitem_font_inactive",previeMenuFontColourEdit[3]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("menuitemtile"),{TYPESTRING,"menuitemtile",menuTileEdit->LFSTK_getCStr(),false,0}}, - - {prefs.LFSTK_hashFromKey("font"),{TYPESTRING,"font",buttonFontEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("font_normal"),{TYPESTRING,"font_normal",previeFontColourEdit[0]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("font_prelight"),{TYPESTRING,"font_prelight",previeFontColourEdit[1]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("font_active"),{TYPESTRING,"font_active",previeFontColourEdit[2]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("font_inactive"),{TYPESTRING,"font_inactive",previeFontColourEdit[3]->LFSTK_getCStr(),false,0}}, - - {prefs.LFSTK_hashFromKey("autotextcolour"),{TYPEBOOL,"autotextcolour","",autoColourCheck->LFSTK_getValue(),0}}, - {prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",useTheme->LFSTK_getValue(),0}}, - {prefs.LFSTK_hashFromKey("themepath"),{TYPESTRING,"themepath",themePath,false,0}}, - {prefs.LFSTK_hashFromKey("monofont"),{TYPESTRING,"monofont",monoFontEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("cursorcolour"),{TYPESTRING,"cursorcolour",cursorColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("sbtroughcolour"),{TYPESTRING,"sbtroughcolour",scrollTroughColourEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("listtroughcolour"),{TYPESTRING,"listtroughcolour",listTroughColourEdit->LFSTK_getCStr(),false,0}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_normal"),{TYPESTRING,"window_normal",windowColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_prelight"),{TYPESTRING,"window_prelight",windowColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_active"),{TYPESTRING,"window_active",windowColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_inactive"),{TYPESTRING,"window_inactive",windowColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("windowtile"),{TYPESTRING,"windowtile",windowTileEdit->LFSTK_getCStr(),false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_normal"),{TYPESTRING,"button_normal",previeBackColourEdit[0]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_prelight"),{TYPESTRING,"button_prelight",previeBackColourEdit[1]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_active"),{TYPESTRING,"button_active",previeBackColourEdit[2]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_inactive"),{TYPESTRING,"button_inactive",previeBackColourEdit[3]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("buttontile"),{TYPESTRING,"buttontile",buttonTileEdit->LFSTK_getCStr(),false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_normal"),{TYPESTRING,"menuitem_normal",previeMenuBackColourEdit[0]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_prelight"),{TYPESTRING,"menuitem_prelight",previeMenuBackColourEdit[0]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_active"),{TYPESTRING,"menuitem_active",previeMenuBackColourEdit[2]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_inactive"),{TYPESTRING,"menuitem_inactive",previeMenuBackColourEdit[3]->LFSTK_getCStr(),false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font"),{TYPESTRING,"menuitem_font",menuFontEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_normal"),{TYPESTRING,"menuitem_font_normal",previeMenuFontColourEdit[0]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_prelight"),{TYPESTRING,"menuitem_font_prelight",previeMenuFontColourEdit[1]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_active"),{TYPESTRING,"menuitem_font_active",previeMenuFontColourEdit[2]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_inactive"),{TYPESTRING,"menuitem_font_inactive",previeMenuFontColourEdit[3]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitemtile"),{TYPESTRING,"menuitemtile",menuTileEdit->LFSTK_getCStr(),false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("font"),{TYPESTRING,"font",buttonFontEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_normal"),{TYPESTRING,"font_normal",previeFontColourEdit[0]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_prelight"),{TYPESTRING,"font_prelight",previeFontColourEdit[1]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_active"),{TYPESTRING,"font_active",previeFontColourEdit[2]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_inactive"),{TYPESTRING,"font_inactive",previeFontColourEdit[3]->LFSTK_getCStr(),false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("autotextcolour"),{TYPEBOOL,"autotextcolour","",autoColourCheck->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",useTheme->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("themepath"),{TYPESTRING,"themepath",themePath,false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("monofont"),{TYPESTRING,"monofont",monoFontEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("cursorcolour"),{TYPESTRING,"cursorcolour",cursorColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("sbtroughcolour"),{TYPESTRING,"sbtroughcolour",scrollTroughColourEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("listtroughcolour"),{TYPESTRING,"listtroughcolour",listTroughColourEdit->LFSTK_getCStr(),false,0}} }; } diff --git a/LFSApplications/LFSApplications/src/lfswm2prefs.cpp b/LFSApplications/LFSApplications/src/lfswm2prefs.cpp index a689dcca..84cecd74 100644 --- a/LFSApplications/LFSApplications/src/lfswm2prefs.cpp +++ b/LFSApplications/LFSApplications/src/lfswm2prefs.cpp @@ -202,27 +202,27 @@ bool buttonCB(void *p,void* ud) { prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("framebg"),{TYPESTRING,"framebg",previeColourEdit[FRAMEBG]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("framefg"),{TYPESTRING,"framefg",previeColourEdit[FRAMEFG]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour",previeColourEdit[TEXTCOL]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("titlebarsize"),{TYPEINT,"titlebarsize","",false,atoi(titleBarSizeEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("framealpha"),{TYPEINT,"framealpha","",false,atoi(frameAlphaEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("bottombarsize"),{TYPEINT,"bottombarsize","",false,atoi(bottomBarSizeEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("leftsidebarsize"),{TYPEINT,"leftsidebarsize","",false,atoi(leftBarSizeEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("ritesidebarsize"),{TYPEINT,"ritesidebarsize","",false,atoi(rightBarSizeEdit->LFSTK_getCStr())}}, - - {prefs.LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont",fontEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("titleposition"),{TYPEINT,"titleposition","",false,titlePosTemp}}, - {prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",useTheme->LFSTK_getValue(),0}}, - {prefs.LFSTK_hashFromKey("theme"),{TYPESTRING,"theme",themeEdit->LFSTK_getCStr(),false,0}}, - - {prefs.LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,prefsPlacementTemp}}, - {prefs.LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,atoi(deskCountEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("resizemode"),{TYPEINT,"resizemode","",false,prefsResizeTemp}}, - {prefs.LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,atoi(rescanEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("forcedocksstack"),{TYPEINT,"forcedocksstack","",false,forceDockStackTemp}}, - - {prefs.LFSTK_hashFromKey("modkeys"),{TYPEINT,"modkeys","",false,prefsModkeys1Temp}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("framebg"),{TYPESTRING,"framebg",previeColourEdit[FRAMEBG]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framefg"),{TYPESTRING,"framefg",previeColourEdit[FRAMEFG]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour",previeColourEdit[TEXTCOL]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlebarsize"),{TYPEINT,"titlebarsize","",false,atoi(titleBarSizeEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framealpha"),{TYPEINT,"framealpha","",false,atoi(frameAlphaEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("bottombarsize"),{TYPEINT,"bottombarsize","",false,atoi(bottomBarSizeEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("leftsidebarsize"),{TYPEINT,"leftsidebarsize","",false,atoi(leftBarSizeEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("ritesidebarsize"),{TYPEINT,"ritesidebarsize","",false,atoi(rightBarSizeEdit->LFSTK_getCStr())}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont",fontEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titleposition"),{TYPEINT,"titleposition","",false,titlePosTemp}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",useTheme->LFSTK_getValue(),0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("theme"),{TYPESTRING,"theme",themeEdit->LFSTK_getCStr(),false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,prefsPlacementTemp}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,atoi(deskCountEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("resizemode"),{TYPEINT,"resizemode","",false,prefsResizeTemp}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,atoi(rescanEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("forcedocksstack"),{TYPEINT,"forcedocksstack","",false,forceDockStackTemp}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("modkeys"),{TYPEINT,"modkeys","",false,prefsModkeys1Temp}} }; prefs.LFSTK_saveVarsToFile(envFile); @@ -387,24 +387,24 @@ int main(int argc, char **argv) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("theme"),{TYPESTRING,"theme","",false,0}}, - {prefs.LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,6}}, - {prefs.LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,2}}, - {prefs.LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont","sans:size=14:bold",false,0}}, - {prefs.LFSTK_hashFromKey("titleposition"),{TYPEINT,"titleposition","",false,2}}, - {prefs.LFSTK_hashFromKey("titlebarsize"),{TYPEINT,"titlebarsize","",false,20}}, - {prefs.LFSTK_hashFromKey("leftsidebarsize"),{TYPEINT,"leftsidebarsize","",false,2}}, - {prefs.LFSTK_hashFromKey("ritesidebarsize"),{TYPEINT,"ritesidebarsize","",false,2}}, - {prefs.LFSTK_hashFromKey("bottombarsize"),{TYPEINT,"bottombarsize","",false,8}}, - {prefs.LFSTK_hashFromKey("framebg"),{TYPESTRING,"framebg","grey",false,15}}, - {prefs.LFSTK_hashFromKey("framefg"),{TYPESTRING,"framefg","white",false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, - {prefs.LFSTK_hashFromKey("forcedocksstack"),{TYPEINT,"forcedocksstack","",false,1}}, - {prefs.LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,10}}, - {prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, - {prefs.LFSTK_hashFromKey("resizemode"),{TYPEINT,"resizemode","",false,2}}, - {prefs.LFSTK_hashFromKey("modkeys"),{TYPEINT,"modkeys","",false,64}}, - {prefs.LFSTK_hashFromKey("framealpha"),{TYPEINT,"framealpha","",false,255}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("theme"),{TYPESTRING,"theme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,6}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont","sans:size=14:bold",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titleposition"),{TYPEINT,"titleposition","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlebarsize"),{TYPEINT,"titlebarsize","",false,20}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("leftsidebarsize"),{TYPEINT,"leftsidebarsize","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("ritesidebarsize"),{TYPEINT,"ritesidebarsize","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("bottombarsize"),{TYPEINT,"bottombarsize","",false,8}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framebg"),{TYPESTRING,"framebg","grey",false,15}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framefg"),{TYPESTRING,"framefg","white",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("forcedocksstack"),{TYPEINT,"forcedocksstack","",false,1}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,10}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("resizemode"),{TYPEINT,"resizemode","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("modkeys"),{TYPEINT,"modkeys","",false,64}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framealpha"),{TYPEINT,"framealpha","",false,255}} }; asprintf(&envFile,"%s/lfswm2.rc",apc->configDir.c_str()); diff --git a/LFSApplications/LFSApplications/src/lfswmprefs.cpp b/LFSApplications/LFSApplications/src/lfswmprefs.cpp index 332cfa12..293411a8 100644 --- a/LFSApplications/LFSApplications/src/lfswmprefs.cpp +++ b/LFSApplications/LFSApplications/src/lfswmprefs.cpp @@ -129,18 +129,18 @@ bool buttonCB(void *p,void* ud) { prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("wmactive_frame"),{TYPESTRING,"wmactive_frame",previeColourEdit[0]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("wmactive_fill"),{TYPESTRING,"wmactive_fill",previeColourEdit[1]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("wminactive_frame"),{TYPESTRING,"wminactive_frame",previeColourEdit[2]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("wminactive_fill"),{TYPESTRING,"wminactive_fill",previeColourEdit[3]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("widgetcolour"),{TYPESTRING,"widgetcolour",previeColourEdit[4]->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont",fontEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("theme"),{TYPESTRING,"theme",themeEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",terminalEdit->LFSTK_getCStr(),false,0}}, - {prefs.LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,prefsPlacementTemp}}, - {prefs.LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,atoi(deskCountEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("liveupdate"),{TYPEINT,"liveupdate","",false,atoi(refreshEdit->LFSTK_getCStr())}}, - {prefs.LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,atoi(rescanEdit->LFSTK_getCStr())}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("wmactive_frame"),{TYPESTRING,"wmactive_frame",previeColourEdit[0]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("wmactive_fill"),{TYPESTRING,"wmactive_fill",previeColourEdit[1]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("wminactive_frame"),{TYPESTRING,"wminactive_frame",previeColourEdit[2]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("wminactive_fill"),{TYPESTRING,"wminactive_fill",previeColourEdit[3]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("widgetcolour"),{TYPESTRING,"widgetcolour",previeColourEdit[4]->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont",fontEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("theme"),{TYPESTRING,"theme",themeEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand",terminalEdit->LFSTK_getCStr(),false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,prefsPlacementTemp}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,atoi(deskCountEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("liveupdate"),{TYPEINT,"liveupdate","",false,atoi(refreshEdit->LFSTK_getCStr())}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,atoi(rescanEdit->LFSTK_getCStr())}} }; prefs.LFSTK_saveVarsToFile(envFile); @@ -250,18 +250,18 @@ int main(int argc, char **argv) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("wmactive_frame"),{TYPESTRING,"wmactive_frame","black",false,0}}, - {prefs.LFSTK_hashFromKey("wmactive_fill"),{TYPESTRING,"wmactive_fill","#00ffff",false,0}}, - {prefs.LFSTK_hashFromKey("wminactive_frame"),{TYPESTRING,"wminactive_frame","black",false,0}}, - {prefs.LFSTK_hashFromKey("wminactive_fill"),{TYPESTRING,"wminactive_fill","white",false,0}}, - {prefs.LFSTK_hashFromKey("widgetcolour"),{TYPESTRING,"widgetcolour","white",false,0}}, - {prefs.LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont","",false,0}}, - {prefs.LFSTK_hashFromKey("theme"),{TYPESTRING,"theme","",false,0}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","",false,0}}, - {prefs.LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,2}}, - {prefs.LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,6}}, - {prefs.LFSTK_hashFromKey("liveupdate"),{TYPEINT,"liveupdate","",false,15}}, - {prefs.LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,4}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("wmactive_frame"),{TYPESTRING,"wmactive_frame","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("wmactive_fill"),{TYPESTRING,"wmactive_fill","#00ffff",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("wminactive_frame"),{TYPESTRING,"wminactive_frame","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("wminactive_fill"),{TYPESTRING,"wminactive_fill","white",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("widgetcolour"),{TYPESTRING,"widgetcolour","white",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("theme"),{TYPESTRING,"theme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,6}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("liveupdate"),{TYPEINT,"liveupdate","",false,15}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,4}}, }; asprintf(&envFile,"%s/lfswmanager.rc",apc->configDir.c_str()); diff --git a/LFSDesktop/LFSDesktop/src/main.cpp b/LFSDesktop/LFSDesktop/src/main.cpp index c39efe9e..c2930301 100644 --- a/LFSDesktop/LFSDesktop/src/main.cpp +++ b/LFSDesktop/LFSDesktop/src/main.cpp @@ -147,7 +147,7 @@ int main(int argc, char **argv) udev=udev_new(); windowInitStruct *wi=new windowInitStruct; - wi->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DESKTOP")); + wi->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DESKTOP")); wi->app=apc; wi->overRide=true; wi->level=BELOWALL; @@ -202,7 +202,7 @@ int main(int argc, char **argv) win->windowName=""; win->loadVars=true; win->wc=wc; - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); win->decorated=false; win->overRide=true; win->level=ABOVEALL; @@ -224,7 +224,7 @@ int main(int argc, char **argv) win->windowName=""; win->loadVars=true; win->wc=wc; - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); win->decorated=false; win->overRide=true; win->level=ABOVEALL; diff --git a/LFSDesktop/LFSDesktop/src/prefs.cpp b/LFSDesktop/LFSDesktop/src/prefs.cpp index 2d11d5f6..e936cbcc 100644 --- a/LFSDesktop/LFSDesktop/src/prefs.cpp +++ b/LFSDesktop/LFSDesktop/src/prefs.cpp @@ -36,7 +36,7 @@ const char *foreCol=NULL; const char *backAlpha; const char *includeList=NULL; const char *excludeList=NULL; -bool doubleClickExecute=false; +bool doubleClickExecute=false; bool loadCacheFile(const char *cachefilepath,desktopItemStruct *cfd) { @@ -47,11 +47,11 @@ bool loadCacheFile(const char *cachefilepath,desktopItemStruct *cfd) cacheprefs.prefsMap= { - {cacheprefs.LFSTK_hashFromKey("uuid"),{TYPESTRING,"uuid","",false,0}}, - {cacheprefs.LFSTK_hashFromKey("posx"),{TYPEINT,"posx","",false,0}}, - {cacheprefs.LFSTK_hashFromKey("posy"),{TYPEINT,"posy","",false,0}}, - {cacheprefs.LFSTK_hashFromKey("hascustomicon"),{TYPEBOOL,"hascustomicon","",false,0}}, - {cacheprefs.LFSTK_hashFromKey("pathtocustomicon"),{TYPESTRING,"pathtocustomicon","",false,0}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("uuid"),{TYPESTRING,"uuid","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("posx"),{TYPEINT,"posx","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("posy"),{TYPEINT,"posy","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("hascustomicon"),{TYPEBOOL,"hascustomicon","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("pathtocustomicon"),{TYPESTRING,"pathtocustomicon","",false,0}} }; cacheprefs.LFSTK_loadVarsFromFile(cachefilepath); @@ -78,11 +78,11 @@ void saveCacheFile(const char *cachefilepath,desktopItemStruct *cfd) cacheprefs.prefsMap= { - {cacheprefs.LFSTK_hashFromKey("uuid"),{TYPESTRING,"uuid",cfd->uuid,false,0}}, - {cacheprefs.LFSTK_hashFromKey("posx"),{TYPEINT,"posx","",false,cfd->posx}}, - {cacheprefs.LFSTK_hashFromKey("posy"),{TYPEINT,"posy","",false,cfd->posy}}, - {cacheprefs.LFSTK_hashFromKey("hascustomicon"),{TYPEBOOL,"hascustomicon","",cfd->hasCustomIcon,0}}, - {cacheprefs.LFSTK_hashFromKey("pathtocustomicon"),{TYPESTRING,"pathtocustomicon",iconpath,false,0}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("uuid"),{TYPESTRING,"uuid",cfd->uuid,false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("posx"),{TYPEINT,"posx","",false,cfd->posx}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("posy"),{TYPEINT,"posy","",false,cfd->posy}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("hascustomicon"),{TYPEBOOL,"hascustomicon","",cfd->hasCustomIcon,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("pathtocustomicon"),{TYPESTRING,"pathtocustomicon",iconpath,false,0}} }; cacheprefs.LFSTK_saveVarsToFile(cachefilepath); @@ -112,25 +112,25 @@ void setDeskNamesProp(void) void loadPrefs(void) { //{(".*"),(.*),&.*} -//{prefs.LFSTK_hashFromKey(\1),{\2,\1,"",false,0}} +//{LFSTK_UtilityClass::LFSTK_hashFromKey(\1),{\2,\1,"",false,0}} prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("icontheme"),{TYPESTRING,"icontheme","gnome",false,0}}, - {prefs.LFSTK_hashFromKey("iconsize"),{TYPEINT,"iconsize","",false,32}}, - {prefs.LFSTK_hashFromKey("gridsize"),{TYPEINT,"gridsize","",false,64}}, - {prefs.LFSTK_hashFromKey("gridborderleft"),{TYPEINT,"gridborderleft","",false,2}}, - {prefs.LFSTK_hashFromKey("gridborderrite"),{TYPEINT,"gridborderrite","",false,2}}, - {prefs.LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,2}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, - {prefs.LFSTK_hashFromKey("showextension"),{TYPEBOOL,"showextension","",false,0}}, - {prefs.LFSTK_hashFromKey("fontface"),{TYPESTRING,"fontface","sans:size=10:bold",false,0}}, - {prefs.LFSTK_hashFromKey("labelbackground"),{TYPESTRING,"labelbackground","#000000",false,0}}, - {prefs.LFSTK_hashFromKey("labelforeground"),{TYPESTRING,"labelforeground","#ffffff",false,0}}, - {prefs.LFSTK_hashFromKey("labelalpha"),{TYPESTRING,"labelalpha","1.0",false,0}}, - {prefs.LFSTK_hashFromKey("includelist"),{TYPESTRING,"includelist","",false,0}}, - {prefs.LFSTK_hashFromKey("excludelist"),{TYPESTRING,"excludelist","",false,0}}, - {prefs.LFSTK_hashFromKey("doubleclickexe"),{TYPEBOOL,"doubleclickexe","",false,0}}, - {prefs.LFSTK_hashFromKey("desknames"),{TYPESTRING,"desknames","Desktop 1,Desktop 2,Desktop 3,Desktop 4,Desktop 5,Desktop 6",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("icontheme"),{TYPESTRING,"icontheme","gnome",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("iconsize"),{TYPEINT,"iconsize","",false,32}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridsize"),{TYPEINT,"gridsize","",false,64}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridborderleft"),{TYPEINT,"gridborderleft","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gridborderrite"),{TYPEINT,"gridborderrite","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("showextension"),{TYPEBOOL,"showextension","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("fontface"),{TYPESTRING,"fontface","sans:size=10:bold",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelbackground"),{TYPESTRING,"labelbackground","#000000",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelforeground"),{TYPESTRING,"labelforeground","#ffffff",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("labelalpha"),{TYPESTRING,"labelalpha","1.0",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("includelist"),{TYPESTRING,"includelist","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("excludelist"),{TYPESTRING,"excludelist","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("doubleclickexe"),{TYPEBOOL,"doubleclickexe","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desknames"),{TYPESTRING,"desknames","Desktop 1,Desktop 2,Desktop 3,Desktop 4,Desktop 5,Desktop 6",false,0}}, }; prefs.LFSTK_loadVarsFromFile(prefsPath); diff --git a/LFSDock/LFSDock/src/calendar.cpp b/LFSDock/LFSDock/src/calendar.cpp index 40378b45..1d9b000d 100644 --- a/LFSDock/LFSDock/src/calendar.cpp +++ b/LFSDock/LFSDock/src/calendar.cpp @@ -207,7 +207,7 @@ int addCalendar(int x,int y,int grav) calendarButton->LFSTK_setImageFromPath(DATADIR "/pixmaps/windows.png",LEFT,true); win=apc->LFSTK_getDefaultWInit(); - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); apc->LFSTK_addToolWindow(win); calWindow=apc->windows->back().window; diff --git a/LFSDock/LFSDock/src/clock.cpp b/LFSDock/LFSDock/src/clock.cpp index 9e68a397..5f36fe16 100644 --- a/LFSDock/LFSDock/src/clock.cpp +++ b/LFSDock/LFSDock/src/clock.cpp @@ -47,7 +47,7 @@ int addClock(int x,int y,int grav) clockButton=new LFSTK_buttonClass(dockWindow,"--:--:--",x,y+(iconWidth/2)-(GADGETHITE/2),iconWidth,GADGETHITE); setGadgetDetails(clockButton); - clockButton->LFSTK_setFontString(prefs.LFSTK_getCString(prefs.LFSTK_hashFromKey("font")),true); + clockButton->LFSTK_setFontString(prefs.LFSTK_getCString("font"),true); clockButton->LFSTK_setIgnores(false,false); clockButton->LFSTK_setTile(NULL,0); //clockButton->LFSTK_setLabelAutoColour(true); diff --git a/LFSDock/LFSDock/src/desktopSwitcher.cpp b/LFSDock/LFSDock/src/desktopSwitcher.cpp index 3b082cdf..369f09e2 100644 --- a/LFSDock/LFSDock/src/desktopSwitcher.cpp +++ b/LFSDock/LFSDock/src/desktopSwitcher.cpp @@ -124,7 +124,7 @@ int addDesktopSwitcer(int x,int y,int grav) deskLabel=new LFSTK_buttonClass(dockWindow,std::to_string(pr.integer+1).c_str(),x,ly,iconWidth,GADGETHITE/2); setGadgetDetails(deskLabel); - deskLabel->LFSTK_setFontString(prefs.LFSTK_getCString(prefs.LFSTK_hashFromKey("font")),true); + deskLabel->LFSTK_setFontString(prefs.LFSTK_getCString("font"),true); deskLabel->LFSTK_setIgnores(false,false); deskLabel->LFSTK_setTile(NULL,0); deskLabel->LFSTK_setGadgetColourPair(NORMALCOLOUR,dockBGColour,dockTextColour); diff --git a/LFSDock/LFSDock/src/launchers.cpp b/LFSDock/LFSDock/src/launchers.cpp index cdccacef..4ba3e8ba 100644 --- a/LFSDock/LFSDock/src/launchers.cpp +++ b/LFSDock/LFSDock/src/launchers.cpp @@ -200,7 +200,7 @@ int addLaunchers(int x,int y,int grav) win->w=200; win->h=200; win->wc=dockWindow; - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); win->app=apc; win->decorated=false; win->overRide=true; @@ -220,7 +220,7 @@ int addLaunchers(int x,int y,int grav) setGadgetDetails(contextButtons[j]); contextButtons[j]->LFSTK_setCairoFontDataParts("sB",20); contextButtons[j]->LFSTK_setTile(NULL,0); - contextButtons[j]->LFSTK_setFontString(prefs.LFSTK_getCString(prefs.LFSTK_hashFromKey("font")),true); + contextButtons[j]->LFSTK_setFontString(prefs.LFSTK_getCString("font"),true); contextButtons[j]->LFSTK_setLabelAutoColour(true); contextButtons[j]->LFSTK_setGadgetColours(GADGETBG,lc,pc,ac,lc); contextButtons[j]->LFSTK_setGadgetColours(GADGETFG,lc,pc,ac,lc); diff --git a/LFSDock/LFSDock/src/main.cpp b/LFSDock/LFSDock/src/main.cpp index b8ca4de8..ed97e8a1 100644 --- a/LFSDock/LFSDock/src/main.cpp +++ b/LFSDock/LFSDock/src/main.cpp @@ -34,13 +34,13 @@ void loadPrefs(std::string prefsfile) { prefs.LFSTK_loadVarsFromFile(prefsfile.c_str()); - dockSize=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("docksize")); - onMonitor=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("onmonitor")); - dockGravity=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("dockgrav")); - dockTextColour=prefs.LFSTK_getString(prefs.LFSTK_hashFromKey("textcolour")); - dockBGColour=prefs.LFSTK_getString(prefs.LFSTK_hashFromKey("dockbgcolour")); - refreshRate= prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("refreshrate")); - useMicros=prefs.LFSTK_getBool(prefs.LFSTK_hashFromKey("usemicroseconds")); + dockSize=prefs.LFSTK_getInt("docksize"); + onMonitor=prefs.LFSTK_getInt("onmonitor"); + dockGravity=prefs.LFSTK_getInt("dockgrav"); + dockTextColour=prefs.LFSTK_getString("textcolour"); + dockBGColour=prefs.LFSTK_getString("dockbgcolour"); + refreshRate= prefs.LFSTK_getInt("refreshrate"); + useMicros=prefs.LFSTK_getBool("usemicroseconds"); } void addGadgets(void) @@ -207,16 +207,16 @@ int main(int argc,char **argv) sanityCheck(); prefs.prefsMap={ - {prefs.LFSTK_hashFromKey("docksize"),{TYPEINT,"docksize","",false,1}}, - {prefs.LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, - {prefs.LFSTK_hashFromKey("dockgrav"),{TYPEINT,"dockgrav","",false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","l",false,0}}, - {prefs.LFSTK_hashFromKey("font"),{TYPESTRING,"font","",false,0}}, - {prefs.LFSTK_hashFromKey("dockbgcolour"),{TYPESTRING,"dockbgcolour","",false,0}}, - {prefs.LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,1}}, - {prefs.LFSTK_hashFromKey("usemicroseconds"),{TYPEBOOL,"usemicroseconds","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("docksize"),{TYPEINT,"docksize","",false,1}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("dockgrav"),{TYPEINT,"dockgrav","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","l",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font"),{TYPESTRING,"font","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("dockbgcolour"),{TYPESTRING,"dockbgcolour","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("refreshrate"),{TYPEINT,"refreshrate","",false,1}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usemicroseconds"),{TYPEBOOL,"usemicroseconds","",false,0}}, }; realMainLoop=true; @@ -238,7 +238,7 @@ int main(int argc,char **argv) dockWindow->LFSTK_setWindowDropCallBack(windowDrop,(void*)0xdeadbeef); win=apc->LFSTK_getDefaultWInit(); - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")); win->level=ABOVEALL; apc->LFSTK_addToolWindow(win); @@ -252,20 +252,20 @@ int main(int argc,char **argv) popActionList->LFSTK_setGadgetColourPair(NORMALCOLOUR,lc,"red"); popActionList->LFSTK_setMouseCallBack(taskListCBDown,popActionWindowSelect,NULL); - WM_STATE=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("WM_STATE")); - NET_WM_WINDOW_TYPE_NORMAL=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); - NET_WM_STATE_HIDDEN=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")); - NET_WM_WINDOW_TYPE_DIALOG=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DIALOG")); - NET_WM_WINDOW_TYPE=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")); - NET_WM_STATE=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_STATE")); - NET_WM_NAME=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_NAME")); - UTF8_STRING=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("UTF8_STRING")); - NET_CURRENT_DESKTOP=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")); - WM_CLASS=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("WM_CLASS")); - NET_WM_PID=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_PID")); - NET_NUMBER_OF_DESKTOPS=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_NUMBER_OF_DESKTOPS")); - NET_ACTIVE_WINDOW=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")); - NET_WM_DESKTOP=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")); + WM_STATE=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_STATE")); + NET_WM_WINDOW_TYPE_NORMAL=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); + NET_WM_STATE_HIDDEN=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")); + NET_WM_WINDOW_TYPE_DIALOG=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DIALOG")); + NET_WM_WINDOW_TYPE=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")); + NET_WM_STATE=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")); + NET_WM_NAME=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_NAME")); + UTF8_STRING=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("UTF8_STRING")); + NET_CURRENT_DESKTOP=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")); + WM_CLASS=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_CLASS")); + NET_WM_PID=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_PID")); + NET_NUMBER_OF_DESKTOPS=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_NUMBER_OF_DESKTOPS")); + NET_ACTIVE_WINDOW=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")); + NET_WM_DESKTOP=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")); env=dockWindow->globalLib->LFSTK_oneLiner("sed -n '2p' %s/lfsappearance.rc",apc->configDir.c_str()); key=std::stoi(env,nullptr,10); diff --git a/LFSPanel/LFSPanel/src/main.cpp b/LFSPanel/LFSPanel/src/main.cpp index 4f0bc7e9..c3083df9 100644 --- a/LFSPanel/LFSPanel/src/main.cpp +++ b/LFSPanel/LFSPanel/src/main.cpp @@ -40,15 +40,15 @@ void loadPrefs(const char *env) { prefs.LFSTK_loadVarsFromFile(env); - panelHeight=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("panelheight")); - panelWidth=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("panelwidth")); - onMonitor=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("onmonitor")); - panelPos=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("panelpos")); - panelGravity=prefs.LFSTK_getInt(prefs.LFSTK_hashFromKey("panelgrav")); - useTheme=prefs.LFSTK_getBool(prefs.LFSTK_hashFromKey("usetheme")); - panelColour=prefs.LFSTK_getCString(prefs.LFSTK_hashFromKey("panelcolour")); - panelTextColour=prefs.LFSTK_getCString(prefs.LFSTK_hashFromKey("textcolour")); - noButtons=prefs.LFSTK_getBool(prefs.LFSTK_hashFromKey("nobuttons")); + panelHeight=prefs.LFSTK_getInt("panelheight"); + panelWidth=prefs.LFSTK_getInt("panelwidth"); + onMonitor=prefs.LFSTK_getInt("onmonitor"); + panelPos=prefs.LFSTK_getInt("panelpos"); + panelGravity=prefs.LFSTK_getInt("panelgrav"); + useTheme=prefs.LFSTK_getBool("usetheme"); + panelColour=prefs.LFSTK_getCString("panelcolour"); + panelTextColour=prefs.LFSTK_getCString("textcolour"); + noButtons=prefs.LFSTK_getBool("nobuttons"); } void addLeftGadgets(void) @@ -189,24 +189,24 @@ int main(int argc,char **argv) int refreshmulti=0; prefs.prefsMap={ - {prefs.LFSTK_hashFromKey("panelheight"),{TYPEINT,"panelheight","",false,0}}, - {prefs.LFSTK_hashFromKey("panelwidth"),{TYPEINT,"panelwidth","",false,0}}, - {prefs.LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, - - {prefs.LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, - {prefs.LFSTK_hashFromKey("logoutcommand"),{TYPESTRING,"logoutcommand","xterm",false,0}}, - {prefs.LFSTK_hashFromKey("restartcommand"),{TYPESTRING,"restartcommand","xterm",false,0}}, - {prefs.LFSTK_hashFromKey("shutdowncommand"),{TYPESTRING,"shutdowncommand","xterm",false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsright"),{TYPESTRING,"gadgetsright","L",false,0}}, - {prefs.LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","l",false,0}}, - - {prefs.LFSTK_hashFromKey("panelpos"),{TYPEINT,"panelpos","",false,0}}, - {prefs.LFSTK_hashFromKey("panelgrav"),{TYPEINT,"panelgrav","",false,0}}, - - {prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, - {prefs.LFSTK_hashFromKey("nobuttons"),{TYPEBOOL,"nobuttons","",false,0}}, - {prefs.LFSTK_hashFromKey("panelcolour"),{TYPESTRING,"panelcolour","white",false,0}}, - {prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelheight"),{TYPEINT,"panelheight","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelwidth"),{TYPEINT,"panelwidth","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("onmonitor"),{TYPEINT,"onmonitor","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("termcommand"),{TYPESTRING,"termcommand","xterm -e ",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("logoutcommand"),{TYPESTRING,"logoutcommand","xterm",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("restartcommand"),{TYPESTRING,"restartcommand","xterm",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("shutdowncommand"),{TYPESTRING,"shutdowncommand","xterm",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsright"),{TYPESTRING,"gadgetsright","L",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("gadgetsleft"),{TYPESTRING,"gadgetsleft","l",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelpos"),{TYPEINT,"panelpos","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelgrav"),{TYPEINT,"panelgrav","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("nobuttons"),{TYPEBOOL,"nobuttons","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("panelcolour"),{TYPESTRING,"panelcolour","white",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}} }; realMainLoop=true; diff --git a/LFSPanel/LFSPanel/src/slider.cpp b/LFSPanel/LFSPanel/src/slider.cpp index 35bb9961..c8ff25bb 100644 --- a/LFSPanel/LFSPanel/src/slider.cpp +++ b/LFSPanel/LFSPanel/src/slider.cpp @@ -199,7 +199,7 @@ int addSlider(int x,int y,int grav,bool fromleft) win->x=100; win->y=100; win->app=apc; - win->windowType=apc->appAtomsHashed.at(apc->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); + win->windowType=apc->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); if((panelGravity==PANELWEST) || (panelGravity==PANELEAST)) { diff --git a/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp b/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp index 78525e67..7dadd4d2 100644 --- a/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp +++ b/LFSSetWallpaper/LFSSetWallpaper/src/main.cpp @@ -274,10 +274,10 @@ void loadPrefs(void) prefs.prefsMap= { - {prefs.LFSTK_hashFromKey("backdrop"),{TYPESTRING,"backdrop","",false,0}}, - {prefs.LFSTK_hashFromKey("mainmode"),{TYPEINT,"mainmode","",false,0}}, - {prefs.LFSTK_hashFromKey("colour"),{TYPESTRING,"colour","",false,0}}, - {prefs.LFSTK_hashFromKey("multimode"),{TYPEBOOL,"multimode","",false,0}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("backdrop"),{TYPESTRING,"backdrop","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("mainmode"),{TYPEINT,"mainmode","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("colour"),{TYPESTRING,"colour","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("multimode"),{TYPEBOOL,"multimode","",false,0}} }; prefs.LFSTK_loadVarsFromFile(prefsPath); diff --git a/LFSToolKit/ChangeLog b/LFSToolKit/ChangeLog index 8209b773..e9eb0072 100644 --- a/LFSToolKit/ChangeLog +++ b/LFSToolKit/ChangeLog @@ -1,4 +1,7 @@ 0.6.1 +Moved function LFSTK_hashFromKey to util class and made static. +Removed redundant functions from prefs class. +Removed old 'c' code from save/load prefsfile. Added LFSTK_strReplaceAllStr to util class. Added LFSTK_strReplaceAllChar to util class. Mose code cleaning... diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp index 13668fef..a3cd007d 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKApplication.cpp @@ -138,8 +138,8 @@ LFSTK_applicationClass::LFSTK_applicationClass() cnt=0; while(appAtomNames[cnt]!=NULL) { - this->appAtomsHashed[this->globalLib->prefs.LFSTK_hashFromKey(appAtomNames[cnt])]=XInternAtom(this->display,appAtomNames[cnt],false); - //fprintf(stderr,"atom=%p atom name=%s\n",this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey(appAtomNames[cnt])),appAtomNames[cnt]); + this->appAtomsHashed[LFSTK_UtilityClass::LFSTK_hashFromKey(appAtomNames[cnt])]=XInternAtom(this->display,appAtomNames[cnt],false); + //fprintf(stderr,"atom=%p atom name=%s\n",this->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey(appAtomNames[cnt])),appAtomNames[cnt]); cnt++; } } @@ -162,7 +162,7 @@ windowInitStruct* LFSTK_applicationClass::LFSTK_getDefaultWInit(void) wininit->overRide=false; wininit->loadVars=true; wininit->shutDisplayOnExit=false; - wininit->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); + wininit->windowType=this->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); wininit->decorated=true; wininit->level=NORMAL; wininit->display=this->display; @@ -196,7 +196,7 @@ void LFSTK_applicationClass::LFSTK_addWindow(windowInitStruct *wi,const char *na win->x=-1; win->y=-1; win->overRide=true; - win->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")); + win->windowType=this->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")); win->decorated=false; } else @@ -224,7 +224,7 @@ void LFSTK_applicationClass::LFSTK_addToolWindow(windowInitStruct *wi,const char if(wi==NULL) { win=this->LFSTK_getDefaultWInit(); - win->windowType=this->appAtomsHashed.at(this->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); + win->windowType=this->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_TOOL")); } else { diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp index 106f66dd..e59736e1 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKLib.cpp @@ -236,43 +236,43 @@ void LFSTK_lib::LFSTK_reloadPrefs(void) this->prefs.prefsMap= { - {this->prefs.LFSTK_hashFromKey("window_normal"),{TYPESTRING,"window_normal","grey40",false,0}}, - {this->prefs.LFSTK_hashFromKey("window_prelight"),{TYPESTRING,"window_prelight","grey40",false,0}}, - {this->prefs.LFSTK_hashFromKey("window_active"),{TYPESTRING,"window_active",",grey40",false,0}}, - {this->prefs.LFSTK_hashFromKey("window_inactive"),{TYPESTRING,"window_inactive","grey40",false,0}}, - {this->prefs.LFSTK_hashFromKey("windowtile"),{TYPESTRING,"windowtile","",false,0}}, - - {this->prefs.LFSTK_hashFromKey("button_normal"),{TYPESTRING,"button_normal","#A3A3A3",false,0}}, - {this->prefs.LFSTK_hashFromKey("button_prelight"),{TYPESTRING,"button_prelight","#7B7B7B",false,0}}, - {this->prefs.LFSTK_hashFromKey("button_active"),{TYPESTRING,"button_active","#676767",false,0}}, - {this->prefs.LFSTK_hashFromKey("button_inactive"),{TYPESTRING,"button_inactive","#D1D1D1",false,0}}, - {this->prefs.LFSTK_hashFromKey("buttontile"),{TYPESTRING,"buttontile","",false,0}}, - - {this->prefs.LFSTK_hashFromKey("menuitem_normal"),{TYPESTRING,"menuitem_normal","#979797",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitem_prelight"),{TYPESTRING,"menuitem_prelight","#979797",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitem_active"),{TYPESTRING,"menuitem_active","#676767",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitem_inactive"),{TYPESTRING,"menuitem_inactive","#d1d1d1",false,0}}, - - {this->prefs.LFSTK_hashFromKey("menuitem_font"),{TYPESTRING,"menuitem_font","sans:size=10",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitem_font_normal"),{TYPESTRING,"menuitem_font_normal","black",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitem_font_prelight"),{TYPESTRING,"menuitem_font_prelight","grey20",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitem_font_active"),{TYPESTRING,"menuitem_font_active","black",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitem_font_inactive"),{TYPESTRING,"menuitem_font_inactive","grey",false,0}}, - {this->prefs.LFSTK_hashFromKey("menuitemtile"),{TYPESTRING,"menuitemtile","",false,0}}, - - {this->prefs.LFSTK_hashFromKey("font"),{TYPESTRING,"font","sans:size=10",false,0}}, - {this->prefs.LFSTK_hashFromKey("font_normal"),{TYPESTRING,"font_normal","white",false,0}}, - {this->prefs.LFSTK_hashFromKey("font_prelight"),{TYPESTRING,"font_prelight","grey20",false,0}}, - {this->prefs.LFSTK_hashFromKey("font_active"),{TYPESTRING,"font_active","black",false,0}}, - {this->prefs.LFSTK_hashFromKey("font_inactive"),{TYPESTRING,"font_inactive","grey",false,0}}, - - {this->prefs.LFSTK_hashFromKey("autotextcolour"),{TYPEBOOL,"autotextcolour","",false,0}}, - {this->prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, - {this->prefs.LFSTK_hashFromKey("themepath"),{TYPESTRING,"themepath","",false,0}}, - {this->prefs.LFSTK_hashFromKey("monofont"),{TYPESTRING,"monofont","mono:size=12",false,0}}, - {this->prefs.LFSTK_hashFromKey("cursorcolour"),{TYPESTRING,"cursorcolour","grey80",false,0}}, - {this->prefs.LFSTK_hashFromKey("sbtroughcolour"),{TYPESTRING,"sbtroughcolour","grey80",false,0}}, - {this->prefs.LFSTK_hashFromKey("listtroughcolour"),{TYPESTRING,"listtroughcolour","grey60",false,0}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_normal"),{TYPESTRING,"window_normal","grey40",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_prelight"),{TYPESTRING,"window_prelight","grey40",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_active"),{TYPESTRING,"window_active",",grey40",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("window_inactive"),{TYPESTRING,"window_inactive","grey40",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("windowtile"),{TYPESTRING,"windowtile","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_normal"),{TYPESTRING,"button_normal","#A3A3A3",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_prelight"),{TYPESTRING,"button_prelight","#7B7B7B",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_active"),{TYPESTRING,"button_active","#676767",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("button_inactive"),{TYPESTRING,"button_inactive","#D1D1D1",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("buttontile"),{TYPESTRING,"buttontile","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_normal"),{TYPESTRING,"menuitem_normal","#979797",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_prelight"),{TYPESTRING,"menuitem_prelight","#979797",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_active"),{TYPESTRING,"menuitem_active","#676767",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_inactive"),{TYPESTRING,"menuitem_inactive","#d1d1d1",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font"),{TYPESTRING,"menuitem_font","sans:size=10",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_normal"),{TYPESTRING,"menuitem_font_normal","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_prelight"),{TYPESTRING,"menuitem_font_prelight","grey20",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_active"),{TYPESTRING,"menuitem_font_active","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitem_font_inactive"),{TYPESTRING,"menuitem_font_inactive","grey",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("menuitemtile"),{TYPESTRING,"menuitemtile","",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("font"),{TYPESTRING,"font","sans:size=10",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_normal"),{TYPESTRING,"font_normal","white",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_prelight"),{TYPESTRING,"font_prelight","grey20",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_active"),{TYPESTRING,"font_active","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("font_inactive"),{TYPESTRING,"font_inactive","grey",false,0}}, + + {LFSTK_UtilityClass::LFSTK_hashFromKey("autotextcolour"),{TYPEBOOL,"autotextcolour","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("themepath"),{TYPESTRING,"themepath","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("monofont"),{TYPESTRING,"monofont","mono:size=12",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("cursorcolour"),{TYPESTRING,"cursorcolour","grey80",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("sbtroughcolour"),{TYPESTRING,"sbtroughcolour","grey80",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("listtroughcolour"),{TYPESTRING,"listtroughcolour","grey60",false,0}} }; std::string str=getenv("HOME"); diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp index c0068cd1..fd396970 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKLineEdit.cpp @@ -131,7 +131,7 @@ LFSTK_lineEditClass::LFSTK_lineEditClass(LFSTK_windowClass* parentwc,const char* win->w=200; win->h=200; win->wc=this->wc; - win->windowType=this->wc->app->appAtomsHashed.at(this->wc->app->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); + win->windowType=this->wc->app->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); win->decorated=false; win->level=ABOVEALL; diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp index ba088337..286ab0b4 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKMenu.cpp @@ -392,7 +392,7 @@ void LFSTK_menuClass::LFSTK_addMainMenus(infoDataStruct **menus,int menucnt) else this->isScrollable=false; win->wc=this->parentwc; - win->windowType=this->parentwc->app->appAtomsHashed.at(this->parentwc->app->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); + win->windowType=this->parentwc->app->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); win->decorated=false; win->overRide=true; diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKMenuItem.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKMenuItem.cpp index b3e5ca2d..b64746e0 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKMenuItem.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKMenuItem.cpp @@ -215,7 +215,7 @@ bool LFSTK_menuItemClass::mouseEnter(XButtonEvent *e) else maxtxtwid+=gotsubmenu; this->w=maxtxtwid; - this->subwc=new LFSTK_toolWindowClass(this->wc->app->display,this->wc,this->wc->app->appAtomsHashed.at(this->wc->app->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")),this->gadgetGeom.x,this->gadgetGeom.y,maxtxtwid,GADGETHITE*this->menuData->subMenuCnt-winshrink,"menu window",this->wc->app); + this->subwc=new LFSTK_toolWindowClass(this->wc->app->display,this->wc,this->wc->app->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")),this->gadgetGeom.x,this->gadgetGeom.y,maxtxtwid,GADGETHITE*this->menuData->subMenuCnt-winshrink,"menu window",this->wc->app); for(int j=0; jmenuData->subMenuCnt; j++) { diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.cpp index b95a230c..2cf6300f 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.cpp @@ -45,7 +45,7 @@ LFSTK_prefsClass::LFSTK_prefsClass() */ void LFSTK_prefsClass::LFSTK_addToPrefs(const char *key,prefsData data) { - this->prefsMap[this->LFSTK_hashFromKey(key)]=data; + this->prefsMap[LFSTK_UtilityClass::LFSTK_hashFromKey(key)]=data; } /** @@ -55,7 +55,7 @@ void LFSTK_prefsClass::LFSTK_addToPrefs(const char *key,prefsData data) */ void LFSTK_prefsClass::LFSTK_deleteFromPrefs(const char *key) { - this->prefsMap.erase(this->LFSTK_hashFromKey(key)); + this->prefsMap.erase(LFSTK_UtilityClass::LFSTK_hashFromKey(key)); } /** @@ -76,9 +76,9 @@ const char* LFSTK_prefsClass::LFSTK_boolToString(bool val) * \return boolean * \note case insensitive. */ -bool LFSTK_prefsClass::LFSTK_stringToBool(const char *val) +bool LFSTK_prefsClass::LFSTK_stringToBool(std::string val) { - if((strcasecmp(val,"true")==0) || (strcasecmp(val,"1")==0)) + if((val.compare("true")==0) || (val.compare("1")==0)) return(true); return(false); } @@ -89,40 +89,52 @@ bool LFSTK_prefsClass::LFSTK_stringToBool(const char *val) * \param filepath Path to prefs file. * \note if filepath = '-' write to stdout. */ -void LFSTK_prefsClass::LFSTK_saveVarsToFile(const char *filepath) +void LFSTK_prefsClass::LFSTK_saveVarsToFile(std::string filepath) { -//write - FILE* fd=NULL; + std::ofstream myfile ; + std::string keyname; + std::string data; + std::streambuf *buf; + bool dook=false; - if(filepath[0]=='-') - fd=stdout; + if(filepath.compare("-")!=0) + { + myfile.open(filepath,std::ofstream::out); + buf=myfile.rdbuf(); + if(myfile.is_open()) + dook=true; + } else - fd=fopen(filepath,"w"); - - if(fd!=NULL) { + buf=std::cout.rdbuf(); + dook=true; + } + + if(dook==true) + { + std::ostream out(buf); for(auto& x:this->prefsMap) { switch(x.second.type) { case TYPESTRING: - if(x.second.strData.length()>0) - fprintf(fd,"%s %s\n",x.second.keyName.c_str(),x.second.strData.c_str()); + if(x.second.strData.empty()==false) + out<LFSTK_boolToString(x.second.boolData)); + out<LFSTK_boolToString(x.second.boolData)<>keyname) { - buffer[0]=0; - argname[0]=0; - strarg[0]=0; - - fgets(buffer,8447,fd); - sscanf(buffer,"%s %[^\n]s",argname,strarg); - if((strlen(argname)==0) || (strlen(buffer)==0) || (strlen(strarg)==0)) - continue; + std::getline(myfile,line); + data=LFSTK_UtilityClass::LFSTK_strStrip(line); for(auto& x:this->prefsMap) { - if(this->LFSTK_hashFromKey(argname)==x.first) + if(LFSTK_UtilityClass::LFSTK_hashFromKey(keyname)==x.first) { switch(x.second.type) { case TYPESTRING: - x.second.strData=strarg; + x.second.strData=data; break; case TYPEBOOL: - x.second.boolData=this->LFSTK_stringToBool(strarg); + x.second.boolData=this->LFSTK_stringToBool(data); break; case TYPEINT: - x.second.intData=atoi(strarg); + x.second.intData=stoi(data,nullptr,10); break; default: break; @@ -173,30 +178,10 @@ void LFSTK_prefsClass::LFSTK_loadVarsFromFile(const char *filepath) } } } - fclose(fd); + myfile.close(); } } -unsigned long LFSTK_prefsClass::LFSTK_hashFromKey(const char *key) -{ - unsigned long hash=0; - - for(unsigned i=0;key[i]!=0;i++) - hash=31*hash+key[i]; - - return(hash); -} - -unsigned long LFSTK_prefsClass::LFSTK_hashFromKey(std::string key) -{ - unsigned long hash=0; - - for(int i=0;iprefsMap.at(this->LFSTK_hashFromKey(key)).strData.c_str()); -} - -/** -* Get c type string. -* \param key. -* \return const char* -*/ -const char* LFSTK_prefsClass::LFSTK_getCString(unsigned long key) -{ - return(this->prefsMap.at(key).strData.c_str()); + return(this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).strData.c_str()); } /** @@ -224,7 +199,7 @@ const char* LFSTK_prefsClass::LFSTK_getCString(unsigned long key) */ std::string LFSTK_prefsClass::LFSTK_getString(const char *key) { - return(this->prefsMap.at(this->LFSTK_hashFromKey(key)).strData); + return(this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).strData); } /** @@ -234,27 +209,7 @@ std::string LFSTK_prefsClass::LFSTK_getString(const char *key) */ const std::string* LFSTK_prefsClass::LFSTK_getStringObject(const char *key) { - return(&(this->prefsMap.at(this->LFSTK_hashFromKey(key)).strData)); -} - -/** -* Get c++ type std::string. -* \param key. -* \return std::string. -*/ -std::string LFSTK_prefsClass::LFSTK_getString(unsigned long key) -{ - return(this->prefsMap.at(key).strData); -} - -/** -* Set string. -* \param unsigned long key. -* \param const char *newstr. -*/ -void LFSTK_prefsClass::LFSTK_setString(unsigned long key,const char *newstr) -{ - this->prefsMap.at(key).strData=newstr; + return(&(this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).strData)); } /** @@ -264,7 +219,7 @@ void LFSTK_prefsClass::LFSTK_setString(unsigned long key,const char *newstr) */ void LFSTK_prefsClass::LFSTK_setString(const char *key,const char *newstr) { - this->prefsMap.at(this->LFSTK_hashFromKey(key)).strData=newstr; + this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).strData=newstr; } /** @@ -274,17 +229,7 @@ void LFSTK_prefsClass::LFSTK_setString(const char *key,const char *newstr) */ bool LFSTK_prefsClass::LFSTK_getBool(const char *key) { - return(this->prefsMap.at(this->LFSTK_hashFromKey(key)).boolData); -} - -/** -* Get boolean. -* \param key. -* \return bool. -*/ -bool LFSTK_prefsClass::LFSTK_getBool(unsigned long key) -{ - return(this->prefsMap.at(key).boolData); + return(this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).boolData); } /** @@ -294,17 +239,7 @@ bool LFSTK_prefsClass::LFSTK_getBool(unsigned long key) */ void LFSTK_prefsClass::LFSTK_setBool(const char *key,bool val) { - this->prefsMap.at(this->LFSTK_hashFromKey(key)).boolData=val; -} - -/** -* Set boolean. -* \paramunsigned long key. -* \param bool val. -*/ -void LFSTK_prefsClass::LFSTK_setBool(unsigned long key,bool val) -{ - this->prefsMap.at(key).boolData=val; + this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).boolData=val; } /** @@ -314,16 +249,15 @@ void LFSTK_prefsClass::LFSTK_setBool(unsigned long key,bool val) */ int LFSTK_prefsClass::LFSTK_getInt(const char *key) { - return(this->prefsMap.at(this->LFSTK_hashFromKey(key)).intData); + return(this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).intData); } /** -* Get int. -* \param key. -* \return int. +* Set int. +* \param const char *key. +* \param bool val. */ -int LFSTK_prefsClass::LFSTK_getInt(unsigned long key) +void LFSTK_prefsClass::LFSTK_setInt(const char *key,int val) { - return(this->prefsMap.at(key).intData); -} - + this->prefsMap.at(LFSTK_UtilityClass::LFSTK_hashFromKey(key)).intData=val; +} \ No newline at end of file diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.h b/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.h index 7c47cc88..ccbb7e8e 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.h +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKPrefsClass.h @@ -50,38 +50,25 @@ class LFSTK_prefsClass void LFSTK_addToPrefs(const char *key,prefsData data); void LFSTK_deleteFromPrefs(const char *key); const char *LFSTK_boolToString(bool val); - bool LFSTK_stringToBool(const char *val); - void LFSTK_saveVarsToFile(const char *filepath); - void LFSTK_loadVarsFromFile(const char *filepath); + bool LFSTK_stringToBool(std::string val); + void LFSTK_saveVarsToFile(std::string filepath); + void LFSTK_loadVarsFromFile(std::string filepath); -//get +//get/set //strings const char *LFSTK_getCString(const char *key); - const char *LFSTK_getCString(unsigned long key); std::string LFSTK_getString(const char *key); const std::string *LFSTK_getStringObject(const char *key); - std::string LFSTK_getString(unsigned long key); -//set -//string - void LFSTK_setString(unsigned long key,const char *newstr); void LFSTK_setString(const char *key,const char *newstr); -//get +//get/set //boolean bool LFSTK_getBool(const char *key); - bool LFSTK_getBool(unsigned long key); -//set -//boolean void LFSTK_setBool(const char *key,bool val); - void LFSTK_setBool(unsigned long key,bool val); -//get -//integer +//get/set int LFSTK_getInt(const char *key); - int LFSTK_getInt(unsigned long key); - - unsigned long LFSTK_hashFromKey(const char *key); - unsigned long LFSTK_hashFromKey(std::string key); + void LFSTK_setInt(const char *key,int val); private: const char *bools[2]={"false","true"}; diff --git a/LFSToolKit/LFSToolKit/lfstk/LFSTKUtilityClass.cpp b/LFSToolKit/LFSToolKit/lfstk/LFSTKUtilityClass.cpp index 042d17a3..51830b00 100644 --- a/LFSToolKit/LFSToolKit/lfstk/LFSTKUtilityClass.cpp +++ b/LFSToolKit/LFSToolKit/lfstk/LFSTKUtilityClass.cpp @@ -159,4 +159,19 @@ std::string LFSTK_UtilityClass::LFSTK_strReplaceAllChar(std::string haystack,std } }while(flag==true); return(localhaystack); +} + +/** +* Get hash from key string. +* \param std::string str key. +* \return unsigned long hashed key string. +*/ +unsigned long LFSTK_UtilityClass::LFSTK_hashFromKey(std::string key) +{ + unsigned long hash=0; + + for(int i=0;iwindowType=this->wc->app->appAtomsHashed.at(this->wc->app->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); + //win->windowType=this->wc->app->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_MENU")); //xa=XInternAtom(this->app->display,"_NET_WM_WINDOW_TYPE",False); - xa=this->app->appAtomsHashed.at(this->app->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")); + xa=this->app->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")); //xa_prop[0]=XInternAtom(this->app->display,type,False); xa_prop[0]=type; @@ -753,8 +753,7 @@ void LFSTK_windowClass::windowClassInitCommon(windowInitStruct *wi) classHint.res_class=(char*)wi->className.c_str(); XSetClassHint(this->app->display,this->window,&classHint); unsigned long pid=getpid(); - //this->LFSTK_setXProperty(XInternAtom(this->app->display,"_NET_WM_PID",False),XA_CARDINAL,32,(void *)&pid,1); - this->LFSTK_setXProperty(this->app->appAtomsHashed.at(this->app->globalLib->prefs.LFSTK_hashFromKey("_NET_WM_PID")),XA_CARDINAL,32,(void *)&pid,1); + this->LFSTK_setXProperty(this->app->appAtomsHashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_PID")),XA_CARDINAL,32,(void *)&pid,1); this->gc=XCreateGC(this->app->display,this->window,0,NULL); this->LFSTK_setFontString((char*)DEFAULTFONT); diff --git a/LFSToolKit/devtests/readfromfile.cpp b/LFSToolKit/devtests/readfromfile.cpp new file mode 100755 index 00000000..7363b338 --- /dev/null +++ b/LFSToolKit/devtests/readfromfile.cpp @@ -0,0 +1,63 @@ +#if 0 + +# keithhedger Wed 20 Dec 16:18:20 GMT 2023 kdhedger68713@gmail.com + + +if [[ $USEVALGRIND -eq 1 ]];then + VALGRIND="valgrind --leak-check=full " +fi + +APPNAME=$(basename $0 .cpp) + +g++ "$0" -O0 -ggdb -I../LFSToolKit -L../LFSToolKit/app/.libs $(pkg-config --cflags --libs x11 xft cairo ) -llfstoolkit -lImlib2 -o $APPNAME||exit 1 +LD_LIBRARY_PATH=../LFSToolKit/app/.libs $VALGRIND ./$APPNAME "$@" + +retval=$? +echo "Exit code $retval" +rm $APPNAME +exit $retval + +#endif + +#include +#include +#include +#include + +#include "lfstk/LFSTKGlobals.h" + +int main(int argc, char **argv) +{ + std::ifstream myfile ; + std::ofstream myoutfile; + std::streambuf *buf; + bool tostderr=true; + + myfile.open(argv[1], std::fstream::in); + + if(myfile.is_open()) + { + if(tostderr==true) + { + myoutfile.open("/tmp/test.txt",std::ofstream::out); + buf=myoutfile.rdbuf(); + } + else + { + buf=std::cout.rdbuf(); + } + std::ostream out(buf); + std::string keyname; + std::string data; + while(myfile>>keyname) + { + std::getline(myfile, data); + //std::cout << "keyname="<mainClass->LFSWM2_pushXErrorHandler(); - namex=(char*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_NAME")),this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("UTF8_STRING")),&nitems_return); + namex=(char*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_NAME")),this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("UTF8_STRING")),&nitems_return); if (namex!=NULL) { this->name=namex; @@ -116,10 +116,10 @@ void LFSWM2_clientClass::drawMousePressed(Window id,Pixmap pm,controlData data) if(this->mainClass->useTheme==true) { - XSetClipMask(this->mainClass->display,this->frameGC,this->mainClass->mainWindowClass->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(cn)]); + XSetClipMask(this->mainClass->display,this->frameGC,this->mainClass->mainWindowClass->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)]); XSetClipOrigin(this->mainClass->display,this->frameGC,0,0); - XCopyArea(this->mainClass->display,this->mainClass->mainWindowClass->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(cn)],id,this->frameGC,0,0,this->mainClass->mainWindowClass->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(cn)],this->mainClass->mainWindowClass->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(cn)],0,0); - XShapeCombineMask(this->mainClass->display,id,ShapeBounding,0,0,this->mainClass->mainWindowClass->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(cn)],ShapeSet); + XCopyArea(this->mainClass->display,this->mainClass->mainWindowClass->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],id,this->frameGC,0,0,this->mainClass->mainWindowClass->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],this->mainClass->mainWindowClass->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],0,0); + XShapeCombineMask(this->mainClass->display,id,ShapeBounding,0,0,this->mainClass->mainWindowClass->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],ShapeSet); return; } @@ -139,10 +139,10 @@ void LFSWM2_clientClass::drawMouseEnter(Window id,Pixmap pm,controlData data) if(this->mainClass->useTheme==true) { - XSetClipMask(this->mainClass->display,this->frameGC,this->mainClass->mainWindowClass->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(cn)]); + XSetClipMask(this->mainClass->display,this->frameGC,this->mainClass->mainWindowClass->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)]); XSetClipOrigin(this->mainClass->display,this->frameGC,0,0); - XCopyArea(this->mainClass->display,this->mainClass->mainWindowClass->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(cn)],id,this->frameGC,0,0,this->mainClass->mainWindowClass->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(cn)],this->mainClass->mainWindowClass->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(cn)],0,0); - XShapeCombineMask(this->mainClass->display,id,ShapeBounding,0,0,this->mainClass->mainWindowClass->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(cn)],ShapeSet); + XCopyArea(this->mainClass->display,this->mainClass->mainWindowClass->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],id,this->frameGC,0,0,this->mainClass->mainWindowClass->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],this->mainClass->mainWindowClass->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],0,0); + XShapeCombineMask(this->mainClass->display,id,ShapeBounding,0,0,this->mainClass->mainWindowClass->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],ShapeSet); return; } @@ -162,10 +162,10 @@ void LFSWM2_clientClass::LFSWM2_drawMouseLeave(Window id,Pixmap pm,controlData d if(this->mainClass->useTheme==true) { - XSetClipMask(this->mainClass->display,this->frameGC,this->mainClass->mainWindowClass->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(cn)]); + XSetClipMask(this->mainClass->display,this->frameGC,this->mainClass->mainWindowClass->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)]); XSetClipOrigin(this->mainClass->display,this->frameGC,0,0); - XCopyArea(this->mainClass->display,this->mainClass->mainWindowClass->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(cn)],id,this->frameGC,0,0,this->mainClass->mainWindowClass->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(cn)],this->mainClass->mainWindowClass->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(cn)],0,0); - XShapeCombineMask(this->mainClass->display,id,ShapeBounding,0,0,this->mainClass->mainWindowClass->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(cn)],ShapeSet); + XCopyArea(this->mainClass->display,this->mainClass->mainWindowClass->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],id,this->frameGC,0,0,this->mainClass->mainWindowClass->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],this->mainClass->mainWindowClass->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],0,0); + XShapeCombineMask(this->mainClass->display,id,ShapeBounding,0,0,this->mainClass->mainWindowClass->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(cn)],ShapeSet); return; } @@ -184,12 +184,12 @@ void LFSWM2_clientClass::LFSWM2_drawMouseLeave(Window id,Pixmap pm,controlData d void LFSWM2_clientClass::LFSWM2_sendCloseWindow(void) { XClientMessageEvent em; -//this->mainClass->mainWindowClass->LFSWM2_windowClass::LFSWM2_removeProp(this->contentWindow,this->mainClass->prefs.LFSTK_hashFromKey("_NET_FRAME_EXTENTS")); +//this->mainClass->mainWindowClass->LFSWM2_windowClass::LFSWM2_removeProp(this->contentWindow,LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_FRAME_EXTENTS")); em.type=ClientMessage; em.window=this->contentWindow; - em.message_type=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("WM_PROTOCOLS")); + em.message_type=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_PROTOCOLS")); em.format=32; - em.data.l[0]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("WM_DELETE_WINDOW"));; + em.data.l[0]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_DELETE_WINDOW"));; em.data.l[1]=CurrentTime; XSendEvent(this->mainClass->display,this->contentWindow,false,NoEventMask,(XEvent *)&em); this->visible=false; @@ -446,9 +446,9 @@ void LFSWM2_clientClass::LFSWM2_unSpecial(void) { if(this->isMaximized==true) { - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))); - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))); - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); this->isMaximized=false; } this->isShaded=false; @@ -459,20 +459,20 @@ void LFSWM2_clientClass::LFSWM2_maxWindow(void) { if(this->isMaximized==true) { - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))); - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))); } else { - this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))); - this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))); + this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))); + this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))); } this->mainClass->mainWindowClass->LFSWM2_reloadWindowState(this->contentWindow); } void LFSWM2_clientClass::LFSWM2_minWindow(void) { - this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); + this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); this->mainClass->mainWindowClass->LFSWM2_reloadWindowState(this->contentWindow); this->LFSWM2_hideWindow(); } @@ -514,18 +514,18 @@ bool LFSWM2_clientClass::wmCB(void *p,void* ud) if(static_cast(p)->LFSTK_getLabel().compare("Fullscreen")==0) { cc->LFSWM2_fullscreenWindow(true,true); - cc->mainClass->mainWindowClass->LFSWM2_addState(cc->contentWindow,cc->mainClass->atomshashed.at(cc->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))); + cc->mainClass->mainWindowClass->LFSWM2_addState(cc->contentWindow,cc->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))); } //if(strcmp(static_cast(p)->LFSTK_getLabel(),"On Top")==0) if(static_cast(p)->LFSTK_getLabel().compare("On Top")==0) { if(cc->onTop==false) { - cc->mainClass->mainWindowClass->LFSWM2_addState(cc->contentWindow,cc->mainClass->atomshashed.at(cc->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); - cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(cc->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); + cc->mainClass->mainWindowClass->LFSWM2_addState(cc->contentWindow,cc->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); + cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); } else - cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(cc->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); + cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); cc->mainClass->mainEventClass->LFSWM2_restack(); } //if(strcmp(static_cast(p)->LFSTK_getLabel(),"On Bottom")==0) @@ -533,11 +533,11 @@ bool LFSWM2_clientClass::wmCB(void *p,void* ud) { if(cc->onBottom==false) { - cc->mainClass->mainWindowClass->LFSWM2_addState(cc->contentWindow,cc->mainClass->atomshashed.at(cc->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); - cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(cc->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); + cc->mainClass->mainWindowClass->LFSWM2_addState(cc->contentWindow,cc->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); + cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); } else - cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(cc->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); + cc->mainClass->mainWindowClass->LFSWM2_removeProp(cc->contentWindow,cc->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); cc->mainClass->mainEventClass->LFSWM2_restack(); } @@ -724,7 +724,7 @@ void LFSWM2_clientClass::LFSWM2_fullscreenWindow(bool isfull,bool force) { this->setWindowRects(); this->clientPreFSRect=this->frameWindowRect; - this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))); + this->mainClass->mainWindowClass->LFSWM2_addState(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))); XMoveResizeWindow(this->mainClass->display,this->frameWindow,mg.x,mg.y,mg.w,mg.h); XMoveResizeWindow(this->mainClass->display,this->contentWindow,0,0,mg.w,mg.h); } @@ -732,7 +732,7 @@ void LFSWM2_clientClass::LFSWM2_fullscreenWindow(bool isfull,bool force) } else { - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))); XMoveResizeWindow(this->mainClass->display,this->frameWindow,this->clientPreFSRect.x,this->clientPreFSRect.y,this->clientPreFSRect.w,this->clientPreFSRect.h); XMoveResizeWindow(this->mainClass->display,this->contentWindow,this->mainClass->leftSideBarSize,this->mainClass->titleBarSize,this->clientPreFSRect.w-(this->mainClass->leftSideBarSize+this->mainClass->riteSideBarSize),this->clientPreFSRect.h-this->mainClass->bottomBarSize-this->mainClass->titleBarSize); } @@ -847,7 +847,7 @@ void LFSWM2_clientClass::LFSWM2_setWMState(XEvent *e) this->onTop=false; this->visibleOnAllDesks=false; - states=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getFullProp(e->xproperty.window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,&n); + states=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getFullProp(e->xproperty.window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,&n); if(n>0) { @@ -858,18 +858,18 @@ void LFSWM2_clientClass::LFSWM2_setWMState(XEvent *e) } } - if(!this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")))) + if(!this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")))) { this->visible=true; this->LFSWM2_showWindow(); } - if(this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_STICKY")))) + if(this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_STICKY")))) { this->visibleOnAllDesks=true; } - if(this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW")))) + if(this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW")))) { this->onBottom=true; this->onTop=false; @@ -877,12 +877,12 @@ void LFSWM2_clientClass::LFSWM2_setWMState(XEvent *e) this->mainClass->restackCnt++; } - if(this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE")))) + if(this->mainClass->mainWindowClass->LFSWM2_hasState(e->xproperty.window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE")))) { this->onBottom=false; this->onTop=true; XRaiseWindow(this->mainClass->display,this->contentWindow); - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,&this->contentWindow,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,&this->contentWindow,1); this->mainClass->restackCnt++; } if(states!=NULL) @@ -939,7 +939,7 @@ bool LFSWM2_clientClass::LFSWM2_doFrameMoveEvents(XEvent *e) XWarpPointer(this->mainClass->display,None,None,0,0,0,0,this->mainClass->displayWidth-50,0); direction=-1; ee.xbutton.x_root=100000; - this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&this->onDesk,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&this->onDesk,1); } else if((ee.xbutton.x_root>this->mainClass->displayWidth-20) && (direction==1)) { @@ -947,7 +947,7 @@ bool LFSWM2_clientClass::LFSWM2_doFrameMoveEvents(XEvent *e) this->mainClass->LFSWM2_setCurrentDesktop(this->onDesk); XWarpPointer(this->mainClass->display,None,None,0,0,0,0,(-this->mainClass->displayWidth-50),0); ee.xbutton.x_root=-1; - this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&this->onDesk,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&this->onDesk,1); } } lastx=ee.xbutton.x_root; @@ -1107,7 +1107,7 @@ bool LFSWM2_clientClass::LFSWM2_handleEvents(XEvent *e) this->frameWindowRect=this->holdFrameRect; XMoveWindow(this->mainClass->display,this->frameWindow,this->frameWindowRect.x,this->frameWindowRect.y); XRaiseWindow(this->mainClass->display,this->frameWindow); - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,&this->contentWindow,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,&this->contentWindow,1); XSetInputFocus(this->mainClass->display,this->contentWindow,RevertToNone,CurrentTime); break; default: @@ -1156,7 +1156,7 @@ void LFSWM2_clientClass::renderFrame(bool isfirst,int x,int y) XMapSubwindows(this->mainClass->display,this->contentWindow); this->setWindowRects(true); this->rendered=true; - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,(void*)&this->contentWindow,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,(void*)&this->contentWindow,1); this->mainClass->restackCnt=0; if(this->isBorderless==true) { @@ -1178,11 +1178,11 @@ void LFSWM2_clientClass::LFSWM2_setFrameExtents(void) if(this->isBorderless==false) { unsigned long v[10]={(unsigned long)this->mainClass->leftSideBarSize,(unsigned long)this->mainClass->riteSideBarSize,(unsigned long)this->mainClass->titleBarSize,(unsigned long)this->mainClass->bottomBarSize,0,0,0,0,0}; - this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_FRAME_EXTENTS")),XA_CARDINAL,32,&v,4); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_FRAME_EXTENTS")),XA_CARDINAL,32,&v,4); } else { unsigned long v[10]={0,0,0,0,0,0,0,0,0}; - this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_FRAME_EXTENTS")),XA_CARDINAL,32,&v,4); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_FRAME_EXTENTS")),XA_CARDINAL,32,&v,4); } } diff --git a/LFSWM2/LFSWM2/src/eventsClass.cpp b/LFSWM2/LFSWM2/src/eventsClass.cpp index 811dfa59..d914e9f3 100644 --- a/LFSWM2/LFSWM2/src/eventsClass.cpp +++ b/LFSWM2/LFSWM2/src/eventsClass.cpp @@ -91,9 +91,9 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) ccs=this->mainClass->mainWindowClass->LFSWM2_getClientClass(this->mainClass->mainWindowClass->windowIDList.at(j)); if(ccs!=NULL) { - if(this->mainClass->mainWindowClass->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey("menu-active")]==false) + if(this->mainClass->mainWindowClass->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey("menu-active")]==false) XMoveWindow(this->mainClass->display,ccs->menuButton,-1000,-1000); - if(this->mainClass->mainWindowClass->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey("shade-active")]==false) + if(this->mainClass->mainWindowClass->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey("shade-active")]==false) XMoveWindow(this->mainClass->display,ccs->shadeButton,-1000,-1000); if(ccs->isFullscreen==false) @@ -220,7 +220,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) if((e.xbutton.state&(this->mainClass->modKeys))==(this->mainClass->modKeys))//TODO//???windows key for now used to move window wihout restacking break; - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,&cc->contentWindow,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,&cc->contentWindow,1); XSetInputFocus(this->mainClass->display,cc->contentWindow,RevertToNone,CurrentTime); XAllowEvents(this->mainClass->display,ReplayPointer,e.xbutton.time); XRaiseWindow(this->mainClass->display,cc->contentWindow); @@ -236,7 +236,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) if(overide==false) this->mainClass->restackCnt=4; - v=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,&nitems_return); + v=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,&nitems_return); if(v!=NULL) { if(e.xmap.window!=v[0]) @@ -250,7 +250,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) { //fprintf(stderr,"MapRequest main event loop window=%x when=%i\n",e.xmap.window,when++); this->noRestack=false; - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->mainClass->rootWindow,this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->mainClass->rootWindow,LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")); XWindowAttributes x_window_attrs; hintsDataStruct hs; XGetWindowAttributes(this->mainClass->display,e.xmaprequest.window,&x_window_attrs); @@ -397,7 +397,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) if((e.xproperty.state==PropertyNewValue) || (e.xproperty.state==PropertyDelete)) { - if(e.xproperty.atom==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP"))) + if(e.xproperty.atom==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP"))) { if(e.xproperty.window==this->mainClass->rootWindow) { @@ -408,7 +408,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) break; } - if(e.xproperty.atom==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE"))) + if(e.xproperty.atom==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE"))) { this->noRestack=false; //fprintf(stderr,"PropertyNotify OUT WM_STATE eventnumber %i\n",when++); @@ -420,7 +420,7 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) } } - if(e.xproperty.atom==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_NAME"))) + if(e.xproperty.atom==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_NAME"))) { cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(e.xproperty.window); if(cc!=NULL) @@ -467,13 +467,13 @@ void LFSWM2_eventsClass::LFSWM2_mainEventLoop(void) //fprintf(stderr,"this->mainClass->restackCnt<1 eventnumber %i\n",when++); Atom *v=NULL; long unsigned int n; - v=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,&n); + v=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,&n); this->LFSWM2_restack(); if((v!=NULL) && (this->mainClass->currentDesktop!=(long unsigned int)v[0])) this->mainClass->mainWindowClass->LFSWM2_setVisibilityForDesk(this->mainClass->currentDesktop); - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,32,&this->mainClass->currentDesktop,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,32,&this->mainClass->currentDesktop,1); this->mainClass->restackCnt=1; overide=false; @@ -503,12 +503,12 @@ void LFSWM2_eventsClass::LFSWM2_doClientMsg(Window id,XClientMessageEvent *e) this->mainClass->DEBUG_printAtom(e->message_type); #endif - if(e->message_type==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")) && e->format==32) + if(e->message_type==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")) && e->format==32) { ccmessage=this->mainClass->mainWindowClass->LFSWM2_getClientClass(this->mainClass->mainWindowClass->LFSWM2_getParentWindow(e->window)); if(ccmessage!=NULL) { - this->mainClass->mainWindowClass->LFSWM2_setProp(e->window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&e->data.l[0],1); + this->mainClass->mainWindowClass->LFSWM2_setProp(e->window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&e->data.l[0],1); ccmessage->onDesk=e->data.l[0]; return; } @@ -516,15 +516,15 @@ void LFSWM2_eventsClass::LFSWM2_doClientMsg(Window id,XClientMessageEvent *e) return; } - if(e->message_type==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")) && e->format==32) + if(e->message_type==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")) && e->format==32) { ccmessage=this->mainClass->mainWindowClass->LFSWM2_getClientClass(e->window); if(ccmessage!=NULL) { this->mainClass->LFSWM2_pushXErrorHandler(); this->mainClass->LFSWM2_setCurrentDesktop(ccmessage->onDesk); - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,(void*)&ccmessage->contentWindow,1); - this->mainClass->mainWindowClass->LFSWM2_removeProp(e->window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,32,(void*)&ccmessage->contentWindow,1); + this->mainClass->mainWindowClass->LFSWM2_removeProp(e->window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); ccmessage->visible=true; XRaiseWindow(this->mainClass->display,ccmessage->contentWindow); XSetInputFocus(this->mainClass->display,ccmessage->contentWindow,RevertToNone,CurrentTime); @@ -536,7 +536,7 @@ void LFSWM2_eventsClass::LFSWM2_doClientMsg(Window id,XClientMessageEvent *e) return; } - if(e->message_type==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")) && e->format==32) + if(e->message_type==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")) && e->format==32) { if(e->window==this->mainClass->rootWindow) { @@ -550,7 +550,7 @@ void LFSWM2_eventsClass::LFSWM2_doClientMsg(Window id,XClientMessageEvent *e) this->noRestack=true; return; } - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,32,&this->mainClass->currentDesktop,1); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,32,&this->mainClass->currentDesktop,1); this->mainClass->restackCnt++; this->noRestack=true; return; @@ -558,7 +558,7 @@ void LFSWM2_eventsClass::LFSWM2_doClientMsg(Window id,XClientMessageEvent *e) return; } - if(e->message_type==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CLOSE_WINDOW")) && e->format==32) + if(e->message_type==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLOSE_WINDOW")) && e->format==32) { ccmessage=this->mainClass->mainWindowClass->LFSWM2_getClientClass(this->mainClass->mainWindowClass->LFSWM2_getParentWindow(e->window)); if(ccmessage!=NULL) @@ -566,18 +566,18 @@ void LFSWM2_eventsClass::LFSWM2_doClientMsg(Window id,XClientMessageEvent *e) return; } - if((e->message_type==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("WM_CHANGE_STATE"))) && (e->format==32)) + if((e->message_type==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_CHANGE_STATE"))) && (e->format==32)) { if(e->data.l[0]==IconicState) { - this->mainClass->mainWindowClass->LFSWM2_addState(e->window,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); + this->mainClass->mainWindowClass->LFSWM2_addState(e->window,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN"))); this->mainClass->mainWindowClass->LFSWM2_reloadWindowState(e->window); this->mainClass->restackCnt++; return; } } - if(e->message_type==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")) && e->format==32) + if(e->message_type==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")) && e->format==32) { this->mainClass->LFSWM2_pushXErrorHandler(); @@ -594,7 +594,7 @@ Atom 0x2 name=SECONDARY data[4]=(nil) Atom (nil) name=(null) */ - if(e->data.l[1]==(long)this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))) + if(e->data.l[1]==(long)this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))) { this->mainClass->mainWindowClass->LFSWM2_changeState(id,e->data.l[0],e->data.l[1]); ccmessage=this->mainClass->mainWindowClass->LFSWM2_getClientClass(this->mainClass->mainWindowClass->LFSWM2_getParentWindow(id)); @@ -613,7 +613,7 @@ Atom (nil) name=(null) } ccmessage->onTop=true; ccmessage->onBottom=false; - this->mainClass->mainWindowClass->LFSWM2_changeState(ccmessage->contentWindow,NET_WM_STATE_REMOVE,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); + this->mainClass->mainWindowClass->LFSWM2_changeState(ccmessage->contentWindow,NET_WM_STATE_REMOVE,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); this->LFSWM2_moveToTop(ccmessage->contentWindow); this->mainClass->restackCnt++; } @@ -621,7 +621,7 @@ Atom (nil) name=(null) return; } - else if(e->data.l[1]==(long)this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))) + else if(e->data.l[1]==(long)this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))) { this->mainClass->mainWindowClass->LFSWM2_changeState(id,e->data.l[0],e->data.l[1]); ccmessage=this->mainClass->mainWindowClass->LFSWM2_getClientClass(this->mainClass->mainWindowClass->LFSWM2_getParentWindow(id)); @@ -640,7 +640,7 @@ Atom (nil) name=(null) } goto exitit; } - else if(e->data.l[1]==(long)this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN")) && e->format==32) + else if(e->data.l[1]==(long)this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN")) && e->format==32) { ccmessage=this->mainClass->mainWindowClass->LFSWM2_getClientClass(this->mainClass->mainWindowClass->LFSWM2_getParentWindow(e->window)); if(ccmessage!=NULL) @@ -703,7 +703,7 @@ void LFSWM2_eventsClass::LFSWM2_restack(void)//TODO// still dont like this code LFSWM2_clientClass *cc=NULL; int a=0; - v=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,&nitems_return); + v=(Atom*)this->mainClass->mainWindowClass->LFSWM2_getProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")),XA_WINDOW,&nitems_return); if((v!=NULL) && (v[0]!=None)) { @@ -711,7 +711,7 @@ void LFSWM2_eventsClass::LFSWM2_restack(void)//TODO// still dont like this code hs=this->mainClass->mainWindowClass->LFSWM2_getWindowHints(v[0]); if((hs.mHints!=NULL) && (hs.mHints->decorations==0)) { - this->mainClass->mainWindowClass->LFSWM2_removeProp(this->mainClass->rootWindow,this->mainClass->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")); + this->mainClass->mainWindowClass->LFSWM2_removeProp(this->mainClass->rootWindow,LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")); v[0]=0; } } @@ -803,7 +803,7 @@ void LFSWM2_eventsClass::LFSWM2_restack(void)//TODO// still dont like this code case DIALOGWINDOW: case TOOLWINDOW: //case UNKNOWNTYPE: - if(this->mainClass->mainWindowClass->LFSWM2_hasState(fromwl.at(j),this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW")))) + if(this->mainClass->mainWindowClass->LFSWM2_hasState(fromwl.at(j),this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW")))) { cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(fromwl.at(j)); if(cc!=NULL) @@ -812,7 +812,7 @@ void LFSWM2_eventsClass::LFSWM2_restack(void)//TODO// still dont like this code towlbelow.push_back(fromwl.at(j)); break; } - if(this->mainClass->mainWindowClass->LFSWM2_hasState(fromwl.at(j),this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE")))) + if(this->mainClass->mainWindowClass->LFSWM2_hasState(fromwl.at(j),this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE")))) { cc=this->mainClass->mainWindowClass->LFSWM2_getClientClass(fromwl.at(j)); if(cc!=NULL) @@ -878,9 +878,9 @@ void LFSWM2_eventsClass::LFSWM2_restack(void)//TODO// still dont like this code netclientwl.push_back(fromwl.at(j)); } } - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST")),XA_WINDOW,32,netclientwl.data(),netclientwl.size()); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST")),XA_WINDOW,32,netclientwl.data(),netclientwl.size()); -//this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")),XA_WINDOW,32,netclientwl.data(),netclientwl.size()); +//this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")),XA_WINDOW,32,netclientwl.data(),netclientwl.size()); // // for(int j=towl.size()-1;j>-1;j--) @@ -897,7 +897,7 @@ void LFSWM2_eventsClass::LFSWM2_restack(void)//TODO// still dont like this code netclientstackwl.push_back(towl.at(j)); } } - this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")),XA_WINDOW,32,netclientstackwl.data(),netclientstackwl.size()); + this->mainClass->mainWindowClass->LFSWM2_setProp(this->mainClass->rootWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")),XA_WINDOW,32,netclientstackwl.data(),netclientstackwl.size()); //XRestackWindows(this->mainClass->display,towl.data(),towl.size()); } diff --git a/LFSWM2/LFSWM2/src/lfswm2Class.cpp b/LFSWM2/LFSWM2/src/lfswm2Class.cpp index 96a26429..8ab87f76 100644 --- a/LFSWM2/LFSWM2/src/lfswm2Class.cpp +++ b/LFSWM2/LFSWM2/src/lfswm2Class.cpp @@ -31,8 +31,8 @@ const char *atomNames[]={"_NET_WM_WINDOW_TYPE_MENU","_NET_ACTIVE_WINDOW","_NET_C LFSWM2_Class::~LFSWM2_Class(void) { - this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST")),XA_WINDOW,32,NULL,0); - this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")),XA_WINDOW,32,NULL,0); + this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST")),XA_WINDOW,32,NULL,0); + this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")),XA_WINDOW,32,NULL,0); XftFontClose(this->display,this->frameFont); delete this->mainEventClass; @@ -118,7 +118,7 @@ LFSWM2_Class::LFSWM2_Class(int argc,char **argv) //set up atoms while(atomNames[cnt]!=NULL) { - this->atomshashed[this->prefs.LFSTK_hashFromKey(atomNames[cnt])]=XInternAtom(this->display,atomNames[cnt],false); + this->atomshashed[LFSTK_UtilityClass::LFSTK_hashFromKey(atomNames[cnt])]=XInternAtom(this->display,atomNames[cnt],false); cnt++; } @@ -159,24 +159,24 @@ LFSWM2_Class::LFSWM2_Class(int argc,char **argv) this->prefs.prefsMap= { - {this->prefs.LFSTK_hashFromKey("theme"),{TYPESTRING,"theme","",false,0}}, - {this->prefs.LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,6}}, - {this->prefs.LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,2}}, - {this->prefs.LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont","sans:size=14:bold",false,0}}, - {this->prefs.LFSTK_hashFromKey("titleposition"),{TYPEINT,"titleposition","",false,2}}, - {this->prefs.LFSTK_hashFromKey("titlebarsize"),{TYPEINT,"titlebarsize","",false,20}}, - {this->prefs.LFSTK_hashFromKey("leftsidebarsize"),{TYPEINT,"leftsidebarsize","",false,2}}, - {this->prefs.LFSTK_hashFromKey("ritesidebarsize"),{TYPEINT,"ritesidebarsize","",false,2}}, - {this->prefs.LFSTK_hashFromKey("bottombarsize"),{TYPEINT,"bottombarsize","",false,8}}, - {this->prefs.LFSTK_hashFromKey("framebg"),{TYPESTRING,"framebg","grey",false,15}}, - {this->prefs.LFSTK_hashFromKey("framefg"),{TYPESTRING,"framefg","white",false,0}}, - {this->prefs.LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, - {this->prefs.LFSTK_hashFromKey("forcedocksstack"),{TYPEINT,"forcedocksstack","",false,1}}, - {this->prefs.LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,10}}, - {this->prefs.LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, - {this->prefs.LFSTK_hashFromKey("resizemode"),{TYPEINT,"resizemode","",false,2}}, - {this->prefs.LFSTK_hashFromKey("modkeys"),{TYPEINT,"modkeys","",false,MOVEKEYS}}, - {this->prefs.LFSTK_hashFromKey("framealpha"),{TYPEINT,"framealpha","",false,0xff}} + {LFSTK_UtilityClass::LFSTK_hashFromKey("theme"),{TYPESTRING,"theme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("desktops"),{TYPEINT,"desktops","",false,6}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("placement"),{TYPEINT,"placement","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlefont"),{TYPESTRING,"titlefont","sans:size=14:bold",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titleposition"),{TYPEINT,"titleposition","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("titlebarsize"),{TYPEINT,"titlebarsize","",false,20}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("leftsidebarsize"),{TYPEINT,"leftsidebarsize","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("ritesidebarsize"),{TYPEINT,"ritesidebarsize","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("bottombarsize"),{TYPEINT,"bottombarsize","",false,8}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framebg"),{TYPESTRING,"framebg","grey",false,15}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framefg"),{TYPESTRING,"framefg","white",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("textcolour"),{TYPESTRING,"textcolour","black",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("forcedocksstack"),{TYPEINT,"forcedocksstack","",false,1}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("rescanprefs"),{TYPEINT,"rescanprefs","",false,10}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("usetheme"),{TYPEBOOL,"usetheme","",false,0}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("resizemode"),{TYPEINT,"resizemode","",false,2}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("modkeys"),{TYPEINT,"modkeys","",false,MOVEKEYS}}, + {LFSTK_UtilityClass::LFSTK_hashFromKey("framealpha"),{TYPEINT,"framealpha","",false,0xff}} }; this->prefsPath=getenv("HOME"); @@ -243,66 +243,66 @@ void LFSWM2_Class::LFSWM2_initRootWindow(void) //XSynchronize(this->display,true); std::vector globalAtoms= { - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CLOSE_WINDOW")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_DESKTOP_GEOMETRY")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_DESKTOP_VIEWPORT")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_FRAME_EXTENTS")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_NUMBER_OF_DESKTOPS")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_REQUEST_FRAME_EXTENTS")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_SUPPORTED")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_SUPPORTING_WM_CHECK")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_CHANGE_DESKTOP")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_CLOSE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_FULLSCREEN")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MINIMIZE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_HORZ")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_VERT")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_RESIZE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ALLOWED_ACTIONS")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_ICON_NAME")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_NAME")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_SKIP_TASKBAR")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_VISIBLE_ICON_NAME")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_VISIBLE_NAME")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WORKAREA")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DESKTOP")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_STICKY")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("WM_CHANGE_STATE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("WM_DELETE_WINDOW")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("WM_PROTOCOLS")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("WM_STATE")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_MOTIF_WM_HINTS")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_WM_NORMAL_HINTS")), - this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_XROOTPMAP_ID")) + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_ACTIVE_WINDOW")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLOSE_WINDOW")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_DESKTOP_GEOMETRY")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_DESKTOP_VIEWPORT")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_FRAME_EXTENTS")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_NUMBER_OF_DESKTOPS")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_REQUEST_FRAME_EXTENTS")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_SUPPORTED")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_SUPPORTING_WM_CHECK")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_CHANGE_DESKTOP")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_CLOSE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_FULLSCREEN")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MINIMIZE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_HORZ")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_VERT")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_RESIZE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ALLOWED_ACTIONS")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ICON_NAME")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_NAME")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_SKIP_TASKBAR")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_VISIBLE_ICON_NAME")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_VISIBLE_NAME")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DOCK")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WORKAREA")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_DESKTOP")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_STICKY")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_CHANGE_STATE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_DELETE_WINDOW")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_PROTOCOLS")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_STATE")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_WM_NORMAL_HINTS")), + this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_XROOTPMAP_ID")) }; - this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_SUPPORTED")),XA_ATOM,32,(void*)globalAtoms.data(),globalAtoms.size()); + this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_SUPPORTED")),XA_ATOM,32,(void*)globalAtoms.data(),globalAtoms.size()); long geometry[2]={this->displayWidth,this->displayHeight}; - this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_DESKTOP_GEOMETRY")),XA_CARDINAL,32,geometry,2); + this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_DESKTOP_GEOMETRY")),XA_CARDINAL,32,geometry,2); - this->mainWindowClass->LFSWM2_removeProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST"))); - this->mainWindowClass->LFSWM2_removeProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING"))); + this->mainWindowClass->LFSWM2_removeProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST"))); + this->mainWindowClass->LFSWM2_removeProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CLIENT_LIST_STACKING"))); // Finally create the WM_CHECK window to announce our EWMH support. wmCheckWin=XCreateWindow(this->display,this->rootWindow,0,0,1,1,0,CopyFromParent,InputOnly,CopyFromParent,0,NULL); - this->mainWindowClass->LFSWM2_setProp(this->wmCheckWin,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_SUPPORTING_WM_CHECK")),XA_WINDOW,32,&wmCheckWin,1); - this->mainWindowClass->LFSWM2_setProp(this->wmCheckWin,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_WM_NAME")),this->atomshashed.at(this->prefs.LFSTK_hashFromKey("UTF8_STRING")),8,(void*)PACKAGE_NAME,strlen(PACKAGE_NAME)); - this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_SUPPORTING_WM_CHECK")),XA_WINDOW,32,&wmCheckWin,1); + this->mainWindowClass->LFSWM2_setProp(this->wmCheckWin,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_SUPPORTING_WM_CHECK")),XA_WINDOW,32,&wmCheckWin,1); + this->mainWindowClass->LFSWM2_setProp(this->wmCheckWin,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_NAME")),this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("UTF8_STRING")),8,(void*)PACKAGE_NAME,strlen(PACKAGE_NAME)); + this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_SUPPORTING_WM_CHECK")),XA_WINDOW,32,&wmCheckWin,1); // fprintf(stderr,"wmCheckWin=%p\n",wmCheckWin); XSync(this->display,true); } @@ -464,7 +464,7 @@ void LFSWM2_Class::LFSWM2_setDeskCount(unsigned long val) if (val==0||val>=0xffffffffUL) return; - this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_NUMBER_OF_DESKTOPS")),XA_CARDINAL,32,&val,1); + this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_NUMBER_OF_DESKTOPS")),XA_CARDINAL,32,&val,1); this->numberOfDesktops=val; } @@ -472,7 +472,7 @@ void LFSWM2_Class::LFSWM2_setCurrentDesktop(unsigned long i,bool force,bool dovi { if((this->currentDesktop!=i) || (force==true)) { - this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,32,&i,1); + this->mainWindowClass->LFSWM2_setProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,32,&i,1); this->currentDesktop=i; if(dovis==true) this->mainWindowClass->LFSWM2_setVisibilityForDesk(this->currentDesktop); @@ -484,7 +484,7 @@ void LFSWM2_Class::LFSWM2_setCurrentDesktopFromRoot(void) Atom *v=NULL; long unsigned int n; - v=(Atom*)this->mainWindowClass->LFSWM2_getProp(this->rootWindow,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,&n); + v=(Atom*)this->mainWindowClass->LFSWM2_getProp(this->rootWindow,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_CURRENT_DESKTOP")),XA_CARDINAL,&n); if(v!=NULL) { this->LFSWM2_setCurrentDesktop((long unsigned int)v[0]); @@ -789,7 +789,7 @@ void LFSWM2_Class::DEBUG_printHintsDataStruct(Window wid) motifHints *hints=NULL; long unsigned int nitems_return=0; - hints=(motifHints*)this->mainWindowClass->LFSWM2_getProp(wid,this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_MOTIF_WM_HINTS")),this->atomshashed.at(this->prefs.LFSTK_hashFromKey("_MOTIF_WM_HINTS")),&nitems_return); + hints=(motifHints*)this->mainWindowClass->LFSWM2_getProp(wid,this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")),this->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")),&nitems_return); hs=this->mainWindowClass->LFSWM2_getWindowHints(wid); diff --git a/LFSWM2/LFSWM2/src/windowsClass.cpp b/LFSWM2/LFSWM2/src/windowsClass.cpp index 17b9f451..75264962 100644 --- a/LFSWM2/LFSWM2/src/windowsClass.cpp +++ b/LFSWM2/LFSWM2/src/windowsClass.cpp @@ -136,12 +136,12 @@ bool LFSWM2_windowClass::LFSWM2_createUnframedWindow(Window wid) // switch(this->mainClass->forceDockStackingOrder) // { // case FORCEABOVE: -// this->LFSWM2_removeProp(wid,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); -// this->LFSWM2_addState(wid,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); +// this->LFSWM2_removeProp(wid,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); +// this->LFSWM2_addState(wid,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); // break; // case FORCEBELOW: -// this->LFSWM2_removeProp(wid,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); -// this->LFSWM2_addState(wid,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); +// this->LFSWM2_removeProp(wid,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))); +// this->LFSWM2_addState(wid,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))); // break; // default: // break; @@ -182,7 +182,7 @@ bool LFSWM2_windowClass::LFSWM2_createClient(Window id,hintsDataStruct premaphs) int thisdesk=-1; bool noborder=false; - setdesktop=(long int*)this->mainClass->mainWindowClass->LFSWM2_getProp(id,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,&nitems_return); + setdesktop=(long int*)this->mainClass->mainWindowClass->LFSWM2_getProp(id,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,&nitems_return); if(setdesktop!=NULL) { @@ -259,14 +259,14 @@ bool LFSWM2_windowClass::LFSWM2_createClient(Window id,hintsDataStruct premaphs) } } - allowed=(Atom*)this->LFSWM2_getProp(id,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ALLOWED_ACTIONS")),XA_ATOM,&nitems_return); + allowed=(Atom*)this->LFSWM2_getProp(id,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ALLOWED_ACTIONS")),XA_ATOM,&nitems_return); if(allowed!=NULL) { for(long unsigned int j=0;jmainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_HORZ"))) || (allowed[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_VERT")))) + if((allowed[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_HORZ"))) || (allowed[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_VERT")))) cc->canMaximize=true; - if(allowed[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MINIMIZE"))) + if(allowed[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MINIMIZE"))) cc->canMinimize=true; } XFree(allowed); @@ -286,7 +286,7 @@ bool LFSWM2_windowClass::LFSWM2_createClient(Window id,hintsDataStruct premaphs) // Atom xa_prop[1]; // xa=XInternAtom(this->mainClass->display,"_NET_WM_WINDOW_TYPE",False); -// xa_prop[0]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); +// xa_prop[0]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE_NORMAL")); // if(xa!=None) // XChangeProperty(this->mainClass->display,id,xa,XA_ATOM,32,PropModeReplace,(unsigned char *)&xa_prop,1); @@ -372,34 +372,34 @@ bool LFSWM2_windowClass::LFSWM2_createClient(Window id,hintsDataStruct premaphs) Atom v[8]; int vcnt=3; - v[0]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_CHANGE_DESKTOP")); - v[1]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_CLOSE")); - v[2]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_FULLSCREEN")); + v[0]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_CHANGE_DESKTOP")); + v[1]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_CLOSE")); + v[2]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_FULLSCREEN")); if(cc->canMaximize==true) { - v[vcnt++]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_HORZ")); - v[vcnt++]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_VERT")); + v[vcnt++]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_HORZ")); + v[vcnt++]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MAXIMIZE_VERT")); } if(cc->canMinimize==true) { - v[vcnt++]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_MINIMIZE")); + v[vcnt++]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_MINIMIZE")); } if(cc->canResize==true) { - v[vcnt++]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_RESIZE")); + v[vcnt++]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_RESIZE")); } if(cc->canClose==true) { - v[vcnt++]=this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ACTION_CLOSE")); + v[vcnt++]=this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ACTION_CLOSE")); } cc->onDesk=thisdesk; - this->LFSWM2_setProp(id,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_ALLOWED_ACTIONS")),XA_ATOM,32,v,vcnt); - this->LFSWM2_setProp(cc->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,(void*)&cc->onDesk,1); + this->LFSWM2_setProp(id,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_ALLOWED_ACTIONS")),XA_ATOM,32,v,vcnt); + this->LFSWM2_setProp(cc->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,(void*)&cc->onDesk,1); this->LFSWM2_setClientList(id,true); if(cc->canResize==true) @@ -494,7 +494,7 @@ bool LFSWM2_windowClass::LFSWM2_createClient(Window id,hintsDataStruct premaphs) cc->controlCnt++; } //shade - if((this->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey("shade-active")]==true) || (this->mainClass->useTheme==false)) + if((this->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey("shade-active")]==true) || (this->mainClass->useTheme==false)) { cc->shadeControlStruct.controlName="shade"; cc->canShade=true; @@ -508,13 +508,13 @@ bool LFSWM2_windowClass::LFSWM2_createClient(Window id,hintsDataStruct premaphs) cc->LFSWM2_setWindowName(); unsigned long n=0; - Atom *states=(Atom*)this->LFSWM2_getFullProp(id,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,&n); + Atom *states=(Atom*)this->LFSWM2_getFullProp(id,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,&n); //check no longer maxed for(long unsigned j=0;jmainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))) || (states[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ")))) + if((states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))) || (states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ")))) cc->isMaximized=true; - if(states[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_STICKY"))) + if(states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_STICKY"))) cc->visibleOnAllDesks=true; } @@ -563,7 +563,7 @@ int LFSWM2_windowClass::LFSWM2_getWindowType(Window id) unsigned long dl; int retval=UNKNOWNTYPE; - status=XGetWindowProperty(this->mainClass->display,id,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")),0L,sizeof (Atom),false,XA_ATOM,&da,&di,&dl,&dl,&propret); + status=XGetWindowProperty(this->mainClass->display,id,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_WINDOW_TYPE")),0L,sizeof (Atom),false,XA_ATOM,&da,&di,&dl,&dl,&propret); /* "_NET_WM_WINDOW_TYPE_NORMAL" "_NET_WM_WINDOW_TYPE_DESKTOP" @@ -695,7 +695,7 @@ void LFSWM2_windowClass::LFSWM2_reloadWindowState(Window id) return; } - Atom *states=(Atom*)this->LFSWM2_getFullProp(id,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,&n); + Atom *states=(Atom*)this->LFSWM2_getFullProp(id,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,&n); cc->onTop=false; cc->onBottom=false; cc->visible=true; @@ -703,19 +703,19 @@ void LFSWM2_windowClass::LFSWM2_reloadWindowState(Window id) for(long unsigned j=0;jmainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))|| states[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))) + if(states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_VERT"))|| states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_MAXIMIZED_HORZ"))) maxit=true; - if(states[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")))//TODO//about boxes + if(states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_HIDDEN")))//TODO//about boxes { cc->visible=false; cc->isHidden=true; ishidden=true; } - if(states[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))) + if(states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_BELOW"))) cc->onBottom=true; - if(states[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))) + if(states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_ABOVE"))) cc->onTop=true; - if(states[j]==this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))) + if(states[j]==this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE_FULLSCREEN"))) isfull=true; } @@ -761,7 +761,7 @@ bool LFSWM2_windowClass::LFSWM2_hasState(Window w,Atom state) { unsigned long n=0; bool found=false; - Atom *v=(Atom*)this->LFSWM2_getProp(w,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,&n); + Atom *v=(Atom*)this->LFSWM2_getProp(w,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,&n); for(unsigned long i=0;imainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,&n); + Atom *old=(Atom*)LFSWM2_getProp(w,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,&n); for(unsigned long i=0;iLFSWM2_setProp(w,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,mynew,n+1); + this->LFSWM2_setProp(w,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,mynew,n+1); free(mynew); } @@ -833,7 +833,7 @@ void LFSWM2_windowClass::LFSWM2_removeProp(Window w,Atom state) { unsigned long n=0; unsigned long k=0; - Atom *v=(Atom*)LFSWM2_getProp(w,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,&n); + Atom *v=(Atom*)LFSWM2_getProp(w,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,&n); if(v==NULL) return; @@ -844,7 +844,7 @@ void LFSWM2_windowClass::LFSWM2_removeProp(Window w,Atom state) v[k++]=v[i]; } - this->LFSWM2_setProp(w,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,v,k); + this->LFSWM2_setProp(w,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_STATE")),XA_ATOM,32,v,k); if(v!=NULL) XFree(v); @@ -892,7 +892,7 @@ void LFSWM2_windowClass::LFSWM2_setClientList(Window id,bool addwindow) void LFSWM2_windowClass::LFSWM2_setWindowState(Window w,long state) { long data[2]={state,None}; - XChangeProperty(this->mainClass->display,w,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("WM_STATE")),this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("WM_STATE")),32,PropModeReplace,(unsigned char *)data,2); + XChangeProperty(this->mainClass->display,w,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_STATE")),this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("WM_STATE")),32,PropModeReplace,(unsigned char *)data,2); } void LFSWM2_windowClass::LFSWM2_setVisibilityForDesk(unsigned long desk) @@ -910,7 +910,7 @@ void LFSWM2_windowClass::LFSWM2_setVisibilityForDesk(unsigned long desk) if(cc->visibleOnAllDesks==true) { cc->onDesk=desk; - this->LFSWM2_setProp(cc->contentWindow,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&cc->onDesk,1); + this->LFSWM2_setProp(cc->contentWindow,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_NET_WM_DESKTOP")),XA_CARDINAL,32,&cc->onDesk,1); } if(cc->onDesk==desk) cc->LFSWM2_showWindow(true); @@ -961,7 +961,7 @@ hintsDataStruct LFSWM2_windowClass::LFSWM2_getWindowHints(Window wid,bool movewi hints.pt.x-=this->mainClass->leftSideBarSize; } - hints.mHints=(motifHints*)this->mainClass->mainWindowClass->LFSWM2_getProp(wid,this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_MOTIF_WM_HINTS")),this->mainClass->atomshashed.at(this->mainClass->prefs.LFSTK_hashFromKey("_MOTIF_WM_HINTS")),&nitems_return); + hints.mHints=(motifHints*)this->mainClass->mainWindowClass->LFSWM2_getProp(wid,this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")),this->mainClass->atomshashed.at(LFSTK_UtilityClass::LFSTK_hashFromKey("_MOTIF_WM_HINTS")),&nitems_return); if(this->mainClass->runLevel!=RL_STARTUP && ( (hints.sh->flags & (USPosition|PPosition))==0)) { @@ -1187,11 +1187,11 @@ void LFSWM2_windowClass::LFSWM2_loadTheme(std::string themename) while(themePartNames[cnt]!=NULL) { - this->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=false; - this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=0; - this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=0; - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=0; - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=0; + this->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=false; + this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=0; + this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=0; + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=0; + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=0; cnt++; } @@ -1222,20 +1222,20 @@ void LFSWM2_windowClass::LFSWM2_loadTheme(std::string themename) if(image!=NULL) { - this->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=true; + this->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=true; imlib_context_set_image(image); hite=imlib_image_get_height(); - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=imlib_image_get_width(); + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=imlib_image_get_width(); if(hite>this->theme.titleBarHeight) this->theme.titleBarHeight=hite; - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=hite; + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=hite; imlib_context_set_drawable(this->mainClass->rootWindow); imlib_image_set_has_alpha(1); #if 0 Pixmap picn; - //imlib_render_pixmaps_for_whole_image(&picn,&this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]); + //imlib_render_pixmaps_for_whole_image(&picn,&this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]); imlib_free_image(); imlib_image_decache_file (filepath.c_str()) ; Imlib_Image imagef; @@ -1259,8 +1259,8 @@ imlib_image_copy_alpha_to_image( img3, 0, 0 ); Pixmap pic1; Pixmap mask1; #endif -//imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])],&mask1); -imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])],&this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]); +//imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])],&mask1); +imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])],&this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]); imlib_free_image(); imlib_image_decache_file (filepath.c_str()) ; /* @@ -1277,17 +1277,17 @@ Pixmap mask1; - // imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])],&this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]); + // imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])],&this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]); //imlib_render_pixmaps_for_whole_image(&pic1,&mask1); //Pixmap pic2=pic1; //Pixmap mask2=mask1; //imlib_free_pixmap_and_mask(pic1); // -// Imlib_Image img3= imlib_create_image(this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])] ); +// Imlib_Image img3= imlib_create_image(this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])] ); //imlib_context_set_image( img3 ); //imlib_image_set_has_alpha( 1 ); //imlib_context_set_color( 0, 0, 0, 150 ); -//imlib_image_fill_rectangle( 0, 0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])], this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])] ); +//imlib_image_fill_rectangle( 0, 0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])], this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])] ); imlib_context_set_image( image ); imlib_image_set_has_alpha( 1 ); @@ -1295,38 +1295,38 @@ imlib_context_set_color( 0, 0, 0, 10 ); imlib_image_copy_alpha_to_image( image, 0, 0 ); //Pixmap pn; -//XFreePixmap(this->mainClass->display,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]); +//XFreePixmap(this->mainClass->display,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]); //XSync(this->mainClass->display,false); //imlib_render_pixmaps_for_whole_image(&ppic,&pn1); - imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])],&this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]); -//this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=ppic; -//this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=pn1; + imlib_render_pixmaps_for_whole_image(&this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])],&this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]); +//this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=ppic; +//this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=pn1; */ } else { - this->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=false; - this->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=false; - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=0; - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]=0; + this->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=false; + this->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=false; + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=0; + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]=0; } // std::cerr<theme.gotPart[themePartNames[cnt]]<theme.partsWidth[themePartNames[cnt]]<theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]<theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]<<" "<theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(themePartNames[cnt])]<theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]<theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]<<" "<theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(themePartNames[cnt])]<theme.leftWidth=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("left-active")]; - this->theme.rightWidth=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("right-active")]; - this->theme.titleBarHeight=this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("title-3-active")]; - this->theme.bottomHeight=this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("bottom-active")]; + this->theme.leftWidth=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("left-active")]; + this->theme.rightWidth=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("right-active")]; + this->theme.titleBarHeight=this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("title-3-active")]; + this->theme.bottomHeight=this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-active")]; - this->theme.middleOffset=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("top-left-active")]; - this->theme.middleAdjust=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("top-right-active")]+this->theme.middleOffset; + this->theme.middleOffset=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("top-left-active")]; + this->theme.middleAdjust=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("top-right-active")]+this->theme.middleOffset; this->mainClass->titleBarSize=this->theme.titleBarHeight; this->mainClass->bottomBarSize=this->theme.bottomHeight; @@ -1334,16 +1334,16 @@ imlib_image_copy_alpha_to_image( image, 0, 0 ); this->mainClass->riteSideBarSize=this->theme.rightWidth; //TODO// - this->theme.closeButtonSize=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("close-active")]; + this->theme.closeButtonSize=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("close-active")]; this->theme.buttonXSpacing=2; - this->theme.buttonOffset=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("right-active")]; - this->mainClass->controlSize=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("close-active")]; - this->theme.buttonYOffset=(this->theme.titleBarHeight/2)-(this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("close-active")]/2); + this->theme.buttonOffset=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("right-active")]; + this->mainClass->controlSize=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("close-active")]; + this->theme.buttonYOffset=(this->theme.titleBarHeight/2)-(this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("close-active")]/2); this->mainClass->buttonYOffset=this->theme.buttonYOffset; //std::cerr<theme.buttonYOffset<theme.titleBarHeight/2)<theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("close-active")]/2)<theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("close-active")]/2)<mainClass->lfstkLib->LFSTK_grepInFile(this->theme.pathToTheme+"/xfwm4/themerc","title_alignment"); @@ -1426,63 +1426,63 @@ void LFSWM2_windowClass::LFSWM2_refreshThemeFrame(LFSWM2_clientClass *cc) //left side fullpartname="left"+activepart; XSetTSOrigin(this->mainClass->display,pmgc,0,0); - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XFillRectangle(this->mainClass->display,pm,pmgc,0,this->theme.titleBarHeight,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XFillRectangle(this->mainClass->display,pm,pmgc,0,this->theme.titleBarHeight,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); XSetTSOrigin(this->mainClass->display,maskgc,0,0); - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XFillRectangle(this->mainClass->display,mask,maskgc,0,this->theme.titleBarHeight,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XFillRectangle(this->mainClass->display,mask,maskgc,0,this->theme.titleBarHeight,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); //rite side fullpartname="right"+activepart; - XSetTSOrigin(this->mainClass->display,pmgc,cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight);//TODO// - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XFillRectangle(this->mainClass->display,pm,pmgc,cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); + XSetTSOrigin(this->mainClass->display,pmgc,cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight);//TODO// + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XFillRectangle(this->mainClass->display,pm,pmgc,cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); - XSetTSOrigin(this->mainClass->display,maskgc,cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight);//TODO// - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XFillRectangle(this->mainClass->display,mask,maskgc,cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); + XSetTSOrigin(this->mainClass->display,maskgc,cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight);//TODO// + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XFillRectangle(this->mainClass->display,mask,maskgc,cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.titleBarHeight,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.titleBarHeight-this->theme.bottomHeight); //bottom fullpartname="bottom"+activepart; - XSetTSOrigin(this->mainClass->display,pmgc,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XFillRectangle(this->mainClass->display,pm,pmgc,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("bottom-left-active")],cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("bottom-right-active")]-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("bottom-left-active")],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTSOrigin(this->mainClass->display,pmgc,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XFillRectangle(this->mainClass->display,pm,pmgc,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-left-active")],cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-right-active")]-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-left-active")],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); - XSetTSOrigin(this->mainClass->display,maskgc,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("bottom-left-active")],cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XFillRectangle(this->mainClass->display,mask,maskgc,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("bottom-left-active")],cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("bottom-right-active")]-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("bottom-left-active")],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTSOrigin(this->mainClass->display,maskgc,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-left-active")],cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XFillRectangle(this->mainClass->display,mask,maskgc,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-left-active")],cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-right-active")]-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("bottom-left-active")],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); //bottom left fullpartname="bottom-left"+activepart; - XCopyArea(this->mainClass->display,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],0,cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XCopyArea(this->mainClass->display,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],0,cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); - XCopyArea(this->mainClass->display,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],0,cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XCopyArea(this->mainClass->display,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],0,cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); //botttom rite fullpartname="bottom-right"+activepart; - XSetClipOrigin(this->mainClass->display,pmgc,cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); - XCopyArea(this->mainClass->display,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetClipOrigin(this->mainClass->display,pmgc,cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); + XCopyArea(this->mainClass->display,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); - XCopyArea(this->mainClass->display,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XCopyArea(this->mainClass->display,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.h-this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); //titlebar tr=cc->setTitlePosition(); - startx=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("top-left"+activepart)]; + startx=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("top-left"+activepart)]; if(this->theme.fullWidthTitle==false) { part3w=tr.w; - part2w=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("title-2-active")]; - part4w=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("title-4-active")]; + part2w=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("title-2-active")]; + part4w=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("title-4-active")]; part1w=tr.x-part2w; part5w=r.w-(tr.x+tr.w+part4w); } else { - part1w=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("title-1-active")]+this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("top-left-active")]+this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("top-left-active")]; - part2w=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("title-2-active")]; - part4w=this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("title-4-active")]; + part1w=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("title-1-active")]+this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("top-left-active")]+this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("top-left-active")]; + part2w=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("title-2-active")]; + part4w=this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("title-4-active")]; part3w=r.w-(part1w+part2w+part4w+cc->riteButtonsWidth+19); part5w=r.w-(part3w); } @@ -1490,69 +1490,69 @@ void LFSWM2_windowClass::LFSWM2_refreshThemeFrame(LFSWM2_clientClass *cc) //left title fullpartname="title-1"+activepart; XSetTSOrigin(this->mainClass->display,pmgc,0,0); - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,pm,pmgc,startx,0,part1w,this->mainClass->titleBarSize); XSetTSOrigin(this->mainClass->display,maskgc,startx,0); - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,mask,maskgc,startx,0,part1w,this->mainClass->titleBarSize); startx+=part1w; //left mid title fullpartname="title-2"+activepart; XSetTSOrigin(this->mainClass->display,pmgc,startx,0); - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,pm,pmgc,startx,0,part2w,this->mainClass->titleBarSize); XSetTSOrigin(this->mainClass->display,maskgc,startx,0); - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,mask,maskgc,startx,0,part2w,this->mainClass->titleBarSize); startx+=part2w; //middle fullpartname="title-3"+activepart; XSetTSOrigin(this->mainClass->display,pmgc,startx,0); - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,pm,pmgc,startx,0,part3w,this->mainClass->titleBarSize); XSetTSOrigin(this->mainClass->display,maskgc,startx,0); - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,mask,maskgc,startx,0,part3w,this->mainClass->titleBarSize); startx+=part3w; //right mid title fullpartname="title-4"+activepart; XSetTSOrigin(this->mainClass->display,pmgc,startx,0); - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,pm,pmgc,startx,0,part4w,this->mainClass->titleBarSize); XSetTSOrigin(this->mainClass->display,maskgc,startx,0); - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,mask,maskgc,startx,0,part4w,this->mainClass->titleBarSize); startx+=part4w; //right title fullpartname="title-5"+activepart; XSetTSOrigin(this->mainClass->display,pmgc,startx,0); - XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,pmgc,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,pm,pmgc,startx,0,part5w,this->mainClass->titleBarSize); XSetTSOrigin(this->mainClass->display,maskgc,startx,0); - XSetTile(this->mainClass->display,maskgc,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)]); + XSetTile(this->mainClass->display,maskgc,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)]); XFillRectangle(this->mainClass->display,mask,maskgc,startx,0,part5w,this->mainClass->titleBarSize); startx+=part4w; //top left fullpartname="top-left"+activepart; - XCopyArea(this->mainClass->display,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],0,0); + XCopyArea(this->mainClass->display,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],0,0); - XCopyArea(this->mainClass->display,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],0,0); + XCopyArea(this->mainClass->display,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],0,0); //top rite fullpartname="top-right"+activepart; - XCopyArea(this->mainClass->display,this->theme.pixmaps[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],0); + XCopyArea(this->mainClass->display,this->theme.pixmaps[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],pm,pmgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],0); - XCopyArea(this->mainClass->display,this->theme.masks[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(fullpartname)],0); + XCopyArea(this->mainClass->display,this->theme.masks[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],mask,maskgc,0,0,this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],cc->frameWindowRect.w-this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(fullpartname)],0); XSetForeground(this->mainClass->display,pmgc,this->mainClass->frameText->pixel); XftDrawChange(this->mainClass->frameText->draw,pm); @@ -1560,8 +1560,8 @@ void LFSWM2_windowClass::LFSWM2_refreshThemeFrame(LFSWM2_clientClass *cc) if(cc->name.length()>0) { r=cc->setTitlePosition(); - if(this->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey("title-2"+activepart)]==true) - r.x=r.x+(this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("title-2"+activepart)]/2); + if(this->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey("title-2"+activepart)]==true) + r.x=r.x+(this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("title-2"+activepart)]/2); if(cc->nameIsUTF==true) XftDrawStringUtf8(this->mainClass->frameText->draw,&(this->mainClass->frameText->color),this->mainClass->frameFont,r.x,r.y,(XftChar8*)cc->name.c_str(),strlen(cc->name.c_str())); else @@ -1599,10 +1599,10 @@ void LFSWM2_windowClass::LFSWM2_setControlRects(LFSWM2_clientClass *cc) { cc->menuControlStruct.controlRect= { - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("top-left-active")], + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("top-left-active")], this->mainClass->buttonYOffset, - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("menu-active")], - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("menu-active")] + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("menu-active")], + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("menu-active")] }; } else @@ -1627,13 +1627,13 @@ void LFSWM2_windowClass::LFSWM2_setControlRects(LFSWM2_clientClass *cc) { if(this->mainClass->useTheme==true) { - offset=this->theme.buttonOffset+this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("close-active")]+this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("right-active")]; + offset=this->theme.buttonOffset+this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("close-active")]+this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("right-active")]; cc->closeControlStruct.controlRect= { cc->frameWindowRect.w-offset, this->mainClass->buttonYOffset, - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("close-active")], - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("close-active")] + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("close-active")], + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("close-active")] }; } else @@ -1660,13 +1660,13 @@ void LFSWM2_windowClass::LFSWM2_setControlRects(LFSWM2_clientClass *cc) { if(this->mainClass->useTheme==true) { - offset+=this->theme.buttonXSpacing+this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("maximize-active")]; + offset+=this->theme.buttonXSpacing+this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("maximize-active")]; cc->maximizeControlStruct.controlRect= { cc->frameWindowRect.w-offset, this->mainClass->buttonYOffset, - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("maximize-active")], - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("maximize-active")] + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("maximize-active")], + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("maximize-active")] }; } else @@ -1693,13 +1693,13 @@ void LFSWM2_windowClass::LFSWM2_setControlRects(LFSWM2_clientClass *cc) { if(this->mainClass->useTheme==true) { - offset+=this->theme.buttonXSpacing+this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("hide-active")]; + offset+=this->theme.buttonXSpacing+this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("hide-active")]; cc->minimizeControlStruct.controlRect= { cc->frameWindowRect.w-offset, this->mainClass->buttonYOffset, - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("hide-active")], - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("hide-active")] + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("hide-active")], + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("hide-active")] }; } else @@ -1723,18 +1723,18 @@ void LFSWM2_windowClass::LFSWM2_setControlRects(LFSWM2_clientClass *cc) //shade cc->canShade=false; - if((this->theme.gotPart[this->mainClass->prefs.LFSTK_hashFromKey("shade-active")]==true) || (this->mainClass->useTheme==false)) + if((this->theme.gotPart[LFSTK_UtilityClass::LFSTK_hashFromKey("shade-active")]==true) || (this->mainClass->useTheme==false)) { cc->canShade=true; if(this->mainClass->useTheme==true) { - offset+=this->theme.buttonXSpacing+this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("hide-active")]; + offset+=this->theme.buttonXSpacing+this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("hide-active")]; cc->shadeControlStruct.controlRect= { cc->frameWindowRect.w-offset, this->mainClass->buttonYOffset, - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey("shade-active")], - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey("shade-active")] + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey("shade-active")], + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey("shade-active")] }; } else @@ -1761,10 +1761,10 @@ void LFSWM2_windowClass::LFSWM2_setControlRects(LFSWM2_clientClass *cc) void LFSWM2_windowClass::LFSWM2_setControlRect(Window wid,controlData *data,std::string xname,std::string yname,std::string wname,std::string hname) { data->controlRect={ - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(xname)], - (this->mainClass->titleBarSize/2)-(this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(hname)]/2), - this->theme.partsWidth[this->mainClass->prefs.LFSTK_hashFromKey(wname)], - this->theme.partsHeight[this->mainClass->prefs.LFSTK_hashFromKey(hname)]}; + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(xname)], + (this->mainClass->titleBarSize/2)-(this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(hname)]/2), + this->theme.partsWidth[LFSTK_UtilityClass::LFSTK_hashFromKey(wname)], + this->theme.partsHeight[LFSTK_UtilityClass::LFSTK_hashFromKey(hname)]}; XMoveResizeWindow(this->mainClass->display,wid, data->controlRect.x, diff --git a/LFSWManager/LFSWManager/src/main.cpp b/LFSWManager/LFSWManager/src/main.cpp index 56b299c2..15ae017b 100644 --- a/LFSWManager/LFSWManager/src/main.cpp +++ b/LFSWManager/LFSWManager/src/main.cpp @@ -545,7 +545,7 @@ int main(int argc,char *argv[]) lfstkLib=new LFSTK_lib(false); - prefsfile=lfstkLib->LFSTK_oneLiner("sed -n '2p' \"%s/.config/LFS/lfsappearance.rc\"",getenv("HOME")); + prefsfile=strdup((lfstkLib->LFSTK_oneLiner("sed -n '2p' \"%s/.config/LFS/lfsappearance.rc\"",getenv("HOME"))).c_str()); key=atoi(prefsfile); ndesk=numberOfDesktops;