From 5ffb6290c12adc5c45a50758f90549fdfc693216 Mon Sep 17 00:00:00 2001 From: fluxgen Date: Wed, 10 Dec 2003 23:08:06 +0000 Subject: cleaning in the menu code --- src/FbMenu.cc | 6 +-- src/FbMenu.hh | 4 +- src/FbTk/Menu.cc | 113 +++++++++++++++++++++-------------------------------- src/FbTk/Menu.hh | 14 +++---- src/IconbarTool.cc | 4 +- src/LayerMenu.hh | 18 ++++----- src/Remember.cc | 10 +---- src/Screen.cc | 35 ++++++++--------- src/Screen.hh | 6 ++- src/SendToMenu.cc | 4 +- src/Slit.cc | 6 +-- src/Toolbar.cc | 7 ++-- src/Window.cc | 5 +-- src/Workspace.cc | 4 +- src/Xinerama.hh | 4 +- 15 files changed, 102 insertions(+), 138 deletions(-) diff --git a/src/FbMenu.cc b/src/FbMenu.cc index c14d9ff..9a62050 100644 --- a/src/FbMenu.cc +++ b/src/FbMenu.cc @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbMenu.cc,v 1.1 2003/07/10 11:26:40 fluxgen Exp $ +// $Id: FbMenu.cc,v 1.2 2003/12/10 23:08:03 fluxgen Exp $ #include "FbMenu.hh" @@ -27,9 +27,9 @@ #include "Shape.hh" -FbMenu::FbMenu(MenuTheme &tm, int screen_num, FbTk::ImageControl &imgctrl, +FbMenu::FbMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, FbTk::XLayer &layer): - FbTk::Menu(tm, screen_num, imgctrl), + FbTk::Menu(tm, imgctrl), m_layeritem(fbwindow(), layer), m_shape(new Shape(fbwindow(), tm.shapePlaces())) { diff --git a/src/FbMenu.hh b/src/FbMenu.hh index e91002b..4252aa4 100644 --- a/src/FbMenu.hh +++ b/src/FbMenu.hh @@ -19,7 +19,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbMenu.hh,v 1.2 2003/07/10 11:25:13 fluxgen Exp $ +// $Id: FbMenu.hh,v 1.3 2003/12/10 23:08:03 fluxgen Exp $ #ifndef FBMENU_HH #define FBMENU_HH @@ -33,7 +33,7 @@ class Shape; /// a layered and shaped menu class FbMenu:public FbTk::Menu { public: - FbMenu(MenuTheme &tm, int screen_num, FbTk::ImageControl &imgctrl, + FbMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, FbTk::XLayer &layer); ~FbMenu(); void clearWindow(); diff --git a/src/FbTk/Menu.cc b/src/FbTk/Menu.cc index e2aa3c5..59cc310 100644 --- a/src/FbTk/Menu.cc +++ b/src/FbTk/Menu.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.cc,v 1.43 2003/11/28 23:26:27 fluxgen Exp $ +// $Id: Menu.cc,v 1.44 2003/12/10 23:08:06 fluxgen Exp $ //use GNU extensions #ifndef _GNU_SOURCE @@ -48,45 +48,18 @@ using namespace std; -namespace { -Pixmap getRootPixmap(int screen_num) { - Pixmap root_pm = 0; - // get root pixmap for transparency - Display *disp = FbTk::App::instance()->display(); - Atom real_type; - int real_format; - unsigned long items_read, items_left; - unsigned int *data; - if (XGetWindowProperty(disp, RootWindow(disp, screen_num), - XInternAtom(disp, "_XROOTPMAP_ID", false), - 0L, 1L, - false, XA_PIXMAP, &real_type, - &real_format, &items_read, &items_left, - (unsigned char **) &data) == Success && - items_read) { - root_pm = (Pixmap) (*data); - XFree(data); - } - - return root_pm; -} - -}; // end anonymous namespace - namespace FbTk { static Menu *shown = 0; Menu *Menu::s_focused = 0; -Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl): +Menu::Menu(MenuTheme &tm, ImageControl &imgctrl): m_theme(tm), - m_screen_num(screen_num), m_image_ctrl(imgctrl), - m_display(FbTk::App::instance()->display()), m_parent(0), - m_screen_width(DisplayWidth(m_display, screen_num)), - m_screen_height(DisplayHeight(m_display, screen_num)), + m_screen_width(DisplayWidth(FbTk::App::instance()->display(), tm.screenNum())), + m_screen_height(DisplayHeight(FbTk::App::instance()->display(), tm.screenNum())), m_alignment(ALIGNDONTCARE), m_border_width(0), m_themeobserver(*this), @@ -123,7 +96,7 @@ Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl): menu.bevel_w = 2; - menu.width = menu.title_h = menu.item_w = menu.frame_h = + menu.title_h = menu.item_w = menu.frame_h = m_theme.titleFont().height() + menu.bevel_w * 2; menu.sublevels = @@ -132,13 +105,11 @@ Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl): menu.item_h = m_theme.frameFont().height() + menu.bevel_w; - menu.height = menu.title_h + 2 + menu.frame_h; - long event_mask = ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | KeyPressMask | ExposureMask | FocusChangeMask; - //create menu window - menu.window = FbTk::FbWindow(screen_num, - menu.x, menu.y, menu.width, menu.height, + // create menu window + menu.window = FbTk::FbWindow(tm.screenNum(), + 0, 0, 10, 10, event_mask, true); // override redirect @@ -152,7 +123,7 @@ Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl): event_mask |= EnterWindowMask | LeaveWindowMask; //create menu title menu.title = FbTk::FbWindow(menu.window, - 0, 0, menu.width, menu.height, + 0, 0, width(), menu.title_h, event_mask); evm.add(*this, menu.title); @@ -160,7 +131,7 @@ Menu::Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl): event_mask |= PointerMotionMask; menu.frame = FbTk::FbWindow(menu.window, 0, menu.title_h, - menu.width, menu.frame_h, + width(), menu.frame_h ? menu.frame_h : 1, event_mask); evm.add(*this, menu.frame); // update style @@ -421,30 +392,36 @@ void Menu::update(int active_index) { menu.persub = 0; } - menu.width = (menu.sublevels * (menu.item_w)); - if (! menu.width) menu.width = menu.item_w; - menu.frame_h = (menu.item_h * menu.persub); if (menu.frame_h < 0) menu.frame_h = 0; - menu.height = menu.frame_h; + + int new_width = (menu.sublevels * menu.item_w); + int new_height = menu.frame_h; + if (title_vis) - menu.height += menu.title_h + ((menu.frame_h>0)?menu.title.borderWidth():0); + new_height += menu.title_h + ((menu.frame_h>0)?menu.title.borderWidth():0); + + + if (new_width < 1) + new_width = menu.item_w; + + if (new_height < 1) + new_height = 1; - if (menu.height < 1) - menu.height = 1; + menu.window.resize(new_width, new_height); Pixmap tmp; if (title_vis) { tmp = menu.title_pixmap; const FbTk::Texture &tex = m_theme.titleTexture(); - if (tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { + if (!tex.usePixmap()) { menu.title_pixmap = None; menu.title.setBackgroundColor(tex.color()); } else { menu.title_pixmap = - m_image_ctrl.renderImage(menu.width, menu.title_h, tex); + m_image_ctrl.renderImage(width(), menu.title_h, tex); menu.title.setBackgroundPixmap(menu.title_pixmap); } @@ -455,11 +432,11 @@ void Menu::update(int active_index) { tmp = menu.frame_pixmap; const FbTk::Texture &frame_tex = m_theme.frameTexture(); - if (frame_tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { + if (!frame_tex.usePixmap()) { menu.frame_pixmap = None; } else { menu.frame_pixmap = - m_image_ctrl.renderImage(menu.width, menu.frame_h, frame_tex); + m_image_ctrl.renderImage(width(), menu.frame_h, frame_tex); } if (tmp) @@ -467,18 +444,18 @@ void Menu::update(int active_index) { tmp = menu.hilite_pixmap; const FbTk::Texture &hilite_tex = m_theme.hiliteTexture(); - if (hilite_tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) + if (!hilite_tex.usePixmap()) { menu.hilite_pixmap = None; - else + } else menu.hilite_pixmap = m_image_ctrl.renderImage(menu.item_w, menu.item_h, hilite_tex); if (tmp) m_image_ctrl.removeImage(tmp); tmp = menu.sel_pixmap; - if (hilite_tex.type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) + if (!hilite_tex.usePixmap()) { menu.sel_pixmap = None; - else { + } else { int hw = menu.item_h / 2; menu.sel_pixmap = m_image_ctrl.renderImage(hw, hw, hilite_tex); @@ -486,11 +463,11 @@ void Menu::update(int active_index) { if (tmp) m_image_ctrl.removeImage(tmp); - menu.window.resize(menu.width, menu.height); + if (title_vis) { menu.title.moveResize(-menu.title.borderWidth(), -menu.title.borderWidth(), - menu.width + menu.title.borderWidth(), menu.title_h); + width() + menu.title.borderWidth(), menu.title_h); } menu.frame.moveResize(0, ((title_vis) ? menu.title.y() + menu.title.height() + @@ -637,11 +614,11 @@ void Menu::redrawTitle() { switch (m_theme.titleFontJustify()) { case FbTk::RIGHT: - dx += menu.width - l; + dx += width() - l; break; case FbTk::CENTER: - dx += (menu.width - l) / 2; + dx += (width() - l) / 2; break; default: break; @@ -695,10 +672,10 @@ void Menu::drawSubmenu(unsigned int index) { } if (m_alignment == ALIGNBOTTOM && - (y + item->submenu()->menu.height) > ((shifted) ? menu.y_shift : - menu.y) + menu.height) { + (y + item->submenu()->height()) > ((shifted) ? menu.y_shift : + menu.y) + height()) { y = (((shifted) ? menu.y_shift : menu.y) + - menu.height - item->submenu()->menu.height); + height() - item->submenu()->height()); } if ((x + item->submenu()->width()) > m_screen_width) { @@ -1090,13 +1067,13 @@ void Menu::buttonReleaseEvent(XButtonEvent &re) { update(); } - if (re.x >= 0 && re.x <= (signed) menu.width && + if (re.x >= 0 && re.x <= (signed) width() && re.y >= 0 && re.y <= (signed) menu.title_h && re.button == 3) hide(); } else if (re.window == menu.frame && - re.x >= 0 && re.x < (signed) menu.width && + re.x >= 0 && re.x < (signed) width() && re.y >= 0 && re.y < (signed) menu.frame_h) { int sbl = (re.x / menu.item_w), i = (re.y / menu.item_h), @@ -1147,7 +1124,7 @@ void Menu::motionNotifyEvent(XMotionEvent &me) { } } } else if ((! (me.state & Button1Mask)) && me.window == menu.frame && - me.x >= 0 && me.x < (signed) menu.width && + me.x >= 0 && me.x < (signed) width() && me.y >= 0 && me.y < (signed) menu.frame_h) { int sbl = (me.x / menu.item_w), i = (me.y / menu.item_h), w = (sbl * menu.persub) + i; @@ -1230,16 +1207,16 @@ void Menu::enterNotifyEvent(XCrossingEvent &ce) { return; menu.x_shift = menu.x, menu.y_shift = menu.y; - if (menu.x + menu.width > m_screen_width) { - menu.x_shift = m_screen_width - menu.width - 2*m_border_width; + if (menu.x + width() > m_screen_width) { + menu.x_shift = m_screen_width - width() - 2*m_border_width; shifted = true; } else if (menu.x < 0) { menu.x_shift = 0; //-m_border_width; shifted = true; } - if (menu.y + menu.height + 2*m_border_width > m_screen_height) { - menu.y_shift = m_screen_height - menu.height - 2*m_border_width; + if (menu.y + height() + 2*m_border_width > m_screen_height) { + menu.y_shift = m_screen_height - height() - 2*m_border_width; shifted = true; } else if (menu.y + (signed) menu.title_h < 0) { menu.y_shift = 0; // -m_border_width;; diff --git a/src/FbTk/Menu.hh b/src/FbTk/Menu.hh index 333f6d8..9a3f425 100644 --- a/src/FbTk/Menu.hh +++ b/src/FbTk/Menu.hh @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Menu.hh,v 1.24 2003/12/08 16:39:44 fluxgen Exp $ +// $Id: Menu.hh,v 1.25 2003/12/10 23:08:06 fluxgen Exp $ #ifndef FBTK_MENU_HH #define FBTK_MENU_HH @@ -57,7 +57,7 @@ public: */ enum { EMPTY = 0, SQUARE, TRIANGLE, DIAMOND }; - Menu(MenuTheme &tm, int screen_num, ImageControl &imgctrl); + Menu(MenuTheme &tm, ImageControl &imgctrl); virtual ~Menu(); /** @@ -132,7 +132,7 @@ public: //@{ inline bool isTorn() const { return torn; } inline bool isVisible() const { return visible; } - inline int screenNumber() const { return m_screen_num; } + inline int screenNumber() const { return menu.window.screenNumber(); } inline Window window() const { return menu.window.window(); } inline FbWindow &fbwindow() { return menu.window; } inline const FbWindow &fbwindow() const { return menu.window; } @@ -141,8 +141,8 @@ public: inline const std::string &label() const { return menu.label; } inline int x() const { return menu.x; } inline int y() const { return menu.y; } - inline unsigned int width() const { return menu.width; } - inline unsigned int height() const { return menu.height; } + inline unsigned int width() const { return menu.window.width(); } + inline unsigned int height() const { return menu.window.height(); } inline unsigned int numberOfItems() const { return menuitems.size(); } inline int currentSubmenu() const { return which_sub; } inline unsigned int titleHeight() const { return menu.title_h; } @@ -178,8 +178,6 @@ private: typedef std::vector Menuitems; const MenuTheme &m_theme; - Display *m_display; - const int m_screen_num; Menu *m_parent; ImageControl &m_image_ctrl; Menuitems menuitems; @@ -198,7 +196,7 @@ private: std::string label; int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub, grab_x, grab_y; - unsigned int width, height, title_h, frame_h, item_w, item_h, bevel_w, + unsigned int title_h, frame_h, item_w, item_h, bevel_w, bevel_h; } menu; diff --git a/src/IconbarTool.cc b/src/IconbarTool.cc index 5b9702e..ee6095e 100644 --- a/src/IconbarTool.cc +++ b/src/IconbarTool.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: IconbarTool.cc,v 1.20 2003/12/07 17:51:02 fluxgen Exp $ +// $Id: IconbarTool.cc,v 1.21 2003/12/10 23:08:03 fluxgen Exp $ #include "IconbarTool.hh" @@ -186,7 +186,7 @@ IconbarTool::IconbarTool(const FbTk::FbWindow &parent, IconbarTheme &theme, BScr screen.name() + ".iconbar.mode", screen.altName() + ".Iconbar.Mode"), m_rc_use_pixmap(screen.resourceManager(), true, screen.name() + ".iconbar.usePixmap", screen.altName() + ".Iconbar.UsePixmap"), - m_menu(*screen.menuTheme(), menu.screenNumber(), screen.imageControl(), + m_menu(*screen.menuTheme(), screen.imageControl(), *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())) { // setup mode menu diff --git a/src/LayerMenu.hh b/src/LayerMenu.hh index 87e6ddd..1afedb5 100644 --- a/src/LayerMenu.hh +++ b/src/LayerMenu.hh @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: LayerMenu.hh,v 1.6 2003/12/03 22:12:26 fluxgen Exp $ +// $Id: LayerMenu.hh,v 1.7 2003/12/10 23:08:03 fluxgen Exp $ #ifndef LAYERMENU_HH #define LAYERMENU_HH @@ -60,7 +60,7 @@ private: template class LayerMenu : public FbMenu { public: - LayerMenu(MenuTheme &tm, int screen_num, FbTk::ImageControl &imgctrl, + LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, FbTk::XLayer &layer, ItemType *item, bool save_rc); private: @@ -69,9 +69,9 @@ private: template -LayerMenu::LayerMenu(MenuTheme &tm, int screen_num, FbTk::ImageControl &imgctrl, +LayerMenu::LayerMenu(MenuTheme &tm, FbTk::ImageControl &imgctrl, FbTk::XLayer &layer, ItemType *item, bool save_rc): - FbMenu(tm, screen_num, imgctrl, layer), + FbMenu(tm, imgctrl, layer), m_object(item) { @@ -93,18 +93,16 @@ LayerMenu::LayerMenu(MenuTheme &tm, int screen_num, FbTk::ImageControl }; FbTk::RefCount saverc_cmd(new FbTk::SimpleCommand( - *Fluxbox::instance(), - &Fluxbox::save_rc)); + *Fluxbox::instance(), + &Fluxbox::save_rc)); for (size_t i=0; i < 6; ++i) { // TODO: fetch nls string if (save_rc) { - insert(new LayerMenuItem( - layer_menuitems[i].default_str, + insert(new LayerMenuItem(layer_menuitems[i].default_str, m_object, layer_menuitems[i].layernum, saverc_cmd)); } else { - insert(new LayerMenuItem( - layer_menuitems[i].default_str, + insert(new LayerMenuItem(layer_menuitems[i].default_str, m_object, layer_menuitems[i].layernum)); } } diff --git a/src/Remember.cc b/src/Remember.cc index 401d29c..812b109 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.30 2003/11/17 00:20:54 fluxgen Exp $ +// $Id: Remember.cc,v 1.31 2003/12/10 23:08:03 fluxgen Exp $ #include "Remember.hh" #include "ClientPattern.hh" @@ -109,11 +109,7 @@ private: FbTk::Menu *createRememberMenu(Remember &remember, FluxboxWindow &win, bool enabled) { // each fluxboxwindow has its own windowmenu // so we also create a remember menu just for it... - BScreen &screen = win.screen(); - FbTk::Menu *menu = new FbMenu(*screen.menuTheme(), - screen.screenNumber(), - screen.imageControl(), - *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); + FbTk::Menu *menu = win.screen().createMenu(""); // if enabled, then we want this to be a unavailable menu if (!enabled) { @@ -141,8 +137,6 @@ FbTk::Menu *createRememberMenu(Remember &remember, FluxboxWindow &win, bool enab Remember::REM_SHADEDSTATE)); menu->insert(new RememberMenuItem("Layer", remember, win, Remember::REM_LAYER)); - // menu->insert(new RememberMenuItem("Tab", remember, win, - // Remember::REM_TABSTATE)); menu->insert(new RememberMenuItem("Save on close", remember, win, Remember::REM_SAVEONCLOSE)); diff --git a/src/Screen.cc b/src/Screen.cc index 25d91ed..c95b96b 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.246 2003/12/10 22:28:07 fluxgen Exp $ +// $Id: Screen.cc,v 1.247 2003/12/10 23:08:03 fluxgen Exp $ #include "Screen.hh" @@ -133,17 +133,6 @@ int anotherWMRunning(Display *display, XErrorEvent *) { return -1; } -FbTk::Menu *createMenuFromScreen(BScreen &screen, const char *label = 0) { - FbTk::Menu *menu = new FbMenu(*screen.menuTheme(), - screen.screenNumber(), - screen.imageControl(), - *screen.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); - if (label) - menu->setLabel(label); - - return menu; -} - class FocusModelMenuItem : public FbTk::MenuItem { public: FocusModelMenuItem(const char *label, BScreen &screen, @@ -353,10 +342,10 @@ BScreen::BScreen(FbTk::ResourceManager &rm, // setup workspaces and workspace menu - workspacemenu.reset(createMenuFromScreen(*this)); + workspacemenu.reset(createMenu("")); workspacemenu->setInternalMenu(); //!! TODO: NLS - m_iconmenu.reset(createMenuFromScreen(*this, "Icons")); + m_iconmenu.reset(createMenu("Icons")); m_iconmenu->setInternalMenu(); if (*resource.workspaces != 0) { @@ -392,7 +381,7 @@ BScreen::BScreen(FbTk::ResourceManager &rm, fluxbox->load_rc(*this); // TODO: nls - m_configmenu.reset(createMenuFromScreen(*this, "Configuration")); + m_configmenu.reset(createMenu("Configuration")); setupConfigmenu(*m_configmenu.get()); m_configmenu->setInternalMenu(); @@ -569,6 +558,16 @@ void BScreen::update(FbTk::Subject *subj) { renderGeomWindow(); } +FbTk::Menu *BScreen::createMenu(const std::string &label) { + FbTk::Menu *menu = new FbMenu(*menuTheme(), + imageControl(), + *layerManager().getLayer(Fluxbox::instance()->getMenuLayer())); + if (!label.empty()) + menu->setLabel(label.c_str()); + + return menu; +} + void BScreen::reconfigure() { m_menutheme->setAlpha(*resource.menu_alpha); Fluxbox::instance()->loadRootCommand(*this); @@ -1548,7 +1547,7 @@ void BScreen::initMenu() { m_rootmenu_list.clear(); } else - m_rootmenu.reset(createMenuFromScreen(*this)); + m_rootmenu.reset(createMenu("")); bool defaultMenu = true; Fluxbox * const fb = Fluxbox::instance(); @@ -1759,7 +1758,7 @@ bool BScreen::parseMenuFile(ifstream &file, FbTk::Menu &menu, int &row) { "no menu label defined\n")); cerr<<"Row: "<setLabel(str_cmd.c_str()); @@ -1873,7 +1872,7 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { // be deleted toghether with the parent const char *focusmenu_label = i18n->getMessage(ConfigmenuSet, ConfigmenuFocusModel, "Focus Model"); - FbTk::Menu *focus_menu = createMenuFromScreen(*this, focusmenu_label); + FbTk::Menu *focus_menu = createMenu(focusmenu_label ? focusmenu_label : ""); focus_menu->insert(new FocusModelMenuItem(i18n->getMessage(ConfigmenuSet, ConfigmenuClickToFocus, diff --git a/src/Screen.hh b/src/Screen.hh index 7e221e3..df836db 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.125 2003/09/29 12:53:58 rathnor Exp $ +// $Id: Screen.hh,v 1.126 2003/12/10 23:08:03 fluxgen Exp $ #ifndef SCREEN_HH #define SCREEN_HH @@ -112,6 +112,8 @@ public: const FbTk::Menu *getWorkspacemenu() const { return workspacemenu.get(); } FbTk::Menu *getWorkspacemenu() { return workspacemenu.get(); } + + unsigned int currentWorkspaceID() const; Pixmap rootPixmap() const; /* @@ -161,6 +163,8 @@ public: void update(FbTk::Subject *subj); + FbTk::Menu *createMenu(const std::string &label); + /// @return the resource value of number of workspace inline int getNumberOfWorkspaces() const { return *resource.workspaces; } diff --git a/src/SendToMenu.cc b/src/SendToMenu.cc index 4c154af..b1d0e75 100644 --- a/src/SendToMenu.cc +++ b/src/SendToMenu.cc @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: SendToMenu.cc,v 1.4 2003/12/04 00:08:55 fluxgen Exp $ +// $Id: SendToMenu.cc,v 1.5 2003/12/10 23:08:03 fluxgen Exp $ #include "SendToMenu.hh" @@ -45,7 +45,7 @@ private: }; SendToMenu::SendToMenu(FluxboxWindow &win): - FbMenu(*win.screen().menuTheme(), win.screen().screenNumber(), + FbMenu(*win.screen().menuTheme(), win.screen().imageControl(), *win.screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_win(win) { diff --git a/src/Slit.cc b/src/Slit.cc index 6d037d6..73e2b3c 100644 --- a/src/Slit.cc +++ b/src/Slit.cc @@ -22,7 +22,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Slit.cc,v 1.82 2003/12/07 16:39:43 fluxgen Exp $ +// $Id: Slit.cc,v 1.83 2003/12/10 23:08:03 fluxgen Exp $ #include "Slit.hh" @@ -236,19 +236,15 @@ Slit::Slit(BScreen &scr, FbTk::XLayer &layer, const char *filename) : m_hidden(false), m_screen(scr), m_slitmenu(*scr.menuTheme(), - scr.screenNumber(), scr.imageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_placement_menu(*scr.menuTheme(), - scr.screenNumber(), scr.imageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_clientlist_menu(*scr.menuTheme(), - scr.screenNumber(), scr.imageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_layermenu(new LayerMenu(*scr.menuTheme(), - scr.screenNumber(), scr.imageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this, diff --git a/src/Toolbar.cc b/src/Toolbar.cc index bd55854..d2dcefc 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.130 2003/12/08 17:29:44 fluxgen Exp $ +// $Id: Toolbar.cc,v 1.131 2003/12/10 23:08:03 fluxgen Exp $ #include "Toolbar.hh" @@ -192,16 +192,15 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, size_t width): m_window_pm(0), m_screen(scrn), m_layermenu(*scrn.menuTheme(), - scrn.screenNumber(), scrn.imageControl(), *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this, true), m_placementmenu(*scrn.menuTheme(), - scrn.screenNumber(), scrn.imageControl(), + scrn.imageControl(), *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_toolbarmenu(*scrn.menuTheme(), - scrn.screenNumber(), scrn.imageControl(), + scrn.imageControl(), *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_theme(scrn.screenNumber()), m_layeritem(frame.window, layer), diff --git a/src/Window.cc b/src/Window.cc index aa2af04..c0893d6 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.249 2003/12/10 22:28:07 fluxgen Exp $ +// $Id: Window.cc,v 1.250 2003/12/10 23:08:03 fluxgen Exp $ #include "Window.hh" @@ -264,7 +264,7 @@ FluxboxWindow::FluxboxWindow(WinClient &client, BScreen &scr, FbWinFrameTheme &t maximized(MAX_NONE), m_screen(scr), display(FbTk::App::instance()->display()), - m_windowmenu(*scr.menuTheme(), scr.screenNumber(), scr.imageControl(), + m_windowmenu(*scr.menuTheme(), scr.imageControl(), *scr.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_old_decoration(DECOR_NORMAL), m_client(&client), @@ -541,7 +541,6 @@ void FluxboxWindow::init() { addExtraMenu("Layer...", new LayerMenu(*screen().menuTheme(), - screen().screenNumber(), screen().imageControl(), *screen().layerManager().getLayer(Fluxbox::instance()->getMenuLayer()), this, diff --git a/src/Workspace.cc b/src/Workspace.cc index 3b339a0..069c3e2 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.85 2003/12/07 17:49:07 fluxgen Exp $ +// $Id: Workspace.cc,v 1.86 2003/12/10 23:08:03 fluxgen Exp $ #include "Workspace.hh" @@ -119,7 +119,7 @@ Workspace::Workspace(BScreen &scrn, FbTk::MultLayers &layermanager, const std::string &name, unsigned int i): m_screen(scrn), m_lastfocus(0), - m_clientmenu(*scrn.menuTheme(), scrn.screenNumber(), scrn.imageControl(), + m_clientmenu(*scrn.menuTheme(), scrn.imageControl(), *scrn.layerManager().getLayer(Fluxbox::instance()->getMenuLayer())), m_layermanager(layermanager), m_name(name), diff --git a/src/Xinerama.hh b/src/Xinerama.hh index fcb396b..977d42c 100644 --- a/src/Xinerama.hh +++ b/src/Xinerama.hh @@ -20,7 +20,7 @@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: Xinerama.hh,v 1.6 2003/12/03 22:12:26 fluxgen Exp $ +// $Id: Xinerama.hh,v 1.7 2003/12/10 23:08:03 fluxgen Exp $ #ifndef XINERAMA_HH #define XINERAMA_HH @@ -74,7 +74,7 @@ private: template XineramaHeadMenu::XineramaHeadMenu(MenuTheme &tm, BScreen &screen, FbTk::ImageControl &imgctrl, FbTk::XLayer &layer, ItemType &item, const char * title = 0): - FbMenu(tm, screen.screenNumber(), imgctrl, layer), + FbMenu(tm, imgctrl, layer), m_object(item) { if (title) -- cgit v0.11.2