updated to match BaseMenu
@@ -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.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 @@ workspacemenu->reconfigure();
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 @@ int focused_window_number = -1;
if (fluxbox->getFocusedWindow()) if (fluxbox->getFocusedWindow()->getScreen()->getScreenNumber() == - getScreenNumber()) { + getScreenNumber()) { have_focused = true; focused_window_number = fluxbox->getFocusedWindow()->getWindowNumber(); }@@ -1192,12 +1192,12 @@
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 @@ continue; //read next line
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 @@ }
} } - 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) {
@@ -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: 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 @@ } else if (e->button == Button2 && (! on_top)) {
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();
@@ -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.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 @@ } else if (be->button == 3) {
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();
@@ -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.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 @@ } else
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 @@
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 @@ if (windowmenu) {
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(); }
@@ -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.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 @@ screen->getRootmenu()->hide();
} 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 @@ } else if (be.button == 3) {
//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);