code deduplication by using <algorithm> and FbTk/STLUtil.hh

This commit is contained in:
Mathias Gumz 2010-09-15 02:07:09 +02:00
parent ba316aa18a
commit 12e1ef7826
6 changed files with 104 additions and 168 deletions

View file

@ -26,6 +26,7 @@
#include "TextUtils.hh" #include "TextUtils.hh"
#include "EventManager.hh" #include "EventManager.hh"
#include "CompareEqual.hh" #include "CompareEqual.hh"
#include "STLUtil.hh"
#include <algorithm> #include <algorithm>
@ -78,7 +79,7 @@ void Container::insertItem(Item item, int pos) {
} else if (pos == 0) { } else if (pos == 0) {
m_item_list.push_front(item); m_item_list.push_front(item);
} else { } else {
ItemList::iterator it = m_item_list.begin(); ItemList::iterator it = begin();
for (; pos != 0; ++it, --pos) for (; pos != 0; ++it, --pos)
continue; continue;
@ -104,12 +105,10 @@ void Container::moveItem(Item item, int movement) {
if (newindex < 0) // neg wrap if (newindex < 0) // neg wrap
newindex += size; newindex += size;
ItemList::iterator it = std::find(m_item_list.begin(), ItemList::iterator it = std::find(begin(), end(), item);
m_item_list.end(),
item);
m_item_list.erase(it); m_item_list.erase(it);
for (it = m_item_list.begin(); newindex >= 0; ++it, --newindex) { for (it = begin(); newindex >= 0; ++it, --newindex) {
if (newindex == 0) { if (newindex == 0) {
break; break;
} }
@ -143,12 +142,11 @@ bool Container::moveItemTo(Item item, int x, int y) {
&itemwin)) &itemwin))
return false; return false;
ItemList::iterator it = find_if(m_item_list.begin(), ItemList::iterator it = find_if(begin(), end(),
m_item_list.end(),
CompareWindow(&FbWindow::window, CompareWindow(&FbWindow::window,
itemwin)); itemwin));
// not found :( // not found :(
if (it == m_item_list.end()) if (it == end())
return false; return false;
Window child_return = 0; Window child_return = 0;
@ -162,8 +160,8 @@ bool Container::moveItemTo(Item item, int x, int y) {
} }
bool Container::removeItem(Item item) { bool Container::removeItem(Item item) {
ItemList::iterator it = m_item_list.begin(); ItemList::iterator it = begin();
ItemList::iterator it_end = m_item_list.end(); ItemList::iterator it_end = end();
for (; it != it_end && (*it) != item; ++it); for (; it != it_end && (*it) != item; ++it);
if (it == it_end) if (it == it_end)
@ -178,7 +176,7 @@ bool Container::removeItem(int index) {
if (index < 0 || index > size()) if (index < 0 || index > size())
return false; return false;
ItemList::iterator it = m_item_list.begin(); ItemList::iterator it = begin();
for (; index != 0; ++it, --index) for (; index != 0; ++it, --index)
continue; continue;
@ -247,12 +245,11 @@ bool Container::tryExposeEvent(XExposeEvent &event) {
return true; return true;
} }
ItemList::iterator it = find_if(m_item_list.begin(), ItemList::iterator it = find_if(begin(), end(),
m_item_list.end(),
CompareWindow(&FbWindow::window, CompareWindow(&FbWindow::window,
event.window)); event.window));
// not found :( // not found :(
if (it == m_item_list.end()) if (it == end())
return false; return false;
(*it)->exposeEvent(event); (*it)->exposeEvent(event);
@ -265,12 +262,11 @@ bool Container::tryButtonPressEvent(XButtonEvent &event) {
return true; return true;
} }
ItemList::iterator it = find_if(m_item_list.begin(), ItemList::iterator it = find_if(begin(), end(),
m_item_list.end(),
CompareWindow(&FbWindow::window, CompareWindow(&FbWindow::window,
event.window)); event.window));
// not found :( // not found :(
if (it == m_item_list.end()) if (it == end())
return false; return false;
(*it)->buttonPressEvent(event); (*it)->buttonPressEvent(event);
@ -283,12 +279,11 @@ bool Container::tryButtonReleaseEvent(XButtonEvent &event) {
return true; return true;
} }
ItemList::iterator it = find_if(m_item_list.begin(), ItemList::iterator it = find_if(begin(), end(),
m_item_list.end(),
CompareWindow(&FbWindow::window, CompareWindow(&FbWindow::window,
event.window)); event.window));
// not found :( // not found :(
if (it == m_item_list.end()) if (it == end())
return false; return false;
(*it)->buttonReleaseEvent(event); (*it)->buttonReleaseEvent(event);
@ -360,8 +355,8 @@ void Container::repositionItems() {
} }
ItemList::iterator it = m_item_list.begin(); ItemList::iterator it = begin();
const ItemList::iterator it_end = m_item_list.end(); const ItemList::iterator it_end = end();
int rounding_error = 0; int rounding_error = 0;
@ -442,41 +437,26 @@ unsigned int Container::maxWidthPerClient() const {
} }
void Container::for_each(std::mem_fun_t<void, FbWindow> function) { void Container::for_each(std::mem_fun_t<void, FbWindow> function) {
std::for_each(m_item_list.begin(), std::for_each(begin(), end(), function);
m_item_list.end(),
function);
} }
void Container::setAlpha(unsigned char alpha) { void Container::setAlpha(unsigned char alpha) {
FbWindow::setAlpha(alpha); FbWindow::setAlpha(alpha);
ItemList::iterator it = m_item_list.begin(); STLUtil::forAll(m_item_list, std::bind2nd(std::mem_fun(&Button::setAlpha), alpha));
ItemList::iterator it_end = m_item_list.end();
for (; it != it_end; ++it)
(*it)->setAlpha(alpha);
} }
void Container::parentMoved() { void Container::parentMoved() {
FbWindow::parentMoved(); FbWindow::parentMoved();
ItemList::iterator it = m_item_list.begin(); STLUtil::forAll(m_item_list, std::mem_fun(&Button::parentMoved));
ItemList::iterator it_end = m_item_list.end();
for (; it != it_end; ++it)
(*it)->parentMoved();
} }
void Container::invalidateBackground() { void Container::invalidateBackground() {
FbWindow::invalidateBackground(); FbWindow::invalidateBackground();
ItemList::iterator it = m_item_list.begin(); STLUtil::forAll(m_item_list, std::mem_fun(&Button::invalidateBackground));
ItemList::iterator it_end = m_item_list.end();
for (; it != it_end; ++it)
(*it)->invalidateBackground();
} }
void Container::clear() { void Container::clear() {
ItemList::iterator it = m_item_list.begin(); STLUtil::forAll(m_item_list, std::mem_fun(&Button::clear));
ItemList::iterator it_end = m_item_list.end();
for (; it != it_end; ++it)
(*it)->clear();
} }
void Container::setOrientation(Orientation orient) { void Container::setOrientation(Orientation orient) {
@ -484,11 +464,7 @@ void Container::setOrientation(Orientation orient) {
return; return;
FbWindow::invalidateBackground(); FbWindow::invalidateBackground();
STLUtil::forAll(m_item_list, std::bind2nd(std::mem_fun(&Button::setOrientation), orient));
ItemList::iterator it = m_item_list.begin();
ItemList::iterator it_end = m_item_list.end();
for (; it != it_end; ++it)
(*it)->setOrientation(orient);
if (((m_orientation == ROT0 || m_orientation == ROT180) && if (((m_orientation == ROT0 || m_orientation == ROT180) &&
(orient == ROT90 || orient == ROT270)) || (orient == ROT90 || orient == ROT270)) ||

View file

@ -68,6 +68,33 @@ void destroyAndClearSecond(A &a) {
a.clear(); a.clear();
} }
template <typename C, typename F>
F forAll(C& c, F f) {
typedef typename C::iterator iterator;
iterator i = c.begin();
iterator e = c.end();
for (; i != e; i++) {
f(*i);
}
return f;
}
template <typename C, typename I, typename F>
F forAllIf(C& c, I i, F f) {
typedef typename C::iterator iterator;
iterator it = c.begin();
iterator end = c.end();
for (; it != end; it++) {
if (i(*it))
f(*it);
}
return f;
}
} // end namespace STLUtil } // end namespace STLUtil
} // end namespace FbTk } // end namespace FbTk

View file

@ -27,6 +27,7 @@
#include "FileUtil.hh" #include "FileUtil.hh"
#include "I18n.hh" #include "I18n.hh"
#include "Image.hh" #include "Image.hh"
#include "STLUtil.hh"
#ifdef HAVE_CSTDIO #ifdef HAVE_CSTDIO
#include <cstdio> #include <cstdio>
@ -50,13 +51,11 @@ struct LoadThemeHelper {
} }
void operator ()(ThemeManager::ThemeList &tmlist) { void operator ()(ThemeManager::ThemeList &tmlist) {
for_each(tmlist.begin(), tmlist.end(), STLUtil::forAll(tmlist, *this);
*this);
// send reconfiguration signal to theme and listeners // send reconfiguration signal to theme and listeners
ThemeManager::ThemeList::iterator it = tmlist.begin(); ThemeManager::ThemeList::iterator it = tmlist.begin();
ThemeManager::ThemeList::iterator it_end = tmlist.end(); ThemeManager::ThemeList::iterator it_end = tmlist.end();
for (; it != it_end; ++it) { for (; it != it_end; ++it) {
(*it)->reconfigTheme();
(*it)->reconfigSig().notify(); (*it)->reconfigSig().notify();
} }
} }
@ -174,9 +173,7 @@ bool ThemeManager::load(const string &filename,
// get list and go throu all the resources and load them // get list and go throu all the resources and load them
// and then reconfigure them // and then reconfigure them
if (screen_num < 0 || screen_num > m_max_screens) { if (screen_num < 0 || screen_num > m_max_screens) {
for_each(m_themes.begin(), STLUtil::forAll(m_themes, load_theme_helper);
m_themes.end(),
load_theme_helper);
} else { } else {
load_theme_helper(m_themes[screen_num]); load_theme_helper(m_themes[screen_num]);
} }

View file

@ -29,6 +29,7 @@
#include "FbTk/Transparent.hh" #include "FbTk/Transparent.hh"
#include "FbTk/CompareEqual.hh" #include "FbTk/CompareEqual.hh"
#include "FbTk/TextUtils.hh" #include "FbTk/TextUtils.hh"
#include "FbTk/STLUtil.hh"
#include "FbWinFrameTheme.hh" #include "FbWinFrameTheme.hh"
#include "Screen.hh" #include "Screen.hh"
@ -42,6 +43,8 @@ using std::max;
using std::mem_fun; using std::mem_fun;
using std::string; using std::string;
using FbTk::STLUtil::forAll;
FbWinFrame::FbWinFrame(BScreen &screen, WindowState &state, FbWinFrame::FbWinFrame(BScreen &screen, WindowState &state,
FocusableTheme<FbWinFrameTheme> &theme): FocusableTheme<FbWinFrameTheme> &theme):
m_screen(screen), m_screen(screen),
@ -439,12 +442,8 @@ void FbWinFrame::notifyMoved(bool clear) {
m_titlebar.parentMoved(); m_titlebar.parentMoved();
for_each(m_buttons_left.begin(), forAll(m_buttons_left, mem_fun(&FbTk::Button::parentMoved));
m_buttons_left.end(), forAll(m_buttons_right, mem_fun(&FbTk::Button::parentMoved));
mem_fun(&FbTk::Button::parentMoved));
for_each(m_buttons_right.begin(),
m_buttons_right.end(),
mem_fun(&FbTk::Button::parentMoved));
} }
if (m_use_handle) { if (m_use_handle) {
@ -463,13 +462,8 @@ void FbWinFrame::clearAll() {
if (m_use_titlebar) { if (m_use_titlebar) {
redrawTitlebar(); redrawTitlebar();
forAll(m_buttons_left, mem_fun(&FbTk::Button::clear));
for_each(m_buttons_left.begin(), forAll(m_buttons_right, mem_fun(&FbTk::Button::clear));
m_buttons_left.end(),
mem_fun(&FbTk::Button::clear));
for_each(m_buttons_right.begin(),
m_buttons_right.end(),
mem_fun(&FbTk::Button::clear));
} else if (m_tabmode == EXTERNAL && m_use_tabs) } else if (m_tabmode == EXTERNAL && m_use_tabs)
m_tab_container.clear(); m_tab_container.clear();

View file

@ -48,6 +48,9 @@
#include "FbTk/MacroCommand.hh" #include "FbTk/MacroCommand.hh"
#include "FbTk/MenuSeparator.hh" #include "FbTk/MenuSeparator.hh"
#include "FbTk/Util.hh" #include "FbTk/Util.hh"
#include "FbTk/STLUtil.hh"
#include "FbTk/Select2nd.hh"
#include "FbTk/Compose.hh"
#include <typeinfo> #include <typeinfo>
#include <iterator> #include <iterator>
@ -465,10 +468,9 @@ void IconbarTool::updateSizing() {
m_icon_container.setBorderWidth(m_theme.border().width()); m_icon_container.setBorderWidth(m_theme.border().width());
m_icon_container.setBorderColor(m_theme.border().color()); m_icon_container.setBorderColor(m_theme.border().color());
IconMap::iterator icon_it = m_icons.begin(); FbTk::STLUtil::forAll(m_icons,
const IconMap::iterator icon_it_end = m_icons.end(); FbTk::Compose(std::mem_fun(&IconButton::reconfigTheme),
for (; icon_it != icon_it_end; ++icon_it) FbTk::Select2nd<IconMap::value_type>()));
icon_it->second->reconfigTheme();
} }

View file

@ -387,10 +387,7 @@ Fluxbox::Fluxbox(int argc, char **argv, const char *dpy_name,
#endif // REMEMBER #endif // REMEMBER
// init all "screens" // init all "screens"
ScreenList::iterator it = m_screen_list.begin(); STLUtil::forAll(m_screen_list, bind1st(mem_fun(&Fluxbox::initScreen), this));
ScreenList::iterator it_end = m_screen_list.end();
for(; it != it_end; ++it)
initScreen(*it);
XAllowEvents(disp, ReplayPointer, CurrentTime); XAllowEvents(disp, ReplayPointer, CurrentTime);
@ -435,11 +432,9 @@ void Fluxbox::initScreen(BScreen *screen) {
// now we can create menus (which needs this screen to be in screen_list) // now we can create menus (which needs this screen to be in screen_list)
screen->initMenus(); screen->initMenus();
screen->initWindows(); screen->initWindows();
// attach screen signals to this // attach screen signals to this
join(screen->workspaceAreaSig(), join(screen->workspaceAreaSig(),
FbTk::MemFun(*this, &Fluxbox::workspaceAreaChanged)); FbTk::MemFun(*this, &Fluxbox::workspaceAreaChanged));
@ -458,11 +453,7 @@ void Fluxbox::initScreen(BScreen *screen) {
FbTk::MemFun(*this, &Fluxbox::workspaceCountChanged)); FbTk::MemFun(*this, &Fluxbox::workspaceCountChanged));
// initiate atomhandler for screen specific stuff // initiate atomhandler for screen specific stuff
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAll(m_atomhandler, bind2nd(mem_fun(&AtomHandler::initForScreen), *screen));
it != m_atomhandler.end();
it++) {
(*it)->initForScreen(*screen);
}
FocusControl::revertFocus(*screen); // make sure focus style is correct FocusControl::revertFocus(*screen); // make sure focus style is correct
@ -984,11 +975,9 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
} }
if (fbwin && &fbwin->stateSig() == changedsub) { // state signal if (fbwin && &fbwin->stateSig() == changedsub) { // state signal
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateState), *fbwin));
if ((*it)->update())
(*it)->updateState(*fbwin);
}
// if window changed to iconic state // if window changed to iconic state
// add to icon list // add to icon list
if (fbwin->isIconic()) { if (fbwin->isIconic()) {
@ -1009,17 +998,11 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
} }
} }
} else if (fbwin && &fbwin->layerSig() == changedsub) { // layer signal } else if (fbwin && &fbwin->layerSig() == changedsub) { // layer signal
AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
for (; it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateLayer), *fbwin));
if ((*it)->update())
(*it)->updateLayer(*fbwin);
}
} else if (fbwin && &fbwin->dieSig() == changedsub) { // window death signal } else if (fbwin && &fbwin->dieSig() == changedsub) { // window death signal
AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
for (; it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateFrameClose), *fbwin));
if ((*it)->update())
(*it)->updateFrameClose(*fbwin);
}
// make sure each workspace get this // make sure each workspace get this
BScreen &scr = fbwin->screen(); BScreen &scr = fbwin->screen();
@ -1027,17 +1010,11 @@ void Fluxbox::update(FbTk::Subject *changedsub) {
if (FocusControl::focusedFbWindow() == fbwin) if (FocusControl::focusedFbWindow() == fbwin)
FocusControl::setFocusedFbWindow(0); FocusControl::setFocusedFbWindow(0);
} else if (fbwin && &fbwin->workspaceSig() == changedsub) { // workspace signal } else if (fbwin && &fbwin->workspaceSig() == changedsub) { // workspace signal
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateClientClose), *fbwin));
if ((*it)->update())
(*it)->updateWorkspace(*fbwin);
}
} else if (client && &client->dieSig() == changedsub) { // client death } else if (client && &client->dieSig() == changedsub) { // client death
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateClientClose), *client));
if ((*it)->update())
(*it)->updateClientClose(*client);
}
BScreen &screen = client->screen(); BScreen &screen = client->screen();
@ -1066,19 +1043,12 @@ void Fluxbox::attachSignals(FluxboxWindow &win) {
win.workspaceSig().attach(this); win.workspaceSig().attach(this);
win.layerSig().attach(this); win.layerSig().attach(this);
win.dieSig().attach(this); win.dieSig().attach(this);
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAll(m_atomhandler, bind2nd(mem_fun(&AtomHandler::setupFrame), win));
it != m_atomhandler.end(); ++it) {
(*it)->setupFrame(win);
}
} }
void Fluxbox::attachSignals(WinClient &winclient) { void Fluxbox::attachSignals(WinClient &winclient) {
winclient.dieSig().attach(this); winclient.dieSig().attach(this);
STLUtil::forAll(m_atomhandler, bind2nd(mem_fun(&AtomHandler::setupClient), winclient));
for (AtomHandlerContainerIt it= m_atomhandler.begin();
it != m_atomhandler.end(); ++it) {
(*it)->setupClient(winclient);
}
} }
BScreen *Fluxbox::searchScreen(Window window) { BScreen *Fluxbox::searchScreen(Window window) {
@ -1178,9 +1148,7 @@ void Fluxbox::shutdown() {
XSetInputFocus(FbTk::App::instance()->display(), PointerRoot, None, CurrentTime); XSetInputFocus(FbTk::App::instance()->display(), PointerRoot, None, CurrentTime);
//send shutdown to all screens STLUtil::forAll(m_screen_list, mem_fun(&BScreen::shutdown));
for_each(m_screen_list.begin(),
m_screen_list.end(), mem_fun(&BScreen::shutdown));
sync(false); sync(false);
} }
@ -1353,32 +1321,21 @@ void Fluxbox::real_reconfigure() {
for (; screen_it != screen_it_end; ++screen_it) for (; screen_it != screen_it_end; ++screen_it)
load_rc(*(*screen_it)); load_rc(*(*screen_it));
// reconfigure all screens STLUtil::forAll(m_screen_list, mem_fun(&BScreen::reconfigure));
for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::reconfigure));
//reconfigure keys
m_key->reconfigure(); m_key->reconfigure();
STLUtil::forAll(m_atomhandler, mem_fun(&AtomHandler::reconfigure));
// and atomhandlers
for (AtomHandlerContainerIt it= m_atomhandler.begin();
it != m_atomhandler.end();
it++) {
(*it)->reconfigure();
}
} }
BScreen *Fluxbox::findScreen(int id) { BScreen *Fluxbox::findScreen(int id) {
ScreenList::iterator it = m_screen_list.begin();
ScreenList::iterator it_end = m_screen_list.end();
for (; it != it_end; ++it) {
if ((*it)->screenNumber() == id)
break;
}
if (it == m_screen_list.end()) BScreen* result = 0;
return 0; ScreenList::iterator it = find_if(m_screen_list.begin(), m_screen_list.end(),
FbTk::CompareEqual<BScreen>(&BScreen::screenNumber, id));
return *it; if (it != m_screen_list.end())
result = *it;
return result;
} }
void Fluxbox::timed_reconfigure() { void Fluxbox::timed_reconfigure() {
@ -1426,48 +1383,33 @@ bool Fluxbox::validateClient(const WinClient *client) const {
} }
void Fluxbox::updateFrameExtents(FluxboxWindow &win) { void Fluxbox::updateFrameExtents(FluxboxWindow &win) {
AtomHandlerContainerIt it = m_atomhandler.begin(); STLUtil::forAll(m_atomhandler, bind2nd(mem_fun(&AtomHandler::updateFrameExtents), win));
AtomHandlerContainerIt it_end = m_atomhandler.end();
for (; it != it_end; ++it ) {
(*it)->updateFrameExtents(win);
}
} }
void Fluxbox::workspaceCountChanged( BScreen& screen ) { void Fluxbox::workspaceCountChanged( BScreen& screen ) {
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateWorkspaceCount), screen));
if ((*it)->update())
(*it)->updateWorkspaceCount(screen);
}
} }
void Fluxbox::workspaceChanged( BScreen& screen ) { void Fluxbox::workspaceChanged( BScreen& screen ) {
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateCurrentWorkspace), screen));
if ((*it)->update())
(*it)->updateCurrentWorkspace(screen);
}
} }
void Fluxbox::workspaceNamesChanged(BScreen &screen) { void Fluxbox::workspaceNamesChanged(BScreen &screen) {
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateWorkspaceNames), screen));
if ((*it)->update())
(*it)->updateWorkspaceNames(screen);
}
} }
void Fluxbox::clientListChanged(BScreen &screen) { void Fluxbox::clientListChanged(BScreen &screen) {
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateClientList), screen));
if ((*it)->update())
(*it)->updateClientList(screen);
}
} }
void Fluxbox::focusedWindowChanged(BScreen &screen, void Fluxbox::focusedWindowChanged(BScreen &screen,
FluxboxWindow* win, FluxboxWindow* win,
WinClient* client) { WinClient* client) {
for (AtomHandlerContainerIt it= m_atomhandler.begin(); for (AtomHandlerContainerIt it= m_atomhandler.begin();
it != m_atomhandler.end(); it++) { it != m_atomhandler.end(); it++) {
(*it)->updateFocusedWindow(screen, client ? client->window() : 0 ); (*it)->updateFocusedWindow(screen, client ? client->window() : 0 );
@ -1475,9 +1417,7 @@ void Fluxbox::focusedWindowChanged(BScreen &screen,
} }
void Fluxbox::workspaceAreaChanged(BScreen &screen) { void Fluxbox::workspaceAreaChanged(BScreen &screen) {
for (AtomHandlerContainerIt it= m_atomhandler.begin(); STLUtil::forAllIf(m_atomhandler, mem_fun(&AtomHandler::update),
it != m_atomhandler.end(); ++it) { bind2nd(mem_fun(&AtomHandler::updateWorkarea), screen));
if ((*it)->update())
(*it)->updateWorkarea(screen);
}
} }