diff options
author | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-05 01:39:19 (GMT) |
---|---|---|
committer | Mark Tiefenbruck <mark@fluxbox.org> | 2008-01-05 01:39:19 (GMT) |
commit | ac1bd7e0981222bf340ce7defb2bb8307d42a0a2 (patch) | |
tree | c8fb9c618184e7ac44f6138409cab3fab86b23e4 /src/Window.cc | |
parent | 60ba709c2f47cc2c7b877aef1b0f297b097853e5 (diff) | |
download | fluxbox_pavel-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.zip fluxbox_pavel-ac1bd7e0981222bf340ce7defb2bb8307d42a0a2.tar.bz2 |
update code to use ThemeProxy
Diffstat (limited to 'src/Window.cc')
-rw-r--r-- | src/Window.cc | 66 |
1 files changed, 33 insertions, 33 deletions
diff --git a/src/Window.cc b/src/Window.cc index 7f14ee8..a2a256e 100644 --- a/src/Window.cc +++ b/src/Window.cc | |||
@@ -261,8 +261,8 @@ private: | |||
261 | 261 | ||
262 | int FluxboxWindow::s_num_grabs = 0; | 262 | int FluxboxWindow::s_num_grabs = 0; |
263 | 263 | ||
264 | FluxboxWindow::FluxboxWindow(WinClient &client, FbWinFrameTheme &tm, | 264 | FluxboxWindow::FluxboxWindow(WinClient &client, |
265 | FbTk::XLayer &layer): | 265 | FbTk::ThemeProxy<FbWinFrameTheme> &tm, FbTk::XLayer &layer): |
266 | Focusable(client.screen(), this), | 266 | Focusable(client.screen(), this), |
267 | oplock(false), | 267 | oplock(false), |
268 | m_hintsig(*this), | 268 | m_hintsig(*this), |
@@ -401,8 +401,8 @@ void FluxboxWindow::init() { | |||
401 | Fluxbox &fluxbox = *Fluxbox::instance(); | 401 | Fluxbox &fluxbox = *Fluxbox::instance(); |
402 | 402 | ||
403 | // setup cursors for resize grips | 403 | // setup cursors for resize grips |
404 | frame().gripLeft().setCursor(frame().theme().lowerLeftAngleCursor()); | 404 | frame().gripLeft().setCursor(frame().theme()->lowerLeftAngleCursor()); |
405 | frame().gripRight().setCursor(frame().theme().lowerRightAngleCursor()); | 405 | frame().gripRight().setCursor(frame().theme()->lowerRightAngleCursor()); |
406 | 406 | ||
407 | associateClient(*m_client); | 407 | associateClient(*m_client); |
408 | 408 | ||
@@ -2777,12 +2777,12 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { | |||
2777 | doSnapping(dx, dy); | 2777 | doSnapping(dx, dy); |
2778 | 2778 | ||
2779 | if (! screen().doOpaqueMove()) { | 2779 | if (! screen().doOpaqueMove()) { |
2780 | parent().drawRectangle(screen().rootTheme().opGC(), | 2780 | parent().drawRectangle(screen().rootTheme()->opGC(), |
2781 | m_last_move_x, m_last_move_y, | 2781 | m_last_move_x, m_last_move_y, |
2782 | frame().width() + 2*frame().window().borderWidth()-1, | 2782 | frame().width() + 2*frame().window().borderWidth()-1, |
2783 | frame().height() + 2*frame().window().borderWidth()-1); | 2783 | frame().height() + 2*frame().window().borderWidth()-1); |
2784 | 2784 | ||
2785 | parent().drawRectangle(screen().rootTheme().opGC(), | 2785 | parent().drawRectangle(screen().rootTheme()->opGC(), |
2786 | dx, dy, | 2786 | dx, dy, |
2787 | frame().width() + 2*frame().window().borderWidth()-1, | 2787 | frame().width() + 2*frame().window().borderWidth()-1, |
2788 | frame().height() + 2*frame().window().borderWidth()-1); | 2788 | frame().height() + 2*frame().window().borderWidth()-1); |
@@ -2874,13 +2874,13 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { | |||
2874 | old_resize_h != m_last_resize_h ) { | 2874 | old_resize_h != m_last_resize_h ) { |
2875 | 2875 | ||
2876 | // draw over old rect | 2876 | // draw over old rect |
2877 | parent().drawRectangle(screen().rootTheme().opGC(), | 2877 | parent().drawRectangle(screen().rootTheme()->opGC(), |
2878 | old_resize_x, old_resize_y, | 2878 | old_resize_x, old_resize_y, |
2879 | old_resize_w - 1 + 2 * frame().window().borderWidth(), | 2879 | old_resize_w - 1 + 2 * frame().window().borderWidth(), |
2880 | old_resize_h - 1 + 2 * frame().window().borderWidth()); | 2880 | old_resize_h - 1 + 2 * frame().window().borderWidth()); |
2881 | 2881 | ||
2882 | // draw resize rectangle | 2882 | // draw resize rectangle |
2883 | parent().drawRectangle(screen().rootTheme().opGC(), | 2883 | parent().drawRectangle(screen().rootTheme()->opGC(), |
2884 | m_last_resize_x, m_last_resize_y, | 2884 | m_last_resize_x, m_last_resize_y, |
2885 | m_last_resize_w - 1 + 2 * frame().window().borderWidth(), | 2885 | m_last_resize_w - 1 + 2 * frame().window().borderWidth(), |
2886 | m_last_resize_h - 1 + 2 * frame().window().borderWidth()); | 2886 | m_last_resize_h - 1 + 2 * frame().window().borderWidth()); |
@@ -2897,10 +2897,10 @@ void FluxboxWindow::motionNotifyEvent(XMotionEvent &me) { | |||
2897 | // so we update drag'n'drop-rectangle | 2897 | // so we update drag'n'drop-rectangle |
2898 | int dx = me.x_root - m_button_grab_x, dy = me.y_root - m_button_grab_y; | 2898 | int dx = me.x_root - m_button_grab_x, dy = me.y_root - m_button_grab_y; |
2899 | 2899 | ||
2900 | parent().drawRectangle(screen().rootTheme().opGC(), | 2900 | parent().drawRectangle(screen().rootTheme()->opGC(), |
2901 | m_last_move_x, m_last_move_y, | 2901 | m_last_move_x, m_last_move_y, |
2902 | m_last_resize_w, m_last_resize_h); | 2902 | m_last_resize_w, m_last_resize_h); |
2903 | parent().drawRectangle(screen().rootTheme().opGC(), | 2903 | parent().drawRectangle(screen().rootTheme()->opGC(), |
2904 | dx, dy, | 2904 | dx, dy, |
2905 | m_last_resize_w, m_last_resize_h); | 2905 | m_last_resize_w, m_last_resize_h); |
2906 | 2906 | ||
@@ -3010,7 +3010,7 @@ void FluxboxWindow::update(FbTk::Subject *subj) { | |||
3010 | if (FocusControl::focusedFbWindow()) | 3010 | if (FocusControl::focusedFbWindow()) |
3011 | setFullscreenLayer(); | 3011 | setFullscreenLayer(); |
3012 | } | 3012 | } |
3013 | } else if (subj == &frame().theme().reconfigSig()) { | 3013 | } else if (subj == &frame().theme()->reconfigSig()) { |
3014 | reconfigTheme(); | 3014 | reconfigTheme(); |
3015 | frame().reconfigure(); | 3015 | frame().reconfigure(); |
3016 | } | 3016 | } |
@@ -3022,7 +3022,7 @@ void FluxboxWindow::applyDecorations(bool initial) { | |||
3022 | 3022 | ||
3023 | unsigned int border_width = 0; | 3023 | unsigned int border_width = 0; |
3024 | if (decorations.border) | 3024 | if (decorations.border) |
3025 | border_width = frame().theme().border(m_focused).width(); | 3025 | border_width = frame().theme()->border(m_focused).width(); |
3026 | 3026 | ||
3027 | bool client_move = false; | 3027 | bool client_move = false; |
3028 | 3028 | ||
@@ -3165,7 +3165,7 @@ void FluxboxWindow::startMoving(int x, int y) { | |||
3165 | // freely map and unmap the window we're moving. | 3165 | // freely map and unmap the window we're moving. |
3166 | grabPointer(screen().rootWindow().window(), False, ButtonMotionMask | | 3166 | grabPointer(screen().rootWindow().window(), False, ButtonMotionMask | |
3167 | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, | 3167 | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, |
3168 | screen().rootWindow().window(), frame().theme().moveCursor(), CurrentTime); | 3168 | screen().rootWindow().window(), frame().theme()->moveCursor(), CurrentTime); |
3169 | 3169 | ||
3170 | if (menu().isVisible()) | 3170 | if (menu().isVisible()) |
3171 | menu().hide(); | 3171 | menu().hide(); |
@@ -3176,7 +3176,7 @@ void FluxboxWindow::startMoving(int x, int y) { | |||
3176 | m_last_move_y = frame().y(); | 3176 | m_last_move_y = frame().y(); |
3177 | if (! screen().doOpaqueMove()) { | 3177 | if (! screen().doOpaqueMove()) { |
3178 | fluxbox->grab(); | 3178 | fluxbox->grab(); |
3179 | parent().drawRectangle(screen().rootTheme().opGC(), | 3179 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3180 | frame().x(), frame().y(), | 3180 | frame().x(), frame().y(), |
3181 | frame().width() + 2*frame().window().borderWidth()-1, | 3181 | frame().width() + 2*frame().window().borderWidth()-1, |
3182 | frame().height() + 2*frame().window().borderWidth()-1); | 3182 | frame().height() + 2*frame().window().borderWidth()-1); |
@@ -3200,7 +3200,7 @@ void FluxboxWindow::stopMoving(bool interrupted) { | |||
3200 | 3200 | ||
3201 | 3201 | ||
3202 | if (! screen().doOpaqueMove()) { | 3202 | if (! screen().doOpaqueMove()) { |
3203 | parent().drawRectangle(screen().rootTheme().opGC(), | 3203 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3204 | m_last_move_x, m_last_move_y, | 3204 | m_last_move_x, m_last_move_y, |
3205 | frame().width() + 2*frame().window().borderWidth()-1, | 3205 | frame().width() + 2*frame().window().borderWidth()-1, |
3206 | frame().height() + 2*frame().window().borderWidth()-1); | 3206 | frame().height() + 2*frame().window().borderWidth()-1); |
@@ -3230,7 +3230,7 @@ void FluxboxWindow::pauseMoving() { | |||
3230 | return; | 3230 | return; |
3231 | } | 3231 | } |
3232 | 3232 | ||
3233 | parent().drawRectangle(screen().rootTheme().opGC(), | 3233 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3234 | m_last_move_x, m_last_move_y, | 3234 | m_last_move_x, m_last_move_y, |
3235 | frame().width() + 2*frame().window().borderWidth()-1, | 3235 | frame().width() + 2*frame().window().borderWidth()-1, |
3236 | frame().height() + 2*frame().window().borderWidth()-1); | 3236 | frame().height() + 2*frame().window().borderWidth()-1); |
@@ -3250,7 +3250,7 @@ void FluxboxWindow::resumeMoving() { | |||
3250 | 3250 | ||
3251 | FbTk::App::instance()->sync(false); | 3251 | FbTk::App::instance()->sync(false); |
3252 | 3252 | ||
3253 | parent().drawRectangle(screen().rootTheme().opGC(), | 3253 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3254 | m_last_move_x, m_last_move_y, | 3254 | m_last_move_x, m_last_move_y, |
3255 | frame().width() + 2*frame().window().borderWidth()-1, | 3255 | frame().width() + 2*frame().window().borderWidth()-1, |
3256 | frame().height() + 2*frame().window().borderWidth()-1); | 3256 | frame().height() + 2*frame().window().borderWidth()-1); |
@@ -3463,14 +3463,14 @@ void FluxboxWindow::startResizing(int x, int y, ResizeDirection dir) { | |||
3463 | resizing = true; | 3463 | resizing = true; |
3464 | maximized = MAX_NONE; | 3464 | maximized = MAX_NONE; |
3465 | 3465 | ||
3466 | const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme().upperLeftAngleCursor() : | 3466 | const Cursor& cursor = (m_resize_corner == LEFTTOP) ? frame().theme()->upperLeftAngleCursor() : |
3467 | (m_resize_corner == RIGHTTOP) ? frame().theme().upperRightAngleCursor() : | 3467 | (m_resize_corner == RIGHTTOP) ? frame().theme()->upperRightAngleCursor() : |
3468 | (m_resize_corner == RIGHTBOTTOM) ? frame().theme().lowerRightAngleCursor() : | 3468 | (m_resize_corner == RIGHTBOTTOM) ? frame().theme()->lowerRightAngleCursor() : |
3469 | (m_resize_corner == LEFT) ? frame().theme().leftSideCursor() : | 3469 | (m_resize_corner == LEFT) ? frame().theme()->leftSideCursor() : |
3470 | (m_resize_corner == RIGHT) ? frame().theme().rightSideCursor() : | 3470 | (m_resize_corner == RIGHT) ? frame().theme()->rightSideCursor() : |
3471 | (m_resize_corner == TOP) ? frame().theme().topSideCursor() : | 3471 | (m_resize_corner == TOP) ? frame().theme()->topSideCursor() : |
3472 | (m_resize_corner == BOTTOM) ? frame().theme().bottomSideCursor() : | 3472 | (m_resize_corner == BOTTOM) ? frame().theme()->bottomSideCursor() : |
3473 | frame().theme().lowerLeftAngleCursor(); | 3473 | frame().theme()->lowerLeftAngleCursor(); |
3474 | 3474 | ||
3475 | grabPointer(fbWindow().window(), | 3475 | grabPointer(fbWindow().window(), |
3476 | false, ButtonMotionMask | ButtonReleaseMask, | 3476 | false, ButtonMotionMask | ButtonReleaseMask, |
@@ -3488,7 +3488,7 @@ void FluxboxWindow::startResizing(int x, int y, ResizeDirection dir) { | |||
3488 | 3488 | ||
3489 | screen().showGeometry(gx, gy); | 3489 | screen().showGeometry(gx, gy); |
3490 | 3490 | ||
3491 | parent().drawRectangle(screen().rootTheme().opGC(), | 3491 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3492 | m_last_resize_x, m_last_resize_y, | 3492 | m_last_resize_x, m_last_resize_y, |
3493 | m_last_resize_w - 1 + 2 * frame().window().borderWidth(), | 3493 | m_last_resize_w - 1 + 2 * frame().window().borderWidth(), |
3494 | m_last_resize_h - 1 + 2 * frame().window().borderWidth()); | 3494 | m_last_resize_h - 1 + 2 * frame().window().borderWidth()); |
@@ -3497,7 +3497,7 @@ void FluxboxWindow::startResizing(int x, int y, ResizeDirection dir) { | |||
3497 | void FluxboxWindow::stopResizing(bool interrupted) { | 3497 | void FluxboxWindow::stopResizing(bool interrupted) { |
3498 | resizing = false; | 3498 | resizing = false; |
3499 | 3499 | ||
3500 | parent().drawRectangle(screen().rootTheme().opGC(), | 3500 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3501 | m_last_resize_x, m_last_resize_y, | 3501 | m_last_resize_x, m_last_resize_y, |
3502 | m_last_resize_w - 1 + 2 * frame().window().borderWidth(), | 3502 | m_last_resize_w - 1 + 2 * frame().window().borderWidth(), |
3503 | m_last_resize_h - 1 + 2 * frame().window().borderWidth()); | 3503 | m_last_resize_h - 1 + 2 * frame().window().borderWidth()); |
@@ -3533,7 +3533,7 @@ void FluxboxWindow::startTabbing(const XButtonEvent &be) { | |||
3533 | // start drag'n'drop for tab | 3533 | // start drag'n'drop for tab |
3534 | grabPointer(be.window, False, ButtonMotionMask | | 3534 | grabPointer(be.window, False, ButtonMotionMask | |
3535 | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, | 3535 | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, |
3536 | None, frame().theme().moveCursor(), CurrentTime); | 3536 | None, frame().theme()->moveCursor(), CurrentTime); |
3537 | 3537 | ||
3538 | // relative position on the button | 3538 | // relative position on the button |
3539 | m_button_grab_x = be.x; | 3539 | m_button_grab_x = be.x; |
@@ -3558,7 +3558,7 @@ void FluxboxWindow::startTabbing(const XButtonEvent &be) { | |||
3558 | m_last_resize_h = frame().height() + bw; | 3558 | m_last_resize_h = frame().height() + bw; |
3559 | } | 3559 | } |
3560 | 3560 | ||
3561 | parent().drawRectangle(screen().rootTheme().opGC(), | 3561 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3562 | m_last_move_x, m_last_move_y, | 3562 | m_last_move_x, m_last_move_y, |
3563 | m_last_resize_w, m_last_resize_h); | 3563 | m_last_resize_w, m_last_resize_h); |
3564 | 3564 | ||
@@ -3569,7 +3569,7 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) { | |||
3569 | if (m_attaching_tab == 0) | 3569 | if (m_attaching_tab == 0) |
3570 | return; | 3570 | return; |
3571 | 3571 | ||
3572 | parent().drawRectangle(screen().rootTheme().opGC(), | 3572 | parent().drawRectangle(screen().rootTheme()->opGC(), |
3573 | m_last_move_x, m_last_move_y, | 3573 | m_last_move_x, m_last_move_y, |
3574 | m_last_resize_w, m_last_resize_h); | 3574 | m_last_resize_w, m_last_resize_h); |
3575 | 3575 | ||
@@ -3978,7 +3978,7 @@ void FluxboxWindow::updateButtons() { | |||
3978 | CommandRef stick_cmd(new WindowCmd(*this, &FluxboxWindow::stick)); | 3978 | CommandRef stick_cmd(new WindowCmd(*this, &FluxboxWindow::stick)); |
3979 | CommandRef show_menu_cmd(new WindowCmd(*this, &FluxboxWindow::popupMenu)); | 3979 | CommandRef show_menu_cmd(new WindowCmd(*this, &FluxboxWindow::popupMenu)); |
3980 | 3980 | ||
3981 | WinButtonTheme &winbutton_theme = screen().winButtonTheme(); | 3981 | FbTk::ThemeProxy<WinButtonTheme> &winbutton_theme = screen().winButtonTheme(); |
3982 | 3982 | ||
3983 | for (size_t c = 0; c < 2 ; c++) { | 3983 | for (size_t c = 0; c < 2 ; c++) { |
3984 | // get titlebar configuration for current side | 3984 | // get titlebar configuration for current side |
@@ -4073,8 +4073,8 @@ void FluxboxWindow::updateButtons() { | |||
4073 | void FluxboxWindow::reconfigTheme() { | 4073 | void FluxboxWindow::reconfigTheme() { |
4074 | 4074 | ||
4075 | m_frame.setBorderWidth(decorations.border ? | 4075 | m_frame.setBorderWidth(decorations.border ? |
4076 | frame().theme().border(m_focused).width() : 0); | 4076 | frame().theme()->border(m_focused).width() : 0); |
4077 | if (decorations.handle && frame().theme().handleWidth() != 0) | 4077 | if (decorations.handle && frame().theme()->handleWidth() != 0) |
4078 | frame().showHandle(); | 4078 | frame().showHandle(); |
4079 | else | 4079 | else |
4080 | frame().hideHandle(); | 4080 | frame().hideHandle(); |