all repos — fluxbox @ 1727656e0a36cd9095e173dfa43200ed14c178d1

custom fork of the fluxbox windowmanager

cleaning, change getCount to numberOfWorkspace
fluxgen fluxgen
commit

1727656e0a36cd9095e173dfa43200ed14c178d1

parent

9049dd33d31ccc03dd3f130681eb481d2b3ff0e6

M src/CurrentWindowCmd.ccsrc/CurrentWindowCmd.cc

@@ -47,38 +47,38 @@ fbwindow().screen().setOnHead(fbwindow(), m_head);

} void SendToWorkspaceCmd::real_execute() { - if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) - fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow(), false); + fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow(), false); } void SendToNextWorkspaceCmd::real_execute() { const int ws_nr = ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % - fbwindow().screen().getNumberOfWorkspaces(); + fbwindow().screen().numberOfWorkspaces(); fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); } void SendToPrevWorkspaceCmd::real_execute() { int ws_nr = fbwindow().screen().currentWorkspaceID() - m_workspace_num; - if ( ws_nr < 0 ) ws_nr += fbwindow().screen().getNumberOfWorkspaces(); + if ( ws_nr < 0 ) + ws_nr += fbwindow().screen().numberOfWorkspaces(); fbwindow().screen().sendToWorkspace(ws_nr, &fbwindow(), false); } void TakeToWorkspaceCmd::real_execute() { - if (m_workspace_num >= 0 && m_workspace_num < fbwindow().screen().getNumberOfWorkspaces()) - fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow()); + fbwindow().screen().sendToWorkspace(m_workspace_num, &fbwindow()); } void TakeToNextWorkspaceCmd::real_execute() { unsigned int workspace_num= ( fbwindow().screen().currentWorkspaceID() + m_workspace_num ) % - fbwindow().screen().getNumberOfWorkspaces(); + fbwindow().screen().numberOfWorkspaces(); fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); } void TakeToPrevWorkspaceCmd::real_execute() { int workspace_num= fbwindow().screen().currentWorkspaceID() - m_workspace_num; - if ( workspace_num < 0 ) workspace_num+= fbwindow().screen().getNumberOfWorkspaces(); + if ( workspace_num < 0 ) + workspace_num += fbwindow().screen().numberOfWorkspaces(); fbwindow().screen().sendToWorkspace(workspace_num, &fbwindow()); }
M src/IconbarTool.ccsrc/IconbarTool.cc

@@ -877,8 +877,8 @@

void IconbarTool::updateIcons() { std::list<FluxboxWindow *> itemlist; // add icons to the itemlist - BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); - BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); + BScreen::Icons::iterator icon_it = m_screen.iconList().begin(); + BScreen::Icons::iterator icon_it_end = m_screen.iconList().end(); for (; icon_it != icon_it_end; ++icon_it) { if (mode() == ICONS) itemlist.push_back(*icon_it);

@@ -904,8 +904,8 @@ }

// add icons from current workspace if (mode() != WORKSPACENOICONS) { - BScreen::Icons::iterator icon_it = m_screen.getIconList().begin(); - BScreen::Icons::iterator icon_it_end = m_screen.getIconList().end(); + BScreen::Icons::iterator icon_it = m_screen.iconList().begin(); + BScreen::Icons::iterator icon_it_end = m_screen.iconList().end(); for (; icon_it != icon_it_end; ++icon_it) { if ((*icon_it)->workspaceNumber() == m_screen.currentWorkspaceID()) itemlist.push_back(*icon_it);

@@ -930,8 +930,8 @@ }

// add icons if(mode() != NOICONS && mode() != WORKSPACENOICONS) { full_list.insert(full_list.end(), - m_screen.getIconList().begin(), - m_screen.getIconList().end()); + m_screen.iconList().begin(), + m_screen.iconList().end()); } removeDuplicate(m_icon_list, full_list);
M src/Netizen.ccsrc/Netizen.cc

@@ -50,7 +50,7 @@

void Netizen::sendWorkspaceCount() { event.xclient.data.l[0] = FbAtoms::instance()->getFluxboxNotifyWorkspaceCountAtom(); - event.xclient.data.l[1] = m_screen.getCount(); + event.xclient.data.l[1] = m_screen.numberOfWorkspaces(); XSendEvent(m_display, window(), False, NoEventMask, &event); }
M src/Screen.ccsrc/Screen.cc

@@ -650,9 +650,9 @@ slit()->menu().hide();

#endif // SLIT // hide icon menus - if (getIconList().size()) { - Icons::iterator it = getIconList().begin(); - const Icons::iterator it_end = getIconList().end(); + if (iconList().size()) { + Icons::iterator it = iconList().begin(); + const Icons::iterator it_end = iconList().end(); for (; it != it_end; ++it) (*it)->menu().hide(); }

@@ -804,7 +804,7 @@ if (w == 0)

return; // make sure we have a unique list - if (find(getIconList().begin(), getIconList().end(), w) != getIconList().end()) + if (find(iconList().begin(), iconList().end(), w) != iconList().end()) return; m_icon_list.push_back(w);

@@ -818,13 +818,13 @@ void BScreen::removeIcon(FluxboxWindow *w) {

if (w == 0) return; - Icons::iterator erase_it = remove_if(getIconList().begin(), - getIconList().end(), + Icons::iterator erase_it = remove_if(iconList().begin(), + iconList().end(), bind2nd(equal_to<FluxboxWindow *>(), w)); // no need to send iconlist signal if we didn't // change the iconlist if (erase_it != m_icon_list.end()) { - getIconList().erase(erase_it); + iconList().erase(erase_it); m_iconlist_sig.notify(); } }

@@ -1354,7 +1354,7 @@ bool ignore_sticky) {

if (w == 0) return; - if (wkspc_id >= getCount()) + if (wkspc_id >= numberOfWorkspaces()) wkspc_id = currentWorkspace()->workspaceID(); if (!w->isIconic() && w->workspaceNumber() == wkspc_id)

@@ -1992,21 +1992,21 @@ /**

Goes to the workspace "right" of the current */ void BScreen::nextWorkspace(const int delta) { - changeWorkspaceID( (currentWorkspaceID() + delta) % getCount()); + changeWorkspaceID( (currentWorkspaceID() + delta) % numberOfWorkspaces()); } /** Goes to the workspace "left" of the current */ void BScreen::prevWorkspace(const int delta) { - changeWorkspaceID( (currentWorkspaceID() - delta + getCount()) % getCount()); + changeWorkspaceID( (currentWorkspaceID() - delta + numberOfWorkspaces()) % numberOfWorkspaces()); } /** Goes to the workspace "right" of the current */ void BScreen::rightWorkspace(const int delta) { - if (currentWorkspaceID()+delta < getCount()) + if (currentWorkspaceID()+delta < numberOfWorkspaces()) changeWorkspaceID(currentWorkspaceID()+delta); }

@@ -2152,7 +2152,7 @@ * is given.

*/ WinClient *BScreen::getLastFocusedWindow(int workspace) { if (focused_list.empty()) return 0; - if (workspace < 0 || workspace >= (int) getCount()) + if (workspace < 0 || workspace >= (int) numberOfWorkspaces()) return focused_list.front(); FocusedWindows::iterator it = focused_list.begin();
M src/Screen.hhsrc/Screen.hh

@@ -125,17 +125,15 @@ inline bool decorateTransient() const { return *resource.decorate_transient; }

inline const std::string &windowMenuFilename() const { return *resource.windowmenufile; } inline FbTk::ImageControl &imageControl() { return *m_image_control.get(); } // menus - const FbTk::Menu &getRootmenu() const { return *m_rootmenu.get(); } - FbTk::Menu &getRootmenu() { return *m_rootmenu.get(); } + const FbTk::Menu &rootMenu() const { return *m_rootmenu.get(); } + FbTk::Menu &rootMenu() { return *m_rootmenu.get(); } const FbTk::Menu &configMenu() const { return *m_configmenu.get(); } FbTk::Menu &configMenu() { return *m_configmenu.get(); } const FbTk::Menu &windowMenu() const { return *m_windowmenu.get(); } FbTk::Menu &windowMenu() { return *m_windowmenu.get(); } - ExtraMenus &extraWindowMenus() { return m_extramenus; } const ExtraMenus &extraWindowMenus() const { return m_extramenus; } - inline const std::string &getRootCommand() const { return *resource.rootcommand; } inline ResizeModel getResizeModel() const { return *resource.resize_model; } inline FocusModel getFocusModel() const { return *resource.focus_model; } inline FollowModel getFollowModel() const { return *resource.follow_model; }

@@ -147,8 +145,8 @@ inline Workspace *getWorkspace(unsigned int w) { return ( w < m_workspaces_list.size() ? m_workspaces_list[w] : 0); }

inline Workspace *currentWorkspace() { return m_current_workspace; } inline const Workspace *currentWorkspace() const { return m_current_workspace; } - const FbTk::Menu &getWorkspacemenu() const { return *m_workspacemenu.get(); } - FbTk::Menu &getWorkspacemenu() { return *m_workspacemenu.get(); } + const FbTk::Menu &workspaceMenu() const { return *m_workspacemenu.get(); } + FbTk::Menu &workspaceMenu() { return *m_workspacemenu.get(); } unsigned int currentWorkspaceID() const;

@@ -169,11 +167,10 @@ inline unsigned int height() const { return rootWindow().height(); }

inline int screenNumber() const { return rootWindow().screenNumber(); } /// @return number of workspaces - inline unsigned int getCount() const { return m_workspaces_list.size(); } - /// @return number of icons - inline unsigned int getIconCount() const { return m_icon_list.size(); } - inline const Icons &getIconList() const { return m_icon_list; } - inline Icons &getIconList() { return m_icon_list; } + unsigned int numberOfWorkspaces() const { return m_workspaces_list.size(); } + + inline const Icons &iconList() const { return m_icon_list; } + inline Icons &iconList() { return m_icon_list; } inline const FocusedWindows &getFocusedList() const { return focused_list; } inline FocusedWindows &getFocusedList() { return focused_list; } WinClient *getLastFocusedWindow(int workspace = -1);

@@ -214,9 +211,6 @@ void removeExtraWindowMenu(FbTk::Menu *menu);

/// hide all windowmenus except the given one (if given) void hideWindowMenus(const FluxboxWindow* except= 0); - - /// @return the resource value of number of workspace - inline int getNumberOfWorkspaces() const { return *resource.workspaces; } inline PlacementPolicy getPlacementPolicy() const { return *resource.placement_policy; } inline int getEdgeSnapThreshold() const { return *resource.edge_snap_threshold; }
M src/Window.ccsrc/Window.cc

@@ -503,7 +503,7 @@ grabButtons();

restoreAttributes(); - if (m_workspace_number < 0 || m_workspace_number >= screen().getCount()) + if (m_workspace_number < 0 || m_workspace_number >= screen().numberOfWorkspaces()) m_workspace_number = screen().currentWorkspaceID(); bool place_window = (m_old_pos_x == 0);

@@ -2198,7 +2198,7 @@ iconic = true;

} if (( m_blackbox_attrib.workspace != screen().currentWorkspaceID()) && - ( m_blackbox_attrib.workspace < screen().getCount())) + ( m_blackbox_attrib.workspace < screen().numberOfWorkspaces())) m_workspace_number = m_blackbox_attrib.workspace; if (m_blackbox_attrib.flags & ATTRIB_OMNIPRESENT &&

@@ -2267,8 +2267,6 @@ menu().hide();

return; } - WindowCmd<void>::setWindow(this); - menu().disableTitle(); int menu_y = frame().titlebar().height() + frame().titlebar().borderWidth(); if (!decorations.titlebar) // if we don't have any titlebar

@@ -2278,13 +2276,6 @@ m_last_button_x = x();

showMenu(m_last_button_x, menu_y + frame().y()); } -/** - Determine if this is the lowest tab of them all -*/ -bool FluxboxWindow::isLowerTab() const { - cerr<<__FILE__<<"(FluxboxWindow::isLowerTab()) TODO!"<<endl; - return true; -} /** Redirect any unhandled event to our handlers

@@ -2754,12 +2745,12 @@ // 2) if we moved in the right direction

if (me.x_root >= int(screen().width()) - warpPad - 1 && moved_x > 0) { //warp right - new_id = (cur_id + 1) % screen().getCount(); + new_id = (cur_id + 1) % screen().numberOfWorkspaces(); dx = - me.x_root; // move mouse back to x=0 } else if (me.x_root <= warpPad && moved_x < 0) { //warp left - new_id = (cur_id + screen().getCount() - 1) % screen().getCount(); + new_id = (cur_id + screen().numberOfWorkspaces() - 1) % screen().numberOfWorkspaces(); dx = screen().width() - me.x_root-1; // move mouse to screen width - 1 } if (new_id != cur_id) {
M src/Window.hhsrc/Window.hh

@@ -340,7 +340,6 @@

unsigned int titlebarHeight() const; - bool isLowerTab() const; int initialState() const; inline FbWinFrame &frame() { return m_frame; }
M src/fluxbox.ccsrc/fluxbox.cc

@@ -931,10 +931,10 @@ if (be.button == 1) {

if (! screen->isRootColormapInstalled()) screen->imageControl().installRootColormap(); // hide menus - if (screen->getRootmenu().isVisible()) - screen->getRootmenu().hide(); - if (screen->getWorkspacemenu().isVisible()) - screen->getWorkspacemenu().hide(); + if (screen->rootMenu().isVisible()) + screen->rootMenu().hide(); + if (screen->workspaceMenu().isVisible()) + screen->workspaceMenu().hide(); } else if (be.button == 2) { FbCommands::ShowWorkspaceMenuCmd cmd;

@@ -1033,7 +1033,7 @@ } else if (ce.message_type == m_fbatoms->getFluxboxChangeWorkspaceAtom()) {

BScreen *screen = searchScreen(ce.window); if (screen && ce.data.l[0] >= 0 && - ce.data.l[0] < (signed)screen->getCount()) + ce.data.l[0] < (signed)screen->numberOfWorkspaces()) screen->changeWorkspaceID(ce.data.l[0]); } else if (ce.message_type == m_fbatoms->getFluxboxChangeWindowFocusAtom()) {

@@ -1468,7 +1468,7 @@ // write out the users workspace names

sprintf(rc_string, "session.screen%d.workspaceNames: ", screen_number); string workspaces_string(rc_string); - for (unsigned int workspace=0; workspace < screen->getCount(); workspace++) { + for (unsigned int workspace=0; workspace < screen->numberOfWorkspaces(); workspace++) { if (screen->getWorkspace(workspace)->name().size()!=0) workspaces_string.append(screen->getWorkspace(workspace)->name()); else

@@ -1575,10 +1575,7 @@ sprintf(name_lookup, "session.screen%d.workspaceNames", screen_number);

sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number); if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, &value)) { -#ifdef DEBUG - cerr<<__FILE__<<"("<<__FUNCTION__<<"): Workspaces="<< - screen.getNumberOfWorkspaces()<<endl; -#endif // DEBUG + string values(value.addr); BScreen::WorkspaceNames names;