diff options
author | fluxgen <fluxgen> | 2003-08-24 11:19:45 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-08-24 11:19:45 (GMT) |
commit | d509be7ac9a01ad5e2de4e4de510788ada3c8a60 (patch) | |
tree | e7e2317571a916a318ace7da21888f3653911cbf /src/FbWinFrame.cc | |
parent | e405a967e2c17d8947fc80a31f211314499d5927 (diff) | |
download | fluxbox_pavel-d509be7ac9a01ad5e2de4e4de510788ada3c8a60.zip fluxbox_pavel-d509be7ac9a01ad5e2de4e4de510788ada3c8a60.tar.bz2 |
cleaning
Diffstat (limited to 'src/FbWinFrame.cc')
-rw-r--r-- | src/FbWinFrame.cc | 68 |
1 files changed, 35 insertions, 33 deletions
diff --git a/src/FbWinFrame.cc b/src/FbWinFrame.cc index 7943c8a..9c8989f 100644 --- a/src/FbWinFrame.cc +++ b/src/FbWinFrame.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbWinFrame.cc,v 1.39 2003/08/23 15:46:06 fluxgen Exp $ | 22 | // $Id: FbWinFrame.cc,v 1.40 2003/08/24 11:11:07 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbWinFrame.hh" | 24 | #include "FbWinFrame.hh" |
25 | 25 | ||
@@ -27,12 +27,14 @@ | |||
27 | #include "FbTk/EventManager.hh" | 27 | #include "FbTk/EventManager.hh" |
28 | #include "FbTk/TextButton.hh" | 28 | #include "FbTk/TextButton.hh" |
29 | #include "FbTk/App.hh" | 29 | #include "FbTk/App.hh" |
30 | #include "FbTk/Compose.hh" | ||
30 | 31 | ||
31 | #include "FbWinFrameTheme.hh" | 32 | #include "FbWinFrameTheme.hh" |
32 | #ifdef SHAPE | 33 | #ifdef SHAPE |
33 | #include "Shape.hh" | 34 | #include "Shape.hh" |
34 | #endif // SHAPE | 35 | #endif // SHAPE |
35 | 36 | ||
37 | |||
36 | #include <algorithm> | 38 | #include <algorithm> |
37 | #include <iostream> | 39 | #include <iostream> |
38 | using namespace std; | 40 | using namespace std; |
@@ -505,14 +507,13 @@ void FbWinFrame::buttonPressEvent(XButtonEvent &event) { | |||
505 | void FbWinFrame::buttonReleaseEvent(XButtonEvent &event) { | 507 | void FbWinFrame::buttonReleaseEvent(XButtonEvent &event) { |
506 | // we can ignore which window the event was generated for | 508 | // we can ignore which window the event was generated for |
507 | 509 | ||
508 | LabelList::iterator btn_it = m_labelbuttons.begin(); | 510 | LabelList::iterator button_it = find_if(m_labelbuttons.begin(), |
509 | LabelList::iterator btn_it_end = m_labelbuttons.end(); | 511 | m_labelbuttons.end(), |
510 | for (; btn_it != btn_it_end; ++btn_it) { | 512 | FbTk::Compose(bind2nd(equal_to<Window>(), event.window), |
511 | if ((*btn_it)->window() == event.window) { | 513 | mem_fun(&FbTk::Button::window))); |
512 | (*btn_it)->buttonReleaseEvent(event); | 514 | if (button_it != m_labelbuttons.end()) |
513 | break; | 515 | (*button_it)->buttonReleaseEvent(event); |
514 | } | 516 | |
515 | } | ||
516 | 517 | ||
517 | if (event.window == m_grip_right.window() || | 518 | if (event.window == m_grip_right.window() || |
518 | event.window == m_grip_left.window() || | 519 | event.window == m_grip_left.window() || |
@@ -549,35 +550,36 @@ void FbWinFrame::exposeEvent(XExposeEvent &event) { | |||
549 | m_grip_right.clearArea(event.x, event.y, event.width, event.height); | 550 | m_grip_right.clearArea(event.x, event.y, event.width, event.height); |
550 | m_grip_right.updateTransparent(); | 551 | m_grip_right.updateTransparent(); |
551 | } else { | 552 | } else { |
552 | LabelList::iterator btn_it = m_labelbuttons.begin(); | 553 | // create compare function |
553 | LabelList::iterator btn_it_end = m_labelbuttons.end(); | 554 | // that we should use with find_if |
554 | for (; btn_it != btn_it_end; ++btn_it) { | 555 | FbTk::Compose_base<std::binder2nd<std::equal_to<Window> >, |
555 | if ((*btn_it)->window() == event.window) { | 556 | std::const_mem_fun_t<Window, FbTk::FbWindow> > |
556 | (*btn_it)->exposeEvent(event); | 557 | compare = FbTk::Compose(bind2nd(equal_to<Window>(), event.window), |
557 | return; | 558 | mem_fun(&FbTk::Button::window)); |
558 | } | 559 | |
560 | LabelList::iterator btn_it = find_if(m_labelbuttons.begin(), | ||
561 | m_labelbuttons.end(), | ||
562 | compare); | ||
563 | if (btn_it != m_labelbuttons.end()) { | ||
564 | (*btn_it)->exposeEvent(event); | ||
565 | return; | ||
559 | } | 566 | } |
560 | 567 | ||
561 | ButtonList::iterator it = m_buttons_left.begin(); | 568 | ButtonList::iterator it = find_if(m_buttons_left.begin(), |
562 | ButtonList::iterator it_end = m_buttons_left.end(); | 569 | m_buttons_left.end(), |
563 | for (; it != it_end; ++it) { | 570 | compare); |
564 | if ((*it)->window() == event.window) { | 571 | if (it != m_buttons_left.end()) { |
565 | (*it)->exposeEvent(event); | 572 | (*it)->exposeEvent(event); |
566 | return; | 573 | return; |
567 | } | ||
568 | } | 574 | } |
569 | 575 | ||
570 | it = m_buttons_right.begin(); | 576 | it = find_if(m_buttons_right.begin(), |
571 | it_end = m_buttons_right.end(); | 577 | m_buttons_right.end(), |
572 | for (; it != it_end; ++it) { | 578 | compare); |
573 | if ((*it)->window() == event.window) { | ||
574 | (*it)->exposeEvent(event); | ||
575 | return; | ||
576 | } | ||
577 | } | ||
578 | } | ||
579 | 579 | ||
580 | 580 | if (it != m_buttons_right.end()) | |
581 | (*it)->exposeEvent(event); | ||
582 | } | ||
581 | } | 583 | } |
582 | 584 | ||
583 | void FbWinFrame::handleEvent(XEvent &event) { | 585 | void FbWinFrame::handleEvent(XEvent &event) { |