Fixed resources

This commit is contained in:
fluxgen 2002-01-20 02:17:23 +00:00
parent aaa0c6d078
commit 6ea3678d02
2 changed files with 201 additions and 124 deletions

View file

@ -99,6 +99,8 @@
#endif // FONT_ELEMENT_SIZE #endif // FONT_ELEMENT_SIZE
#include <iostream> #include <iostream>
#include <memory>
using namespace std; using namespace std;
static Bool running = True; static Bool running = True;
@ -125,15 +127,113 @@ static int dcmp(const void *one, const void *two) {
return (strcmp((*(char **) one), (*(char **) two))); return (strcmp((*(char **) one), (*(char **) two)));
} }
BScreen::BScreen(Fluxbox *b, int scrn) : ScreenInfo(b, scrn), //---------- resource manipulators ---------
rootcommand("") template<>
void Resource<Tab::Alignment>::
setFromString(const char *strval) {
m_value = Tab::getTabAlignmentNum(strval);
}
template<>
void Resource<Tab::Placement>::
setFromString(const char *strval) {
m_value = Tab::getTabPlacementNum(strval);
}
template<>
void Resource<Toolbar::Placement>::
setFromString(const char *strval) {
if (strcasecmp(strval, "TopLeft")==0)
m_value = Toolbar::TOPLEFT;
else if (strcasecmp(strval, "BottomLeft")==0)
m_value = Toolbar::BOTTOMLEFT;
else if (strcasecmp(strval, "TopCenter")==0)
m_value = Toolbar::TOPCENTER;
else if (strcasecmp(strval, "BottomCenter")==0)
m_value = Toolbar::BOTTOMCENTER;
else if (strcasecmp(strval, "TopRight")==0)
m_value = Toolbar::TOPRIGHT;
else if (strcasecmp(strval, "BottomRight")==0)
m_value = Toolbar::BOTTOMRIGHT;
else
setDefaultValue();
}
//--------- resource accessors --------------
template<>
string Resource<Tab::Alignment>::
getString() {
return Tab::getTabAlignmentString(m_value);
}
template<>
string Resource<Tab::Placement>::
getString() {
return Tab::getTabPlacementString(m_value);
}
template<>
string Resource<Toolbar::Placement>::
getString() {
switch (m_value) {
case Toolbar::TOPLEFT:
return string("TopLeft");
break;
case Toolbar::BOTTOMLEFT:
return string("BottomLeft");
break;
case Toolbar::TOPCENTER:
return string("TopCenter");
break;
case Toolbar::BOTTOMCENTER:
return string("BottomCenter");
break;
case Toolbar::TOPRIGHT:
return string("TopRight");
break;
case Toolbar::BOTTOMRIGHT:
return string("BottomRight");
break;
}
//default string
return string("BottomCenter");
}
BScreen::ScreenResource::ScreenResource(ResourceManager &rm,
const std::string &scrname, const std::string &altscrname):
toolbar_on_top(rm, false, scrname+".toolbar.onTop", altscrname+".Toolbar.OnTop"),
toolbar_auto_hide(rm, false, scrname+".toolbar.autoHide", altscrname+".Toolbar.AutoHide"),
image_dither(rm, false, scrname+".imageDither", altscrname+".ImageDither"),
opaque_move(rm, false, "session.opaqueMove", "Session.OpaqueMove"),
full_max(rm, true, scrname+".fullMaximization", altscrname+".FullMaximization"),
max_over_slit(rm, true, scrname+".maxOverSlit",altscrname+".MaxOverSlit"),
tab_rotate_vertical(rm, true, scrname+".tab.rotatevertical", altscrname+".Tab.RotateVertical"),
sloppy_window_grouping(rm, true, scrname+".sloppywindowgrouping", altscrname+".SloppyWindowGrouping"),
rootcommand(rm, "", scrname+".rootCommand", altscrname+".RootCommand"),
workspaces(rm, 1, scrname+".workspaces", altscrname+".Workspaces"),
toolbar_width_percent(rm, 65, scrname+".toolbar.widthPercent", altscrname+".Toolbar.WidthPercent"),
edge_snap_threshold(rm, 0, scrname+".edgeSnapThreshold", altscrname+".EdgeSnapThreshold"),
tab_width(rm, 64, scrname+".tab.width", altscrname+".Tab.Width"),
tab_height(rm, 16, scrname+".tab.height", altscrname+".Tab.Height"),
tab_placement(rm, Tab::PTOP, scrname+".tab.placement", altscrname+".Tab.Placement"),
tab_alignment(rm, Tab::ALEFT, scrname+".tab.alignment", altscrname+".Tab.Alignment"),
toolbar_placement(rm, Toolbar::BOTTOMCENTER, scrname+".toolbar.placement", altscrname+".Toolbar.Placement")
{
};
BScreen::BScreen(ResourceManager &rm, Fluxbox *b,
const string &screenname, const string &altscreenname,
int scrn) : ScreenInfo(b, scrn),
theme(0),
resource(rm, screenname, altscreenname)
{ {
theme = 0;
fluxbox = b; fluxbox = b;
event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask | event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask |
SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | SubstructureRedirectMask | KeyPressMask | KeyReleaseMask |
ButtonPressMask | ButtonReleaseMask; ButtonPressMask | ButtonReleaseMask;
XErrorHandler old = XSetErrorHandler((XErrorHandler) anotherWMRunning); XErrorHandler old = XSetErrorHandler((XErrorHandler) anotherWMRunning);
XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), event_mask); XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), event_mask);
@ -149,11 +249,11 @@ rootcommand("")
fprintf(stderr, fprintf(stderr,
i18n-> i18n->
getMessage( getMessage(
#ifdef NLS #ifdef NLS
ScreenSet, ScreenManagingScreen, ScreenSet, ScreenManagingScreen,
#else // !NLS #else // !NLS
0, 0, 0, 0,
#endif // NLS #endif // NLS
"BScreen::BScreen: managing screen %d " "BScreen::BScreen: managing screen %d "
"using visual 0x%lx, depth %d\n"), "using visual 0x%lx, depth %d\n"),
getScreenNumber(), XVisualIDFromVisual(getVisual()), getScreenNumber(), XVisualIDFromVisual(getVisual()),
@ -161,22 +261,22 @@ rootcommand("")
rootmenu = 0; rootmenu = 0;
#ifdef HAVE_STRFTIME #ifdef HAVE_STRFTIME
resource.strftime_format = 0; resource.strftime_format = 0;
#endif // HAVE_STRFTIME #endif // HAVE_STRFTIME
#ifdef HAVE_GETPID #ifdef HAVE_GETPID
pid_t bpid = getpid(); pid_t bpid = getpid();
XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(),
fluxbox->getFluxboxPidAtom(), XA_CARDINAL, fluxbox->getFluxboxPidAtom(), XA_CARDINAL,
sizeof(pid_t) * 8, PropModeReplace, sizeof(pid_t) * 8, PropModeReplace,
(unsigned char *) &bpid, 1); (unsigned char *) &bpid, 1);
#endif // HAVE_GETPID #endif // HAVE_GETPID
XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(), XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(),
fluxbox->getSessionCursor()); fluxbox->getSessionCursor());
workspaceNames = new LinkedList<char>; workspaceNames = new LinkedList<char>;
workspacesList = new LinkedList<Workspace>; workspacesList = new LinkedList<Workspace>;
@ -192,40 +292,41 @@ rootcommand("")
fluxbox->load_rc(this); fluxbox->load_rc(this);
image_control->setDither(resource.image_dither); image_control->setDither(*resource.image_dither);
theme = new Theme(getBaseDisplay()->getXDisplay(), getRootWindow(), getColormap(), getScreenNumber(), theme = new Theme(getBaseDisplay()->getXDisplay(), getRootWindow(), getColormap(), getScreenNumber(),
image_control, fluxbox->getStyleFilename(), getRootCommand().c_str()); image_control, fluxbox->getStyleFilename(), getRootCommand().c_str());
#ifdef GNOME #ifdef GNOME
/* create the GNOME window */ /* create the GNOME window */
Window gnome_win = XCreateSimpleWindow(getBaseDisplay()->getXDisplay(), Window gnome_win = XCreateSimpleWindow(getBaseDisplay()->getXDisplay(),
getRootWindow(), 0, 0, 5, 5, 0, 0, 0); getRootWindow(), 0, 0, 5, 5, 0, 0, 0);
/* supported WM check */ /* supported WM check */
XChangeProperty(getBaseDisplay()->getXDisplay(), XChangeProperty(getBaseDisplay()->getXDisplay(),
getRootWindow(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(), getRootWindow(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(),
XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1);
XChangeProperty(getBaseDisplay()->getXDisplay(), gnome_win, XChangeProperty(getBaseDisplay()->getXDisplay(), gnome_win,
getBaseDisplay()->getGnomeSupportingWMCheckAtom(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(),
XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1);
Atom gnomeatomlist[1] = {getBaseDisplay()->getGnomeWorkspaceAtom()}; Atom gnomeatomlist[1] = {getBaseDisplay()->getGnomeWorkspaceAtom()};
XChangeProperty(getBaseDisplay()->getXDisplay(), XChangeProperty(getBaseDisplay()->getXDisplay(),
getRootWindow(), getBaseDisplay()->getGnomeProtAtom(), getRootWindow(), getBaseDisplay()->getGnomeProtAtom(),
XA_ATOM, 32, PropModeReplace, XA_ATOM, 32, PropModeReplace,
(unsigned char *)gnomeatomlist, 1); (unsigned char *)gnomeatomlist, 1);
#endif #endif
const char *s = i18n->getMessage( const char *s = i18n->getMessage(
#ifdef NLS #ifdef NLS
ScreenSet, ScreenPositionLength, ScreenSet, ScreenPositionLength,
#else // !NLS #else // !NLS
0, 0, 0, 0,
#endif // NLS #endif // NLS
"0: 0000 x 0: 0000"); "0: 0000 x 0: 0000");
int l = strlen(s); int l = strlen(s);
if (i18n->multibyte()) { if (i18n->multibyte()) {
@ -236,7 +337,7 @@ rootcommand("")
geom_h = theme->getWindowStyle().font.set_extents->max_ink_extent.height; geom_h = theme->getWindowStyle().font.set_extents->max_ink_extent.height;
} else { } else {
geom_h = theme->getWindowStyle().font.fontstruct->ascent + geom_h = theme->getWindowStyle().font.fontstruct->ascent +
theme->getWindowStyle().font.fontstruct->descent; theme->getWindowStyle().font.fontstruct->descent;
geom_w = XTextWidth(theme->getWindowStyle().font.fontstruct, s, l); geom_w = XTextWidth(theme->getWindowStyle().font.fontstruct, s, l);
} }
@ -287,8 +388,8 @@ rootcommand("")
configmenu = new Configmenu(this); configmenu = new Configmenu(this);
Workspace *wkspc = (Workspace *) 0; Workspace *wkspc = (Workspace *) 0;
if (resource.workspaces != 0) { if (*resource.workspaces != 0) {
for (int i = 0; i < resource.workspaces; ++i) { for (int i = 0; i < *resource.workspaces; ++i) {
wkspc = new Workspace(this, workspacesList->count()); wkspc = new Workspace(this, workspacesList->count());
workspacesList->insert(wkspc); workspacesList->insert(wkspc);
workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); workspacemenu->insert(wkspc->getName(), wkspc->getMenu());
@ -1597,8 +1698,8 @@ void BScreen::shutdown(void) {
void BScreen::showPosition(int x, int y) { void BScreen::showPosition(int x, int y) {
if (! geom_visible) { if (! geom_visible) {
XMoveResizeWindow(getBaseDisplay()->getXDisplay(), geom_window, XMoveResizeWindow(getBaseDisplay()->getXDisplay(), geom_window,
(getWidth() - geom_w) / 2, (getWidth() - geom_w) / 2,
(getHeight() - geom_h) / 2, geom_w, geom_h); (getHeight() - geom_h) / 2, geom_w, geom_h);
XMapWindow(getBaseDisplay()->getXDisplay(), geom_window); XMapWindow(getBaseDisplay()->getXDisplay(), geom_window);
XRaiseWindow(getBaseDisplay()->getXDisplay(), geom_window); XRaiseWindow(getBaseDisplay()->getXDisplay(), geom_window);

View file

@ -22,7 +22,7 @@
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
// DEALINGS IN THE SOFTWARE. // DEALINGS IN THE SOFTWARE.
// $Id: Screen.hh,v 1.9 2002/01/11 10:20:00 fluxgen Exp $ // $Id: Screen.hh,v 1.10 2002/01/20 02:17:23 fluxgen Exp $
#ifndef _SCREEN_HH_ #ifndef _SCREEN_HH_
#define _SCREEN_HH_ #define _SCREEN_HH_
@ -87,50 +87,39 @@ class BScreen;
class BScreen : public ScreenInfo { class BScreen : public ScreenInfo {
public: public:
BScreen(Fluxbox *, int); BScreen(ResourceManager &rm, Fluxbox *b,
~BScreen(void); const string &screenname, const string &altscreenname,
int scrn);
~BScreen();
inline const Bool &isToolbarOnTop(void) const inline const bool isToolbarOnTop(void) { return *resource.toolbar_on_top; }
{ return resource.toolbar_on_top; } inline const bool doToolbarAutoHide(void) { return *resource.toolbar_auto_hide; }
inline const Bool &doToolbarAutoHide(void) const inline const bool isSloppyFocus(void) { return resource.sloppy_focus; }
{ return resource.toolbar_auto_hide; } inline const bool isSemiSloppyFocus(void) { return resource.semi_sloppy_focus; }
inline const Bool &isSloppyFocus(void) const inline const bool isRootColormapInstalled(void) { return root_colormap_installed; }
{ return resource.sloppy_focus; } inline const bool isScreenManaged(void) { return managed; }
inline const Bool &isSemiSloppyFocus(void) const inline const bool isTabRotateVertical(void) { return *resource.tab_rotate_vertical; }
{ return resource.semi_sloppy_focus; } inline const bool isSloppyWindowGrouping(void) { return *resource.sloppy_window_grouping; }
inline const Bool &isRootColormapInstalled(void) const inline const bool doAutoRaise(void) { return resource.auto_raise; }
{ return root_colormap_installed; } inline const bool doImageDither(void) { return *resource.image_dither; }
inline const Bool &isScreenManaged(void) const { return managed; } inline const bool doMaxOverSlit(void) { return *resource.max_over_slit; }
inline const Bool &isTabRotateVertical(void) const inline const bool doOpaqueMove(void) { return *resource.opaque_move; }
{ return resource.tab_rotate_vertical; } inline const bool doFullMax(void) { return *resource.full_max; }
inline const Bool &isSloppyWindowGrouping(void) const inline const bool doFocusNew(void) { return resource.focus_new; }
{ return resource.sloppy_window_grouping; } inline const bool doFocusLast(void) { return resource.focus_last; }
inline const Bool &doAutoRaise(void) const { return resource.auto_raise; }
inline const Bool &doImageDither(void) const
{ return resource.image_dither; }
inline const Bool &doOrderedDither(void) const
{ return resource.ordered_dither; }
inline const Bool &doMaxOverSlit(void) const { return resource.max_over_slit; }
inline const Bool &doOpaqueMove(void) const { return resource.opaque_move; }
inline const Bool &doFullMax(void) const { return resource.full_max; }
inline const Bool &doFocusNew(void) const { return resource.focus_new; }
inline const Bool &doFocusLast(void) const { return resource.focus_last; }
inline const GC &getOpGC() const { return theme->getOpGC(); } inline const GC &getOpGC() const { return theme->getOpGC(); }
inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); } inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); }
inline BImageControl *getImageControl(void) { return image_control; } inline BImageControl *getImageControl(void) { return image_control; }
inline Rootmenu *getRootmenu(void) { return rootmenu; } inline Rootmenu *getRootmenu(void) { return rootmenu; }
inline std::string &getRootCommand(void) { return rootcommand; } inline std::string &getRootCommand(void) { return *resource.rootcommand; }
#ifdef SLIT #ifdef SLIT
inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; } inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; }
inline const Bool &doSlitAutoHide(void) const inline const Bool &doSlitAutoHide(void) const { return resource.slit_auto_hide; }
{ return resource.slit_auto_hide; }
inline Slit *getSlit(void) { return slit; } inline Slit *getSlit(void) { return slit; }
inline const int &getSlitPlacement(void) const inline const int &getSlitPlacement(void) const { return resource.slit_placement; }
{ return resource.slit_placement; } inline const int &getSlitDirection(void) const { return resource.slit_direction; }
inline const int &getSlitDirection(void) const
{ return resource.slit_direction; }
inline void saveSlitPlacement(int p) { resource.slit_placement = p; } inline void saveSlitPlacement(int p) { resource.slit_placement = p; }
inline void saveSlitDirection(int d) { resource.slit_direction = d; } inline void saveSlitDirection(int d) { resource.slit_direction = d; }
inline void saveSlitOnTop(Bool t) { resource.slit_on_top = t; } inline void saveSlitOnTop(Bool t) { resource.slit_on_top = t; }
@ -144,61 +133,41 @@ public:
inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; }
inline const unsigned int getHandleWidth(void) const inline const unsigned int getHandleWidth(void) const { return theme->getHandleWidth(); }
{ return theme->getHandleWidth(); } inline const unsigned int getBevelWidth(void) const { return theme->getBevelWidth(); }
inline const unsigned int getBevelWidth(void) const inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); }
{ return theme->getBevelWidth(); } inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); }
inline const unsigned int getFrameWidth(void) const inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; }
{ return theme->getFrameWidth(); } inline const int getCurrentWorkspaceID() { return current_workspace->getWorkspaceID(); }
inline const unsigned int getBorderWidth(void) const
{ return theme->getBorderWidth(); }
inline const unsigned int getBorderWidth2x(void) const
{ return theme->getBorderWidth()*2; }
inline const int getCurrentWorkspaceID()
{ return current_workspace->getWorkspaceID(); }
inline const int getCount(void) { return workspacesList->count(); } inline const int getCount(void) { return workspacesList->count(); }
inline const int getIconCount(void) { return iconList->count(); } inline const int getIconCount(void) { return iconList->count(); }
inline LinkedList<FluxboxWindow> *getIconList(void) { return iconList; } inline LinkedList<FluxboxWindow> *getIconList(void) { return iconList; }
inline const int &getNumberOfWorkspaces(void) const inline const int getNumberOfWorkspaces(void) { return *resource.workspaces; }
{ return resource.workspaces; } inline const Toolbar::Placement getToolbarPlacement(void) { return *resource.toolbar_placement; }
inline const int &getToolbarPlacement(void) const inline const int getToolbarWidthPercent(void) { return *resource.toolbar_width_percent; }
{ return resource.toolbar_placement; } inline const int getPlacementPolicy(void) const { return resource.placement_policy; }
inline const int &getToolbarWidthPercent(void) const inline const int getEdgeSnapThreshold(void) { return *resource.edge_snap_threshold; }
{ return resource.toolbar_width_percent; } inline const int getRowPlacementDirection(void) const { return resource.row_direction; }
inline const int &getPlacementPolicy(void) const inline const int getColPlacementDirection(void) const { return resource.col_direction; }
{ return resource.placement_policy; } inline const unsigned int getTabWidth(void) { return *resource.tab_width; }
inline const int &getEdgeSnapThreshold(void) const inline const unsigned int getTabHeight(void) { return *resource.tab_height; }
{ return resource.edge_snap_threshold; } inline const Tab::Placement getTabPlacement(void) { return *resource.tab_placement; }
inline const int &getRowPlacementDirection(void) const inline const Tab::Alignment getTabAlignment(void) { return *resource.tab_alignment; }
{ return resource.row_direction; }
inline const int &getColPlacementDirection(void) const
{ return resource.col_direction; }
inline const unsigned int &getTabWidth(void) const
{ return resource.tab_width; }
inline const unsigned int &getTabHeight(void) const
{ return resource.tab_height; }
inline const int getTabPlacement(void)
{ return resource.tab_placement; }
inline const int getTabAlignment(void)
{ return resource.tab_alignment; }
inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; }
inline void saveRootCommand(std::string rootcmd) { rootcommand = rootcmd; } inline void saveRootCommand(std::string rootcmd) { *resource.rootcommand = rootcmd; }
inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; } inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; }
inline void saveSemiSloppyFocus(Bool s) { resource.semi_sloppy_focus = s; } inline void saveSemiSloppyFocus(Bool s) { resource.semi_sloppy_focus = s; }
inline void saveAutoRaise(Bool a) { resource.auto_raise = a; } inline void saveAutoRaise(Bool a) { resource.auto_raise = a; }
inline void saveWorkspaces(int w) { resource.workspaces = w; } inline void saveWorkspaces(int w) { resource.workspaces = w; }
inline void saveToolbarOnTop(Bool r) { resource.toolbar_on_top = r; } inline void saveToolbarOnTop(Bool r) { resource.toolbar_on_top = r; }
inline void saveToolbarAutoHide(Bool r) { resource.toolbar_auto_hide = r; } inline void saveToolbarAutoHide(Bool r) { resource.toolbar_auto_hide = r; }
inline void saveToolbarWidthPercent(int w) inline void saveToolbarWidthPercent(int w) { resource.toolbar_width_percent = w; }
{ resource.toolbar_width_percent = w; } inline void saveToolbarPlacement(Toolbar::Placement p) { *resource.toolbar_placement = p; }
inline void saveToolbarPlacement(int p) { resource.toolbar_placement = p; }
inline void savePlacementPolicy(int p) { resource.placement_policy = p; } inline void savePlacementPolicy(int p) { resource.placement_policy = p; }
inline void saveRowPlacementDirection(int d) { resource.row_direction = d; } inline void saveRowPlacementDirection(int d) { resource.row_direction = d; }
inline void saveColPlacementDirection(int d) { resource.col_direction = d; } inline void saveColPlacementDirection(int d) { resource.col_direction = d; }
inline void saveEdgeSnapThreshold(int t) inline void saveEdgeSnapThreshold(int t) { resource.edge_snap_threshold = t; }
{ resource.edge_snap_threshold = t; }
inline void saveImageDither(Bool d) { resource.image_dither = d; } inline void saveImageDither(Bool d) { resource.image_dither = d; }
inline void saveMaxOverSlit(Bool m) { resource.max_over_slit = m; } inline void saveMaxOverSlit(Bool m) { resource.max_over_slit = m; }
inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; } inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; }
@ -207,8 +176,8 @@ public:
inline void saveFocusLast(Bool f) { resource.focus_last = f; } inline void saveFocusLast(Bool f) { resource.focus_last = f; }
inline void saveTabWidth(unsigned int w) { resource.tab_width = w; } inline void saveTabWidth(unsigned int w) { resource.tab_width = w; }
inline void saveTabHeight(unsigned int h) { resource.tab_height = h; } inline void saveTabHeight(unsigned int h) { resource.tab_height = h; }
inline void saveTabPlacement(unsigned int p) { resource.tab_placement = p; } inline void saveTabPlacement(Tab::Placement p) { *resource.tab_placement = p; }
inline void saveTabAlignment(unsigned int a) { resource.tab_alignment = a; } inline void saveTabAlignment(Tab::Alignment a) { *resource.tab_alignment = a; }
inline void saveTabRotateVertical(Bool r) inline void saveTabRotateVertical(Bool r)
{ resource.tab_rotate_vertical = r; } { resource.tab_rotate_vertical = r; }
inline void saveSloppyWindowGrouping(Bool s) inline void saveSloppyWindowGrouping(Bool s)
@ -280,7 +249,6 @@ public:
private: private:
Theme *theme; Theme *theme;
std::string rootcommand;
Bool root_colormap_installed, managed, geom_visible; Bool root_colormap_installed, managed, geom_visible;
GC opGC; GC opGC;
@ -312,17 +280,25 @@ private:
LinkedList<char> *workspaceNames; LinkedList<char> *workspaceNames;
LinkedList<Workspace> *workspacesList; LinkedList<Workspace> *workspacesList;
struct resource { struct ScreenResource {
ScreenResource(ResourceManager &rm, const std::string &scrname,
const std::string &altscrname);
Bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise, Resource<bool> toolbar_on_top, toolbar_auto_hide,
auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max, image_dither, opaque_move, full_max,
focus_new, focus_last, max_over_slit, tab_rotate_vertical, semi_sloppy_focus, max_over_slit, tab_rotate_vertical,
sloppy_window_grouping; sloppy_window_grouping;
Resource<std::string> rootcommand;
bool auto_raise, sloppy_focus, semi_sloppy_focus, focus_new, focus_last,
ordered_dither;
Resource<int> workspaces, toolbar_width_percent, edge_snap_threshold,
tab_width, tab_height;
int placement_policy, row_direction, col_direction;
int workspaces, toolbar_placement, toolbar_width_percent, placement_policy, Resource<Tab::Placement> tab_placement;
edge_snap_threshold, row_direction, col_direction; Resource<Tab::Alignment> tab_alignment;
Resource<Toolbar::Placement> toolbar_placement;
unsigned int tab_placement, tab_alignment, tab_width, tab_height;
#ifdef SLIT #ifdef SLIT
Bool slit_on_top, slit_auto_hide; Bool slit_on_top, slit_auto_hide;