From aa72e23c8e1f6decf0bb78f8bd909e3e67b3a9da Mon Sep 17 00:00:00 2001 From: fluxgen Date: Sun, 11 May 2003 13:36:12 +0000 Subject: minor cleaning --- src/Ewmh.cc | 4 ++-- src/Gnome.cc | 8 ++++---- src/Remember.cc | 10 +++++----- src/Screen.cc | 20 ++++++++++---------- src/Toolbar.cc | 4 ++-- src/ToolbarHandler.cc | 10 +++++----- src/Window.cc | 10 +++++----- src/Window.hh | 10 ++++------ src/Workspace.cc | 18 +++++++++--------- src/fluxbox.cc | 42 +++++++++++++++++++++--------------------- 10 files changed, 67 insertions(+), 69 deletions(-) diff --git a/src/Ewmh.cc b/src/Ewmh.cc index c4349b9..a61d9a6 100644 --- a/src/Ewmh.cc +++ b/src/Ewmh.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Ewmh.cc,v 1.21 2003/05/10 22:56:48 fluxgen Exp $ +// $Id: Ewmh.cc,v 1.22 2003/05/11 13:36:10 fluxgen Exp $ #include "Ewmh.hh" @@ -120,7 +120,7 @@ void Ewmh::setupWindow(FluxboxWindow &win) { if (desktop == 0xFFFFFFFF && !win.isStuck()) win.stick(); else - win.getScreen().sendToWorkspace(desktop, &win, false); + win.screen().sendToWorkspace(desktop, &win, false); XFree(data); } diff --git a/src/Gnome.cc b/src/Gnome.cc index 11cce0d..6e4a8b7 100644 --- a/src/Gnome.cc +++ b/src/Gnome.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Gnome.cc,v 1.20 2003/05/10 22:57:37 fluxgen Exp $ +// $Id: Gnome.cc,v 1.21 2003/05/11 13:36:10 fluxgen Exp $ #include "Gnome.hh" @@ -118,7 +118,7 @@ void Gnome::setupWindow(FluxboxWindow &win) { (unsigned char **) &data) == Success && data) { unsigned int workspace_num = *data; if (win.getWorkspaceNumber() != workspace_num) - win.getScreen().reassociateWindow(&win, workspace_num, false); + win.screen().reassociateWindow(&win, workspace_num, false); XFree (data); } @@ -269,8 +269,8 @@ bool Gnome::checkClientMessage(const XClientMessageEvent &ce, BScreen * screen, #endif//!DEBUG if ( win !=0 && // the message sent to client window? ce.data.l[0] >= 0 && - ce.data.l[0] < (signed)win->getScreen().getCount()) { - win->getScreen().changeWorkspaceID(ce.data.l[0]); + ce.data.l[0] < (signed)win->screen().getCount()) { + win->screen().changeWorkspaceID(ce.data.l[0]); } else if (screen!=0 && //the message sent to root window? ce.data.l[0] >= 0 && diff --git a/src/Remember.cc b/src/Remember.cc index e2729d7..e82c1aa 100644 --- a/src/Remember.cc +++ b/src/Remember.cc @@ -21,7 +21,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Remember.cc,v 1.12 2003/05/10 22:47:55 fluxgen Exp $ +// $Id: Remember.cc,v 1.13 2003/05/11 13:36:10 fluxgen Exp $ #include "Remember.hh" #include "StringUtil.hh" @@ -97,7 +97,7 @@ private: FbTk::Menu *createRememberMenu(Remember &remember, FluxboxWindow &win) { // each fluxboxwindow has its own windowmenu // so we also create a remember menu just for it... - BScreen &screen = win.getScreen(); + BScreen &screen = win.screen(); FbTk::Menu *menu = new FbMenu(*screen.menuTheme(), screen.getScreenNumber(), *screen.getImageControl(), @@ -465,7 +465,7 @@ void Remember::rememberAttrib(WinClient &winclient, Attribute attrib) { app->rememberWorkspace(win->getWorkspaceNumber()); break; case REM_DIMENSIONS: - app->rememberDimensions(win->getWidth(), win->getHeight()); + app->rememberDimensions(win->width(), win->height()); break; case REM_POSITION: app->rememberPosition(win->getXFrame(), win->getYFrame()); @@ -573,7 +573,7 @@ void Remember::setupWindow(FluxboxWindow &win) { if (app == 0) return; // nothing to do - BScreen &screen = win.getScreen(); + BScreen &screen = win.screen(); if (app->workspace_remember) { // TODO: fix placement to initialise properly @@ -631,7 +631,7 @@ void Remember::updateWindowClose(FluxboxWindow &win) { if (app->workspace_remember) app->rememberWorkspace(win.getWorkspaceNumber()); if (app->dimensions_remember) - app->rememberDimensions(win.getWidth(), win.getHeight()); + app->rememberDimensions(win.width(), win.height()); if (app->position_remember) app->rememberPosition(win.getXFrame(), win.getYFrame()); if (app->shadedstate_remember) diff --git a/src/Screen.cc b/src/Screen.cc index 3964c9a..1c5f7d4 100644 --- a/src/Screen.cc +++ b/src/Screen.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.cc,v 1.153 2003/05/11 11:47:19 rathnor Exp $ +// $Id: Screen.cc,v 1.154 2003/05/11 13:36:10 fluxgen Exp $ #include "Screen.hh" @@ -981,7 +981,7 @@ void BScreen::removeClient(WinClient &client) { if (client.transientFor() && client.transientFor()->fbwindow()) client.transientFor()->fbwindow()->setInputFocus(); else - Fluxbox::instance()->revertFocus(&focused->getScreen()); + Fluxbox::instance()->revertFocus(&focused->screen()); } } @@ -1112,7 +1112,7 @@ void BScreen::sendToWorkspace(unsigned int id, FluxboxWindow *win, bool changeWS if (id != current_workspace->workspaceID()) { XSync(FbTk::App::instance()->display(), True); - if (win && &win->getScreen() == this && + if (win && &win->screen() == this && (! win->isStuck())) { if (win->isIconic()) { @@ -1478,7 +1478,7 @@ void BScreen::nextFocus(int opts) { const int num_windows = getCurrentWorkspace()->getCount(); if (focused != 0) { - if (focused->getScreen().getScreenNumber() == + if (focused->screen().getScreenNumber() == getScreenNumber()) { have_focused = true; focused_window_number = focused->getWindowNumber(); @@ -1568,7 +1568,7 @@ void BScreen::prevFocus(int opts) { int num_windows = getCurrentWorkspace()->getCount(); if ((focused = Fluxbox::instance()->getFocusedWindow())) { - if (focused->getScreen().getScreenNumber() == + if (focused->screen().getScreenNumber() == getScreenNumber()) { have_focused = true; focused_window_number = focused->getWindowNumber(); @@ -1660,7 +1660,7 @@ void BScreen::raiseFocus() { Fluxbox * const fb = Fluxbox::instance(); if (fb->getFocusedWindow()) - if (fb->getFocusedWindow()->getScreen().getScreenNumber() == + if (fb->getFocusedWindow()->screen().getScreenNumber() == getScreenNumber()) { have_focused = true; focused_window_number = fb->getFocusedWindow()->getWindowNumber(); @@ -1689,9 +1689,9 @@ void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) { int weight = 999999, exposure = 0; // extreme values int borderW = m_root_theme->borderWidth(), top = win.getYFrame(), - bottom = win.getYFrame() + win.getHeight() + 2*borderW, + bottom = win.getYFrame() + win.height() + 2*borderW, left = win.getXFrame(), - right = win.getXFrame() + win.getWidth() + 2*borderW; + right = win.getXFrame() + win.width() + 2*borderW; Workspace::Windows &wins = getCurrentWorkspace()->getWindowList(); Workspace::Windows::iterator it = wins.begin(); @@ -1702,9 +1702,9 @@ void BScreen::dirFocus(FluxboxWindow &win, FocusDir dir) { int edge=0, upper=0, lower=0, oedge=0, oupper=0, olower=0; int otop = (*it)->getYFrame(), - obottom = (*it)->getYFrame() + (*it)->getHeight() + 2*borderW, + obottom = (*it)->getYFrame() + (*it)->height() + 2*borderW, oleft = (*it)->getXFrame(), - oright = (*it)->getXFrame() + (*it)->getWidth() + 2*borderW; + oright = (*it)->getXFrame() + (*it)->width() + 2*borderW; // check if they intersect switch (dir) { case FOCUSUP: diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 8027a0b..6354022 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Toolbar.cc,v 1.78 2003/05/10 13:57:07 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.79 2003/05/11 13:36:11 fluxgen Exp $ #include "Toolbar.hh" @@ -787,7 +787,7 @@ void Toolbar::redrawWindowLabel(bool redraw) { FluxboxWindow *foc = Fluxbox::instance()->getFocusedWindow(); // don't draw focused window if it's not on the same screen - if (&foc->getScreen() != &screen() || foc->getTitle().size() == 0) + if (&foc->screen() != &screen() || foc->getTitle().size() == 0) return; unsigned int newlen = foc->getTitle().size(); diff --git a/src/ToolbarHandler.cc b/src/ToolbarHandler.cc index bc21772..8a40bbe 100644 --- a/src/ToolbarHandler.cc +++ b/src/ToolbarHandler.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: ToolbarHandler.cc,v 1.8 2003/04/16 23:33:59 rathnor Exp $ +// $Id: ToolbarHandler.cc,v 1.9 2003/05/11 13:36:11 fluxgen Exp $ /** * The ToolbarHandler class acts as a rough interface to the toolbar. @@ -205,7 +205,7 @@ void ToolbarHandler::initForScreen(BScreen &screen) { } void ToolbarHandler::setupWindow(FluxboxWindow &win) { - if (&win.getScreen() != &m_screen) + if (&win.screen() != &m_screen) return; switch (m_mode) { @@ -233,7 +233,7 @@ void ToolbarHandler::setupWindow(FluxboxWindow &win) { } void ToolbarHandler::updateWindowClose(FluxboxWindow &win) { - if (&win.getScreen() != &m_screen) + if (&win.screen() != &m_screen) return; // check status of window (in current workspace, etc) and remove if necessary @@ -262,7 +262,7 @@ void ToolbarHandler::updateWindowClose(FluxboxWindow &win) { } void ToolbarHandler::updateState(FluxboxWindow &win) { - if (&win.getScreen() != &m_screen) + if (&win.screen() != &m_screen) return; // this function only relevant for icons @@ -292,7 +292,7 @@ void ToolbarHandler::updateState(FluxboxWindow &win) { void ToolbarHandler::updateWorkspace(FluxboxWindow &win) { - if (&win.getScreen() != &m_screen) + if (&win.screen() != &m_screen) return; // don't care about current workspace except if in workspace mode diff --git a/src/Window.cc b/src/Window.cc index 4161c3b..be8fab6 100644 --- a/src/Window.cc +++ b/src/Window.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.cc,v 1.168 2003/05/10 23:04:37 fluxgen Exp $ +// $Id: Window.cc,v 1.169 2003/05/11 13:36:11 fluxgen Exp $ #include "Window.hh" @@ -2836,8 +2836,8 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { int top = orig_top; // orig include the borders int left = orig_left; - int right = orig_left + getWidth() + 2*borderW; - int bottom = orig_top + getHeight() + 2*borderW; + int right = orig_left + width() + 2*borderW; + int bottom = orig_top + height() + 2*borderW; ///////////////////////////////////// // begin by checking the screen edges @@ -2858,9 +2858,9 @@ void FluxboxWindow::doSnapping(int &orig_left, int &orig_top) { snapToWindow(dx, dy, left, right, top, bottom, (*it)->getXFrame(), - (*it)->getXFrame() + (*it)->getWidth() + 2*borderW, + (*it)->getXFrame() + (*it)->width() + 2*borderW, (*it)->getYFrame(), - (*it)->getYFrame() + (*it)->getHeight() + 2*borderW); + (*it)->getYFrame() + (*it)->height() + 2*borderW); } ///////////////////////////////////// diff --git a/src/Window.hh b/src/Window.hh index 1bae6e2..e6d8633 100644 --- a/src/Window.hh +++ b/src/Window.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Window.hh,v 1.70 2003/05/10 23:03:49 fluxgen Exp $ +// $Id: Window.hh,v 1.71 2003/05/11 13:36:11 fluxgen Exp $ #ifndef WINDOW_HH #define WINDOW_HH @@ -282,9 +282,6 @@ public: inline const ClientList &clientList() const { return m_clientlist; } inline WinClient &winClient() { return *m_client; } inline const WinClient &winClient() const { return *m_client; } - // obsolete - inline const BScreen &getScreen() const { return m_screen; } - inline BScreen &getScreen() { return m_screen; } inline const BScreen &screen() const { return m_screen; } inline BScreen &screen() { return m_screen; } @@ -316,8 +313,9 @@ public: int getWindowNumber() const { return m_window_number; } int getLayerNum() const { return m_layernum; } void setLayerNum(int layernum); - unsigned int getWidth() const { return m_frame.width(); } - unsigned int getHeight() const { return m_frame.height(); } + + unsigned int width() const { return m_frame.width(); } + unsigned int height() const { return m_frame.height(); } unsigned int getClientHeight() const; unsigned int getClientWidth() const; unsigned int getTitleHeight() const { return m_frame.titleHeight(); } diff --git a/src/Workspace.cc b/src/Workspace.cc index e0d23b6..93ba77e 100644 --- a/src/Workspace.cc +++ b/src/Workspace.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Workspace.cc,v 1.60 2003/05/10 23:07:04 fluxgen Exp $ +// $Id: Workspace.cc,v 1.61 2003/05/11 13:36:12 fluxgen Exp $ #include "Workspace.hh" @@ -81,7 +81,7 @@ public: if (m_client.fbwindow() == 0) return; FluxboxWindow &win = *m_client.fbwindow(); - BScreen &scr = win.getScreen(); + BScreen &scr = win.screen(); // determine workspace change for (size_t i=0; i test_x && @@ -634,11 +634,11 @@ void Workspace::placeWindow(FluxboxWindow &win) { for (; it != it_end && placed; ++it) { curr_x = (*it)->getXFrame(); curr_y = (*it)->getYFrame(); - curr_w = (*it)->getWidth() + (*it)->getFbWindow().borderWidth()*2; + curr_w = (*it)->width() + (*it)->getFbWindow().borderWidth()*2; curr_h = (((*it)->isShaded()) ? (*it)->getTitleHeight() - : (*it)->getHeight()) + + : (*it)->height()) + (*it)->getFbWindow().borderWidth()*2; @@ -687,5 +687,5 @@ void Workspace::placeWindow(FluxboxWindow &win) { place_y = (((signed) screen.getHeight()) - win_h) / 2; - win.moveResize(place_x, place_y, win.getWidth(), win.getHeight()); + win.moveResize(place_x, place_y, win.width(), win.height()); } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index 482df5c..64be2e8 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: fluxbox.cc,v 1.134 2003/05/10 23:07:42 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.135 2003/05/11 13:36:12 fluxgen Exp $ #include "fluxbox.hh" @@ -964,7 +964,7 @@ void Fluxbox::handleUnmapNotify(XUnmapEvent &ue) { client = 0; // it's invalid now when win destroyed the client if (win == m_focused_window) - revertFocus(&win->getScreen()); + revertFocus(&win->screen()); // finaly destroy window if empty if (win->numClients() == 0) { @@ -1383,64 +1383,64 @@ void Fluxbox::doWindowAction(int action, const int param) { case Keys::NUDGERIGHT: m_focused_window->moveResize( m_focused_window->getXFrame()+param, m_focused_window->getYFrame(), - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; case Keys::NUDGELEFT: m_focused_window->moveResize( m_focused_window->getXFrame()-param, m_focused_window->getYFrame(), - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; case Keys::NUDGEUP: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame()-param, - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; case Keys::NUDGEDOWN: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame()+param, - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; // NOTE !!! BIGNUDGExxxx is not needed, just use 10 as a parameter case Keys::BIGNUDGERIGHT: m_focused_window->moveResize( m_focused_window->getXFrame()+10, m_focused_window->getYFrame(), - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; case Keys::BIGNUDGELEFT: m_focused_window->moveResize( m_focused_window->getXFrame()-10, m_focused_window->getYFrame(), - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; case Keys::BIGNUDGEUP: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame()-10, - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; case Keys::BIGNUDGEDOWN: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame()+10, - m_focused_window->getWidth(), m_focused_window->getHeight()); + m_focused_window->width(), m_focused_window->height()); break; case Keys::HORIZINC: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame(), - m_focused_window->getWidth()+10, m_focused_window->getHeight()); + m_focused_window->width() + 10, m_focused_window->height()); break; case Keys::VERTINC: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame(), - m_focused_window->getWidth(), m_focused_window->getHeight()+10); + m_focused_window->width(), m_focused_window->height()+10); break; case Keys::HORIZDEC: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame(), - m_focused_window->getWidth()-10, m_focused_window->getHeight()); + m_focused_window->width() - 10, m_focused_window->height()); break; case Keys::VERTDEC: m_focused_window->moveResize( m_focused_window->getXFrame(), m_focused_window->getYFrame(), - m_focused_window->getWidth(), m_focused_window->getHeight()-10); + m_focused_window->width(), m_focused_window->height()-10); break; case Keys::TOGGLEDECOR: @@ -1526,16 +1526,16 @@ void Fluxbox::update(FbTk::Subject *changedsub) { // if window changed to iconic state // add to icon list if (win.isIconic()) { - Workspace *space = win.getScreen().getWorkspace(win.getWorkspaceNumber()); + Workspace *space = win.screen().getWorkspace(win.getWorkspaceNumber()); if (space != 0) space->removeWindow(&win); - win.getScreen().addIcon(&win); + win.screen().addIcon(&win); } if (win.isStuck()) { // if we're sticky then reassociate window // to all workspaces - BScreen &scr = win.getScreen(); + BScreen &scr = win.screen(); if (scr.getCurrentWorkspaceID() != win.getWorkspaceNumber()) { scr.reassociateWindow(&win, scr.getCurrentWorkspaceID(), @@ -1554,7 +1554,7 @@ void Fluxbox::update(FbTk::Subject *changedsub) { m_atomhandler[i]->updateWindowClose(win); } // make sure each workspace get this - BScreen &scr = win.getScreen(); + BScreen &scr = win.screen(); scr.removeWindow(&win); if (m_focused_window == &win) revertFocus(&scr); @@ -1599,7 +1599,7 @@ void Fluxbox::update(FbTk::Subject *changedsub) { WinClient &client = subj->winClient(); if (client.fbwindow()) { - BScreen &screen = client.fbwindow()->getScreen(); + BScreen &screen = client.fbwindow()->screen(); screen.updateNetizenWindowDel(client.window()); screen.removeClient(client); } @@ -2315,7 +2315,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) { m_focused_window = 0; } else { old_win = m_focused_window; - old_screen = &old_win->getScreen(); + old_screen = &old_win->screen(); old_tbar = old_screen->getToolbar(); old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber()); @@ -2329,7 +2329,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) { // make sure we have a valid win pointer with a valid screen ScreenList::iterator winscreen = std::find(m_screen_list.begin(), m_screen_list.end(), - &win->getScreen()); + &win->screen()); if (winscreen == m_screen_list.end()) { m_focused_window = 0; // the window pointer wasn't valid, mark no window focused } else { -- cgit v0.11.2