diff options
Diffstat (limited to 'src/Slit.cc')
-rw-r--r-- | src/Slit.cc | 64 |
1 files changed, 32 insertions, 32 deletions
diff --git a/src/Slit.cc b/src/Slit.cc index 379fdaa..c263ba9 100644 --- a/src/Slit.cc +++ b/src/Slit.cc | |||
@@ -187,7 +187,7 @@ void Slit::addClient(Window w) { | |||
187 | XSelectInput(display, client->window, NoEventMask); | 187 | XSelectInput(display, client->window, NoEventMask); |
188 | 188 | ||
189 | XReparentWindow(display, client->window, frame.window, 0, 0); | 189 | XReparentWindow(display, client->window, frame.window, 0, 0); |
190 | XMapRaised(display, client->window); | 190 | XMapRaised(display, client->window); //TODO: bbkeys bug here? |
191 | XChangeSaveSet(display, client->window, SetModeInsert); | 191 | XChangeSaveSet(display, client->window, SetModeInsert); |
192 | 192 | ||
193 | XSelectInput(display, frame.window, SubstructureRedirectMask | | 193 | XSelectInput(display, frame.window, SubstructureRedirectMask | |
@@ -255,7 +255,7 @@ void Slit::reconfigure(void) { | |||
255 | LinkedListIterator<SlitClient> it(clientList); | 255 | LinkedListIterator<SlitClient> it(clientList); |
256 | 256 | ||
257 | switch (screen->getSlitDirection()) { | 257 | switch (screen->getSlitDirection()) { |
258 | case Vertical: | 258 | case VERTICAL: |
259 | for (; it.current(); it++) { | 259 | for (; it.current(); it++) { |
260 | frame.height += it.current()->height + screen->getBevelWidth(); | 260 | frame.height += it.current()->height + screen->getBevelWidth(); |
261 | 261 | ||
@@ -275,7 +275,7 @@ void Slit::reconfigure(void) { | |||
275 | 275 | ||
276 | break; | 276 | break; |
277 | 277 | ||
278 | case Horizontal: | 278 | case HORIZONTAL: |
279 | for (; it.current(); it++) { | 279 | for (; it.current(); it++) { |
280 | frame.width += it.current()->width + screen->getBevelWidth(); | 280 | frame.width += it.current()->width + screen->getBevelWidth(); |
281 | 281 | ||
@@ -310,7 +310,7 @@ void Slit::reconfigure(void) { | |||
310 | Pixmap tmp = frame.pixmap; | 310 | Pixmap tmp = frame.pixmap; |
311 | BImageControl *image_ctrl = screen->getImageControl(); | 311 | BImageControl *image_ctrl = screen->getImageControl(); |
312 | BTexture *texture = &(screen->getToolbarStyle()->toolbar); | 312 | BTexture *texture = &(screen->getToolbarStyle()->toolbar); |
313 | if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { | 313 | if (texture->getTexture() == (BImage::FLAT | BImage::SOLID)) { |
314 | frame.pixmap = None; | 314 | frame.pixmap = None; |
315 | XSetWindowBackground(display, frame.window, | 315 | XSetWindowBackground(display, frame.window, |
316 | texture->getColor()->getPixel()); | 316 | texture->getColor()->getPixel()); |
@@ -326,7 +326,7 @@ void Slit::reconfigure(void) { | |||
326 | it.reset(); | 326 | it.reset(); |
327 | 327 | ||
328 | switch (screen->getSlitDirection()) { | 328 | switch (screen->getSlitDirection()) { |
329 | case Vertical: | 329 | case VERTICAL: |
330 | x = 0; | 330 | x = 0; |
331 | y = screen->getBevelWidth(); | 331 | y = screen->getBevelWidth(); |
332 | 332 | ||
@@ -363,7 +363,7 @@ void Slit::reconfigure(void) { | |||
363 | 363 | ||
364 | break; | 364 | break; |
365 | 365 | ||
366 | case Horizontal: | 366 | case HORIZONTAL: |
367 | x = screen->getBevelWidth(); | 367 | x = screen->getBevelWidth(); |
368 | y = 0; | 368 | y = 0; |
369 | 369 | ||
@@ -408,10 +408,10 @@ void Slit::reconfigure(void) { | |||
408 | void Slit::reposition(void) { | 408 | void Slit::reposition(void) { |
409 | // place the slit in the appropriate place | 409 | // place the slit in the appropriate place |
410 | switch (screen->getSlitPlacement()) { | 410 | switch (screen->getSlitPlacement()) { |
411 | case TopLeft: | 411 | case TOPLEFT: |
412 | frame.x = 0; | 412 | frame.x = 0; |
413 | frame.y = 0; | 413 | frame.y = 0; |
414 | if (screen->getSlitDirection() == Vertical) { | 414 | if (screen->getSlitDirection() == VERTICAL) { |
415 | frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() | 415 | frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() |
416 | - frame.width; | 416 | - frame.width; |
417 | frame.y_hidden = 0; | 417 | frame.y_hidden = 0; |
@@ -422,7 +422,7 @@ void Slit::reposition(void) { | |||
422 | } | 422 | } |
423 | break; | 423 | break; |
424 | 424 | ||
425 | case CenterLeft: | 425 | case CENTERLEFT: |
426 | frame.x = 0; | 426 | frame.x = 0; |
427 | frame.y = (screen->getHeight() - frame.height) / 2; | 427 | frame.y = (screen->getHeight() - frame.height) / 2; |
428 | frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() | 428 | frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() |
@@ -430,10 +430,10 @@ void Slit::reposition(void) { | |||
430 | frame.y_hidden = frame.y; | 430 | frame.y_hidden = frame.y; |
431 | break; | 431 | break; |
432 | 432 | ||
433 | case BottomLeft: | 433 | case BOTTOMLEFT: |
434 | frame.x = 0; | 434 | frame.x = 0; |
435 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); | 435 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); |
436 | if (screen->getSlitDirection() == Vertical) { | 436 | if (screen->getSlitDirection() == VERTICAL) { |
437 | frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() | 437 | frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() |
438 | - frame.width; | 438 | - frame.width; |
439 | frame.y_hidden = frame.y; | 439 | frame.y_hidden = frame.y; |
@@ -444,7 +444,7 @@ void Slit::reposition(void) { | |||
444 | } | 444 | } |
445 | break; | 445 | break; |
446 | 446 | ||
447 | case TopCenter: | 447 | case TOPCENTER: |
448 | frame.x = (screen->getWidth() - frame.width) / 2; | 448 | frame.x = (screen->getWidth() - frame.width) / 2; |
449 | frame.y = 0; | 449 | frame.y = 0; |
450 | frame.x_hidden = frame.x; | 450 | frame.x_hidden = frame.x; |
@@ -452,7 +452,7 @@ void Slit::reposition(void) { | |||
452 | - frame.height; | 452 | - frame.height; |
453 | break; | 453 | break; |
454 | 454 | ||
455 | case BottomCenter: | 455 | case BOTTOMCENTER: |
456 | frame.x = (screen->getWidth() - frame.width) / 2; | 456 | frame.x = (screen->getWidth() - frame.width) / 2; |
457 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); | 457 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); |
458 | frame.x_hidden = frame.x; | 458 | frame.x_hidden = frame.x; |
@@ -460,10 +460,10 @@ void Slit::reposition(void) { | |||
460 | - screen->getBorderWidth(); | 460 | - screen->getBorderWidth(); |
461 | break; | 461 | break; |
462 | 462 | ||
463 | case TopRight: | 463 | case TOPRIGHT: |
464 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); | 464 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); |
465 | frame.y = 0; | 465 | frame.y = 0; |
466 | if (screen->getSlitDirection() == Vertical) { | 466 | if (screen->getSlitDirection() == VERTICAL) { |
467 | frame.x_hidden = screen->getWidth() - screen->getBevelWidth() | 467 | frame.x_hidden = screen->getWidth() - screen->getBevelWidth() |
468 | - screen->getBorderWidth(); | 468 | - screen->getBorderWidth(); |
469 | frame.y_hidden = 0; | 469 | frame.y_hidden = 0; |
@@ -474,7 +474,7 @@ void Slit::reposition(void) { | |||
474 | } | 474 | } |
475 | break; | 475 | break; |
476 | 476 | ||
477 | case CenterRight: | 477 | case CENTERRIGHT: |
478 | default: | 478 | default: |
479 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); | 479 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); |
480 | frame.y = (screen->getHeight() - frame.height) / 2; | 480 | frame.y = (screen->getHeight() - frame.height) / 2; |
@@ -483,10 +483,10 @@ void Slit::reposition(void) { | |||
483 | frame.y_hidden = frame.y; | 483 | frame.y_hidden = frame.y; |
484 | break; | 484 | break; |
485 | 485 | ||
486 | case BottomRight: | 486 | case BOTTOMRIGHT: |
487 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); | 487 | frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); |
488 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); | 488 | frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); |
489 | if (screen->getSlitDirection() == Vertical) { | 489 | if (screen->getSlitDirection() == VERTICAL) { |
490 | frame.x_hidden = screen->getWidth() - screen->getBevelWidth() | 490 | frame.x_hidden = screen->getWidth() - screen->getBevelWidth() |
491 | - screen->getBorderWidth(); | 491 | - screen->getBorderWidth(); |
492 | frame.y_hidden = frame.y; | 492 | frame.y_hidden = frame.y; |
@@ -508,13 +508,13 @@ void Slit::reposition(void) { | |||
508 | tbar->getY() < frame.y + sh && tbar->getY() + th > frame.y) { | 508 | tbar->getY() < frame.y + sh && tbar->getY() + th > frame.y) { |
509 | if (frame.y < th) { | 509 | if (frame.y < th) { |
510 | frame.y += tbar->getExposedHeight(); | 510 | frame.y += tbar->getExposedHeight(); |
511 | if (screen->getSlitDirection() == Vertical) | 511 | if (screen->getSlitDirection() == VERTICAL) |
512 | frame.y_hidden += tbar->getExposedHeight(); | 512 | frame.y_hidden += tbar->getExposedHeight(); |
513 | else | 513 | else |
514 | frame.y_hidden = frame.y; | 514 | frame.y_hidden = frame.y; |
515 | } else { | 515 | } else { |
516 | frame.y -= tbar->getExposedHeight(); | 516 | frame.y -= tbar->getExposedHeight(); |
517 | if (screen->getSlitDirection() == Vertical) | 517 | if (screen->getSlitDirection() == VERTICAL) |
518 | frame.y_hidden -= tbar->getExposedHeight(); | 518 | frame.y_hidden -= tbar->getExposedHeight(); |
519 | else | 519 | else |
520 | frame.y_hidden = frame.y; | 520 | frame.y_hidden = frame.y; |
@@ -764,7 +764,7 @@ Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
764 | 0, 0, | 764 | 0, 0, |
765 | #endif // NLS | 765 | #endif // NLS |
766 | "Horizontal"), | 766 | "Horizontal"), |
767 | Slit::Horizontal); | 767 | Slit::HORIZONTAL); |
768 | insert(i18n->getMessage( | 768 | insert(i18n->getMessage( |
769 | #ifdef NLS | 769 | #ifdef NLS |
770 | CommonSet, CommonDirectionVert, | 770 | CommonSet, CommonDirectionVert, |
@@ -772,11 +772,11 @@ Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
772 | 0, 0, | 772 | 0, 0, |
773 | #endif // NLS | 773 | #endif // NLS |
774 | "Vertical"), | 774 | "Vertical"), |
775 | Slit::Vertical); | 775 | Slit::VERTICAL); |
776 | 776 | ||
777 | update(); | 777 | update(); |
778 | 778 | ||
779 | if (sm->slit->screen->getSlitDirection() == Slit::Horizontal) | 779 | if (sm->slit->screen->getSlitDirection() == Slit::HORIZONTAL) |
780 | setItemSelected(0, True); | 780 | setItemSelected(0, True); |
781 | else | 781 | else |
782 | setItemSelected(1, True); | 782 | setItemSelected(1, True); |
@@ -790,7 +790,7 @@ void Slitmenu::Directionmenu::itemSelected(int button, int index) { | |||
790 | 790 | ||
791 | slitmenu->slit->screen->saveSlitDirection(item->function()); | 791 | slitmenu->slit->screen->saveSlitDirection(item->function()); |
792 | 792 | ||
793 | if (item->function() == Slit::Horizontal) { | 793 | if (item->function() == Slit::HORIZONTAL) { |
794 | setItemSelected(0, True); | 794 | setItemSelected(0, True); |
795 | setItemSelected(1, False); | 795 | setItemSelected(1, False); |
796 | } else { | 796 | } else { |
@@ -825,7 +825,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
825 | 0, 0, | 825 | 0, 0, |
826 | #endif // NLS | 826 | #endif // NLS |
827 | "Top Left"), | 827 | "Top Left"), |
828 | Slit::TopLeft); | 828 | Slit::TOPLEFT); |
829 | insert(i18n->getMessage( | 829 | insert(i18n->getMessage( |
830 | #ifdef NLS | 830 | #ifdef NLS |
831 | CommonSet, CommonPlacementCenterLeft, | 831 | CommonSet, CommonPlacementCenterLeft, |
@@ -833,7 +833,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
833 | 0, 0, | 833 | 0, 0, |
834 | #endif // NLS | 834 | #endif // NLS |
835 | "Center Left"), | 835 | "Center Left"), |
836 | Slit::CenterLeft); | 836 | Slit::CENTERLEFT); |
837 | insert(i18n->getMessage( | 837 | insert(i18n->getMessage( |
838 | #ifdef NLS | 838 | #ifdef NLS |
839 | CommonSet, CommonPlacementBottomLeft, | 839 | CommonSet, CommonPlacementBottomLeft, |
@@ -841,7 +841,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
841 | 0, 0, | 841 | 0, 0, |
842 | #endif // NLS | 842 | #endif // NLS |
843 | "Bottom Left"), | 843 | "Bottom Left"), |
844 | Slit::BottomLeft); | 844 | Slit::BOTTOMLEFT); |
845 | insert(i18n->getMessage( | 845 | insert(i18n->getMessage( |
846 | #ifdef NLS | 846 | #ifdef NLS |
847 | CommonSet, CommonPlacementTopCenter, | 847 | CommonSet, CommonPlacementTopCenter, |
@@ -849,7 +849,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
849 | 0, 0, | 849 | 0, 0, |
850 | #endif // NLS | 850 | #endif // NLS |
851 | "Top Center"), | 851 | "Top Center"), |
852 | Slit::TopCenter); | 852 | Slit::TOPCENTER); |
853 | insert(""); | 853 | insert(""); |
854 | insert(i18n->getMessage( | 854 | insert(i18n->getMessage( |
855 | #ifdef NLS | 855 | #ifdef NLS |
@@ -858,7 +858,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
858 | 0, 0, | 858 | 0, 0, |
859 | #endif // NLS | 859 | #endif // NLS |
860 | "Bottom Center"), | 860 | "Bottom Center"), |
861 | Slit::BottomCenter); | 861 | Slit::BOTTOMCENTER); |
862 | insert(i18n->getMessage( | 862 | insert(i18n->getMessage( |
863 | #ifdef NLS | 863 | #ifdef NLS |
864 | CommonSet, CommonPlacementTopRight, | 864 | CommonSet, CommonPlacementTopRight, |
@@ -866,7 +866,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
866 | 0, 0, | 866 | 0, 0, |
867 | #endif // NLS | 867 | #endif // NLS |
868 | "Top Right"), | 868 | "Top Right"), |
869 | Slit::TopRight); | 869 | Slit::TOPRIGHT); |
870 | insert(i18n->getMessage( | 870 | insert(i18n->getMessage( |
871 | #ifdef NLS | 871 | #ifdef NLS |
872 | CommonSet, CommonPlacementCenterRight, | 872 | CommonSet, CommonPlacementCenterRight, |
@@ -874,7 +874,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
874 | 0, 0, | 874 | 0, 0, |
875 | #endif // NLS | 875 | #endif // NLS |
876 | "Center Right"), | 876 | "Center Right"), |
877 | Slit::CenterRight); | 877 | Slit::CENTERRIGHT); |
878 | insert(i18n->getMessage( | 878 | insert(i18n->getMessage( |
879 | #ifdef NLS | 879 | #ifdef NLS |
880 | CommonSet, CommonPlacementBottomRight, | 880 | CommonSet, CommonPlacementBottomRight, |
@@ -882,7 +882,7 @@ Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen | |||
882 | 0, 0, | 882 | 0, 0, |
883 | #endif // NLS | 883 | #endif // NLS |
884 | "Bottom Right"), | 884 | "Bottom Right"), |
885 | Slit::BottomRight); | 885 | Slit::BOTTOMRIGHT); |
886 | 886 | ||
887 | update(); | 887 | update(); |
888 | } | 888 | } |