aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-05-10 13:57:07 (GMT)
committerfluxgen <fluxgen>2003-05-10 13:57:07 (GMT)
commit4a396013c67a2d5c95009b6b401266fcf4fc1566 (patch)
tree82d8308007d80c77ba327e0e1de4cf4e54eefeb9
parent94deb10b014a0f6bb27bc34a130b5c4df9ee764e (diff)
downloadfluxbox_paul-4a396013c67a2d5c95009b6b401266fcf4fc1566.zip
fluxbox_paul-4a396013c67a2d5c95009b6b401266fcf4fc1566.tar.bz2
minor cleaning
-rw-r--r--src/Toolbar.cc45
-rw-r--r--src/Toolbar.hh25
2 files changed, 35 insertions, 35 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc
index 541bdea..8027a0b 100644
--- a/src/Toolbar.cc
+++ b/src/Toolbar.cc
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.cc,v 1.77 2003/04/28 16:48:23 rathnor Exp $ 25// $Id: Toolbar.cc,v 1.78 2003/05/10 13:57:07 fluxgen Exp $
26 26
27#include "Toolbar.hh" 27#include "Toolbar.hh"
28 28
@@ -246,9 +246,8 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
246 do_auto_hide(scrn.doToolbarAutoHide()), 246 do_auto_hide(scrn.doToolbarAutoHide()),
247 frame(*this, scrn.getScreenNumber()), 247 frame(*this, scrn.getScreenNumber()),
248 m_screen(scrn), 248 m_screen(scrn),
249 image_ctrl(*scrn.getImageControl()), 249 m_clock_timer(this), // get the clock updating every minute
250 clock_timer(this), // get the clock updating every minute 250 m_hide_timer(&hide_handler),
251 hide_timer(&hide_handler),
252 m_toolbarmenu(menu), 251 m_toolbarmenu(menu),
253 m_placementmenu(*scrn.menuTheme(), 252 m_placementmenu(*scrn.menuTheme(),
254 scrn.getScreenNumber(), *scrn.getImageControl()), 253 scrn.getScreenNumber(), *scrn.getImageControl()),
@@ -279,12 +278,12 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
279 timeval delay; 278 timeval delay;
280 delay.tv_sec = 1; 279 delay.tv_sec = 1;
281 delay.tv_usec = 0; 280 delay.tv_usec = 0;
282 clock_timer.setTimeout(delay); 281 m_clock_timer.setTimeout(delay);
283 clock_timer.start(); 282 m_clock_timer.start();
284 283
285 hide_handler.toolbar = this; 284 hide_handler.toolbar = this;
286 hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay()); 285 m_hide_timer.setTimeout(Fluxbox::instance()->getAutoRaiseDelay());
287 hide_timer.fireOnce(true); 286 m_hide_timer.fireOnce(true);
288 287
289 frame.grab_x = frame.grab_y = 0; 288 frame.grab_x = frame.grab_y = 0;
290 289
@@ -320,7 +319,7 @@ Toolbar::Toolbar(BScreen &scrn, FbTk::XLayer &layer, FbTk::Menu &menu, size_t wi
320 319
321 320
322Toolbar::~Toolbar() { 321Toolbar::~Toolbar() {
323 322 FbTk::ImageControl &image_ctrl = *screen().getImageControl();
324 if (frame.base) image_ctrl.removeImage(frame.base); 323 if (frame.base) image_ctrl.removeImage(frame.base);
325 if (frame.label) image_ctrl.removeImage(frame.label); 324 if (frame.label) image_ctrl.removeImage(frame.label);
326 if (frame.wlabel) image_ctrl.removeImage(frame.wlabel); 325 if (frame.wlabel) image_ctrl.removeImage(frame.wlabel);
@@ -388,7 +387,7 @@ void Toolbar::reconfigure() {
388 387
389 if (do_auto_hide == false && 388 if (do_auto_hide == false &&
390 do_auto_hide != screen().doToolbarAutoHide()) { 389 do_auto_hide != screen().doToolbarAutoHide()) {
391 hide_timer.start(); 390 m_hide_timer.start();
392 } 391 }
393 392
394 do_auto_hide = screen().doToolbarAutoHide(); 393 do_auto_hide = screen().doToolbarAutoHide();
@@ -563,6 +562,8 @@ void Toolbar::reconfigure() {
563 frame.clock.moveResize(next_x + text_x, next_y + text_y, 562 frame.clock.moveResize(next_x + text_x, next_y + text_y,
564 clock_w, clock_h); 563 clock_w, clock_h);
565 564
565 FbTk::ImageControl &image_ctrl = *screen().getImageControl();
566
566 Pixmap tmp = frame.base; 567 Pixmap tmp = frame.base;
567 const FbTk::Texture *texture = &(m_theme.toolbar()); 568 const FbTk::Texture *texture = &(m_theme.toolbar());
568 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) { 569 if (texture->type() == (FbTk::Texture::FLAT | FbTk::Texture::SOLID)) {
@@ -972,11 +973,11 @@ void Toolbar::enterNotifyEvent(XCrossingEvent &not_used) {
972 return; 973 return;
973 974
974 if (hidden) { 975 if (hidden) {
975 if (! hide_timer.isTiming()) 976 if (! m_hide_timer.isTiming())
976 hide_timer.start(); 977 m_hide_timer.start();
977 } else { 978 } else {
978 if (hide_timer.isTiming()) 979 if (m_hide_timer.isTiming())
979 hide_timer.stop(); 980 m_hide_timer.stop();
980 } 981 }
981} 982}
982 983
@@ -985,10 +986,10 @@ void Toolbar::leaveNotifyEvent(XCrossingEvent &not_used) {
985 return; 986 return;
986 987
987 if (hidden) { 988 if (hidden) {
988 if (hide_timer.isTiming()) 989 if (m_hide_timer.isTiming())
989 hide_timer.stop(); 990 m_hide_timer.stop();
990 } else if (! m_toolbarmenu.isVisible() && ! hide_timer.isTiming()) 991 } else if (! m_toolbarmenu.isVisible() && ! m_hide_timer.isTiming())
991 hide_timer.start(); 992 m_hide_timer.start();
992 993
993} 994}
994 995
@@ -1072,7 +1073,7 @@ void Toolbar::timeout() {
1072 timeval delay; 1073 timeval delay;
1073 delay.tv_sec = 1; 1074 delay.tv_sec = 1;
1074 delay.tv_usec = 0; 1075 delay.tv_usec = 0;
1075 clock_timer.setTimeout(delay); 1076 m_clock_timer.setTimeout(delay);
1076} 1077}
1077 1078
1078 1079
@@ -1209,12 +1210,12 @@ void Toolbar::setPlacement(Toolbar::Placement where) {
1209 1210
1210void Toolbar::HideHandler::timeout() { 1211void Toolbar::HideHandler::timeout() {
1211 if (toolbar->isEditing()) { // don't hide if we're editing workspace label 1212 if (toolbar->isEditing()) { // don't hide if we're editing workspace label
1212 toolbar->hide_timer.fireOnce(false); 1213 toolbar->m_hide_timer.fireOnce(false);
1213 toolbar->hide_timer.start(); // restart timer and try next timeout 1214 toolbar->m_hide_timer.start(); // restart timer and try next timeout
1214 return; 1215 return;
1215 } 1216 }
1216 1217
1217 toolbar->hide_timer.fireOnce(true); 1218 toolbar->m_hide_timer.fireOnce(true);
1218 1219
1219 toolbar->hidden = ! toolbar->hidden; 1220 toolbar->hidden = ! toolbar->hidden;
1220 if (toolbar->hidden) { 1221 if (toolbar->hidden) {
diff --git a/src/Toolbar.hh b/src/Toolbar.hh
index 344495d..0fc7b88 100644
--- a/src/Toolbar.hh
+++ b/src/Toolbar.hh
@@ -1,5 +1,5 @@
1// Toolbar.hh for Fluxbox 1// Toolbar.hh for Fluxbox
2// Copyright (c) 2002 Henrik Kinnunen (fluxgen at users.sourceforge.net) 2// Copyright (c) 2002-2003 Henrik Kinnunen (fluxgen at users.sourceforge.net)
3// 3//
4// Toolbar.hh for Blackbox - an X11 Window manager 4// Toolbar.hh for Blackbox - an X11 Window manager
5// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) 5// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net)
@@ -22,7 +22,7 @@
22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23// DEALINGS IN THE SOFTWARE. 23// DEALINGS IN THE SOFTWARE.
24 24
25// $Id: Toolbar.hh,v 1.29 2003/04/25 11:39:31 fluxgen Exp $ 25// $Id: Toolbar.hh,v 1.30 2003/05/10 13:55:57 fluxgen Exp $
26 26
27#ifndef TOOLBAR_HH 27#ifndef TOOLBAR_HH
28#define TOOLBAR_HH 28#define TOOLBAR_HH
@@ -47,13 +47,11 @@ class ImageControl;
47}; 47};
48 48
49/// The toolbar. 49/// The toolbar.
50/** 50/// Handles iconbar, workspace name view and clock view
51 Handles iconbar, workspace name view and clock view
52 */
53class Toolbar : public FbTk::TimeoutHandler, public FbTk::EventHandler { 51class Toolbar : public FbTk::TimeoutHandler, public FbTk::EventHandler {
54public: 52public:
55 53
56 ///Toolbar placement on the screen 54 /// Toolbar placement on the screen
57 enum Placement{ 55 enum Placement{
58 // top and bottom placement 56 // top and bottom placement
59 TOPLEFT = 1, BOTTOMLEFT, TOPCENTER, 57 TOPLEFT = 1, BOTTOMLEFT, TOPCENTER,
@@ -63,9 +61,9 @@ public:
63 RIGHTCENTER, RIGHTBOTTOM, RIGHTTOP 61 RIGHTCENTER, RIGHTBOTTOM, RIGHTTOP
64 }; 62 };
65 63
66 /// create a toolbar on the screen with specific width 64 /// Create a toolbar on the screen with specific width
67 explicit Toolbar(BScreen &screen, FbTk::XLayer &layer, FbTk::Menu &menu, size_t width = 200); 65 Toolbar(BScreen &screen, FbTk::XLayer &layer, FbTk::Menu &menu, size_t width = 200);
68 /// destructor 66
69 virtual ~Toolbar(); 67 virtual ~Toolbar();
70 68
71 /// add icon to iconbar 69 /// add icon to iconbar
@@ -161,12 +159,13 @@ private:
161 159
162 virtual void timeout(); 160 virtual void timeout();
163 } hide_handler; 161 } hide_handler;
162
164 friend class HideHandler; 163 friend class HideHandler;
165 164
166 BScreen &m_screen; 165 BScreen &m_screen; ///< screen connection
167 FbTk::ImageControl &image_ctrl; 166
168 FbTk::Timer clock_timer; ///< timer to update clock 167 FbTk::Timer m_clock_timer; ///< timer to update clock
169 FbTk::Timer hide_timer; ///< timer to for auto hide toolbar 168 FbTk::Timer m_hide_timer; ///< timer to for auto hide toolbar
170 FbTk::Menu &m_toolbarmenu; 169 FbTk::Menu &m_toolbarmenu;
171 FbTk::Menu m_placementmenu; 170 FbTk::Menu m_placementmenu;
172 LayerMenu<Toolbar> m_layermenu; 171 LayerMenu<Toolbar> m_layermenu;