all repos — fluxbox @ 988392b1eb89deaddfddfcb37a15e8f55d58bb70

custom fork of the fluxbox windowmanager

minor cleaning in BScreen interface
fluxgen fluxgen
commit

988392b1eb89deaddfddfcb37a15e8f55d58bb70

parent

cbce8634dde14fd7000fde92e86f4bd4bf3525c2

M src/Ewmh.ccsrc/Ewmh.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.24 2003/05/15 11:17:26 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.25 2003/05/15 12:00:42 fluxgen Exp $ #include "Ewmh.hh"

@@ -223,7 +223,7 @@ delete [] names[i];

} void Ewmh::updateCurrentWorkspace(BScreen &screen) { - size_t workspace = screen.getCurrentWorkspaceID(); + size_t workspace = screen.currentWorkspaceID(); XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), m_net_current_desktop, XA_CARDINAL, 32, PropModeReplace,
M src/Gnome.ccsrc/Gnome.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Gnome.cc,v 1.23 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: Gnome.cc,v 1.24 2003/05/15 12:00:42 fluxgen Exp $ #include "Gnome.hh"

@@ -205,7 +205,7 @@ delete [] names[i];

} void Gnome::updateCurrentWorkspace(BScreen &screen) { - int workspace = screen.getCurrentWorkspaceID(); + int workspace = screen.currentWorkspaceID(); XChangeProperty(FbTk::App::instance()->display(), screen.rootWindow().window(), m_gnome_wm_win_workspace, XA_CARDINAL, 32, PropModeReplace,
M src/IconBar.ccsrc/IconBar.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconBar.cc,v 1.34 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: IconBar.cc,v 1.35 2003/05/15 12:00:43 fluxgen Exp $ #include "IconBar.hh"

@@ -191,7 +191,7 @@ void IconBar::decorate(Window win) {

//!! TODO iconbar border width style XSetWindowBorderWidth(m_display, win, 1); XSetWindowBorder(m_display, win, BlackPixel(FbTk::App::instance()->display(), - screen().getScreenNumber())); + screen().screenNumber())); if (m_focus_pm) XSetWindowBackgroundPixmap(m_display, win, m_focus_pm); else

@@ -294,7 +294,7 @@ XSetWindowAttributes attrib;

attrib.background_pixmap = None; attrib.background_pixel = attrib.border_pixel = BlackPixel(m_display, - screen().getScreenNumber()); + screen().screenNumber()); // fluxboxwin->screen().getWindowStyle()->tab.border_color.pixel(); attrib.colormap = fluxboxwin->screen().rootWindow().colormap(); attrib.override_redirect = True;

@@ -347,7 +347,7 @@ dy += bevel_w;

m_font.drawText( iconwin, - screen().getScreenNumber(), + screen().screenNumber(), screen().winFrameTheme().labelTextFocusGC(), fluxboxwin->iconTitle().c_str(), newlen, dx, dy, m_vertical);
M src/Netizen.ccsrc/Netizen.cc

@@ -57,7 +57,7 @@

void Netizen::sendCurrentWorkspace() { event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyCurrentWorkspaceAtom(); - event.xclient.data.l[1] = m_screen.getCurrentWorkspaceID(); + event.xclient.data.l[1] = m_screen.currentWorkspaceID(); XSendEvent(m_display, window(), False, NoEventMask, &event); }
M src/Remember.ccsrc/Remember.cc

@@ -21,7 +21,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.cc,v 1.14 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: Remember.cc,v 1.15 2003/05/15 12:00:43 fluxgen Exp $ #include "Remember.hh" #include "StringUtil.hh"

@@ -99,7 +99,7 @@ // each fluxboxwindow has its own windowmenu

// so we also create a remember menu just for it... BScreen &screen = win.screen(); FbTk::Menu *menu = new FbMenu(*screen.menuTheme(), - screen.getScreenNumber(), + screen.screenNumber(), *screen.getImageControl(), *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); menu->disableTitle();
M src/Screen.ccsrc/Screen.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.166 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: Screen.cc,v 1.167 2003/05/15 12:00:44 fluxgen Exp $ #include "Screen.hh"

@@ -140,9 +140,9 @@ }

FbTk::Menu *createMenuFromScreen(BScreen &screen) { FbTk::Menu *menu = new FbMenu(*screen.menuTheme(), - screen.getScreenNumber(), - *screen.getImageControl(), - *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); + screen.screenNumber(), + *screen.getImageControl(), + *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); return menu; }

@@ -541,7 +541,7 @@ getMessage(

FBNLS::ScreenSet, FBNLS::ScreenManagingScreen, "BScreen::BScreen: managing screen %d " "using visual 0x%lx, depth %d\n"), - getScreenNumber(), XVisualIDFromVisual(rootWindow().visual()), + screenNumber(), XVisualIDFromVisual(rootWindow().visual()), rootWindow().depth()); Fluxbox * const fluxbox = Fluxbox::instance();

@@ -653,10 +653,10 @@ m_configmenu->setInternalMenu();

workspacemenu->setItemSelected(2, true); - if (getToolbar()) { - getToolbar()->setPlacement(*resource.toolbar_placement); - getToolbar()->theme().font().setAntialias(*resource.antialias); - getToolbar()->reconfigure(); + if (toolbar()) { + toolbar()->setPlacement(*resource.toolbar_placement); + toolbar()->theme().font().setAntialias(*resource.antialias); + toolbar()->reconfigure(); } initMenu(); // create and initiate rootmenu

@@ -723,8 +723,8 @@ }

} } - if (! isSloppyFocus() && getToolbar() != 0) { - XSetInputFocus(disp, getToolbar()->window().window(), + if (! isSloppyFocus() && toolbar() != 0) { + XSetInputFocus(disp, toolbar()->window().window(), RevertToParent, CurrentTime); }

@@ -777,7 +777,7 @@ FbTk::Menu &BScreen::getToolbarModemenu() {

return m_toolbarhandler->getModeMenu(); } -unsigned int BScreen::getCurrentWorkspaceID() const { +unsigned int BScreen::currentWorkspaceID() const { return current_workspace->workspaceID(); }

@@ -805,22 +805,22 @@

} /// TODO -unsigned int BScreen::getMaxLeft() const { +unsigned int BScreen::maxLeft() const { return 0; } ///!! TODO -unsigned int BScreen::getMaxRight() const { - return getWidth(); +unsigned int BScreen::maxRight() const { + return width(); } ///!! TODO -unsigned int BScreen::getMaxTop() const { +unsigned int BScreen::maxTop() const { return 0; } ///!! TODO -unsigned int BScreen::getMaxBottom() const { - return getHeight(); +unsigned int BScreen::maxBottom() const { + return height(); } void BScreen::reconfigure() {

@@ -834,8 +834,8 @@ // setup windowtheme, toolbartheme for antialias

winFrameTheme().font().setAntialias(*resource.antialias); m_menutheme->titleFont().setAntialias(*resource.antialias); m_menutheme->frameFont().setAntialias(*resource.antialias); - if (getToolbar() && getToolbar()->theme().font().isAntialias() != *resource.antialias) - getToolbar()->theme().font().setAntialias(*resource.antialias); + if (toolbar() && toolbar()->theme().font().isAntialias() != *resource.antialias) + toolbar()->theme().font().setAntialias(*resource.antialias); // load theme std::string theme_filename(Fluxbox::instance()->getStyleFilename());

@@ -930,9 +930,9 @@

} } - if (getToolbar()) { - getToolbar()->setPlacement(*resource.toolbar_placement); - getToolbar()->reconfigure(); + if (toolbar()) { + toolbar()->setPlacement(*resource.toolbar_placement); + toolbar()->reconfigure(); } #ifdef SLIT

@@ -1054,8 +1054,8 @@ wkspc->workspaceID() + 2); //+2 so we add it after "remove last"

workspacemenu->update(); saveWorkspaces(workspacesList.size()); - if (getToolbar() != 0) - getToolbar()->reconfigure(); + if (toolbar() != 0) + toolbar()->reconfigure(); updateNetizenWorkspaceCount();

@@ -1083,8 +1083,8 @@ //remove last workspace

workspacesList.pop_back(); delete wkspc; - if (getToolbar() != 0) - getToolbar()->reconfigure(); + if (toolbar() != 0) + toolbar()->reconfigure(); updateNetizenWorkspaceCount(); saveWorkspaces(workspacesList.size());

@@ -1112,7 +1112,7 @@ focused->pauseMoving();

} // reassociate all windows that are stuck to the new workspace - Workspace *wksp = getCurrentWorkspace(); + Workspace *wksp = currentWorkspace(); Workspace::Windows wins = wksp->windowList(); Workspace::Windows::iterator it = wins.begin(); for (; it != wins.end(); ++it) {

@@ -1129,8 +1129,8 @@ // set new workspace

current_workspace = getWorkspace(id); workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, true); - if (getToolbar() != 0) - getToolbar()->redrawWorkspaceLabel(true); + if (toolbar() != 0) + toolbar()->redrawWorkspaceLabel(true); current_workspace->showAll();

@@ -1306,7 +1306,7 @@ *layerManager().getLayer(Fluxbox::instance()->getNormalLayer()));

#ifdef SLIT if (win->initialState() == WithdrawnState) - getSlit()->addClient(win->clientWindow()); + slit()->addClient(win->clientWindow()); #endif // SLIT if (!win->isManaged()) {

@@ -1325,7 +1325,7 @@ Fluxbox::instance()->saveWindowSearch(client, win);

setupWindowActions(*win); Fluxbox::instance()->attachSignals(*win); } - if (win->workspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) { + if (win->workspaceNumber() == currentWorkspaceID() || win->isStuck()) { win->show(); } XSync(FbTk::App::instance()->display(), False);

@@ -1338,7 +1338,7 @@ winFrameTheme(), *menuTheme(),

*layerManager().getLayer(Fluxbox::instance()->getNormalLayer())); #ifdef SLIT if (win->initialState() == WithdrawnState) - getSlit()->addClient(win->clientWindow()); + slit()->addClient(win->clientWindow()); #endif // SLIT if (!win->isManaged()) { delete win;

@@ -1350,7 +1350,7 @@

Fluxbox::instance()->saveWindowSearch(client.window(), win); setupWindowActions(*win); Fluxbox::instance()->attachSignals(*win); - if (win->workspaceNumber() == getCurrentWorkspaceID() || win->isStuck()) { + if (win->workspaceNumber() == currentWorkspaceID() || win->isStuck()) { win->show(); } return win;

@@ -1527,11 +1527,10 @@ void BScreen::nextFocus(int opts) {

bool have_focused = false; int focused_window_number = -1; FluxboxWindow *focused = Fluxbox::instance()->getFocusedWindow(); - const int num_windows = getCurrentWorkspace()->numberOfWindows(); + const int num_windows = currentWorkspace()->numberOfWindows(); if (focused != 0) { - if (focused->screen().getScreenNumber() == - getScreenNumber()) { + if (focused->screen().screenNumber() == screenNumber()) { have_focused = true; focused_window_number = focused->windowNumber(); }

@@ -1565,7 +1564,7 @@

FluxboxWindow *fbwin = (*it)->m_win; if (fbwin && !fbwin->isIconic() && (fbwin->isStuck() - || fbwin->workspaceNumber() == getCurrentWorkspaceID())) { + || fbwin->workspaceNumber() == currentWorkspaceID())) { // either on this workspace, or stuck // keep track of the originally selected window in a set

@@ -1586,7 +1585,7 @@ }

} cycling_window = it; } else { // not stacked cycling - Workspace *wksp = getCurrentWorkspace(); + Workspace *wksp = currentWorkspace(); Workspace::Windows &wins = wksp->windowList(); Workspace::Windows::iterator it = wins.begin();

@@ -1617,11 +1616,10 @@ void BScreen::prevFocus(int opts) {

bool have_focused = false; int focused_window_number = -1; FluxboxWindow *focused; - int num_windows = getCurrentWorkspace()->numberOfWindows(); + int num_windows = currentWorkspace()->numberOfWindows(); if ((focused = Fluxbox::instance()->getFocusedWindow())) { - if (focused->screen().getScreenNumber() == - getScreenNumber()) { + if (focused->screen().screenNumber() == screenNumber()) { have_focused = true; focused_window_number = focused->windowNumber(); }

@@ -1656,7 +1654,7 @@

FluxboxWindow *fbwin = (*it)->m_win; if (fbwin && !fbwin->isIconic() && (fbwin->isStuck() - || fbwin->workspaceNumber() == getCurrentWorkspaceID())) { + || fbwin->workspaceNumber() == currentWorkspaceID())) { // either on this workspace, or stuck // keep track of the originally selected window in a set

@@ -1679,7 +1677,7 @@ }

cycling_window = it; } else { // not stacked cycling - Workspace *wksp = getCurrentWorkspace(); + Workspace *wksp = currentWorkspace(); Workspace::Windows &wins = wksp->windowList(); Workspace::Windows::iterator it = wins.begin();

@@ -1712,13 +1710,12 @@ int focused_window_number = -1;

Fluxbox * const fb = Fluxbox::instance(); if (fb->getFocusedWindow()) - if (fb->getFocusedWindow()->screen().getScreenNumber() == - getScreenNumber()) { + if (fb->getFocusedWindow()->screen().screenNumber() == screenNumber()) { have_focused = true; focused_window_number = fb->getFocusedWindow()->windowNumber(); } - if ((getCurrentWorkspace()->numberOfWindows() > 1) && have_focused) + if ((currentWorkspace()->numberOfWindows() > 1) && have_focused) fb->getFocusedWindow()->raise(); }

@@ -1745,7 +1742,7 @@ bottom = win.y() + win.height() + 2*borderW,

left = win.x(), right = win.x() + win.width() + 2*borderW; - Workspace::Windows &wins = getCurrentWorkspace()->windowList(); + Workspace::Windows &wins = currentWorkspace()->windowList(); Workspace::Windows::iterator it = wins.begin(); for (; it != wins.end(); ++it) { if ((*it) == &win) continue; // skip self

@@ -1883,7 +1880,7 @@

if (defaultMenu) { FbTk::RefCount<FbTk::Command> restart_fb(new FbCommands::RestartFluxboxCmd()); FbTk::RefCount<FbTk::Command> exit_fb(new FbCommands::ExitFluxboxCmd()); - FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm", getScreenNumber())); + FbTk::RefCount<FbTk::Command> execute_xterm(new FbCommands::ExecuteCmd("xterm", screenNumber())); m_rootmenu->setInternalMenu(); m_rootmenu->insert(i18n->getMessage( FBNLS::ScreenSet, FBNLS::Screenxterm,

@@ -1955,7 +1952,7 @@ "BScreen::parseMenuFile: [exec] error, "

"no menu label and/or command defined\n")); cerr<<"Row: "<<row<<endl; } else { - FbTk::RefCount<FbTk::Command> exec_cmd(new FbCommands::ExecuteCmd(str_cmd, getScreenNumber())); + FbTk::RefCount<FbTk::Command> exec_cmd(new FbCommands::ExecuteCmd(str_cmd, screenNumber())); FbTk::MacroCommand *exec_and_hide = new FbTk::MacroCommand(); exec_and_hide->add(hide_menu); exec_and_hide->add(exec_cmd);

@@ -2192,9 +2189,9 @@ ConfigmenuSet, ConfigmenuFocusModel,

"Focus Model"), focus_menu); #ifdef SLIT - if (getSlit() != 0) { - getSlit()->menu().setInternalMenu(); - menu.insert("Slit", &getSlit()->menu()); + if (slit() != 0) { + slit()->menu().setInternalMenu(); + menu.insert("Slit", &slit()->menu()); } #endif // SLIT menu.insert(i18n->getMessage(

@@ -2346,8 +2343,8 @@ geom_window.moveResize(getHeadX(head) + (getHeadWidth(head) - geom_w) / 2,

getHeadY(head) + (getHeadHeight(head) - geom_h) / 2, geom_w, geom_h); #else // !XINERMA - geom_window.moveResize((getWidth() - geom_w) / 2, - (getHeight() - geom_h) / 2, geom_w, geom_h); + geom_window.moveResize((width() - geom_w) / 2, + (height() - geom_h) / 2, geom_w, geom_h); #endif // XINERAMA geom_window.show();

@@ -2358,20 +2355,18 @@ }

char label[256]; sprintf(label, - I18n::instance()->getMessage( - FBNLS::ScreenSet, FBNLS::ScreenPositionFormat, + I18n::instance()->getMessage(FBNLS::ScreenSet, FBNLS::ScreenPositionFormat, "X: %4d x Y: %4d"), x, y); geom_window.clear(); - winFrameTheme().font().drawText( - geom_window.window(), - getScreenNumber(), - winFrameTheme().labelTextFocusGC(), - label, strlen(label), - m_root_theme->bevelWidth(), - m_root_theme->bevelWidth() + - winFrameTheme().font().ascent()); + winFrameTheme().font().drawText(geom_window.window(), + screenNumber(), + winFrameTheme().labelTextFocusGC(), + label, strlen(label), + m_root_theme->bevelWidth(), + m_root_theme->bevelWidth() + + winFrameTheme().font().ascent()); }

@@ -2385,8 +2380,8 @@ geom_window.moveResize(getHeadX(head) + (getHeadWidth(head) - geom_w) / 2,

getHeadY(head) + (getHeadHeight(head) - geom_h) / 2, geom_w, geom_h); #else // !XINERMA - geom_window.moveResize((getWidth() - geom_w) / 2, - (getHeight() - geom_h) / 2, geom_w, geom_h); + geom_window.moveResize((width() - geom_w) / 2, + (height() - geom_h) / 2, geom_w, geom_h); #endif // XINERAMA geom_window.show(); geom_window.raise();

@@ -2405,12 +2400,12 @@ geom_window.clear();

//TODO: geom window again?! repeated winFrameTheme().font().drawText(geom_window.window(), - getScreenNumber(), - winFrameTheme().labelTextFocusGC(), - label, strlen(label), - m_root_theme->bevelWidth(), - m_root_theme->bevelWidth() + - winFrameTheme().font().ascent()); + screenNumber(), + winFrameTheme().labelTextFocusGC(), + label, strlen(label), + m_root_theme->bevelWidth(), + m_root_theme->bevelWidth() + + winFrameTheme().font().ascent()); }

@@ -2430,30 +2425,30 @@ /**

Goes to the workspace "right" of the current */ void BScreen::nextWorkspace(const int delta) { - changeWorkspaceID( (getCurrentWorkspaceID() + delta) % getCount()); + changeWorkspaceID( (currentWorkspaceID() + delta) % getCount()); } /** Goes to the workspace "left" of the current */ void BScreen::prevWorkspace(const int delta) { - changeWorkspaceID( (getCurrentWorkspaceID() - delta + getCount()) % getCount()); + changeWorkspaceID( (currentWorkspaceID() - delta + getCount()) % getCount()); } /** Goes to the workspace "right" of the current */ void BScreen::rightWorkspace(const int delta) { - if (getCurrentWorkspaceID()+delta < getCount()) - changeWorkspaceID(getCurrentWorkspaceID()+delta); + if (currentWorkspaceID()+delta < getCount()) + changeWorkspaceID(currentWorkspaceID()+delta); } /** Goes to the workspace "left" of the current */ void BScreen::leftWorkspace(const int delta) { - if (getCurrentWorkspaceID() >= static_cast<unsigned int>(delta)) - changeWorkspaceID(getCurrentWorkspaceID()-delta); + if (currentWorkspaceID() >= static_cast<unsigned int>(delta)) + changeWorkspaceID(currentWorkspaceID()-delta); } /**

@@ -2521,11 +2516,11 @@

// reset background m_root_theme->reconfigTheme(); - if (getToolbar()) - getToolbar()->reconfigure(); + if (toolbar()) + toolbar()->reconfigure(); - if (getSlit()) - getSlit()->reconfigure(); + if (slit()) + slit()->reconfigure(); //!! TODO: should we re-maximize the maximized windows?
M src/Screen.hhsrc/Screen.hh

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.96 2003/05/13 21:12:17 fluxgen Exp $ +// $Id: Screen.hh,v 1.97 2003/05/15 12:00:44 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH

@@ -106,8 +106,8 @@

inline bool &doSlitAutoHide() { return *resource.slit_auto_hide; } inline const bool &doSlitAutoHide() const { return *resource.slit_auto_hide; } - inline Slit *getSlit() { return m_slit.get(); } - inline const Slit *getSlit() const { return m_slit.get(); } + inline Slit *slit() { return m_slit.get(); } + inline const Slit *slit() const { return m_slit.get(); } inline Slit::Placement getSlitPlacement() const { return *resource.slit_placement; } inline Slit::Direction getSlitDirection() const { return *resource.slit_direction; }

@@ -119,31 +119,31 @@

inline unsigned int getSlitOnHead() const { return resource.slit_on_head; } inline void saveSlitOnHead(unsigned int h) { resource.slit_on_head = h; } - inline const Toolbar *getToolbar() const { return m_toolbarhandler->getToolbar(); } - inline Toolbar *getToolbar() { return m_toolbarhandler->getToolbar(); } + inline const Toolbar *toolbar() const { return m_toolbarhandler->getToolbar(); } + inline Toolbar *toolbar() { return m_toolbarhandler->getToolbar(); } - inline const ToolbarHandler &getToolbarHandler() const { return *m_toolbarhandler; } - inline ToolbarHandler &getToolbarHandler() { return *m_toolbarhandler; } + inline const ToolbarHandler &toolbarHandler() const { return *m_toolbarhandler; } + inline ToolbarHandler &toolbarHandler() { return *m_toolbarhandler; } inline Workspace *getWorkspace(unsigned int w) { return ( w < workspacesList.size() ? workspacesList[w] : 0); } - inline Workspace *getCurrentWorkspace() { return current_workspace; } + inline Workspace *currentWorkspace() { return current_workspace; } const FbTk::Menu *getWorkspacemenu() const { return workspacemenu.get(); } FbTk::Menu *getWorkspacemenu() { return workspacemenu.get(); } - unsigned int getCurrentWorkspaceID() const; + unsigned int currentWorkspaceID() const; Pixmap rootPixmap() const; /* maximum screen surface */ - unsigned int getMaxLeft() const; - unsigned int getMaxRight() const; - unsigned int getMaxTop() const; - unsigned int getMaxBottom() const; + unsigned int maxLeft() const; + unsigned int maxRight() const; + unsigned int maxTop() const; + unsigned int maxBottom() const; - inline unsigned int getWidth() const { return rootWindow().width(); } - inline unsigned int getHeight() const { return rootWindow().height(); } - inline unsigned int getScreenNumber() const { return rootWindow().screenNumber(); } + inline unsigned int width() const { return rootWindow().width(); } + inline unsigned int height() const { return rootWindow().height(); } + inline unsigned int screenNumber() const { return rootWindow().screenNumber(); } typedef std::vector<FluxboxWindow *> Icons; typedef std::list<WinClient *> FocusedWindows;
M src/Slit.ccsrc/Slit.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.52 2003/05/13 21:09:43 fluxgen Exp $ +// $Id: Slit.cc,v 1.53 2003/05/15 12:00:45 fluxgen Exp $ #include "Slit.hh"

@@ -245,7 +245,7 @@ }; // End anonymous namespace

class SlitTheme:public FbTk::Theme { public: - explicit SlitTheme(Slit &slit):FbTk::Theme(slit.screen().getScreenNumber()), + explicit SlitTheme(Slit &slit):FbTk::Theme(slit.screen().screenNumber()), m_slit(slit), m_texture(*this, "slit", "Slit") { // default texture type

@@ -263,19 +263,19 @@

Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) : m_screen(scr), m_timer(this), m_slitmenu(*scr.menuTheme(), - scr.getScreenNumber(), + scr.screenNumber(), *scr.getImageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_placement_menu(*scr.menuTheme(), - scr.getScreenNumber(), + scr.screenNumber(), *scr.getImageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_clientlist_menu(*scr.menuTheme(), - scr.getScreenNumber(), + scr.screenNumber(), *scr.getImageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_layermenu(new LayerMenu<Slit>(*scr.menuTheme(), - scr.getScreenNumber(), + scr.screenNumber(), *scr.getImageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this,

@@ -322,7 +322,7 @@

FbTk::EventManager::instance()->add(*this, frame.window); m_transp.reset(new FbTk::Transparent(screen().rootPixmap(), frame.window.drawable(), *screen().slitAlphaResource(), - screen().getScreenNumber())); + screen().screenNumber())); m_layeritem.reset(new FbTk::XLayerItem(frame.window, layer));

@@ -387,8 +387,8 @@

if (wmhints != 0) { if ((wmhints->flags & IconWindowHint) && (wmhints->icon_window != None)) { - XMoveWindow(disp, client->client_window, screen().getWidth() + 10, - screen().getHeight() + 10); + XMoveWindow(disp, client->client_window, screen().width() + 10, + screen().height() + 10); XMapWindow(disp, client->client_window); client->icon_window = wmhints->icon_window; client->window = client->icon_window;

@@ -790,8 +790,8 @@ head_y = 0,

head_w, head_h; - head_w = screen().getWidth(); - head_h = screen().getHeight(); + head_w = screen().width(); + head_h = screen().height(); int border_width = screen().rootTheme().borderWidth(); int bevel_width = screen().rootTheme().bevelWidth();

@@ -985,13 +985,13 @@ y = e.y_root - (m_slitmenu.height() / 2);

if (x < 0) x = 0; - else if (x + m_slitmenu.width() > screen().getWidth()) - x = screen().getWidth() - m_slitmenu.width(); + else if (x + m_slitmenu.width() > screen().width()) + x = screen().width() - m_slitmenu.width(); if (y < 0) y = 0; - else if (y + m_slitmenu.height() > screen().getHeight()) - y = screen().getHeight() - m_slitmenu.height(); + else if (y + m_slitmenu.height() > screen().height()) + y = screen().height() - m_slitmenu.height(); m_slitmenu.move(x, y); m_slitmenu.show();

@@ -1077,7 +1077,7 @@ void Slit::clearWindow() {

frame.window.clear(); if (frame.pixmap != 0) { if (screen().rootPixmap() != m_transp->source()) - m_transp->setSource(screen().rootPixmap(), screen().getScreenNumber()); + m_transp->setSource(screen().rootPixmap(), screen().screenNumber()); m_transp->render(frame.window.x(), frame.window.y(), 0, 0,
M src/Toolbar.ccsrc/Toolbar.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.81 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.82 2003/05/15 12:00:45 fluxgen Exp $ #include "Toolbar.hh"

@@ -250,20 +250,20 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t width):

editing(false), hidden(scrn.doToolbarAutoHide()), do_auto_hide(scrn.doToolbarAutoHide()), - frame(*this, scrn.getScreenNumber()), + frame(*this, scrn.screenNumber()), m_screen(scrn), m_clock_timer(this), // get the clock updating every minute m_hide_timer(&hide_handler), m_toolbarmenu(menu), m_placementmenu(*scrn.menuTheme(), - scrn.getScreenNumber(), *scrn.getImageControl()), + scrn.screenNumber(), *scrn.getImageControl()), m_layermenu(*scrn.menuTheme(), - scrn.getScreenNumber(), + scrn.screenNumber(), *scrn.getImageControl(), *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this, true), - m_theme(scrn.getScreenNumber()), + m_theme(scrn.screenNumber()), m_place(BOTTOMCENTER), m_themelistener(*this), m_layeritem(frame.window, layer) {

@@ -778,7 +778,7 @@ }

frame.clock.clear(); m_theme.font().drawText( frame.clock.window(), - screen().getScreenNumber(), + screen().screenNumber(), m_theme.clockTextGC(), t, newlen, dx, dy);

@@ -813,7 +813,7 @@ dy += frame.bevel_w;

m_theme.font().drawText( frame.window_label.window(), - screen().getScreenNumber(), + screen().screenNumber(), m_theme.windowTextGC(), foc->title().c_str(), newlen, dx, dy);

@@ -823,14 +823,14 @@ }

void Toolbar::redrawWorkspaceLabel(bool redraw) { - if (screen().getCurrentWorkspace()->name().size()==0) + if (screen().currentWorkspace()->name().size()==0) return; if (redraw) frame.workspace_label.clear(); - const char *text = screen().getCurrentWorkspace()->name().c_str(); - size_t textlen = screen().getCurrentWorkspace()->name().size(); + const char *text = screen().currentWorkspace()->name().c_str(); + size_t textlen = screen().currentWorkspace()->name().size(); unsigned int newlen = textlen; int dx = FbTk::doAlignment(frame.workspace_label_w, frame.bevel_w, m_theme.justify(),

@@ -844,7 +844,7 @@ dx = tmp;

} m_theme.font().drawText( frame.workspace_label.window(), - screen().getScreenNumber(), + screen().screenNumber(), m_theme.labelTextGC(), text, newlen, dx, dy);

@@ -906,8 +906,8 @@ menu_y = 0;

} if (menu_x < 0) { menu_x = 0; - } else if (menu_x + wm.width() > screen().getWidth()) { - menu_x = screen().getWidth() - wm.width(); + } else if (menu_x + wm.width() > screen().width()) { + menu_x = screen().width() - wm.width(); } fluxboxwin->showMenu(menu_x, menu_y);

@@ -919,13 +919,13 @@ y = be.y_root - (m_toolbarmenu.height() / 2);

if (x < 0) x = 0; - else if (x + m_toolbarmenu.width() > screen().getWidth()) - x = screen().getWidth() - m_toolbarmenu.width(); + else if (x + m_toolbarmenu.width() > screen().width()) + x = screen().width() - m_toolbarmenu.width(); if (y < 0) y = 0; - else if (y + m_toolbarmenu.height() > screen().getHeight()) - y = screen().getHeight() - m_toolbarmenu.height(); + else if (y + m_toolbarmenu.height() > screen().height()) + y = screen().height() - m_toolbarmenu.height(); m_toolbarmenu.move(x, y); m_toolbarmenu.show();

@@ -949,13 +949,13 @@ int newx = menu->x(); // new x position of menu

int newy = menu->y(); // new y position of menu if (menu->x() < 0) newx = 0; - else if (menu->x() + menu->width() > screen().getWidth()) - newx = screen().getWidth() - menu->width(); + else if (menu->x() + menu->width() > screen().width()) + newx = screen().width() - menu->width(); if (menu->y() < 0) newy = 0; - else if (menu->y() + menu->height() > screen().getHeight()) - newy = screen().getHeight() - menu->height(); + else if (menu->y() + menu->height() > screen().height()) + newy = screen().height() - menu->height(); // move and show menu menu->move(newx, newy); menu->show();

@@ -1029,7 +1029,7 @@ } else

XSetInputFocus(display, PointerRoot, None, CurrentTime); if (ks == XK_Return) //change workspace name if keypress = Return - screen().getCurrentWorkspace()->setName(new_workspace_name.c_str()); + screen().currentWorkspace()->setName(new_workspace_name.c_str()); new_workspace_name.erase(); //erase temporary workspace name reconfigure();

@@ -1060,7 +1060,7 @@ x = tmp;

} m_theme.font().drawText(frame.workspace_label.window(), - screen().getScreenNumber(), + screen().screenNumber(), screen().winFrameTheme().labelTextFocusGC(), new_workspace_name.c_str(), l, x, dy);

@@ -1091,8 +1091,8 @@ head_h;

m_place = where; - head_w = screen().getWidth(); - head_h = screen().getHeight(); + head_w = screen().width(); + head_h = screen().height(); frame.width = head_w * screen().getToolbarWidthPercent() / 100; frame.height = m_theme.font().height();
M src/ToolbarHandler.ccsrc/ToolbarHandler.cc

@@ -20,7 +20,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolbarHandler.cc,v 1.11 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: ToolbarHandler.cc,v 1.12 2003/05/15 12:00:45 fluxgen Exp $ /** * The ToolbarHandler class acts as a rough interface to the toolbar.

@@ -91,9 +91,9 @@

ToolbarHandler::ToolbarHandler(BScreen &screen, ToolbarMode mode) : m_screen(screen), m_mode(mode), m_toolbar(0), m_current_workspace(0), m_modemenu(*screen.menuTheme(), - screen.getScreenNumber(), *screen.getImageControl()), + screen.screenNumber(), *screen.getImageControl()), m_toolbarmenu(*screen.menuTheme(), - screen.getScreenNumber(), *screen.getImageControl()) + screen.screenNumber(), *screen.getImageControl()) { m_modemenu.setInternalMenu(); setupModeMenu(m_modemenu, *this);

@@ -147,8 +147,7 @@ case OFF:

break; case NONE: break; - case ALLWINDOWS: - { + case ALLWINDOWS: { BScreen::Workspaces::const_iterator workspace_it = m_screen.getWorkspacesList().begin(); BScreen::Workspaces::const_iterator workspace_it_end = m_screen.getWorkspacesList().end(); for (; workspace_it != workspace_it_end; ++workspace_it) {

@@ -168,8 +167,7 @@ }

} // fall through and add icons case LASTMODE: - case ICONS: - { + case ICONS: { BScreen::Icons &iconlist = m_screen.getIconList(); BScreen::Icons::iterator iconit = iconlist.begin(); BScreen::Icons::iterator iconit_end = iconlist.end();

@@ -178,9 +176,8 @@ m_toolbar->addIcon(*iconit);

} } break; - case WORKSPACE: - { - Workspace::Windows &wins = m_screen.getCurrentWorkspace()->windowList(); + case WORKSPACE: { + Workspace::Windows &wins = m_screen.currentWorkspace()->windowList(); Workspace::Windows::iterator wit = wins.begin(); Workspace::Windows::iterator wit_end = wins.end(); for (; wit != wit_end; ++wit) {

@@ -188,9 +185,8 @@ m_toolbar->addIcon(*wit);

} } // fall through and add icons for this workspace - case WORKSPACEICONS: - { - m_current_workspace = m_screen.getCurrentWorkspaceID(); + case WORKSPACEICONS: { + m_current_workspace = m_screen.currentWorkspaceID(); BScreen::Icons &wiconlist = m_screen.getIconList(); BScreen::Icons::iterator iconit = wiconlist.begin();

@@ -273,7 +269,8 @@ case WORKSPACE:

case ALLWINDOWS: break; case WORKSPACEICONS: - if (win.workspaceNumber() != m_current_workspace) break; + if (win.workspaceNumber() != m_current_workspace) + break; // else fall through and do the same as icons (knowing it is the right ws) case LASTMODE: case ICONS:

@@ -313,10 +310,12 @@ }

} void ToolbarHandler::updateCurrentWorkspace(BScreen &screen) { - if (&screen != &m_screen) return; + if (&screen != &m_screen) + return; // if only displaying current workspace, update list // otherwise ignore it - if (m_mode != WORKSPACE && m_mode != WORKSPACEICONS) return; + if (m_mode != WORKSPACE && m_mode != WORKSPACEICONS) + return; m_toolbar->delAllIcons(); initForScreen(m_screen); }
M src/Window.ccsrc/Window.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.176 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: Window.cc,v 1.177 2003/05/15 12:00:46 fluxgen Exp $ #include "Window.hh"

@@ -236,16 +236,16 @@ stuck(false), send_focus_message(false), m_managed(false),

m_screen(scr), m_timer(this), display(0), - m_windowmenu(menutheme, scr.getScreenNumber(), *scr.getImageControl()), + m_windowmenu(menutheme, scr.screenNumber(), *scr.getImageControl()), m_layermenu(new LayerMenu<FluxboxWindow>(menutheme, - scr.getScreenNumber(), + scr.screenNumber(), *scr.getImageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this, false)), m_old_decoration(DECOR_NORMAL), m_client(&client), - m_frame(new FbWinFrame(tm, *scr.getImageControl(), scr.getScreenNumber(), 0, 0, 100, 100)), + m_frame(new FbWinFrame(tm, *scr.getImageControl(), scr.screenNumber(), 0, 0, 100, 100)), m_layeritem(m_frame->window(), layer), m_layernum(layer.getLayerNum()), m_parent(scr.rootWindow()) {

@@ -269,16 +269,16 @@ stuck(false), send_focus_message(false), m_managed(false),

m_screen(scr), m_timer(this), display(0), - m_windowmenu(menutheme, scr.getScreenNumber(), *scr.getImageControl()), + m_windowmenu(menutheme, scr.screenNumber(), *scr.getImageControl()), m_layermenu(new LayerMenu<FluxboxWindow>(menutheme, - scr.getScreenNumber(), + scr.screenNumber(), *scr.getImageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this, false)), m_old_decoration(DECOR_NORMAL), m_client(new WinClient(w, *this)), - m_frame(new FbWinFrame(tm, *scr.getImageControl(), scr.getScreenNumber(), 0, 0, 100, 100)), + m_frame(new FbWinFrame(tm, *scr.getImageControl(), scr.screenNumber(), 0, 0, 100, 100)), m_layeritem(m_frame->window(), layer), m_layernum(layer.getLayerNum()), m_parent(scr.rootWindow()) {

@@ -484,8 +484,8 @@ int real_y = frame().y();

if (real_x >= 0 && real_y + frame().y() >= 0 && - real_x <= (signed) screen().getWidth() && - real_y <= (signed) screen().getHeight()) + real_x <= (signed) screen().width() && + real_y <= (signed) screen().height()) place_window = false; } else

@@ -500,7 +500,7 @@

positionWindows(); if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) - m_workspace_number = screen().getCurrentWorkspaceID(); + m_workspace_number = screen().currentWorkspaceID(); restoreAttributes();

@@ -1180,23 +1180,23 @@ if (((signed) (frame().x() + frame().width())) < 0) {

if (((signed) (frame().y() + frame().height())) < 0) { moveResize(screen().rootTheme().borderWidth(), screen().rootTheme().borderWidth(), frame().width(), frame().height()); - } else if (frame().y() > (signed) screen().getHeight()) { - moveResize(screen().rootTheme().borderWidth(), screen().getHeight() - frame().height(), + } else if (frame().y() > (signed) screen().height()) { + moveResize(screen().rootTheme().borderWidth(), screen().height() - frame().height(), frame().width(), frame().height()); } else { moveResize(screen().rootTheme().borderWidth(), frame().y() + screen().rootTheme().borderWidth(), frame().width(), frame().height()); } - } else if (frame().x() > (signed) screen().getWidth()) { + } else if (frame().x() > (signed) screen().width()) { if (((signed) (frame().y() + frame().height())) < 0) { - moveResize(screen().getWidth() - frame().width(), screen().rootTheme().borderWidth(), + moveResize(screen().width() - frame().width(), screen().rootTheme().borderWidth(), frame().width(), frame().height()); - } else if (frame().y() > (signed) screen().getHeight()) { - moveResize(screen().getWidth() - frame().width(), - screen().getHeight() - frame().height(), + } else if (frame().y() > (signed) screen().height()) { + moveResize(screen().width() - frame().width(), + screen().height() - frame().height(), frame().width(), frame().height()); } else { - moveResize(screen().getWidth() - frame().width(), + moveResize(screen().width() - frame().width(), frame().y() + screen().rootTheme().borderWidth(), frame().width(), frame().height()); }

@@ -1299,8 +1299,8 @@ if (oplock) return;

oplock = true; if (iconic || reassoc) { - screen().reassociateWindow(this, screen().getCurrentWorkspace()->workspaceID(), false); - } else if (moving || m_workspace_number != screen().getCurrentWorkspace()->workspaceID()) { + screen().reassociateWindow(this, screen().currentWorkspace()->workspaceID(), false); + } else if (moving || m_workspace_number != screen().currentWorkspace()->workspaceID()) { oplock = false; return; }

@@ -1384,12 +1384,12 @@ m_old_width = frame().width();

m_old_height = frame().height(); m_old_pos_x = frame().x(); m_old_pos_y = frame().y(); - unsigned int left_x = screen().getMaxLeft(); - unsigned int max_width = screen().getMaxRight(); - unsigned int max_top = screen().getMaxTop(); + unsigned int left_x = screen().maxLeft(); + unsigned int max_width = screen().maxRight(); + unsigned int max_top = screen().maxTop(); moveResize(left_x, max_top, max_width - left_x, - screen().getMaxBottom() - max_top - frame().window().borderWidth()); + screen().maxBottom() - max_top - frame().window().borderWidth()); } else { // demaximize, restore to old values moveResize(m_old_pos_x, m_old_pos_y, m_old_width, m_old_height);

@@ -1399,8 +1399,8 @@ maximized = !maximized;

} void FluxboxWindow::maximizeHorizontal() { - unsigned int left_x = screen().getMaxLeft(); - unsigned int max_width = screen().getMaxRight(); + unsigned int left_x = screen().maxLeft(); + unsigned int max_width = screen().maxRight(); moveResize(left_x, frame().y(), max_width - left_x, frame().height() - frame().window().borderWidth());

@@ -1410,10 +1410,10 @@ /**

Maximize window horizontal */ void FluxboxWindow::maximizeVertical() { - unsigned int max_top = screen().getMaxTop(); + unsigned int max_top = screen().maxTop(); moveResize(frame().x(), max_top, frame().width() - frame().window().borderWidth(), - screen().getMaxBottom() - max_top); + screen().maxBottom() - max_top); }

@@ -1862,7 +1862,7 @@

m_current_state = save_state; } - if (( m_blackbox_attrib.workspace != screen().getCurrentWorkspaceID()) && + if (( m_blackbox_attrib.workspace != screen().currentWorkspaceID()) && ( m_blackbox_attrib.workspace < screen().getCount())) { m_workspace_number = m_blackbox_attrib.workspace;

@@ -2434,12 +2434,12 @@ m_last_resize_x = me.x_root;

m_last_resize_y = me.y_root; if (moved_x && screen().isWorkspaceWarping()) { - unsigned int cur_id = screen().getCurrentWorkspaceID(); + unsigned int cur_id = screen().currentWorkspaceID(); unsigned int new_id = cur_id; const int warpPad = screen().getEdgeSnapThreshold(); // 1) if we're inside the border threshold // 2) if we moved in the right direction - if (me.x_root >= int(screen().getWidth()) - warpPad - 1 && + if (me.x_root >= int(screen().width()) - warpPad - 1 && moved_x > 0) { //warp right new_id = (cur_id + 1) % screen().getCount();

@@ -2448,7 +2448,7 @@ } else if (me.x_root <= warpPad &&

moved_x < 0) { //warp left new_id = (cur_id + screen().getCount() - 1) % screen().getCount(); - dx = screen().getWidth() - me.x_root-1; // move mouse to screen width - 1 + dx = screen().width() - me.x_root-1; // move mouse to screen width - 1 } if (new_id != cur_id) { XWarpPointer(display, None, None, 0, 0, 0, 0, dx, 0);

@@ -2559,12 +2559,12 @@ dx -= screen().rootTheme().borderWidth();

dy -= screen().rootTheme().borderWidth(); if (screen().getEdgeSnapThreshold()) { - int drx = screen().getWidth() - (dx + 1); + int drx = screen().width() - (dx + 1); if (dx > 0 && dx < drx && dx < screen().getEdgeSnapThreshold()) dx = 0; else if (drx > 0 && drx < screen().getEdgeSnapThreshold()) - dx = screen().getWidth() - 1; + dx = screen().width() - 1; int dty, dby;

@@ -2821,8 +2821,8 @@ m_last_move_x, m_last_move_y,

frame().width() + 2*frame().window().borderWidth()-1, frame().height() + 2*frame().window().borderWidth()-1); moveResize(m_last_move_x, m_last_move_y, frame().width(), frame().height()); - if (m_workspace_number != screen().getCurrentWorkspaceID()) { - screen().reassociateWindow(this, screen().getCurrentWorkspaceID(), true); + if (m_workspace_number != screen().currentWorkspaceID()) { + screen().reassociateWindow(this, screen().currentWorkspaceID(), true); frame().show(); } fluxbox->ungrab();

@@ -2853,7 +2853,7 @@ if (screen().doOpaqueMove()) {

return; } - if (m_workspace_number == screen().getCurrentWorkspaceID()) { + if (m_workspace_number == screen().currentWorkspaceID()) { frame().show(); } XSync(display,false);

@@ -2930,13 +2930,13 @@

///////////////////////////////////// // begin by checking the screen edges - snapToWindow(dx, dy, left, right, top, bottom, 0, screen().getWidth(), 0, screen().getHeight()); + snapToWindow(dx, dy, left, right, top, bottom, 0, screen().width(), 0, screen().height()); ///////////////////////////////////// // now check window edges Workspace::Windows &wins = - screen().getCurrentWorkspace()->windowList(); + screen().currentWorkspace()->windowList(); Workspace::Windows::iterator it = wins.begin(); Workspace::Windows::iterator it_end = wins.end();

@@ -2951,26 +2951,6 @@ (*it)->y(),

(*it)->y() + (*it)->height() + 2*borderW); } - ///////////////////////////////////// - // now the toolbar - - Toolbar *tbar = screen().getToolbar(); - if (tbar) - snapToWindow(dx, dy, left, right, top, bottom, - tbar->x(), tbar->x() + tbar->width() + 2*borderW, - tbar->y(), tbar->y() + tbar->height() + 2*borderW); - - ///////////////////////////////////// - // and the slit - -#ifdef SLIT - Slit *slit = screen().getSlit(); - if (slit) - snapToWindow(dx, dy, left, right, top, bottom, - slit->x(), slit->x() + slit->width() + 2*borderW, - slit->y(), slit->y() + slit->height() + 2*borderW); -#endif // SLIT - // commit if (dx <= screen().getEdgeSnapThreshold()) orig_left += dx;

@@ -3066,10 +3046,11 @@ }

//finds and redraw the icon label void FluxboxWindow::updateIcon() { - if (screen().getToolbar()) { + //!! TODO we shouldn't know about the toolbar in fluxboxwindow! + if (screen().toolbar()) { const IconBar *iconbar = 0; const IconBarObj *icon = 0; - if ((iconbar = screen().getToolbar()->iconBar()) != 0) { + if ((iconbar = screen().toolbar()->iconBar()) != 0) { if ((icon = iconbar->findIcon(this)) != 0) iconbar->draw(icon, icon->width()); }

@@ -3216,7 +3197,7 @@ (m_workspace_number != net.workspace)) {

screen().reassociateWindow(this, net.workspace, true); - if (screen().getCurrentWorkspaceID() != net.workspace) + if (screen().currentWorkspaceID() != net.workspace) withdraw(); else deiconify();
M src/Workspace.ccsrc/Workspace.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.64 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: Workspace.cc,v 1.65 2003/05/15 12:00:46 fluxgen Exp $ #include "Workspace.hh"

@@ -115,7 +115,7 @@

Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager, unsigned int i): m_screen(scrn), m_lastfocus(0), - m_clientmenu(*scrn.menuTheme(), scrn.getScreenNumber(), *scrn.getImageControl()), + m_clientmenu(*scrn.menuTheme(), scrn.screenNumber(), *scrn.getImageControl()), m_layermanager(layermanager), m_name(""), m_id(i),

@@ -401,7 +401,7 @@ }

bool Workspace::isCurrent() const{ - return (m_id == screen().getCurrentWorkspaceID()); + return (m_id == screen().currentWorkspaceID()); }

@@ -440,7 +440,7 @@ clears the m_windowlist

*/ void Workspace::shutdown() { #ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): scr "<<screen().getScreenNumber()<<", ws "<< + cerr<<__FILE__<<"("<<__FUNCTION__<<"): scr "<<screen().screenNumber()<<", ws "<< m_id<<", windowlist:"<<endl; copy(m_windowlist.begin(), m_windowlist.end(), ostream_iterator<FluxboxWindow *>(cerr, " \n"));

@@ -507,10 +507,10 @@

test_x = root_x - (win_w / 2); test_y = root_y - (win_h / 2); - min_x = (int) screen().getMaxLeft(); - min_y = (int) screen().getMaxTop(); - max_x = (int) screen().getMaxRight() - win_w; - max_y = (int) screen().getMaxBottom() - win_h; + min_x = (int) screen().maxLeft(); + min_y = (int) screen().maxTop(); + max_x = (int) screen().maxRight() - win_w; + max_y = (int) screen().maxBottom() - win_h; // keep the window inside the screen

@@ -539,21 +539,21 @@

test_y = 0; if (screen().getColPlacementDirection() == BScreen::BOTTOMTOP) - test_y = screen().getHeight() - win_h - test_y; + test_y = screen().height() - win_h - test_y; while (((screen().getColPlacementDirection() == BScreen::BOTTOMTOP) ? - test_y > 0 : test_y + win_h < (signed) screen().getHeight()) && + test_y > 0 : test_y + win_h < (signed) screen().height()) && ! placed) { test_x = 0; if (screen().getRowPlacementDirection() == BScreen::RIGHTLEFT) - test_x = screen().getWidth() - win_w - test_x; + test_x = screen().width() - win_w - test_x; while (((screen().getRowPlacementDirection() == BScreen::RIGHTLEFT) ? - test_x > 0 : test_x + win_w < (signed) screen().getWidth()) && ! placed) { + test_x > 0 : test_x + win_w < (signed) screen().width()) && ! placed) { placed = true;

@@ -599,19 +599,19 @@ test_x = 0;

if (screen().getRowPlacementDirection() == BScreen::RIGHTLEFT) - test_x = screen().getWidth() - win_w - test_x; + test_x = screen().width() - win_w - test_x; while (((screen().getRowPlacementDirection() == BScreen::RIGHTLEFT) ? - test_x > 0 : test_x + win_w < (signed) screen().getWidth()) && + test_x > 0 : test_x + win_w < (signed) screen().width()) && !placed) { test_y = 0; if (screen().getColPlacementDirection() == BScreen::BOTTOMTOP) - test_y = screen().getHeight() - win_h - test_y; + test_y = screen().height() - win_h - test_y; while (((screen().getColPlacementDirection() == BScreen::BOTTOMTOP) ? - test_y > 0 : test_y + win_h < (signed) screen().getHeight()) && + test_y > 0 : test_y + win_h < (signed) screen().height()) && !placed) { placed = True;

@@ -656,8 +656,8 @@

// cascade placement or smart placement failed if (! placed) { - if (((unsigned) m_cascade_x > (screen().getWidth() / 2)) || - ((unsigned) m_cascade_y > (screen().getHeight() / 2))) + if (((unsigned) m_cascade_x > (screen().width() / 2)) || + ((unsigned) m_cascade_y > (screen().height() / 2))) m_cascade_x = m_cascade_y = 32; place_x = m_cascade_x;

@@ -667,10 +667,10 @@ m_cascade_x += win.titleHeight();

m_cascade_y += win.titleHeight(); } - if (place_x + win_w > (signed) screen().getWidth()) - place_x = (((signed) screen().getWidth()) - win_w) / 2; - if (place_y + win_h > (signed) screen().getHeight()) - place_y = (((signed) screen().getHeight()) - win_h) / 2; + if (place_x + win_w > (signed) screen().width()) + place_x = (((signed) screen().width()) - win_w) / 2; + if (place_y + win_h > (signed) screen().height()) + place_y = (((signed) screen().height()) - win_h) / 2; win.moveResize(place_x, place_y, win.width(), win.height());
M src/fluxbox.ccsrc/fluxbox.cc

@@ -22,7 +22,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.148 2003/05/15 11:17:27 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.149 2003/05/15 12:00:46 fluxgen Exp $ #include "fluxbox.hh"

@@ -523,7 +523,7 @@

#endif // HAVE_RANDR m_screen_list.push_back(screen); - m_atomhandler.push_back(&screen->getToolbarHandler()); + m_atomhandler.push_back(&screen->toolbarHandler()); // attach screen signals to this screen->currentWorkspaceSig().attach(this);

@@ -919,15 +919,15 @@ if (mx < 0) mx = 0;

if (my < 0) my = 0; if (mx + screen->getWorkspacemenu()->width() > - screen->getWidth()) { - mx = screen->getWidth() - + screen->width()) { + mx = screen->width() - screen->getWorkspacemenu()->width() - screen->getWorkspacemenu()->fbwindow().borderWidth(); } if (my + screen->getWorkspacemenu()->height() > - screen->getHeight()) { - my = screen->getHeight() - + screen->height()) { + my = screen->height() - screen->getWorkspacemenu()->height() - screen->getWorkspacemenu()->fbwindow().borderWidth(); }

@@ -948,15 +948,15 @@

if (mx < 0) mx = 0; if (my < 0) my = 0; - if (mx + screen->getRootmenu()->width() > screen->getWidth()) { - mx = screen->getWidth() - + if (mx + screen->getRootmenu()->width() > screen->width()) { + mx = screen->width() - screen->getRootmenu()->width() - screen->getRootmenu()->fbwindow().borderWidth(); } if (my + screen->getRootmenu()->height() > - screen->getHeight()) { - my = screen->getHeight() - + screen->height()) { + my = screen->height() - screen->getRootmenu()->height() - screen->getRootmenu()->fbwindow().borderWidth(); }

@@ -1274,7 +1274,7 @@ break;

case Keys::ATTACHLAST: //!! just attach last window to focused window if (m_focused_window) { - Workspace *space = keyscreen->getCurrentWorkspace(); + Workspace *space = keyscreen->currentWorkspace(); Workspace::Windows &wins = space->windowList(); if (wins.size() == 1) break;

@@ -1283,7 +1283,7 @@ BScreen::FocusedWindows::iterator it = fwins.begin();

for (; it != fwins.end(); ++it) { if ((*it)->fbwindow() != m_focused_window && (*it)->fbwindow()->workspaceNumber() == - keyscreen->getCurrentWorkspaceID()) { + keyscreen->currentWorkspaceID()) { m_focused_window->attachClient(**it); break; }

@@ -1296,7 +1296,7 @@ m_focused_window->detachClient(m_focused_window->winClient());

} break; case Keys::EXECUTE: { //execute command on keypress - FbCommands::ExecuteCmd cmd(m_key->getExecCommand(), mousescreen->getScreenNumber()); + FbCommands::ExecuteCmd cmd(m_key->getExecCommand(), mousescreen->screenNumber()); cmd.execute(); } break; case Keys::QUIT:

@@ -1314,15 +1314,15 @@

if (mx < 0) mx = 0; if (my < 0) my = 0; - if (mx + mousescreen->getRootmenu()->width() > mousescreen->getWidth()) { - mx = mousescreen->getWidth() - + if (mx + mousescreen->getRootmenu()->width() > mousescreen->width()) { + mx = mousescreen->width() - mousescreen->getRootmenu()->width() - mousescreen->getRootmenu()->fbwindow().borderWidth(); } if (my + mousescreen->getRootmenu()->height() > - mousescreen->getHeight()) { - my = mousescreen->getHeight() - + mousescreen->height()) { + my = mousescreen->height() - mousescreen->getRootmenu()->height() - mousescreen->getRootmenu()->fbwindow().borderWidth(); }

@@ -1571,9 +1571,9 @@ if (win.isStuck()) {

// if we're sticky then reassociate window // to all workspaces BScreen &scr = win.screen(); - if (scr.getCurrentWorkspaceID() != win.workspaceNumber()) { + if (scr.currentWorkspaceID() != win.workspaceNumber()) { scr.reassociateWindow(&win, - scr.getCurrentWorkspaceID(), + scr.currentWorkspaceID(), true); } }

@@ -1785,7 +1785,7 @@ //Save screen resources

for (; it != it_end; ++it) { BScreen *screen = *it; - int screen_number = screen->getScreenNumber(); + int screen_number = screen->screenNumber(); /* #ifdef SLIT

@@ -2003,7 +2003,7 @@ database = XrmGetFileDatabase(DEFAULT_INITFILE);

XrmValue value; char *value_type, name_lookup[1024], class_lookup[1024]; - int screen_number = screen.getScreenNumber(); + int screen_number = screen.screenNumber(); sprintf(name_lookup, "session.screen%d.rowPlacementDirection", screen_number); sprintf(class_lookup, "Session.Screen%d.RowPlacementDirection", screen_number);

@@ -2185,8 +2185,8 @@ database = XrmGetFileDatabase(DEFAULT_INITFILE);

XrmValue value; char *value_type, name_lookup[1024], class_lookup[1024]; - sprintf(name_lookup, "session.screen%d.rootCommand", screen.getScreenNumber()); - sprintf(class_lookup, "Session.Screen%d.RootCommand", screen.getScreenNumber()); + sprintf(name_lookup, "session.screen%d.rootCommand", screen.screenNumber()); + sprintf(class_lookup, "Session.Screen%d.RootCommand", screen.screenNumber()); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { screen.saveRootCommand(value.addr==0 ? "": value.addr);

@@ -2368,7 +2368,7 @@ } else {

old_win = m_focused_window; old_screen = &old_win->screen(); - old_tbar = old_screen->getToolbar(); + old_tbar = old_screen->toolbar(); old_wkspc = old_screen->getWorkspace(old_win->workspaceNumber()); old_win->setFocusFlag(false);

@@ -2385,7 +2385,7 @@ if (winscreen == m_screen_list.end()) {

m_focused_window = 0; // the window pointer wasn't valid, mark no window focused } else { screen = *winscreen; - tbar = screen->getToolbar(); + tbar = screen->toolbar(); wkspc = screen->getWorkspace(win->workspaceNumber()); m_focused_window = win; // update focused window win->setFocusFlag(true); // set focus flag

@@ -2419,7 +2419,7 @@ void Fluxbox::revertFocus(BScreen &screen) {

// Relevant resources: // resource.focus_last = whether we focus last focused when changing workspace // Fluxbox::FocusModel = sloppy, click, whatever - WinClient *next_focus = screen.getLastFocusedWindow(screen.getCurrentWorkspaceID()); + WinClient *next_focus = screen.getLastFocusedWindow(screen.currentWorkspaceID()); // if setting focus fails, or isn't possible, fallback correctly if (!(next_focus && next_focus->fbwindow() &&