From 46e9b6e5462af0a05808c4d636526c04067a3623 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Tue, 9 Apr 2002 23:20:40 +0000 Subject: update from Workspace changes --- src/Screen.cc | 32 ++++++++++++++++---------------- src/Screen.hh | 4 ++-- src/Tab.cc | 4 ++-- src/Window.cc | 8 ++++---- src/Windowmenu.cc | 4 ++-- src/Workspacemenu.cc | 4 +++- src/fluxbox.cc | 15 +++++++-------- 7 files changed, 36 insertions(+), 35 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 79d627e..8cade50 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.44 2002/04/08 22:26:25 fluxgen Exp $ +// $Id: Screen.cc,v 1.45 2002/04/09 23:15:21 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -371,12 +371,12 @@ resource(rm, screenname, altscreenname) for (int i = 0; i < *resource.workspaces; ++i) { wkspc = new Workspace(this, workspacesList.size()); workspacesList.push_back(wkspc); - workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); + workspacemenu->insert(wkspc->name().c_str(), wkspc->menu()); } } else { wkspc = new Workspace(this, workspacesList.size()); workspacesList.push_back(wkspc); - workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); + workspacemenu->insert(wkspc->name().c_str(), wkspc->menu()); } workspacemenu->insert(i18n-> @@ -720,8 +720,8 @@ int BScreen::addWorkspace(void) { Workspace *wkspc = new Workspace(this, workspacesList.size()); workspacesList.push_back(wkspc); //add workspace to workspacemenu - workspacemenu->insert(wkspc->getName(), wkspc->getMenu(), - wkspc->getWorkspaceID() + 2); //+2 so we add it after "remove last" + workspacemenu->insert(wkspc->name().c_str(), wkspc->menu(), + wkspc->workspaceID() + 2); //+2 so we add it after "remove last" workspacemenu->update(); saveWorkspaces(workspacesList.size()); @@ -739,12 +739,12 @@ int BScreen::removeLastWorkspace(void) { if (workspacesList.size() > 1) { Workspace *wkspc = workspacesList.back(); - if (current_workspace->getWorkspaceID() == wkspc->getWorkspaceID()) - changeWorkspaceID(current_workspace->getWorkspaceID() - 1); + if (current_workspace->workspaceID() == wkspc->workspaceID()) + changeWorkspaceID(current_workspace->workspaceID() - 1); wkspc->removeAll(); - workspacemenu->remove(wkspc->getWorkspaceID()+2); // + 2 is where workspaces starts + workspacemenu->remove(wkspc->workspaceID()+2); // + 2 is where workspaces starts workspacemenu->update(); //remove last workspace @@ -766,12 +766,12 @@ void BScreen::changeWorkspaceID(unsigned int id) { if (! current_workspace || id >= workspacesList.size()) return; - if (id != current_workspace->getWorkspaceID()) { + if (id != current_workspace->workspaceID()) { XSync(fluxbox->getXDisplay(), true); current_workspace->hideAll(); - workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, false); + workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, false); if (fluxbox->getFocusedWindow() && fluxbox->getFocusedWindow()->getScreen() == this && @@ -784,7 +784,7 @@ void BScreen::changeWorkspaceID(unsigned int id) { current_workspace = getWorkspace(id); - workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, true); + workspacemenu->setItemSelected(current_workspace->workspaceID() + 2, true); toolbar->redrawWorkspaceLabel(true); current_workspace->showAll(); @@ -803,7 +803,7 @@ void BScreen::sendToWorkspace(unsigned int id, bool changeWS) { if (! current_workspace || id >= workspacesList.size()) return; - if (id != current_workspace->getWorkspaceID()) { + if (id != current_workspace->workspaceID()) { XSync(fluxbox->getXDisplay(), True); win = fluxbox->getFocusedWindow(); @@ -840,12 +840,12 @@ void BScreen::addNetizen(Netizen *n) { for (; it != it_end; ++it) { for (int i = 0; i < (*it)->getCount(); ++i) { n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(), - (*it)->getWorkspaceID()); + (*it)->workspaceID()); } } Window f = ((fluxbox->getFocusedWindow()) ? - fluxbox->getFocusedWindow()->getClientWindow() : None); + fluxbox->getFocusedWindow()->getClientWindow() : None); n->sendWindowFocus(f); } @@ -990,7 +990,7 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) { Workspaces::iterator wit = workspacesList.begin(); Workspaces::iterator wit_end = workspacesList.end(); for (; wit != wit_end; ++wit) { - session_stack[i++] = (*wit)->getMenu()->windowID(); + session_stack[i++] = (*wit)->menu()->windowID(); } session_stack[i++] = workspacemenu->windowID(); @@ -1074,7 +1074,7 @@ void BScreen::reassociateWindow(FluxboxWindow *w, unsigned int wkspc_id, bool ig if (! w) return; if (wkspc_id >= workspaceNames.size()) - wkspc_id = current_workspace->getWorkspaceID(); + wkspc_id = current_workspace->workspaceID(); if (w->getWorkspaceNumber() == wkspc_id) return; diff --git a/src/Screen.hh b/src/Screen.hh index 4c8ffae..025b65c 100644 --- a/src/Screen.hh +++ b/src/Screen.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Screen.hh,v 1.28 2002/04/09 12:13:44 fluxgen Exp $ +// $Id: Screen.hh,v 1.29 2002/04/09 23:20:40 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -121,7 +121,7 @@ public: inline const unsigned int getFrameWidth(void) const { return theme->getFrameWidth(); } inline const unsigned int getBorderWidth(void) const { return theme->getBorderWidth(); } inline const unsigned int getBorderWidth2x(void) const { return theme->getBorderWidth()*2; } - inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->getWorkspaceID(); } + inline const unsigned int getCurrentWorkspaceID() const { return current_workspace->workspaceID(); } typedef std::vector Icons; inline const unsigned int getCount(void) const { return workspacesList.size(); } diff --git a/src/Tab.cc b/src/Tab.cc index a14de09..4ade4f7 100644 --- a/src/Tab.cc +++ b/src/Tab.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Tab.cc,v 1.22 2002/04/03 23:01:04 fluxgen Exp $ +// $Id: Tab.cc,v 1.23 2002/04/09 23:15:36 fluxgen Exp $ #include "Tab.hh" @@ -286,7 +286,7 @@ void Tab::stick() { win->stuck = false; if (!win->isIconic()) { BScreen *screen = win->getScreen(); - screen->reassociateWindow(win, screen->getCurrentWorkspace()->getWorkspaceID(), true); + screen->reassociateWindow(win, screen->getCurrentWorkspace()->workspaceID(), true); } } else { diff --git a/src/Window.cc b/src/Window.cc index 80edb86..260fa7c 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.41 2002/04/08 22:32:07 fluxgen Exp $ +// $Id: Window.cc,v 1.42 2002/04/09 23:17:11 fluxgen Exp $ #include "Window.hh" @@ -1952,8 +1952,8 @@ void FluxboxWindow::iconify(void) { void FluxboxWindow::deiconify(bool reassoc, bool raise) { if (iconic || reassoc) { - screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), false); - } else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID()) + screen->reassociateWindow(this, screen->getCurrentWorkspace()->workspaceID(), false); + } else if (workspace_number != screen->getCurrentWorkspace()->workspaceID()) return; setState(NormalState); @@ -2376,7 +2376,7 @@ void FluxboxWindow::stick(void) { stuck = false; if (! iconic) - screen->reassociateWindow(this, screen->getCurrentWorkspace()->getWorkspaceID(), true); + screen->reassociateWindow(this, screen->getCurrentWorkspace()->workspaceID(), true); } else { diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc index 5846261..89956c3 100644 --- a/src/Windowmenu.cc +++ b/src/Windowmenu.cc @@ -21,7 +21,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Windowmenu.cc,v 1.11 2002/04/08 22:35:16 fluxgen Exp $ +// $Id: Windowmenu.cc,v 1.12 2002/04/09 23:19:02 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -239,7 +239,7 @@ void Windowmenu::SendtoWorkspacemenu::update(void) { remove(0); } for (i = 0; i < windowmenu->screen->getCount(); ++i) - insert(windowmenu->screen->getWorkspace(i)->getName()); + insert(windowmenu->screen->getWorkspace(i)->name().c_str()); Basemenu::update(); } diff --git a/src/Workspacemenu.cc b/src/Workspacemenu.cc index ba4ff0a..a9b0b52 100644 --- a/src/Workspacemenu.cc +++ b/src/Workspacemenu.cc @@ -21,6 +21,8 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. +// $Id: Workspacemenu.cc,v 1.6 2002/04/09 23:19:17 fluxgen Exp $ + //use GNU extension #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -63,7 +65,7 @@ void Workspacemenu::itemSelected(int button, unsigned int index) { screen->addWorkspace(); else if (index == 1) screen->removeLastWorkspace(); - else if ((screen->getCurrentWorkspace()->getWorkspaceID() != + else if ((screen->getCurrentWorkspace()->workspaceID() != (index - 2)) && ((index - 2) < screen->getCount())) screen->changeWorkspaceID(index - 2); diff --git a/src/fluxbox.cc b/src/fluxbox.cc index e0895d4..4d26daa 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.48 2002/04/09 12:09:03 cout Exp $ +// $Id: fluxbox.cc,v 1.49 2002/04/09 23:14:25 fluxgen Exp $ //Use some GNU extensions #ifndef _GNU_SOURCE @@ -610,9 +610,8 @@ void Fluxbox::process_event(XEvent *e) { if (iskdedockapp) { XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask); - std::list::iterator it = screenList.begin(); - std::list::iterator it_end = screenList.end(); - for (; (*it) == screenList->last(); ++it) { + std::list::iterator it = screenList.begin(); + for (; (*it) == screenList.back(); ++it) { (*it)->getSlit()->addClient(e->xmaprequest.window); } return; @@ -1850,8 +1849,8 @@ void Fluxbox::save_rc(void) { string workspaces_string(rc_string); for (unsigned int workspace=0; workspace < screen->getCount(); workspace++) { - if (screen->getWorkspace(workspace)->getName()!=0) - workspaces_string.append(screen->getWorkspace(workspace)->getName()); + if (screen->getWorkspace(workspace)->name().size()!=0) + workspaces_string.append(screen->getWorkspace(workspace)->name()); else workspaces_string.append("Null"); workspaces_string.append(","); @@ -2402,7 +2401,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) { old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber()); old_win->setFocusFlag(False); - old_wkspc->getMenu()->setItemSelected(old_win->getWindowNumber(), False); + old_wkspc->menu()->setItemSelected(old_win->getWindowNumber(), false); } @@ -2413,7 +2412,7 @@ void Fluxbox::setFocusedWindow(FluxboxWindow *win) { wkspc = screen->getWorkspace(win->getWorkspaceNumber()); focused_window = win; win->setFocusFlag(True); - wkspc->getMenu()->setItemSelected(win->getWindowNumber(), True); + wkspc->menu()->setItemSelected(win->getWindowNumber(), true); } else focused_window = (FluxboxWindow *) 0; -- cgit v0.11.2