cleaning
This commit is contained in:
parent
e405a967e2
commit
d509be7ac9
4 changed files with 66 additions and 95 deletions
|
@ -19,7 +19,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: FbWinFrame.cc,v 1.39 2003/08/23 15:46:06 fluxgen Exp $
|
// $Id: FbWinFrame.cc,v 1.40 2003/08/24 11:11:07 fluxgen Exp $
|
||||||
|
|
||||||
#include "FbWinFrame.hh"
|
#include "FbWinFrame.hh"
|
||||||
|
|
||||||
|
@ -27,12 +27,14 @@
|
||||||
#include "FbTk/EventManager.hh"
|
#include "FbTk/EventManager.hh"
|
||||||
#include "FbTk/TextButton.hh"
|
#include "FbTk/TextButton.hh"
|
||||||
#include "FbTk/App.hh"
|
#include "FbTk/App.hh"
|
||||||
|
#include "FbTk/Compose.hh"
|
||||||
|
|
||||||
#include "FbWinFrameTheme.hh"
|
#include "FbWinFrameTheme.hh"
|
||||||
#ifdef SHAPE
|
#ifdef SHAPE
|
||||||
#include "Shape.hh"
|
#include "Shape.hh"
|
||||||
#endif // SHAPE
|
#endif // SHAPE
|
||||||
|
|
||||||
|
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
@ -505,14 +507,13 @@ void FbWinFrame::buttonPressEvent(XButtonEvent &event) {
|
||||||
void FbWinFrame::buttonReleaseEvent(XButtonEvent &event) {
|
void FbWinFrame::buttonReleaseEvent(XButtonEvent &event) {
|
||||||
// we can ignore which window the event was generated for
|
// we can ignore which window the event was generated for
|
||||||
|
|
||||||
LabelList::iterator btn_it = m_labelbuttons.begin();
|
LabelList::iterator button_it = find_if(m_labelbuttons.begin(),
|
||||||
LabelList::iterator btn_it_end = m_labelbuttons.end();
|
m_labelbuttons.end(),
|
||||||
for (; btn_it != btn_it_end; ++btn_it) {
|
FbTk::Compose(bind2nd(equal_to<Window>(), event.window),
|
||||||
if ((*btn_it)->window() == event.window) {
|
mem_fun(&FbTk::Button::window)));
|
||||||
(*btn_it)->buttonReleaseEvent(event);
|
if (button_it != m_labelbuttons.end())
|
||||||
break;
|
(*button_it)->buttonReleaseEvent(event);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (event.window == m_grip_right.window() ||
|
if (event.window == m_grip_right.window() ||
|
||||||
event.window == m_grip_left.window() ||
|
event.window == m_grip_left.window() ||
|
||||||
|
@ -549,36 +550,37 @@ void FbWinFrame::exposeEvent(XExposeEvent &event) {
|
||||||
m_grip_right.clearArea(event.x, event.y, event.width, event.height);
|
m_grip_right.clearArea(event.x, event.y, event.width, event.height);
|
||||||
m_grip_right.updateTransparent();
|
m_grip_right.updateTransparent();
|
||||||
} else {
|
} else {
|
||||||
LabelList::iterator btn_it = m_labelbuttons.begin();
|
// create compare function
|
||||||
LabelList::iterator btn_it_end = m_labelbuttons.end();
|
// that we should use with find_if
|
||||||
for (; btn_it != btn_it_end; ++btn_it) {
|
FbTk::Compose_base<std::binder2nd<std::equal_to<Window> >,
|
||||||
if ((*btn_it)->window() == event.window) {
|
std::const_mem_fun_t<Window, FbTk::FbWindow> >
|
||||||
|
compare = FbTk::Compose(bind2nd(equal_to<Window>(), event.window),
|
||||||
|
mem_fun(&FbTk::Button::window));
|
||||||
|
|
||||||
|
LabelList::iterator btn_it = find_if(m_labelbuttons.begin(),
|
||||||
|
m_labelbuttons.end(),
|
||||||
|
compare);
|
||||||
|
if (btn_it != m_labelbuttons.end()) {
|
||||||
(*btn_it)->exposeEvent(event);
|
(*btn_it)->exposeEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ButtonList::iterator it = m_buttons_left.begin();
|
ButtonList::iterator it = find_if(m_buttons_left.begin(),
|
||||||
ButtonList::iterator it_end = m_buttons_left.end();
|
m_buttons_left.end(),
|
||||||
for (; it != it_end; ++it) {
|
compare);
|
||||||
if ((*it)->window() == event.window) {
|
if (it != m_buttons_left.end()) {
|
||||||
(*it)->exposeEvent(event);
|
(*it)->exposeEvent(event);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
it = m_buttons_right.begin();
|
it = find_if(m_buttons_right.begin(),
|
||||||
it_end = m_buttons_right.end();
|
m_buttons_right.end(),
|
||||||
for (; it != it_end; ++it) {
|
compare);
|
||||||
if ((*it)->window() == event.window) {
|
|
||||||
|
if (it != m_buttons_right.end())
|
||||||
(*it)->exposeEvent(event);
|
(*it)->exposeEvent(event);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
void FbWinFrame::handleEvent(XEvent &event) {
|
void FbWinFrame::handleEvent(XEvent &event) {
|
||||||
if (event.type == ConfigureNotify && event.xconfigure.window == window().window())
|
if (event.type == ConfigureNotify && event.xconfigure.window == window().window())
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Screen.cc,v 1.223 2003/08/22 15:03:28 fluxgen Exp $
|
// $Id: Screen.cc,v 1.224 2003/08/24 11:13:36 fluxgen Exp $
|
||||||
|
|
||||||
|
|
||||||
#include "Screen.hh"
|
#include "Screen.hh"
|
||||||
|
@ -689,7 +689,7 @@ void BScreen::rereadMenu() {
|
||||||
|
|
||||||
|
|
||||||
void BScreen::removeWorkspaceNames() {
|
void BScreen::removeWorkspaceNames() {
|
||||||
m_workspace_names.erase(m_workspace_names.begin(), m_workspace_names.end());
|
m_workspace_names.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
void BScreen::updateWorkspaceNamesAtom() {
|
void BScreen::updateWorkspaceNamesAtom() {
|
||||||
|
@ -976,15 +976,11 @@ void BScreen::updateNetizenWorkspaceCount() {
|
||||||
|
|
||||||
|
|
||||||
void BScreen::updateNetizenWindowFocus() {
|
void BScreen::updateNetizenWindowFocus() {
|
||||||
|
|
||||||
Netizens::iterator it = m_netizen_list.begin();
|
|
||||||
Netizens::iterator it_end = m_netizen_list.end();
|
|
||||||
Window f = ((Fluxbox::instance()->getFocusedWindow()) ?
|
Window f = ((Fluxbox::instance()->getFocusedWindow()) ?
|
||||||
Fluxbox::instance()->getFocusedWindow()->window() : None);
|
Fluxbox::instance()->getFocusedWindow()->window() : None);
|
||||||
for (; it != it_end; ++it) {
|
for_each(m_netizen_list.begin(),
|
||||||
(*it)->sendWindowFocus(f);
|
m_netizen_list.end(),
|
||||||
}
|
bind2nd(mem_fun(&Netizen::sendWindowFocus), f));
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1001,41 +997,33 @@ void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) {
|
||||||
|
|
||||||
|
|
||||||
void BScreen::updateNetizenWindowDel(Window w) {
|
void BScreen::updateNetizenWindowDel(Window w) {
|
||||||
Netizens::iterator it = m_netizen_list.begin();
|
for_each(m_netizen_list.begin(),
|
||||||
Netizens::iterator it_end = m_netizen_list.end();
|
m_netizen_list.end(),
|
||||||
for (; it != it_end; ++it) {
|
bind2nd(mem_fun(&Netizen::sendWindowDel), w));
|
||||||
(*it)->sendWindowDel(w);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_clientlist_sig.notify();
|
m_clientlist_sig.notify();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::updateNetizenWindowRaise(Window w) {
|
void BScreen::updateNetizenWindowRaise(Window w) {
|
||||||
Netizens::iterator it = m_netizen_list.begin();
|
for_each(m_netizen_list.begin(),
|
||||||
Netizens::iterator it_end = m_netizen_list.end();
|
m_netizen_list.end(),
|
||||||
for (; it != it_end; ++it) {
|
bind2nd(mem_fun(&Netizen::sendWindowRaise), w));
|
||||||
(*it)->sendWindowRaise(w);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void BScreen::updateNetizenWindowLower(Window w) {
|
void BScreen::updateNetizenWindowLower(Window w) {
|
||||||
Netizens::iterator it = m_netizen_list.begin();
|
for_each(m_netizen_list.begin(),
|
||||||
Netizens::iterator it_end = m_netizen_list.end();
|
m_netizen_list.end(),
|
||||||
for (; it != it_end; ++it) {
|
bind2nd(mem_fun(&Netizen::sendWindowLower), w));
|
||||||
(*it)->sendWindowLower(w);
|
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void BScreen::updateNetizenConfigNotify(XEvent &e) {
|
void BScreen::updateNetizenConfigNotify(XEvent &e) {
|
||||||
Netizens::iterator it = m_netizen_list.begin();
|
Netizens::iterator it = m_netizen_list.begin();
|
||||||
Netizens::iterator it_end = m_netizen_list.end();
|
Netizens::iterator it_end = m_netizen_list.end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it)
|
||||||
(*it)->sendConfigNotify(e);
|
(*it)->sendConfigNotify(e);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
FluxboxWindow *BScreen::createWindow(Window client) {
|
FluxboxWindow *BScreen::createWindow(Window client) {
|
||||||
XSync(FbTk::App::instance()->display(), false);
|
XSync(FbTk::App::instance()->display(), false);
|
||||||
|
@ -1047,7 +1035,7 @@ FluxboxWindow *BScreen::createWindow(Window client) {
|
||||||
bool iskdedockapp = false;
|
bool iskdedockapp = false;
|
||||||
Atom ajunk;
|
Atom ajunk;
|
||||||
int ijunk;
|
int ijunk;
|
||||||
unsigned long *data = (unsigned long *) 0, uljunk;
|
unsigned long *data = 0, uljunk;
|
||||||
Display *disp = FbTk::App::instance()->display();
|
Display *disp = FbTk::App::instance()->display();
|
||||||
// Check if KDE v2.x dock applet
|
// Check if KDE v2.x dock applet
|
||||||
if (XGetWindowProperty(disp, client,
|
if (XGetWindowProperty(disp, client,
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: Workspace.cc,v 1.80 2003/08/19 16:16:28 fluxgen Exp $
|
// $Id: Workspace.cc,v 1.81 2003/08/24 11:16:42 fluxgen Exp $
|
||||||
|
|
||||||
#include "Workspace.hh"
|
#include "Workspace.hh"
|
||||||
|
|
||||||
|
@ -246,10 +246,9 @@ void Workspace::removeWindow(WinClient &client) {
|
||||||
void Workspace::showAll() {
|
void Workspace::showAll() {
|
||||||
Windows::iterator it = m_windowlist.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::iterator it_end = m_windowlist.end();
|
Windows::iterator it_end = m_windowlist.end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it)
|
||||||
(*it)->deiconify(false, false);
|
(*it)->deiconify(false, false);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Workspace::hideAll() {
|
void Workspace::hideAll() {
|
||||||
|
@ -265,10 +264,9 @@ void Workspace::hideAll() {
|
||||||
void Workspace::removeAll() {
|
void Workspace::removeAll() {
|
||||||
Windows::iterator it = m_windowlist.begin();
|
Windows::iterator it = m_windowlist.begin();
|
||||||
Windows::const_iterator it_end = m_windowlist.end();
|
Windows::const_iterator it_end = m_windowlist.end();
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it)
|
||||||
(*it)->iconify();
|
(*it)->iconify();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void Workspace::reconfigure() {
|
void Workspace::reconfigure() {
|
||||||
|
@ -291,7 +289,7 @@ namespace {
|
||||||
class FindInGroup {
|
class FindInGroup {
|
||||||
public:
|
public:
|
||||||
FindInGroup(const FluxboxWindow &w):m_w(w) { }
|
FindInGroup(const FluxboxWindow &w):m_w(w) { }
|
||||||
bool operator ()(const string &name) {
|
bool operator ()(const string &name) const {
|
||||||
return (name == m_w.winClient().getWMClassName());
|
return (name == m_w.winClient().getWMClassName());
|
||||||
}
|
}
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -22,7 +22,7 @@
|
||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
// $Id: fluxbox.cc,v 1.186 2003/08/22 21:38:58 fluxgen Exp $
|
// $Id: fluxbox.cc,v 1.187 2003/08/24 11:19:45 fluxgen Exp $
|
||||||
|
|
||||||
#include "fluxbox.hh"
|
#include "fluxbox.hh"
|
||||||
|
|
||||||
|
@ -1332,17 +1332,11 @@ void Fluxbox::attachSignals(WinClient &winclient) {
|
||||||
}
|
}
|
||||||
|
|
||||||
BScreen *Fluxbox::searchScreen(Window window) {
|
BScreen *Fluxbox::searchScreen(Window window) {
|
||||||
BScreen *screen = 0;
|
|
||||||
ScreenList::iterator it = m_screen_list.begin();
|
ScreenList::iterator it = m_screen_list.begin();
|
||||||
ScreenList::iterator it_end = m_screen_list.end();
|
ScreenList::iterator it_end = m_screen_list.end();
|
||||||
|
|
||||||
for (; it != it_end; ++it) {
|
for (; it != it_end; ++it) {
|
||||||
if (*it) {
|
if (*it && (*it)->rootWindow() == window)
|
||||||
if ((*it)->rootWindow() == window) {
|
return (*it);
|
||||||
screen = (*it);
|
|
||||||
return screen;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -1431,12 +1425,8 @@ void Fluxbox::shutdown() {
|
||||||
XSetInputFocus(FbTk::App::instance()->display(), PointerRoot, None, CurrentTime);
|
XSetInputFocus(FbTk::App::instance()->display(), PointerRoot, None, CurrentTime);
|
||||||
|
|
||||||
//send shutdown to all screens
|
//send shutdown to all screens
|
||||||
ScreenList::iterator it = m_screen_list.begin();
|
for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::shutdown));
|
||||||
ScreenList::iterator it_end = m_screen_list.end();
|
|
||||||
for (; it != it_end; ++it) {
|
|
||||||
if(*it)
|
|
||||||
(*it)->shutdown();
|
|
||||||
}
|
|
||||||
m_shutdown = true;
|
m_shutdown = true;
|
||||||
XSync(FbTk::App::instance()->display(), False);
|
XSync(FbTk::App::instance()->display(), False);
|
||||||
|
|
||||||
|
@ -1791,10 +1781,8 @@ void Fluxbox::real_reconfigure() {
|
||||||
if (old_blackboxrc)
|
if (old_blackboxrc)
|
||||||
XrmDestroyDatabase(old_blackboxrc);
|
XrmDestroyDatabase(old_blackboxrc);
|
||||||
|
|
||||||
ScreenList::iterator sit = m_screen_list.begin();
|
// reconfigure all screens
|
||||||
ScreenList::iterator sit_end = m_screen_list.end();
|
for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::reconfigure));
|
||||||
for (; sit != sit_end; ++sit)
|
|
||||||
(*sit)->reconfigure();
|
|
||||||
|
|
||||||
//reconfigure keys
|
//reconfigure keys
|
||||||
m_key->reconfigure(StringUtil::expandFilename(*m_rc_keyfile).c_str());
|
m_key->reconfigure(StringUtil::expandFilename(*m_rc_keyfile).c_str());
|
||||||
|
@ -1841,12 +1829,7 @@ void Fluxbox::real_rereadMenu() {
|
||||||
delete *it;
|
delete *it;
|
||||||
|
|
||||||
m_menu_timestamps.erase(m_menu_timestamps.begin(), m_menu_timestamps.end());
|
m_menu_timestamps.erase(m_menu_timestamps.begin(), m_menu_timestamps.end());
|
||||||
|
for_each(m_screen_list.begin(), m_screen_list.end(), mem_fun(&BScreen::rereadMenu));
|
||||||
ScreenList::iterator sit = m_screen_list.begin();
|
|
||||||
ScreenList::iterator sit_end = m_screen_list.end();
|
|
||||||
for (; sit != sit_end; ++sit) {
|
|
||||||
(*sit)->rereadMenu();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Fluxbox::saveMenuFilename(const char *filename) {
|
void Fluxbox::saveMenuFilename(const char *filename) {
|
||||||
|
|
Loading…
Reference in a new issue