diff options
Diffstat (limited to 'src/Toolbar.cc')
-rw-r--r-- | src/Toolbar.cc | 89 |
1 files changed, 44 insertions, 45 deletions
diff --git a/src/Toolbar.cc b/src/Toolbar.cc index 214a64f..eeebda6 100644 --- a/src/Toolbar.cc +++ b/src/Toolbar.cc | |||
@@ -63,7 +63,6 @@ | |||
63 | #endif // TIME_WITH_SYS_TIME | 63 | #endif // TIME_WITH_SYS_TIME |
64 | 64 | ||
65 | #include <iostream> | 65 | #include <iostream> |
66 | #include "misc.hh" | ||
67 | 66 | ||
68 | using namespace std; | 67 | using namespace std; |
69 | 68 | ||
@@ -227,7 +226,7 @@ void Toolbar::reconfigure(void) { | |||
227 | frame.height += (frame.bevel_w * 2); | 226 | frame.height += (frame.bevel_w * 2); |
228 | 227 | ||
229 | switch (screen->getToolbarPlacement()) { | 228 | switch (screen->getToolbarPlacement()) { |
230 | case TopLeft: | 229 | case TOPLEFT: |
231 | frame.x = 0; | 230 | frame.x = 0; |
232 | frame.y = 0; | 231 | frame.y = 0; |
233 | frame.x_hidden = 0; | 232 | frame.x_hidden = 0; |
@@ -235,7 +234,7 @@ void Toolbar::reconfigure(void) { | |||
235 | - frame.height; | 234 | - frame.height; |
236 | break; | 235 | break; |
237 | 236 | ||
238 | case BottomLeft: | 237 | case BOTTOMLEFT: |
239 | frame.x = 0; | 238 | frame.x = 0; |
240 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); | 239 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); |
241 | frame.x_hidden = 0; | 240 | frame.x_hidden = 0; |
@@ -243,7 +242,7 @@ void Toolbar::reconfigure(void) { | |||
243 | - screen->getBorderWidth(); | 242 | - screen->getBorderWidth(); |
244 | break; | 243 | break; |
245 | 244 | ||
246 | case TopCenter: | 245 | case TOPCENTER: |
247 | frame.x = (screen->getWidth() - frame.width) / 2; | 246 | frame.x = (screen->getWidth() - frame.width) / 2; |
248 | frame.y = 0; | 247 | frame.y = 0; |
249 | frame.x_hidden = frame.x; | 248 | frame.x_hidden = frame.x; |
@@ -251,7 +250,7 @@ void Toolbar::reconfigure(void) { | |||
251 | - frame.height; | 250 | - frame.height; |
252 | break; | 251 | break; |
253 | 252 | ||
254 | case BottomCenter: | 253 | case BOTTOMCENTER: |
255 | default: | 254 | default: |
256 | frame.x = (screen->getWidth() - frame.width) / 2; | 255 | frame.x = (screen->getWidth() - frame.width) / 2; |
257 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); | 256 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); |
@@ -260,7 +259,7 @@ void Toolbar::reconfigure(void) { | |||
260 | - screen->getBorderWidth(); | 259 | - screen->getBorderWidth(); |
261 | break; | 260 | break; |
262 | 261 | ||
263 | case TopRight: | 262 | case TOPRIGHT: |
264 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); | 263 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); |
265 | frame.y = 0; | 264 | frame.y = 0; |
266 | frame.x_hidden = frame.x; | 265 | frame.x_hidden = frame.x; |
@@ -268,7 +267,7 @@ void Toolbar::reconfigure(void) { | |||
268 | - frame.height; | 267 | - frame.height; |
269 | break; | 268 | break; |
270 | 269 | ||
271 | case BottomRight: | 270 | case BOTTOMRIGHT: |
272 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); | 271 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); |
273 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); | 272 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); |
274 | frame.x_hidden = frame.x; | 273 | frame.x_hidden = frame.x; |
@@ -356,42 +355,42 @@ void Toolbar::reconfigure(void) { | |||
356 | 355 | ||
357 | frame.window_label_w = | 356 | frame.window_label_w = |
358 | (frame.width - (frame.clock_w + (frame.button_w * 4) + | 357 | (frame.width - (frame.clock_w + (frame.button_w * 4) + |
359 | frame.workspace_label_w + (frame.bevel_w * 8) + 6)); | 358 | frame.workspace_label_w + (frame.bevel_w * 8) + 6)); |
360 | 359 | ||
361 | if (hidden) | 360 | if (hidden) |
362 | XMoveResizeWindow(display, frame.window, frame.x_hidden, frame.y_hidden, | 361 | XMoveResizeWindow(display, frame.window, frame.x_hidden, frame.y_hidden, |
363 | frame.width, frame.height); | 362 | frame.width, frame.height); |
364 | else | 363 | else |
365 | XMoveResizeWindow(display, frame.window, frame.x, frame.y, | 364 | XMoveResizeWindow(display, frame.window, frame.x, frame.y, |
366 | frame.width, frame.height); | 365 | frame.width, frame.height); |
367 | 366 | ||
368 | XMoveResizeWindow(display, frame.workspace_label, frame.bevel_w, | 367 | XMoveResizeWindow(display, frame.workspace_label, frame.bevel_w, |
369 | frame.bevel_w, frame.workspace_label_w, | 368 | frame.bevel_w, frame.workspace_label_w, |
370 | frame.label_h); | 369 | frame.label_h); |
371 | XMoveResizeWindow(display, frame.psbutton, (frame.bevel_w * 2) + | 370 | XMoveResizeWindow(display, frame.psbutton, (frame.bevel_w * 2) + |
372 | frame.workspace_label_w + 1, frame.bevel_w + 1, | 371 | frame.workspace_label_w + 1, frame.bevel_w + 1, |
373 | frame.button_w, frame.button_w); | 372 | frame.button_w, frame.button_w); |
374 | XMoveResizeWindow(display ,frame.nsbutton, (frame.bevel_w * 3) + | 373 | XMoveResizeWindow(display ,frame.nsbutton, (frame.bevel_w * 3) + |
375 | frame.workspace_label_w + frame.button_w + 2, | 374 | frame.workspace_label_w + frame.button_w + 2, |
376 | frame.bevel_w + 1, frame.button_w, frame.button_w); | 375 | frame.bevel_w + 1, frame.button_w, frame.button_w); |
377 | XMoveResizeWindow(display, frame.window_label, (frame.bevel_w * 4) + | 376 | XMoveResizeWindow(display, frame.window_label, (frame.bevel_w * 4) + |
378 | (frame.button_w * 2) + frame.workspace_label_w + 3, | 377 | (frame.button_w * 2) + frame.workspace_label_w + 3, |
379 | frame.bevel_w, frame.window_label_w, frame.label_h); | 378 | frame.bevel_w, frame.window_label_w, frame.label_h); |
380 | XMoveResizeWindow(display, frame.pwbutton, (frame.bevel_w * 5) + | 379 | XMoveResizeWindow(display, frame.pwbutton, (frame.bevel_w * 5) + |
381 | (frame.button_w * 2) + frame.workspace_label_w + | 380 | (frame.button_w * 2) + frame.workspace_label_w + |
382 | frame.window_label_w + 4, frame.bevel_w + 1, | 381 | frame.window_label_w + 4, frame.bevel_w + 1, |
383 | frame.button_w, frame.button_w); | 382 | frame.button_w, frame.button_w); |
384 | XMoveResizeWindow(display, frame.nwbutton, (frame.bevel_w * 6) + | 383 | XMoveResizeWindow(display, frame.nwbutton, (frame.bevel_w * 6) + |
385 | (frame.button_w * 3) + frame.workspace_label_w + | 384 | (frame.button_w * 3) + frame.workspace_label_w + |
386 | frame.window_label_w + 5, frame.bevel_w + 1, | 385 | frame.window_label_w + 5, frame.bevel_w + 1, |
387 | frame.button_w, frame.button_w); | 386 | frame.button_w, frame.button_w); |
388 | XMoveResizeWindow(display, frame.clock, frame.width - frame.clock_w - | 387 | XMoveResizeWindow(display, frame.clock, frame.width - frame.clock_w - |
389 | frame.bevel_w, frame.bevel_w, frame.clock_w, | 388 | frame.bevel_w, frame.bevel_w, frame.clock_w, |
390 | frame.label_h); | 389 | frame.label_h); |
391 | 390 | ||
392 | Pixmap tmp = frame.base; | 391 | Pixmap tmp = frame.base; |
393 | BTexture *texture = &(screen->getToolbarStyle()->toolbar); | 392 | BTexture *texture = &(screen->getToolbarStyle()->toolbar); |
394 | if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { | 393 | if (texture->getTexture() == (BImage::FLAT | BImage::SOLID)) { |
395 | frame.base = None; | 394 | frame.base = None; |
396 | XSetWindowBackground(display, frame.window, | 395 | XSetWindowBackground(display, frame.window, |
397 | texture->getColor()->getPixel()); | 396 | texture->getColor()->getPixel()); |
@@ -404,7 +403,7 @@ void Toolbar::reconfigure(void) { | |||
404 | 403 | ||
405 | tmp = frame.label; | 404 | tmp = frame.label; |
406 | texture = &(screen->getToolbarStyle()->window); | 405 | texture = &(screen->getToolbarStyle()->window); |
407 | if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { | 406 | if (texture->getTexture() == (BImage::FLAT | BImage::SOLID)) { |
408 | frame.label = None; | 407 | frame.label = None; |
409 | XSetWindowBackground(display, frame.window_label, | 408 | XSetWindowBackground(display, frame.window_label, |
410 | texture->getColor()->getPixel()); | 409 | texture->getColor()->getPixel()); |
@@ -417,7 +416,7 @@ void Toolbar::reconfigure(void) { | |||
417 | 416 | ||
418 | tmp = frame.wlabel; | 417 | tmp = frame.wlabel; |
419 | texture = &(screen->getToolbarStyle()->label); | 418 | texture = &(screen->getToolbarStyle()->label); |
420 | if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { | 419 | if (texture->getTexture() == (BImage::FLAT | BImage::SOLID)) { |
421 | frame.wlabel = None; | 420 | frame.wlabel = None; |
422 | XSetWindowBackground(display, frame.workspace_label, | 421 | XSetWindowBackground(display, frame.workspace_label, |
423 | texture->getColor()->getPixel()); | 422 | texture->getColor()->getPixel()); |
@@ -430,7 +429,7 @@ void Toolbar::reconfigure(void) { | |||
430 | 429 | ||
431 | tmp = frame.clk; | 430 | tmp = frame.clk; |
432 | texture = &(screen->getToolbarStyle()->clock); | 431 | texture = &(screen->getToolbarStyle()->clock); |
433 | if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { | 432 | if (texture->getTexture() == (BImage::FLAT | BImage::SOLID)) { |
434 | frame.clk = None; | 433 | frame.clk = None; |
435 | XSetWindowBackground(display, frame.clock, | 434 | XSetWindowBackground(display, frame.clock, |
436 | texture->getColor()->getPixel()); | 435 | texture->getColor()->getPixel()); |
@@ -443,7 +442,7 @@ void Toolbar::reconfigure(void) { | |||
443 | 442 | ||
444 | tmp = frame.button; | 443 | tmp = frame.button; |
445 | texture = &(screen->getToolbarStyle()->button); | 444 | texture = &(screen->getToolbarStyle()->button); |
446 | if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { | 445 | if (texture->getTexture() == (BImage::FLAT | BImage::SOLID)) { |
447 | frame.button = None; | 446 | frame.button = None; |
448 | 447 | ||
449 | frame.button_pixel = texture->getColor()->getPixel(); | 448 | frame.button_pixel = texture->getColor()->getPixel(); |
@@ -464,7 +463,7 @@ void Toolbar::reconfigure(void) { | |||
464 | 463 | ||
465 | tmp = frame.pbutton; | 464 | tmp = frame.pbutton; |
466 | texture = &(screen->getToolbarStyle()->pressed); | 465 | texture = &(screen->getToolbarStyle()->pressed); |
467 | if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { | 466 | if (texture->getTexture() == (BImage::FLAT | BImage::SOLID)) { |
468 | frame.pbutton = None; | 467 | frame.pbutton = None; |
469 | frame.pbutton_pixel = texture->getColor()->getPixel(); | 468 | frame.pbutton_pixel = texture->getColor()->getPixel(); |
470 | } else | 469 | } else |
@@ -645,14 +644,14 @@ void Toolbar::checkClock(Bool redraw, Bool date) { | |||
645 | } | 644 | } |
646 | 645 | ||
647 | switch (screen->getToolbarStyle()->font.justify) { | 646 | switch (screen->getToolbarStyle()->font.justify) { |
648 | case FFont::Right: | 647 | case DrawUtil::Font::RIGHT: |
649 | dx += frame.clock_w - l; | 648 | dx += frame.clock_w - l; |
650 | break; | 649 | break; |
651 | 650 | ||
652 | case FFont::Center: | 651 | case DrawUtil::Font::CENTER: |
653 | dx += (frame.clock_w - l) / 2; | 652 | dx += (frame.clock_w - l) / 2; |
654 | break; | 653 | break; |
655 | default: | 654 | default: //LEFT |
656 | break; | 655 | break; |
657 | } | 656 | } |
658 | 657 | ||
@@ -711,11 +710,11 @@ void Toolbar::redrawWindowLabel(Bool redraw) { | |||
711 | } | 710 | } |
712 | } | 711 | } |
713 | switch (screen->getToolbarStyle()->font.justify) { | 712 | switch (screen->getToolbarStyle()->font.justify) { |
714 | case FFont::Right: | 713 | case DrawUtil::Font::RIGHT: |
715 | dx += frame.window_label_w - l; | 714 | dx += frame.window_label_w - l; |
716 | break; | 715 | break; |
717 | 716 | ||
718 | case FFont::Center: | 717 | case DrawUtil::Font::CENTER: |
719 | dx += (frame.window_label_w - l) / 2; | 718 | dx += (frame.window_label_w - l) / 2; |
720 | break; | 719 | break; |
721 | default: | 720 | default: |
@@ -789,11 +788,11 @@ void Toolbar::redrawWorkspaceLabel(Bool redraw) { | |||
789 | } | 788 | } |
790 | 789 | ||
791 | switch (screen->getToolbarStyle()->font.justify) { | 790 | switch (screen->getToolbarStyle()->font.justify) { |
792 | case FFont::Right: | 791 | case DrawUtil::Font::RIGHT: |
793 | dx += frame.workspace_label_w - l; | 792 | dx += frame.workspace_label_w - l; |
794 | break; | 793 | break; |
795 | 794 | ||
796 | case FFont::Center: | 795 | case DrawUtil::Font::CENTER: |
797 | dx += (frame.workspace_label_w - l) / 2; | 796 | dx += (frame.workspace_label_w - l) / 2; |
798 | break; | 797 | break; |
799 | default: | 798 | default: |
@@ -1349,7 +1348,7 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) | |||
1349 | 0, 0, | 1348 | 0, 0, |
1350 | #endif // NLS | 1349 | #endif // NLS |
1351 | "Top Left"), | 1350 | "Top Left"), |
1352 | Toolbar::TopLeft); | 1351 | Toolbar::TOPLEFT); |
1353 | insert(i18n->getMessage( | 1352 | insert(i18n->getMessage( |
1354 | #ifdef NLS | 1353 | #ifdef NLS |
1355 | CommonSet, CommonPlacementBottomLeft, | 1354 | CommonSet, CommonPlacementBottomLeft, |
@@ -1357,7 +1356,7 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) | |||
1357 | 0, 0, | 1356 | 0, 0, |
1358 | #endif // NLS | 1357 | #endif // NLS |
1359 | "Bottom Left"), | 1358 | "Bottom Left"), |
1360 | Toolbar::BottomLeft); | 1359 | Toolbar::BOTTOMLEFT); |
1361 | insert(i18n->getMessage( | 1360 | insert(i18n->getMessage( |
1362 | #ifdef NLS | 1361 | #ifdef NLS |
1363 | CommonSet, CommonPlacementTopCenter, | 1362 | CommonSet, CommonPlacementTopCenter, |
@@ -1365,7 +1364,7 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) | |||
1365 | 0, 0, | 1364 | 0, 0, |
1366 | #endif // NLS | 1365 | #endif // NLS |
1367 | "Top Center"), | 1366 | "Top Center"), |
1368 | Toolbar::TopCenter); | 1367 | Toolbar::TOPCENTER); |
1369 | insert(i18n->getMessage( | 1368 | insert(i18n->getMessage( |
1370 | #ifdef NLS | 1369 | #ifdef NLS |
1371 | CommonSet, CommonPlacementBottomCenter, | 1370 | CommonSet, CommonPlacementBottomCenter, |
@@ -1373,7 +1372,7 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) | |||
1373 | 0, 0, | 1372 | 0, 0, |
1374 | #endif // NLS | 1373 | #endif // NLS |
1375 | "Bottom Center"), | 1374 | "Bottom Center"), |
1376 | Toolbar::BottomCenter); | 1375 | Toolbar::BOTTOMCENTER); |
1377 | insert(i18n->getMessage( | 1376 | insert(i18n->getMessage( |
1378 | #ifdef NLS | 1377 | #ifdef NLS |
1379 | CommonSet, CommonPlacementTopRight, | 1378 | CommonSet, CommonPlacementTopRight, |
@@ -1381,7 +1380,7 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) | |||
1381 | 0, 0, | 1380 | 0, 0, |
1382 | #endif // NLS | 1381 | #endif // NLS |
1383 | "Top Right"), | 1382 | "Top Right"), |
1384 | Toolbar::TopRight); | 1383 | Toolbar::TOPRIGHT); |
1385 | insert(i18n->getMessage( | 1384 | insert(i18n->getMessage( |
1386 | #ifdef NLS | 1385 | #ifdef NLS |
1387 | CommonSet, CommonPlacementBottomRight, | 1386 | CommonSet, CommonPlacementBottomRight, |
@@ -1389,7 +1388,7 @@ Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) | |||
1389 | 0, 0, | 1388 | 0, 0, |
1390 | #endif // NLS | 1389 | #endif // NLS |
1391 | "Bottom Right"), | 1390 | "Bottom Right"), |
1392 | Toolbar::BottomRight); | 1391 | Toolbar::BOTTOMRIGHT); |
1393 | 1392 | ||
1394 | update(); | 1393 | update(); |
1395 | } | 1394 | } |