From 51c33a318d66cb6c5f54b7ee9ebea06c7898fbcf Mon Sep 17 00:00:00 2001 From: fluxgen Date: Thu, 9 Jan 2003 17:29:14 +0000 Subject: removed --- src/Rootmenu.cc | 158 -------------------------------------------------------- src/Rootmenu.hh | 47 ----------------- 2 files changed, 205 deletions(-) delete mode 100644 src/Rootmenu.cc delete mode 100644 src/Rootmenu.hh diff --git a/src/Rootmenu.cc b/src/Rootmenu.cc deleted file mode 100644 index bb290cd..0000000 --- a/src/Rootmenu.cc +++ /dev/null @@ -1,158 +0,0 @@ -// Rootmenu.cc for fluxbox -// Copyright (c) 2002 Henrik Kinnunen (fluxgen at linuxmail.org) -// Rootmenu.cc for Blackbox - an X11 Window manager -// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// 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. - -//Use GNU extensions -#ifndef _GNU_SOURCE -#define _GNU_SOURCE -#endif // _GNU_SOURCE - -#ifdef HAVE_CONFIG_H -# include "../config.h" -#endif // HAVE_CONFIG_H - -#include "fluxbox.hh" -#include "Rootmenu.hh" -#include "Screen.hh" - -#ifdef HAVE_STDIO_H -# include -#endif // HAVE_STDIO_H - -#ifdef STDC_HEADERS -# include -# include -#endif // STDC_HEADERS - -#ifdef HAVE_SYS_PARAM_H -# include -#endif // HAVE_SYS_PARAM_H - -#ifndef MAXPATHLEN -#define MAXPATHLEN 255 -#endif // MAXPATHLEN - - -Rootmenu::Rootmenu(BScreen *scrn) - : Basemenu(scrn), - auto_group_window(0) -{ - -} - - -void Rootmenu::itemSelected(int button, unsigned int index) { - - Fluxbox *fluxbox = Fluxbox::instance(); - - if (button == 1) { - BasemenuItem *item = find(index); - - if (item->function()) { - switch (item->function()) { - case BScreen::EXECUTE: - if (item->exec().size()) { -#ifndef __EMX__ - char displaystring[MAXPATHLEN]; - sprintf(displaystring, "DISPLAY=%s", - DisplayString(screen()->getBaseDisplay()->getXDisplay())); - sprintf(displaystring + strlen(displaystring) - 1, "%d", - screen()->getScreenNumber()); - - screen()->setAutoGroupWindow(useAutoGroupWindow()); - - bexec(item->exec().c_str(), displaystring); -#else // __EMX__ - spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec().c_str(), NULL); -#endif // !__EMX__ - } - break; - - case BScreen::RESTART: - fluxbox->restart(); - break; - - case BScreen::RESTARTOTHER: - if (item->exec().size()) - fluxbox->restart(item->exec().c_str()); - break; - - case BScreen::EXIT: - fluxbox->shutdown(); - break; - - case BScreen::SETSTYLE: - if (item->exec().size()) { - fluxbox->saveStyleFilename(item->exec().c_str()); - fluxbox->reconfigureTabs(); - } - fluxbox->reconfigure(); - fluxbox->save_rc(); - break; - case BScreen::RECONFIGURE: - fluxbox->reconfigure(); - return; - } - if (! (screen()->getRootmenu()->isTorn() || isTorn()) && - item->function() != BScreen::RECONFIGURE && - item->function() != BScreen::SETSTYLE) - hide(); - } - } -} - -void Rootmenu::setAutoGroupWindow(Window window) { - auto_group_window = window; -} - -void Rootmenu::show() { - Basemenu::show(); - // make sure it's full visible - - int newx = x(), newy = y(); - if (x() < 0) - newx = 0; - else if (x() + width() > screen()->getWidth()) - newx = screen()->getWidth() - width(); - if (y() < 0) - newy = 0; - else if (y() + height() > screen()->getHeight()) - newy = screen()->getHeight() - height(); - - move(newx, newy); -} - -Window Rootmenu::useAutoGroupWindow() { - // Return and clear the auto-grouping state. - Window w = auto_group_window; - if (w) - auto_group_window = 0; // clear it immediately - // If not set check the parent and the parent's parent, ... - else if (parent()) { - // TODO: dynamic_cast throws std::bad_cast! - Rootmenu *p = dynamic_cast(parent()); - w = p->useAutoGroupWindow(); - } - return w; -} - - diff --git a/src/Rootmenu.hh b/src/Rootmenu.hh deleted file mode 100644 index 75df30d..0000000 --- a/src/Rootmenu.hh +++ /dev/null @@ -1,47 +0,0 @@ -// Rootmenu.hh for fluxbox -// Copyright (c) 2002 Henrik Kinnunen (fluxgen at linuxmail.org) -// -// Rootmenu.hh for Blackbox - an X11 Window manager -// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) -// -// Permission is hereby granted, free of charge, to any person obtaining a -// copy of this software and associated documentation files (the "Software"), -// to deal in the Software without restriction, including without limitation -// the rights to use, copy, modify, merge, publish, distribute, sublicense, -// and/or sell copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following conditions: -// -// The above copyright notice and this permission notice shall be included in -// all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL -// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -// 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. - -#ifndef ROOTMENU_HH -#define ROOTMENU_HH - -#include "Basemenu.hh" - -class Rootmenu: public Basemenu { -public: - explicit Rootmenu(BScreen *scr); - void setAutoGroupWindow(Window window); - void show(); - -protected: - virtual void itemSelected(int button, unsigned int index); - -private: - Window useAutoGroupWindow(); - Window auto_group_window; - -}; - - -#endif // ROOTMENU_HH - -- cgit v0.11.2