diff options
author | pekdon <pekdon> | 2002-01-06 11:34:29 (GMT) |
---|---|---|
committer | pekdon <pekdon> | 2002-01-06 11:34:29 (GMT) |
commit | 525b182259442ef2f29349b8bc6ee46c0d880b23 (patch) | |
tree | 1ad3da50844280e2cabe6f9d3826fb5ec7beacb6 | |
parent | 9c2e78819f2791ce72e8fd844153e849f2e823e3 (diff) | |
download | fluxbox_paul-525b182259442ef2f29349b8bc6ee46c0d880b23.zip fluxbox_paul-525b182259442ef2f29349b8bc6ee46c0d880b23.tar.bz2 |
Starting to use member functions of FluxboxWindow instead of accessing things directly
-rw-r--r-- | src/Tab.cc | 76 |
1 files changed, 38 insertions, 38 deletions
@@ -262,7 +262,7 @@ void Tab::stick() { | |||
262 | win->blackbox_attrib.flags ^= BaseDisplay::ATTRIB_OMNIPRESENT; | 262 | win->blackbox_attrib.flags ^= BaseDisplay::ATTRIB_OMNIPRESENT; |
263 | win->blackbox_attrib.attrib ^= BaseDisplay::ATTRIB_OMNIPRESENT; | 263 | win->blackbox_attrib.attrib ^= BaseDisplay::ATTRIB_OMNIPRESENT; |
264 | win->stuck = false; | 264 | win->stuck = false; |
265 | if (!win->iconic) | 265 | if (!win->isIconic()) |
266 | win->getScreen()->reassociateWindow(win, -1, true); | 266 | win->getScreen()->reassociateWindow(win, -1, true); |
267 | 267 | ||
268 | } else { | 268 | } else { |
@@ -285,8 +285,8 @@ void Tab::resize() { | |||
285 | //now move and resize the windows in the list | 285 | //now move and resize the windows in the list |
286 | for (; first != 0; first = first->m_next) { | 286 | for (; first != 0; first = first->m_next) { |
287 | if (first!=this) { | 287 | if (first!=this) { |
288 | first->m_win->configure(m_win->frame.x, m_win->frame.y, | 288 | first->m_win->configure(m_win->getXFrame(), m_win->getYFrame(), |
289 | m_win->frame.width, m_win->frame.height); | 289 | m_win->getWidth(), m_win->getHeight()); |
290 | } | 290 | } |
291 | } | 291 | } |
292 | 292 | ||
@@ -326,7 +326,7 @@ void Tab::shade() { | |||
326 | void Tab::draw(bool pressed) { | 326 | void Tab::draw(bool pressed) { |
327 | unsigned int tabtext_w; | 327 | unsigned int tabtext_w; |
328 | 328 | ||
329 | GC gc = ((m_win->focused) ? m_win->getScreen()->getWindowStyle()->tab.l_text_focus_gc : | 329 | GC gc = ((m_win->isFocused()) ? m_win->getScreen()->getWindowStyle()->tab.l_text_focus_gc : |
330 | m_win->getScreen()->getWindowStyle()->tab.l_text_unfocus_gc); | 330 | m_win->getScreen()->getWindowStyle()->tab.l_text_unfocus_gc); |
331 | 331 | ||
332 | // Different routines for drawing rotated text | 332 | // Different routines for drawing rotated text |
@@ -386,23 +386,23 @@ void Tab::setPosition() { | |||
386 | 386 | ||
387 | //Tab placement | 387 | //Tab placement |
388 | if (m_win->getScreen()->getTabPlacement() == PTOP) { | 388 | if (m_win->getScreen()->getTabPlacement() == PTOP) { |
389 | pos_y = m_win->frame.y - m_size_h; | 389 | pos_y = m_win->getYFrame() - m_size_h; |
390 | 390 | ||
391 | } else if (m_win->getScreen()->getTabPlacement() == PBOTTOM || | 391 | } else if (m_win->getScreen()->getTabPlacement() == PBOTTOM || |
392 | m_win->isShaded()) { | 392 | m_win->isShaded()) { |
393 | if (m_win->isShaded()) | 393 | if (m_win->isShaded()) |
394 | pos_y = m_win->frame.y + m_win->getTitleHeight() + | 394 | pos_y = m_win->getYFrame() + m_win->getTitleHeight() + |
395 | m_win->getScreen()->getBorderWidth2x(); | 395 | m_win->getScreen()->getBorderWidth2x(); |
396 | 396 | ||
397 | else | 397 | else |
398 | pos_y = m_win->frame.y + m_win->getHeight() + | 398 | pos_y = m_win->getYFrame() + m_win->getHeight() + |
399 | m_win->getScreen()->getBorderWidth2x(); | 399 | m_win->getScreen()->getBorderWidth2x(); |
400 | 400 | ||
401 | } else if (m_win->getScreen()->getTabPlacement() == PLEFT) { | 401 | } else if (m_win->getScreen()->getTabPlacement() == PLEFT) { |
402 | pos_x = m_win->frame.x - m_size_w; | 402 | pos_x = m_win->getXFrame() - m_size_w; |
403 | 403 | ||
404 | } else if (m_win->getScreen()->getTabPlacement() == PRIGHT) { | 404 | } else if (m_win->getScreen()->getTabPlacement() == PRIGHT) { |
405 | pos_x = m_win->frame.x + m_win->frame.width + | 405 | pos_x = m_win->getXFrame() + m_win->getWidth() + |
406 | m_win->getScreen()->getBorderWidth2x(); | 406 | m_win->getScreen()->getBorderWidth2x(); |
407 | } | 407 | } |
408 | 408 | ||
@@ -413,20 +413,20 @@ void Tab::setPosition() { | |||
413 | switch(m_win->getScreen()->getTabAlignment()) { | 413 | switch(m_win->getScreen()->getTabAlignment()) { |
414 | case ARELATIVE: | 414 | case ARELATIVE: |
415 | case ALEFT: | 415 | case ALEFT: |
416 | pos_x = m_win->frame.x; | 416 | pos_x = m_win->getXFrame(); |
417 | break; | 417 | break; |
418 | case ACENTER: | 418 | case ACENTER: |
419 | pos_x = calcCenterXPos(); | 419 | pos_x = calcCenterXPos(); |
420 | break; | 420 | break; |
421 | case ARIGHT: | 421 | case ARIGHT: |
422 | pos_x = m_win->frame.x + m_win->frame.width + | 422 | pos_x = m_win->getXFrame() + m_win->getWidth() + |
423 | m_win->getScreen()->getBorderWidth2x() - m_size_w; | 423 | m_win->getScreen()->getBorderWidth2x() - m_size_w; |
424 | break; | 424 | break; |
425 | } | 425 | } |
426 | } else { //PLeft | PRight | 426 | } else { //PLeft | PRight |
427 | switch(m_win->getScreen()->getTabAlignment()) { | 427 | switch(m_win->getScreen()->getTabAlignment()) { |
428 | case ALEFT: | 428 | case ALEFT: |
429 | pos_y = m_win->frame.y - m_size_h + m_win->frame.height + | 429 | pos_y = m_win->getYFrame() - m_size_h + m_win->getHeight() + |
430 | m_win->getScreen()->getBorderWidth2x(); | 430 | m_win->getScreen()->getBorderWidth2x(); |
431 | break; | 431 | break; |
432 | case ACENTER: | 432 | case ACENTER: |
@@ -434,7 +434,7 @@ void Tab::setPosition() { | |||
434 | break; | 434 | break; |
435 | case ARELATIVE: | 435 | case ARELATIVE: |
436 | case ARIGHT: | 436 | case ARIGHT: |
437 | pos_y = m_win->frame.y; | 437 | pos_y = m_win->getYFrame(); |
438 | break; | 438 | break; |
439 | } | 439 | } |
440 | } | 440 | } |
@@ -448,8 +448,8 @@ void Tab::setPosition() { | |||
448 | 448 | ||
449 | //dont move fluxboxwindow if the itterator = this | 449 | //dont move fluxboxwindow if the itterator = this |
450 | if (first!=this) { | 450 | if (first!=this) { |
451 | first->m_win->configure(m_win->frame.x, m_win->frame.y, | 451 | first->m_win->configure(m_win->getXFrame(), m_win->getYFrame(), |
452 | m_win->frame.width, m_win->frame.height); | 452 | m_win->getWidth(), m_win->getHeight()); |
453 | } | 453 | } |
454 | } | 454 | } |
455 | 455 | ||
@@ -517,9 +517,9 @@ void Tab::calcIncrease(void) { | |||
517 | m_win->getScreen()->getTabPlacement() == PBOTTOM || | 517 | m_win->getScreen()->getTabPlacement() == PBOTTOM || |
518 | m_win->isShaded()) && | 518 | m_win->isShaded()) && |
519 | m_win->getScreen()->getTabAlignment() == ARELATIVE) { | 519 | m_win->getScreen()->getTabAlignment() == ARELATIVE) { |
520 | if (!((m_win->frame.width + | 520 | if (!((m_win->getWidth() + |
521 | m_win->getScreen()->getBorderWidth2x()) % tabs) || | 521 | m_win->getScreen()->getBorderWidth2x()) % tabs) || |
522 | i >= ((m_win->frame.width + | 522 | i >= ((m_win->getWidth() + |
523 | m_win->getScreen()->getBorderWidth2x()) % tabs)) { | 523 | m_win->getScreen()->getBorderWidth2x()) % tabs)) { |
524 | first->setTabWidth(inc_x); | 524 | first->setTabWidth(inc_x); |
525 | first->m_inc_x = inc_x; | 525 | first->m_inc_x = inc_x; |
@@ -529,9 +529,9 @@ void Tab::calcIncrease(void) { | |||
529 | } | 529 | } |
530 | first->m_inc_y = inc_y; | 530 | first->m_inc_y = inc_y; |
531 | } else if (m_win->getScreen()->getTabAlignment() == ARELATIVE) { | 531 | } else if (m_win->getScreen()->getTabAlignment() == ARELATIVE) { |
532 | if (!((m_win->frame.height + | 532 | if (!((m_win->getHeight() + |
533 | m_win->getScreen()->getBorderWidth2x()) % tabs) || | 533 | m_win->getScreen()->getBorderWidth2x()) % tabs) || |
534 | i >= ((m_win->frame.height + | 534 | i >= ((m_win->getHeight() + |
535 | m_win->getScreen()->getBorderWidth2x()) % tabs)) { | 535 | m_win->getScreen()->getBorderWidth2x()) % tabs)) { |
536 | 536 | ||
537 | first->setTabHeight(inc_y); | 537 | first->setTabHeight(inc_y); |
@@ -623,7 +623,7 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) { | |||
623 | 623 | ||
624 | if (placement == PTOP || placement == PBOTTOM || m_win->isShaded()) { | 624 | if (placement == PTOP || placement == PBOTTOM || m_win->isShaded()) { |
625 | if (placement == PBOTTOM && !m_win->isShaded()) | 625 | if (placement == PBOTTOM && !m_win->isShaded()) |
626 | dest_y -= m_win->frame.height; | 626 | dest_y -= m_win->getHeight(); |
627 | else if (placement != PTOP && m_win->isShaded()) | 627 | else if (placement != PTOP && m_win->isShaded()) |
628 | dest_y -= m_win->getTitleHeight(); | 628 | dest_y -= m_win->getTitleHeight(); |
629 | else // PTOP | 629 | else // PTOP |
@@ -631,29 +631,29 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) { | |||
631 | 631 | ||
632 | switch(m_win->getScreen()->getTabAlignment()) { | 632 | switch(m_win->getScreen()->getTabAlignment()) { |
633 | case ACENTER: | 633 | case ACENTER: |
634 | dest_x -= (m_win->frame.width / 2) - (m_size_w / 2); | 634 | dest_x -= (m_win->getWidth() / 2) - (m_size_w / 2); |
635 | break; | 635 | break; |
636 | case ARIGHT: | 636 | case ARIGHT: |
637 | dest_x -= m_win->frame.width - m_size_w; | 637 | dest_x -= m_win->getWidth() - m_size_w; |
638 | break; | 638 | break; |
639 | } | 639 | } |
640 | 640 | ||
641 | } else { // PLEFT & PRIGHT | 641 | } else { // PLEFT & PRIGHT |
642 | if (placement == PRIGHT) | 642 | if (placement == PRIGHT) |
643 | dest_x = be->x_root - m_win->frame.width; | 643 | dest_x = be->x_root - m_win->getWidth(); |
644 | 644 | ||
645 | switch(m_win->getScreen()->getTabAlignment()) { | 645 | switch(m_win->getScreen()->getTabAlignment()) { |
646 | case ACENTER: | 646 | case ACENTER: |
647 | dest_y -= (m_win->frame.height / 2) - (m_size_h / 2); | 647 | dest_y -= (m_win->getHeight() / 2) - (m_size_h / 2); |
648 | break; | 648 | break; |
649 | case ALEFT: | 649 | case ALEFT: |
650 | dest_y -= m_win->frame.height - m_size_h; | 650 | dest_y -= m_win->getHeight() - m_size_h; |
651 | break; | 651 | break; |
652 | } | 652 | } |
653 | } | 653 | } |
654 | //TODO: this causes an calculate increase event, even if we | 654 | //TODO: this causes an calculate increase event, even if we |
655 | // only are moving a window | 655 | // only are moving a window |
656 | m_win->configure(dest_x, dest_y, m_win->frame.width, m_win->frame.height); | 656 | m_win->configure(dest_x, dest_y, m_win->getWidth(), m_win->getHeight()); |
657 | } | 657 | } |
658 | } | 658 | } |
659 | } else { | 659 | } else { |
@@ -848,13 +848,13 @@ void Tab::insert(Tab *tab) { | |||
848 | // if the window we are grouping to, we need to shade the tab window | 848 | // if the window we are grouping to, we need to shade the tab window |
849 | // _after_ reconfigure | 849 | // _after_ reconfigure |
850 | if(m_win->isShaded()) { | 850 | if(m_win->isShaded()) { |
851 | tab->m_win->configure(m_win->frame.x, m_win->frame.y, | 851 | tab->m_win->configure(m_win->getXFrame(), m_win->getYFrame(), |
852 | m_win->frame.width, m_win->frame.height); | 852 | m_win->getWidth(), m_win->getHeight()); |
853 | tab->m_win->shade(); | 853 | tab->m_win->shade(); |
854 | } else { | 854 | } else { |
855 | tab->m_win->shade(); // switch to correct shade state | 855 | tab->m_win->shade(); // switch to correct shade state |
856 | tab->m_win->configure(m_win->frame.x, m_win->frame.y, | 856 | tab->m_win->configure(m_win->getXFrame(), m_win->getYFrame(), |
857 | m_win->frame.width, m_win->frame.height); | 857 | m_win->getWidth(), m_win->getHeight()); |
858 | } | 858 | } |
859 | 859 | ||
860 | tab->m_stoptabs = false; | 860 | tab->m_stoptabs = false; |
@@ -862,11 +862,11 @@ void Tab::insert(Tab *tab) { | |||
862 | // both window have the same shaded state and have different sizes, | 862 | // both window have the same shaded state and have different sizes, |
863 | // checking this so that I'll only do shade on windows if configure did | 863 | // checking this so that I'll only do shade on windows if configure did |
864 | // anything. | 864 | // anything. |
865 | } else if ((m_win->frame.width != tab->m_win->frame.width) || | 865 | } else if ((m_win->getWidth() != tab->m_win->getWidth()) || |
866 | (m_win->frame.height != tab->m_win->frame.height)) { | 866 | (m_win->getHeight() != tab->m_win->getHeight())) { |
867 | 867 | ||
868 | tab->m_win->configure(m_win->frame.x, m_win->frame.y, | 868 | tab->m_win->configure(m_win->getXFrame(), m_win->getYFrame(), |
869 | m_win->frame.width, m_win->frame.height); | 869 | m_win->getWidth(), m_win->getHeight()); |
870 | 870 | ||
871 | // need to shade the tab window as configure will mess it up | 871 | // need to shade the tab window as configure will mess it up |
872 | if (m_win->isShaded()) | 872 | if (m_win->isShaded()) |
@@ -982,7 +982,7 @@ unsigned int Tab::calcRelativeWidth() { | |||
982 | //calculate num objs in list (extract this to a function?) | 982 | //calculate num objs in list (extract this to a function?) |
983 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); | 983 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); |
984 | 984 | ||
985 | return ((m_win->frame.width + m_win->getScreen()->getBorderWidth2x())/num); | 985 | return ((m_win->getWidth() + m_win->getScreen()->getBorderWidth2x())/num); |
986 | } | 986 | } |
987 | 987 | ||
988 | //------------- calcRelativeHeight ------- | 988 | //------------- calcRelativeHeight ------- |
@@ -994,7 +994,7 @@ unsigned int Tab::calcRelativeHeight() { | |||
994 | //calculate num objs in list (extract this to a function?) | 994 | //calculate num objs in list (extract this to a function?) |
995 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); | 995 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); |
996 | 996 | ||
997 | return ((m_win->frame.height + m_win->getScreen()->getBorderWidth2x())/num); | 997 | return ((m_win->getHeight() + m_win->getScreen()->getBorderWidth2x())/num); |
998 | } | 998 | } |
999 | 999 | ||
1000 | //------------- calcCenterXPos ----------- | 1000 | //------------- calcCenterXPos ----------- |
@@ -1006,7 +1006,7 @@ unsigned int Tab::calcCenterXPos() { | |||
1006 | //calculate num objs in list (extract this to a function?) | 1006 | //calculate num objs in list (extract this to a function?) |
1007 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); | 1007 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); |
1008 | 1008 | ||
1009 | return (m_win->frame.x + ((m_win->frame.width - (m_size_w * num)) / 2)); | 1009 | return (m_win->getXFrame() + ((m_win->getWidth() - (m_size_w * num)) / 2)); |
1010 | } | 1010 | } |
1011 | 1011 | ||
1012 | //------------- calcCenterYPos ----------- | 1012 | //------------- calcCenterYPos ----------- |
@@ -1018,7 +1018,7 @@ unsigned int Tab::calcCenterYPos() { | |||
1018 | //calculate num objs in list (extract this to a function?) | 1018 | //calculate num objs in list (extract this to a function?) |
1019 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); | 1019 | for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); |
1020 | 1020 | ||
1021 | return (m_win->frame.y + ((m_win->frame.height - (m_size_h * num)) / 2)); | 1021 | return (m_win->getYFrame() + ((m_win->getHeight() - (m_size_h * num)) / 2)); |
1022 | } | 1022 | } |
1023 | 1023 | ||
1024 | 1024 | ||