From 02253281ee96b0b68a3369d4a02bd90a216c9c58 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Mon, 8 Apr 2002 22:36:30 +0000 Subject: updated to match BaseMenu --- src/Screen.cc | 48 ++++++++++++++++++++++++------------------------ src/Slit.cc | 16 +++++++--------- src/Toolbar.cc | 14 +++++++------- src/Window.cc | 28 ++++++++++++++-------------- src/Windowmenu.cc | 8 ++++++-- src/fluxbox.cc | 26 +++++++++++++------------- 6 files changed, 71 insertions(+), 69 deletions(-) diff --git a/src/Screen.cc b/src/Screen.cc index 86a3cee..79d627e 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.43 2002/04/04 14:28:54 fluxgen Exp $ +// $Id: Screen.cc,v 1.44 2002/04/08 22:26:25 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -596,7 +596,7 @@ void BScreen::reconfigure(void) { iconmenu->reconfigure(); { - int remember_sub = rootmenu->getCurrentSubmenu(); + int remember_sub = rootmenu->currentSubmenu(); initMenu(); raiseWindows(0, 0); rootmenu->reconfigure(); @@ -984,48 +984,48 @@ void BScreen::raiseWindows(Window *workspace_stack, int num) { Window session_stack[(num + workspacesList.size() + rootmenuList.size() + 30)]; int i = 0; - XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID()); - session_stack[i++] = iconmenu->getWindowID(); + XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->windowID()); + session_stack[i++] = iconmenu->windowID(); Workspaces::iterator wit = workspacesList.begin(); Workspaces::iterator wit_end = workspacesList.end(); for (; wit != wit_end; ++wit) { - session_stack[i++] = (*wit)->getMenu()->getWindowID(); + session_stack[i++] = (*wit)->getMenu()->windowID(); } - session_stack[i++] = workspacemenu->getWindowID(); + session_stack[i++] = workspacemenu->windowID(); - session_stack[i++] = configmenu->getFocusmenu()->getWindowID(); - session_stack[i++] = configmenu->getPlacementmenu()->getWindowID(); - session_stack[i++] = configmenu->getTabmenu()->getWindowID(); - session_stack[i++] = configmenu->getWindowID(); + session_stack[i++] = configmenu->getFocusmenu()->windowID(); + session_stack[i++] = configmenu->getPlacementmenu()->windowID(); + session_stack[i++] = configmenu->getTabmenu()->windowID(); + session_stack[i++] = configmenu->windowID(); #ifdef SLIT - session_stack[i++] = slit->getMenu().getDirectionmenu()->getWindowID(); - session_stack[i++] = slit->getMenu().getPlacementmenu()->getWindowID(); + session_stack[i++] = slit->getMenu().getDirectionmenu()->windowID(); + session_stack[i++] = slit->getMenu().getPlacementmenu()->windowID(); #ifdef XINERAMA if (hasXinerama()) { - session_stack[i++] = slit->getMenu().getHeadmenu()->getWindowID(); + session_stack[i++] = slit->getMenu().getHeadmenu()->windowID(); } #endif // XINERAMA - session_stack[i++] = slit->getMenu().getWindowID(); + session_stack[i++] = slit->getMenu().windowID(); #endif // SLIT session_stack[i++] = - toolbar->getMenu()->getPlacementmenu()->getWindowID(); + toolbar->getMenu()->getPlacementmenu()->windowID(); #ifdef XINERAMA if (hasXinerama()) { - session_stack[i++] = toolbar->getMenu()->getHeadmenu()->getWindowID(); + session_stack[i++] = toolbar->getMenu()->getHeadmenu()->windowID(); } #endif // XINERAMA - session_stack[i++] = toolbar->getMenu()->getWindowID(); + session_stack[i++] = toolbar->getMenu()->windowID(); Rootmenus::iterator rit = rootmenuList.begin(); Rootmenus::iterator rit_end = rootmenuList.end(); for (; rit != rit_end; ++rit) { - session_stack[i++] = (*rit)->getWindowID(); + session_stack[i++] = (*rit)->windowID(); } - session_stack[i++] = rootmenu->getWindowID(); + session_stack[i++] = rootmenu->windowID(); if (toolbar->isOnTop()) session_stack[i++] = toolbar->getWindowID(); @@ -1176,7 +1176,7 @@ void BScreen::raiseFocus(void) { if (fluxbox->getFocusedWindow()) if (fluxbox->getFocusedWindow()->getScreen()->getScreenNumber() == - getScreenNumber()) { + getScreenNumber()) { have_focused = true; focused_window_number = fluxbox->getFocusedWindow()->getWindowNumber(); } @@ -1192,12 +1192,12 @@ void BScreen::initMenu(void) { if (rootmenu) { rootmenuList.erase(rootmenuList.begin(), rootmenuList.end()); - while (rootmenu->getCount()) + while (rootmenu->numberOfItems()) rootmenu->remove(0); } else rootmenu = new Rootmenu(this); - Bool defaultMenu = true; + bool defaultMenu = true; if (fluxbox->getMenuFilename()) { ifstream menu_file(fluxbox->getMenuFilename()); @@ -1290,7 +1290,7 @@ Bool BScreen::parseMenuFile(ifstream &file, Rootmenu *menu, int &row) { I18n *i18n = I18n::instance(); if (str_key == "end") { - return ((menu->getCount() == 0) ? true : false); + return ((menu->numberOfItems() == 0) ? true : false); } else if (str_key == "nop") { menu->insert(str_label.c_str()); } else if (str_key == "exec") { // exec @@ -1469,7 +1469,7 @@ Bool BScreen::parseMenuFile(ifstream &file, Rootmenu *menu, int &row) { } } - return ((menu->getCount() == 0) ? true : false); + return ((menu->numberOfItems() == 0) ? true : false); } void BScreen::createStyleMenu(Rootmenu *menu, bool newmenu, const char *label, const char *directory) { diff --git a/src/Slit.cc b/src/Slit.cc index f0a37c7..45ec396 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.11 2002/04/08 18:58:27 fluxgen Exp $ +// $Id: Slit.cc,v 1.12 2002/04/08 22:26:58 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -567,20 +567,18 @@ void Slit::buttonPressEvent(XButtonEvent *e) { XLowerWindow(display, frame.window); } else if (e->button == Button3) { if (! slitmenu.isVisible()) { - int x, y; - - x = e->x_root - (slitmenu.getWidth() / 2); - y = e->y_root - (slitmenu.getHeight() / 2); + int x = e->x_root - (slitmenu.width() / 2), + y = e->y_root - (slitmenu.height() / 2); if (x < 0) x = 0; - else if (x + slitmenu.getWidth() > screen->getWidth()) - x = screen->getWidth() - slitmenu.getWidth(); + else if (x + slitmenu.width() > screen->getWidth()) + x = screen->getWidth() - slitmenu.width(); if (y < 0) y = 0; - else if (y + slitmenu.getHeight() > screen->getHeight()) - y = screen->getHeight() - slitmenu.getHeight(); + else if (y + slitmenu.height() > screen->getHeight()) + y = screen->getHeight() - slitmenu.height(); slitmenu.move(x, y); slitmenu.show(); diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 546d970..389b6db 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.19 2002/04/04 11:28:19 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.20 2002/04/08 22:30:51 fluxgen Exp $ // stupid macros needed to access some functions in version 2 of the GNU C // library @@ -1035,18 +1035,18 @@ void Toolbar::buttonPressEvent(XButtonEvent *be) { if (! toolbarmenu->isVisible()) { int x, y; - x = be->x_root - (toolbarmenu->getWidth() / 2); - y = be->y_root - (toolbarmenu->getHeight() / 2); + x = be->x_root - (toolbarmenu->width() / 2); + y = be->y_root - (toolbarmenu->height() / 2); if (x < 0) x = 0; - else if (x + toolbarmenu->getWidth() > screen->getWidth()) - x = screen->getWidth() - toolbarmenu->getWidth(); + else if (x + toolbarmenu->width() > screen->getWidth()) + x = screen->getWidth() - toolbarmenu->width(); if (y < 0) y = 0; - else if (y + toolbarmenu->getHeight() > screen->getHeight()) - y = screen->getHeight() - toolbarmenu->getHeight(); + else if (y + toolbarmenu->height() > screen->getHeight()) + y = screen->getHeight() - toolbarmenu->height(); toolbarmenu->move(x, y); toolbarmenu->show(); diff --git a/src/Window.cc b/src/Window.cc index 3b0afd8..80edb86 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.40 2002/04/04 22:39:52 fluxgen Exp $ +// $Id: Window.cc,v 1.41 2002/04/08 22:32:07 fluxgen Exp $ #include "Window.hh" @@ -1377,7 +1377,7 @@ void FluxboxWindow::reconfigure(void) { XUngrabButton(display, Button1, AnyModifier, frame.plate); if (windowmenu) { - windowmenu->move(windowmenu->getX(), frame.y + frame.title_h); + windowmenu->move(windowmenu->x(), frame.y + frame.title_h); windowmenu->reconfigure(); } @@ -3192,30 +3192,30 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent *be) { int mx = 0, my = 0; if (frame.title == be->window || frame.label == be->window) { - mx = be->x_root - (windowmenu->getWidth() / 2); + mx = be->x_root - (windowmenu->width() / 2); my = frame.y + frame.title_h; } else if (frame.handle == be->window) { - mx = be->x_root - (windowmenu->getWidth() / 2); - my = frame.y + frame.y_handle - windowmenu->getHeight(); + mx = be->x_root - (windowmenu->width() / 2); + my = frame.y + frame.y_handle - windowmenu->height(); } else { bool buttonproc=false; if (buttonproc) - mx = be->x_root - (windowmenu->getWidth() / 2); + mx = be->x_root - (windowmenu->width() / 2); if (be->y <= (signed) frame.bevel_w) my = frame.y + frame.y_border; else - my = be->y_root - (windowmenu->getHeight() / 2); + my = be->y_root - (windowmenu->height() / 2); } - if (mx > (signed) (frame.x + frame.width - windowmenu->getWidth())) - mx = frame.x + frame.width - windowmenu->getWidth(); + if (mx > (signed) (frame.x + frame.width - windowmenu->width())) + mx = frame.x + frame.width - windowmenu->width(); if (mx < frame.x) mx = frame.x; - if (my > (signed) (frame.y + frame.y_handle - windowmenu->getHeight())) - my = frame.y + frame.y_handle - windowmenu->getHeight(); + if (my > (signed) (frame.y + frame.y_handle - windowmenu->height())) + my = frame.y + frame.y_handle - windowmenu->height(); if (my < (signed) (frame.y + ((decorations.titlebar) ? frame.title_h : frame.y_border))) my = frame.y + @@ -3225,9 +3225,9 @@ void FluxboxWindow::buttonPressEvent(XButtonEvent *be) { if (! windowmenu->isVisible()) { // if not window menu is visible then show it windowmenu->move(mx, my); windowmenu->show(); - XRaiseWindow(display, windowmenu->getWindowID()); - XRaiseWindow(display, windowmenu->getSendToMenu()->getWindowID()); - XRaiseWindow(display, windowmenu->getSendGroupToMenu()->getWindowID()); + XRaiseWindow(display, windowmenu->windowID()); + XRaiseWindow(display, windowmenu->getSendToMenu()->windowID()); + XRaiseWindow(display, windowmenu->getSendGroupToMenu()->windowID()); } else //else hide menu windowmenu->hide(); } diff --git a/src/Windowmenu.cc b/src/Windowmenu.cc index a79c608..5846261 100644 --- a/src/Windowmenu.cc +++ b/src/Windowmenu.cc @@ -1,3 +1,5 @@ +// Windowmenu.cc for Fluxbox +// Copyright (c) 2001-2002 Henrik Kinnunen (fluxgen@linuxmail.org) // Windowmenu.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // @@ -19,6 +21,8 @@ // 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 $ + //use GNU extensions #ifndef _GNU_SOURCE #define _GNU_SOURCE @@ -228,9 +232,9 @@ void Windowmenu::SendtoWorkspacemenu::itemSelected(int button, unsigned int inde void Windowmenu::SendtoWorkspacemenu::update(void) { - unsigned int i, r = getCount(); + unsigned int i, r = numberOfItems(); - if (getCount() != 0) { + if (numberOfItems() != 0) { for (i = 0; i < r; ++i) remove(0); } diff --git a/src/fluxbox.cc b/src/fluxbox.cc index c2f53e2..3d7cc2d 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.45 2002/04/04 14:23:54 fluxgen Exp $ +// $Id: fluxbox.cc,v 1.46 2002/04/08 22:36:30 fluxgen Exp $ //Use some GNU extensions #ifndef _GNU_SOURCE @@ -946,24 +946,24 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { } else if (be.button == 2) { int mx = be.x_root - - (screen->getWorkspacemenu()->getWidth() / 2); + (screen->getWorkspacemenu()->width() / 2); int my = be.y_root - - (screen->getWorkspacemenu()->getTitleHeight() / 2); + (screen->getWorkspacemenu()->titleHeight() / 2); if (mx < 0) mx = 0; if (my < 0) my = 0; - if (mx + screen->getWorkspacemenu()->getWidth() > + if (mx + screen->getWorkspacemenu()->width() > screen->getWidth()) { mx = screen->getWidth() - - screen->getWorkspacemenu()->getWidth() - + screen->getWorkspacemenu()->width() - screen->getBorderWidth(); } - if (my + screen->getWorkspacemenu()->getHeight() > + if (my + screen->getWorkspacemenu()->height() > screen->getHeight()) { my = screen->getHeight() - - screen->getWorkspacemenu()->getHeight() - + screen->getWorkspacemenu()->height() - screen->getBorderWidth(); } screen->getWorkspacemenu()->move(mx, my); @@ -976,23 +976,23 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) { //calculate placement of workspace menu //and show/hide it int mx = be.x_root - - (screen->getRootmenu()->getWidth() / 2); + (screen->getRootmenu()->width() / 2); int my = be.y_root - - (screen->getRootmenu()->getTitleHeight() / 2); + (screen->getRootmenu()->titleHeight() / 2); if (mx < 0) mx = 0; if (my < 0) my = 0; - if (mx + screen->getRootmenu()->getWidth() > screen->getWidth()) { + if (mx + screen->getRootmenu()->width() > screen->getWidth()) { mx = screen->getWidth() - - screen->getRootmenu()->getWidth() - + screen->getRootmenu()->width() - screen->getBorderWidth(); } - if (my + screen->getRootmenu()->getHeight() > + if (my + screen->getRootmenu()->height() > screen->getHeight()) { my = screen->getHeight() - - screen->getRootmenu()->getHeight() - + screen->getRootmenu()->height() - screen->getBorderWidth(); } screen->getRootmenu()->move(mx, my); -- cgit v0.11.2