From e850b0191977da47eb7233e248dbab7ebd1d21f0 Mon Sep 17 00:00:00 2001 From: Mathias Gumz Date: Wed, 23 Mar 2011 12:02:15 +0100 Subject: compile fix: sunCC 5.11 (sunstudio 12) compiles and links again biggest change: renaming of 'class Layer' to 'class ResourceLayer' in Layer.hh to handle complaints about 'ambiguous Layer: Layer or FbTk::Layer'. 'ResourceLayer' sounds crappy, but that was the best I could come up with right now. --- src/ClientMenu.cc | 2 +- src/ClientPattern.cc | 4 +++- src/CurrentWindowCmd.cc | 2 +- src/Ewmh.cc | 28 ++++++++++++++-------------- src/FbWinFrame.cc | 2 +- src/FbWinFrame.hh | 7 ++----- src/Gnome.cc | 18 +++++++++--------- src/IconbarTool.cc | 2 +- src/Layer.hh | 40 ++++++++++++++++++++-------------------- src/LayerMenu.cc | 12 ++++++------ src/MenuCreator.cc | 6 +++--- src/Remember.cc | 2 +- src/Resources.cc | 10 +++++----- src/Screen.cc | 8 ++++---- src/SendToMenu.cc | 2 +- src/Slit.cc | 12 ++++++------ src/Slit.hh | 2 +- src/Toolbar.cc | 10 +++++----- src/Toolbar.hh | 2 +- src/Window.cc | 22 +++++++++++----------- src/Window.hh | 13 ++++++------- src/WindowState.hh | 2 +- src/WorkspaceCmd.cc | 2 +- src/WorkspaceMenu.cc | 2 +- src/fluxbox.cc | 2 +- 25 files changed, 106 insertions(+), 108 deletions(-) diff --git a/src/ClientMenu.cc b/src/ClientMenu.cc index 063cad4..faa1d3f 100644 --- a/src/ClientMenu.cc +++ b/src/ClientMenu.cc @@ -93,7 +93,7 @@ private: ClientMenu::ClientMenu(BScreen &screen, Focusables &clients, bool listen_for_iconlist_changes): FbMenu(screen.menuTheme(), screen.imageControl(), - *screen.layerManager().getLayer(Layer::MENU)), + *screen.layerManager().getLayer(ResourceLayer::MENU)), m_list(clients) { if (listen_for_iconlist_changes) { diff --git a/src/ClientPattern.cc b/src/ClientPattern.cc index 500574e..b2ad691 100644 --- a/src/ClientPattern.cc +++ b/src/ClientPattern.cc @@ -87,11 +87,13 @@ const Name2WinProperty name_2_winproperties[] = { // sorted for 'bsearch' { "workspacename", ClientPattern::WORKSPACENAME } }; +extern "C" { int name_2_winproperty_cmp(const void* a, const void* b) { return strcmp( reinterpret_cast(a)->name, reinterpret_cast(b)->name); } +} const Name2WinProperty* find_winproperty_by_name(const FbTk::FbString& name) { @@ -442,7 +444,7 @@ FbTk::FbString ClientPattern::getProperty(WinProperty prop, const Focusable &cli break; case LAYER: if (fbwin) { - result = ::Layer::getString(fbwin->layerNum()); + result = ::ResourceLayer::getString(fbwin->layerNum()); } break; case URGENT: diff --git a/src/CurrentWindowCmd.cc b/src/CurrentWindowCmd.cc index 1851f2d..1122e1f 100644 --- a/src/CurrentWindowCmd.cc +++ b/src/CurrentWindowCmd.cc @@ -605,7 +605,7 @@ void FullscreenCmd::real_execute() { FbTk::Command *SetLayerCmd::parse(const string &command, const string &args, bool trusted) { - int l = Layer::getNumFromString(args); + int l = ResourceLayer::getNumFromString(args); return (l == -1) ? 0 : new SetLayerCmd(l); } diff --git a/src/Ewmh.cc b/src/Ewmh.cc index 241fd0a..bab543b 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -992,9 +992,9 @@ void Ewmh::updateState(FluxboxWindow &win) { state.push_back(m_net->wm_state_sticky); if (win.isShaded()) state.push_back(m_net->wm_state_shaded); - if (win.layerNum() == Layer::BOTTOM) + if (win.layerNum() == ResourceLayer::BOTTOM) state.push_back(m_net->wm_state_below); - if (win.layerNum() == Layer::ABOVE_DOCK) + if (win.layerNum() == ResourceLayer::ABOVE_DOCK) state.push_back(m_net->wm_state_above); if (win.isIconic()) state.push_back(m_net->wm_state_hidden); @@ -1346,14 +1346,14 @@ void Ewmh::setState(FluxboxWindow &win, Atom state, bool value, win.setIconHidden(value); } else if (state == m_net->wm_state_below) { // bottom layer if (value) - win.moveToLayer(Layer::BOTTOM); - else if (win.layerNum() > Layer::NORMAL) - win.moveToLayer(Layer::NORMAL); + win.moveToLayer(ResourceLayer::BOTTOM); + else if (win.layerNum() > ResourceLayer::NORMAL) + win.moveToLayer(ResourceLayer::NORMAL); } else if (state == m_net->wm_state_above) { // above layer if (value) - win.moveToLayer(Layer::ABOVE_DOCK); - else if (win.layerNum() < Layer::NORMAL) - win.moveToLayer(Layer::NORMAL); + win.moveToLayer(ResourceLayer::ABOVE_DOCK); + else if (win.layerNum() < ResourceLayer::NORMAL) + win.moveToLayer(ResourceLayer::NORMAL); } else if (state == m_net->wm_state_demands_attention) { if (value) { // if add attention Fluxbox::instance()->attentionHandler().addAttention(client); @@ -1386,16 +1386,16 @@ void Ewmh::toggleState(FluxboxWindow &win, Atom state, WinClient &client) { } else if (state == m_net->wm_state_skip_taskbar) { // taskbar win.setIconHidden(!win.isIconHidden()); } else if (state == m_net->wm_state_below) { // bottom layer - if (win.layerNum() == Layer::BOTTOM) - win.moveToLayer(Layer::NORMAL); + if (win.layerNum() == ResourceLayer::BOTTOM) + win.moveToLayer(ResourceLayer::NORMAL); else - win.moveToLayer(Layer::BOTTOM); + win.moveToLayer(ResourceLayer::BOTTOM); } else if (state == m_net->wm_state_above) { // top layer - if (win.layerNum() == Layer::ABOVE_DOCK) - win.moveToLayer(Layer::NORMAL); + if (win.layerNum() == ResourceLayer::ABOVE_DOCK) + win.moveToLayer(ResourceLayer::NORMAL); else - win.moveToLayer(Layer::ABOVE_DOCK); + win.moveToLayer(ResourceLayer::ABOVE_DOCK); } else if (state == m_net->wm_state_modal) { // modal client.setStateModal(!client.isStateModal()); } diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index d5b4b70..2b64fa5 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc @@ -55,7 +55,7 @@ FbWinFrame::FbWinFrame(BScreen &screen, WindowState &state, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | EnterWindowMask | LeaveWindowMask, true), - m_layeritem(window(), *screen.layerManager().getLayer(Layer::NORMAL)), + m_layeritem(window(), *screen.layerManager().getLayer(ResourceLayer::NORMAL)), m_titlebar(m_window, 0, 0, 100, 16, ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask | diff --git a/src/FbWinFrame.hh b/src/FbWinFrame.hh index 68da564..6c52566 100644 --- a/src/FbWinFrame.hh +++ b/src/FbWinFrame.hh @@ -22,6 +22,8 @@ #ifndef FBWINFRAME_HH #define FBWINFRAME_HH +#include "WindowState.hh" + #include "FbTk/FbWindow.hh" #include "FbTk/EventHandler.hh" #include "FbTk/RefCount.hh" @@ -33,10 +35,6 @@ #include "FbTk/Container.hh" #include "FbTk/Shape.hh" -#include "WindowState.hh" - -#include - #include #include @@ -50,7 +48,6 @@ namespace FbTk { class ImageControl; template class Command; class Texture; -class Layer; } /// holds a window frame with a client window diff --git a/src/Gnome.cc b/src/Gnome.cc index 78e8a2f..91a0aef 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc @@ -296,7 +296,7 @@ void Gnome::updateState(FluxboxWindow &win) { void Gnome::updateLayer(FluxboxWindow &win) { //TODO - map from flux layers to gnome ones // our layers are in the opposite direction to GNOME - long layernum = Layer::DESKTOP - win.layerNum(); + long layernum = ResourceLayer::DESKTOP - win.layerNum(); FluxboxWindow::ClientList::iterator client_it = win.clientList().begin(); FluxboxWindow::ClientList::iterator client_it_end = win.clientList().end(); @@ -421,35 +421,35 @@ void Gnome::setLayer(FluxboxWindow *win, int layer) { switch (layer) { case WIN_LAYER_DESKTOP: fbdbg<<"Gnome::setLayer("<title().logical()<<", "< wouldn't allow this */ -class Layer { +class ResourceLayer { public: enum { MENU = 0, @@ -43,7 +43,7 @@ public: NUM_LAYERS = 13 }; - explicit Layer(int i) : m_num(i) {}; + explicit ResourceLayer(int i) : m_num(i) {}; static int getNumFromString(const std::string &str) { int tempnum = 0; @@ -51,37 +51,37 @@ public: if (FbTk::StringUtil::extractNumber(str, tempnum)) return tempnum; if (v == "menu") - return ::Layer::MENU; + return ::ResourceLayer::MENU; if (v == "abovedock") - return ::Layer::ABOVE_DOCK; + return ::ResourceLayer::ABOVE_DOCK; if (v == "dock") - return ::Layer::DOCK; + return ::ResourceLayer::DOCK; if (v == "top") - return ::Layer::TOP; + return ::ResourceLayer::TOP; if (v == "normal") - return ::Layer::NORMAL; + return ::ResourceLayer::NORMAL; if (v == "bottom") - return ::Layer::BOTTOM; + return ::ResourceLayer::BOTTOM; if (v == "desktop") - return ::Layer::DESKTOP; + return ::ResourceLayer::DESKTOP; return -1; } static std::string getString(int num) { switch (num) { - case ::Layer::MENU: + case ::ResourceLayer::MENU: return std::string("Menu"); - case ::Layer::ABOVE_DOCK: + case ::ResourceLayer::ABOVE_DOCK: return std::string("AboveDock"); - case ::Layer::DOCK: + case ::ResourceLayer::DOCK: return std::string("Dock"); - case ::Layer::TOP: + case ::ResourceLayer::TOP: return std::string("Top"); - case ::Layer::NORMAL: + case ::ResourceLayer::NORMAL: return std::string("Normal"); - case ::Layer::BOTTOM: + case ::ResourceLayer::BOTTOM: return std::string("Bottom"); - case ::Layer::DESKTOP: + case ::ResourceLayer::DESKTOP: return std::string("Desktop"); default: return FbTk::StringUtil::number2String(num); @@ -91,10 +91,10 @@ public: int getNum() const { return m_num; } std::string getString() const { return getString(m_num); } - Layer &operator=(int num) { m_num = num; return *this; } + ResourceLayer &operator=(int num) { m_num = num; return *this; } private: int m_num; }; -#endif // LAYER_HH +#endif // RESOURCE_LAYER_HH diff --git a/src/LayerMenu.cc b/src/LayerMenu.cc index 0638366..94a6622 100644 --- a/src/LayerMenu.cc +++ b/src/LayerMenu.cc @@ -42,12 +42,12 @@ LayerMenu::LayerMenu(FbTk::ThemeProxy &tm, int layernum; } layer_menuitems[] = { //TODO: nls - {0, 0, _FB_XTEXT(Layer, AboveDock, "Above Dock", "Layer above dock"), Layer::ABOVE_DOCK}, - {0, 0, _FB_XTEXT(Layer, Dock, "Dock", "Layer dock"), Layer::DOCK}, - {0, 0, _FB_XTEXT(Layer, Top, "Top", "Layer top"), Layer::TOP}, - {0, 0, _FB_XTEXT(Layer, Normal, "Normal", "Layer normal"), Layer::NORMAL}, - {0, 0, _FB_XTEXT(Layer, Bottom, "Bottom", "Layer bottom"), Layer::BOTTOM}, - {0, 0, _FB_XTEXT(Layer, Desktop, "Desktop", "Layer desktop"), Layer::DESKTOP}, + {0, 0, _FB_XTEXT(Layer, AboveDock, "Above Dock", "Layer above dock"), ResourceLayer::ABOVE_DOCK}, + {0, 0, _FB_XTEXT(Layer, Dock, "Dock", "Layer dock"), ResourceLayer::DOCK}, + {0, 0, _FB_XTEXT(Layer, Top, "Top", "Layer top"), ResourceLayer::TOP}, + {0, 0, _FB_XTEXT(Layer, Normal, "Normal", "Layer normal"), ResourceLayer::NORMAL}, + {0, 0, _FB_XTEXT(Layer, Bottom, "Bottom", "Layer bottom"), ResourceLayer::BOTTOM}, + {0, 0, _FB_XTEXT(Layer, Desktop, "Desktop", "Layer desktop"), ResourceLayer::DESKTOP}, }; FbTk::RefCount > saverc_cmd(new FbCommands::SaveResources()); diff --git a/src/MenuCreator.cc b/src/MenuCreator.cc index 72e55ca..9884187 100644 --- a/src/MenuCreator.cc +++ b/src/MenuCreator.cc @@ -374,7 +374,7 @@ FbMenu *MenuCreator::createMenu(const string &label, int screen_number) { FbMenu *menu = new FbMenu(screen->menuTheme(), screen->imageControl(), - *screen->layerManager().getLayer(Layer::MENU)); + *screen->layerManager().getLayer(ResourceLayer::MENU)); if (!label.empty()) menu->setLabel(label); @@ -511,7 +511,7 @@ bool MenuCreator::createWindowMenuItem(const string &type, FbTk::Menu *submenu = new AlphaMenu(screen->menuTheme(), screen->imageControl(), - *screen->layerManager().getLayer(Layer::MENU)); + *screen->layerManager().getLayer(ResourceLayer::MENU)); submenu->disableTitle(); menu.insert(label.empty() ? _FB_XTEXT(Configmenu, Transparency, "Transparency", "Menu containing various transparency options"): label, @@ -537,7 +537,7 @@ bool MenuCreator::createWindowMenuItem(const string &type, FbTk::Menu *submenu = new LayerMenu(screen->menuTheme(), screen->imageControl(), - *screen->layerManager().getLayer(Layer::MENU), + *screen->layerManager().getLayer(ResourceLayer::MENU), &context, false); submenu->disableTitle(); diff --git a/src/Remember.cc b/src/Remember.cc index a9be4bc..6dd636f 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -477,7 +477,7 @@ int parseApp(ifstream &file, Application &app, string *first_line = 0) { else had_error = true; } else if (str_key == "layer") { - int l = Layer::getNumFromString(str_label); + int l = ResourceLayer::getNumFromString(str_label); had_error = (l == -1); if (!had_error) app.rememberLayer(l); diff --git a/src/Resources.cc b/src/Resources.cc index 0364477..2e07725 100644 --- a/src/Resources.cc +++ b/src/Resources.cc @@ -192,17 +192,17 @@ setFromString(const char *strval) { template<> -string FbTk::Resource:: +string FbTk::Resource:: getString() const { - return ::Layer::getString(m_value.getNum()); + return ::ResourceLayer::getString(m_value.getNum()); } template<> -void FbTk::Resource:: +void FbTk::Resource:: setFromString(const char *strval) { string str(strval); - int tempnum = ::Layer::getNumFromString(str); - if (tempnum >= 0 && tempnum < ::Layer::NUM_LAYERS) + int tempnum = ::ResourceLayer::getNumFromString(str); + if (tempnum >= 0 && tempnum < ::ResourceLayer::NUM_LAYERS) m_value = tempnum; else setDefaultValue(); diff --git a/src/Screen.cc b/src/Screen.cc index 107f4d2..1b58231 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -489,7 +489,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, changeWorkspaceID(first_desktop); #ifdef SLIT - m_slit.reset(new Slit(*this, *layerManager().getLayer(Layer::DESKTOP), + m_slit.reset(new Slit(*this, *layerManager().getLayer(ResourceLayer::DESKTOP), fluxbox->getSlitlistFilename().c_str())); #endif // SLIT @@ -598,7 +598,7 @@ void BScreen::initWindows() { #ifdef USE_TOOLBAR m_toolbar.reset(new Toolbar(*this, - *layerManager().getLayer(::Layer::NORMAL))); + *layerManager().getLayer(::ResourceLayer::NORMAL))); #endif // USE_TOOLBAR unsigned int nchild; @@ -858,7 +858,7 @@ void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) { FbMenu *BScreen::createMenu(const string &label) { FbMenu *menu = new FbMenu(menuTheme(), imageControl(), - *layerManager().getLayer(Layer::MENU)); + *layerManager().getLayer(ResourceLayer::MENU)); if (!label.empty()) menu->setLabel(label); @@ -868,7 +868,7 @@ FbMenu *BScreen::createMenu(const string &label) { FbMenu *BScreen::createToggleMenu(const string &label) { FbMenu *menu = new ToggleMenu(menuTheme(), imageControl(), - *layerManager().getLayer(Layer::MENU)); + *layerManager().getLayer(ResourceLayer::MENU)); if (!label.empty()) menu->setLabel(label); diff --git a/src/SendToMenu.cc b/src/SendToMenu.cc index 0aa1c31..b148a30 100644 --- a/src/SendToMenu.cc +++ b/src/SendToMenu.cc @@ -50,7 +50,7 @@ private: SendToMenu::SendToMenu(BScreen &screen): FbMenu(screen.menuTheme(), screen.imageControl(), - *screen.layerManager().getLayer(Layer::MENU)) { + *screen.layerManager().getLayer(ResourceLayer::MENU)) { // listen to: // workspace count signal // workspace names signal diff --git a/src/Slit.cc b/src/Slit.cc index 8ad83dd..ef1564a 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -224,10 +224,10 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename) m_screen(scr), m_clientlist_menu(scr.menuTheme(), scr.imageControl(), - *scr.layerManager().getLayer(Layer::MENU)), + *scr.layerManager().getLayer(ResourceLayer::MENU)), m_slitmenu(scr.menuTheme(), scr.imageControl(), - *scr.layerManager().getLayer(Layer::MENU)), + *scr.layerManager().getLayer(ResourceLayer::MENU)), #ifdef XINERAMA m_xineramaheadmenu(0), #endif // XINERAMA @@ -257,7 +257,7 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename) scr.name() + ".slit.alpha", scr.altName() + ".Slit.Alpha"), m_rc_on_head(scr.resourceManager(), 0, scr.name() + ".slit.onhead", scr.altName() + ".Slit.onHead"), - m_rc_layernum(scr.resourceManager(), Layer(Layer::DOCK), + m_rc_layernum(scr.resourceManager(), ResourceLayer(ResourceLayer::DOCK), scr.name() + ".slit.layer", scr.altName() + ".Slit.Layer") { _FB_USES_NLS; @@ -298,7 +298,7 @@ Slit::Slit(BScreen &scr, FbTk::Layer &layer, const char *filename) m_layermenu.reset(new LayerMenu(scr.menuTheme(), scr.imageControl(), *scr.layerManager(). - getLayer(Layer::MENU), + getLayer(ResourceLayer::MENU), this, true)); m_layermenu->setLabel(_FB_XTEXT(Slit, Layer, "Slit Layer", "Title of Slit Layer Menu")); @@ -1176,7 +1176,7 @@ void Slit::setupMenu() { // it'll be freed by the slitmenu (since not marked internal) FbMenu *placement_menu = new FbMenu(m_screen.menuTheme(), m_screen.imageControl(), - *m_screen.layerManager().getLayer(::Layer::MENU)); + *m_screen.layerManager().getLayer(::ResourceLayer::MENU)); // setup base menu @@ -1194,7 +1194,7 @@ void Slit::setupMenu() { screen().menuTheme(), screen(), screen().imageControl(), - *screen().layerManager().getLayer(::Layer::MENU), + *screen().layerManager().getLayer(::ResourceLayer::MENU), *this, _FB_XTEXT(Slit, OnHead, "Slit on Head", "Title of Slits On Head menu") )); diff --git a/src/Slit.hh b/src/Slit.hh index fea43ea..7f2729d 100644 --- a/src/Slit.hh +++ b/src/Slit.hh @@ -186,7 +186,7 @@ private: FbTk::Resource m_rc_kde_dockapp, m_rc_auto_hide, m_rc_maximize_over; FbTk::Resource m_rc_placement; FbTk::Resource m_rc_alpha, m_rc_on_head; - FbTk::Resource m_rc_layernum; + FbTk::Resource m_rc_layernum; }; diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 1e43b5c..471f5ec 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -190,15 +190,15 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width): m_layeritem(frame.window, layer), m_layermenu(scrn.menuTheme(), scrn.imageControl(), - *scrn.layerManager().getLayer(Layer::MENU), + *scrn.layerManager().getLayer(ResourceLayer::MENU), this, true), m_placementmenu(scrn.menuTheme(), scrn.imageControl(), - *scrn.layerManager().getLayer(Layer::MENU)), + *scrn.layerManager().getLayer(ResourceLayer::MENU)), m_toolbarmenu(scrn.menuTheme(), scrn.imageControl(), - *scrn.layerManager().getLayer(Layer::MENU)), + *scrn.layerManager().getLayer(ResourceLayer::MENU)), #ifdef XINERAMA m_xineramaheadmenu(0), #endif // XINERAMA @@ -215,7 +215,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::Layer &layer, size_t width): scrn.name() + ".toolbar.widthPercent", scrn.altName() + ".Toolbar.WidthPercent"), m_rc_alpha(scrn.resourceManager(), 255, scrn.name() + ".toolbar.alpha", scrn.altName() + ".Toolbar.Alpha"), - m_rc_layernum(scrn.resourceManager(), Layer(Layer::DOCK), + m_rc_layernum(scrn.resourceManager(), ResourceLayer(ResourceLayer::DOCK), scrn.name() + ".toolbar.layer", scrn.altName() + ".Toolbar.Layer"), m_rc_on_head(scrn.resourceManager(), 1, scrn.name() + ".toolbar.onhead", scrn.altName() + ".Toolbar.onHead"), @@ -829,7 +829,7 @@ void Toolbar::setupMenus(bool skip_new_placement) { new XineramaHeadMenu(screen().menuTheme(), screen(), screen().imageControl(), - *screen().layerManager().getLayer(::Layer::MENU), + *screen().layerManager().getLayer(::ResourceLayer::MENU), *this, _FB_XTEXT(Toolbar, OnHead, "Toolbar on Head", "Title of toolbar on head menu"))); diff --git a/src/Toolbar.hh b/src/Toolbar.hh index 1f41ed5..3c9d048 100644 --- a/src/Toolbar.hh +++ b/src/Toolbar.hh @@ -187,7 +187,7 @@ private: FbTk::Resource m_rc_auto_hide, m_rc_maximize_over, m_rc_visible; FbTk::Resource m_rc_width_percent; FbTk::Resource m_rc_alpha; - FbTk::Resource m_rc_layernum; + FbTk::Resource m_rc_layernum; FbTk::Resource m_rc_on_head; FbTk::Resource m_rc_placement; FbTk::Resource m_rc_height; diff --git a/src/Window.cc b/src/Window.cc index 51a66df..1a5bd91 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -479,7 +479,7 @@ void FluxboxWindow::init() { m_workspace_number = m_client->transientFor()->fbwindow()->workspaceNumber(); } else // if no parent then set default layer - moveToLayer(m_state.layernum, m_state.layernum != ::Layer::NORMAL); + moveToLayer(m_state.layernum, m_state.layernum != ::ResourceLayer::NORMAL); fbdbg<<"FluxboxWindow::init("<transientFor()<getOnHead() || (foc->winClient().isTransient() && foc->winClient().transientFor()->fbwindow() == this)) { - moveToLayer(::Layer::ABOVE_DOCK); + moveToLayer(::ResourceLayer::ABOVE_DOCK); } else { - moveToLayer(::Layer::DESKTOP); + moveToLayer(::ResourceLayer::DESKTOP); } stateSig().notify(); @@ -1683,10 +1683,10 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) { fbdbg<<"FluxboxWindow("<= ::Layer::NUM_LAYERS) - layernum = ::Layer::NUM_LAYERS - 1; + if (layernum <= ::ResourceLayer::MENU) + layernum = ::ResourceLayer::MENU + 1; + else if (layernum >= ::ResourceLayer::NUM_LAYERS) + layernum = ::ResourceLayer::NUM_LAYERS - 1; if (!m_initialized) m_state.layernum = layernum; @@ -1758,7 +1758,7 @@ void FluxboxWindow::setFocusFlag(bool focus) { } if (m_state.fullscreen && focus) { - moveToLayer(::Layer::ABOVE_DOCK); + moveToLayer(::ResourceLayer::ABOVE_DOCK); leave(screen().focusedWindowSig()); } @@ -3774,7 +3774,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) { setMouseFocus(false); setClickFocus(false); setDecorationMask(WindowState::DECOR_NONE); - moveToLayer(::Layer::DOCK); + moveToLayer(::ResourceLayer::DOCK); break; case WindowState::TYPE_DESKTOP: /* @@ -3787,7 +3787,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) { setIconHidden(true); setFocusNew(false); setMouseFocus(false); - moveToLayer(::Layer::DESKTOP); + moveToLayer(::ResourceLayer::DESKTOP); setDecorationMask(WindowState::DECOR_NONE); setTabable(false); setMovable(false); @@ -3822,7 +3822,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) { */ setDecorationMask(WindowState::DECOR_TOOL); setIconHidden(true); - moveToLayer(::Layer::ABOVE_DOCK); + moveToLayer(::ResourceLayer::ABOVE_DOCK); break; case WindowState::TYPE_NORMAL: default: diff --git a/src/Window.hh b/src/Window.hh index 607ff69..bb27060 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -25,6 +25,12 @@ #ifndef WINDOW_HH #define WINDOW_HH +#include "FbWinFrame.hh" +#include "Focusable.hh" +#include "FocusableTheme.hh" +#include "FocusControl.hh" +#include "WinButton.hh" + #include "FbTk/DefaultValue.hh" #include "FbTk/Timer.hh" #include "FbTk/Subject.hh" @@ -33,13 +39,6 @@ #include "FbTk/LayerItem.hh" #include "FbTk/Signal.hh" -#include "FbWinFrame.hh" -#include "Focusable.hh" -#include "FocusableTheme.hh" -#include "FocusControl.hh" -#include "WinButton.hh" - - #include #include #include diff --git a/src/WindowState.hh b/src/WindowState.hh index 6409d13..58664fa 100644 --- a/src/WindowState.hh +++ b/src/WindowState.hh @@ -113,7 +113,7 @@ public: focused(false), shaded(false), fullscreen(false), stuck(false), iconic(false), focus_hidden(false), icon_hidden(false), - maximized(0), layernum(Layer::NORMAL), + maximized(0), layernum(ResourceLayer::NORMAL), x(0), y(0), width(1), height(1) { } void saveGeometry(int x, int y, unsigned int width, unsigned int height, diff --git a/src/WorkspaceCmd.cc b/src/WorkspaceCmd.cc index 168a56d..ad88640 100644 --- a/src/WorkspaceCmd.cc +++ b/src/WorkspaceCmd.cc @@ -509,7 +509,7 @@ void ShowDesktopCmd::execute() { for (; it != it_end; ++it) { if (!(*it)->fbwindow()->isIconic() && ((*it)->fbwindow()->isStuck() || (*it)->fbwindow()->workspaceNumber() == space) && - (*it)->fbwindow()->layerNum() < Layer::DESKTOP) { + (*it)->fbwindow()->layerNum() < ResourceLayer::DESKTOP) { (*it)->fbwindow()->iconify(); count++; } diff --git a/src/WorkspaceMenu.cc b/src/WorkspaceMenu.cc index d0d01bc..d73947b 100644 --- a/src/WorkspaceMenu.cc +++ b/src/WorkspaceMenu.cc @@ -69,7 +69,7 @@ void add_workspaces(WorkspaceMenu& menu, BScreen& screen) { WorkspaceMenu::WorkspaceMenu(BScreen &screen): FbMenu(screen.menuTheme(), screen.imageControl(), - *screen.layerManager().getLayer(Layer::MENU)) { + *screen.layerManager().getLayer(ResourceLayer::MENU)) { init(screen); } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index ee0abae..99b9ea9 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -401,7 +401,7 @@ Fluxbox::Fluxbox(int argc, char **argv, BScreen *screen = new BScreen(m_screen_rm.lock(), std::string("session.screen") + sc_nr, std::string("session.Screen") + sc_nr, - screens[s], ::Layer::NUM_LAYERS); + screens[s], ::ResourceLayer::NUM_LAYERS); // already handled if (! screen->isScreenManaged()) { -- cgit v0.11.2