From 69ebd4b8dca1acd5eb4bf18d668a706e9418bd2e Mon Sep 17 00:00:00 2001 From: pekdon Date: Sat, 5 Jan 2002 23:00:18 +0000 Subject: Changed tab placement/alignment enums to uppercase letters --- ChangeLog | 1 + src/Configmenu.cc | 200 +++++++++++++++++++++++++++--------------------------- src/Tab.cc | 142 +++++++++++++++++++------------------- src/Tab.hh | 4 +- src/Window.cc | 12 ++-- src/fluxbox.cc | 4 +- 6 files changed, 182 insertions(+), 181 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5efa1e1..edaf2ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ Changes for 0.1.6: *02/01/05: + * Changed placement/alignment enums to uppercase letters (Claes Nästén) * Fixed tab/iconbar resource bug (Claes Nästén) * Applied "maximize slit stop"-patch (Thanks Andrew Livesay ) * Fixed stickytoggle bug in Windowmenu (Thanks Chris Elston) diff --git a/src/Configmenu.cc b/src/Configmenu.cc index edb527a..ca547bb 100644 --- a/src/Configmenu.cc +++ b/src/Configmenu.cc @@ -538,112 +538,112 @@ Configmenu::Tabmenu::Tabmenu(Configmenu *cm) : Basemenu(cm->screen) { #else // !NLS 0, 0, #endif // NLS - "Top Left"), Tab::PTop + Tab::ALeft); + "Top Left"), Tab::PTOP + Tab::ALEFT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementTopCenter, #else // !NLS 0, 0, #endif // NLS - "Top Center"), Tab::PTop + Tab::ACenter); + "Top Center"), Tab::PTOP + Tab::ACENTER); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementTopRight, #else // !NLS 0, 0, #endif // NLS - "Top Right"), Tab::PTop + Tab::ARight); + "Top Right"), Tab::PTOP + Tab::ARIGHT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementTopRelative, #else // !NLS 0, 0, #endif // NLS - "Top Relative"), Tab::PTop + Tab::ARelative); + "Top Relative"), Tab::PTOP + Tab::ARELATIVE); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementBottomLeft, #else // !NLS 0, 0, #endif // NLS - "Bottom Left"), Tab::PBottom + Tab::ALeft); + "Bottom Left"), Tab::PBOTTOM + Tab::ALEFT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementBottomCenter, #else // !NLS 0, 0, #endif // NLS - "Bottom Center"), Tab::PBottom + Tab::ACenter); + "Bottom Center"), Tab::PBOTTOM + Tab::ACENTER); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementBottomRight, #else // !NLS 0, 0, #endif // NLS - "Bottom Right"), Tab::PBottom + Tab::ARight); + "Bottom Right"), Tab::PBOTTOM + Tab::ARIGHT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementBottomRelative, #else // !NLS 0, 0, #endif // NLS - "Bottom Relative"), Tab::PBottom + Tab::ARelative); + "Bottom Relative"), Tab::PBOTTOM + Tab::ARELATIVE); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementLeftTop, #else // !NLS 0, 0, #endif // NLS - "Left Top"), Tab::PLeft + Tab::ARight); + "Left Top"), Tab::PLEFT + Tab::ARIGHT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementLeftCenter, #else // !NLS 0, 0, #endif // NLS - "Left Center"), Tab::PLeft + Tab::ACenter); + "Left Center"), Tab::PLEFT + Tab::ACENTER); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementLeftBottom, #else // !NLS 0, 0, #endif // NLS - "Left Bottom"), Tab::PLeft + Tab::ALeft); + "Left Bottom"), Tab::PLEFT + Tab::ALEFT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementLeftRelative, #else // !NLS 0, 0, #endif // NLS - "Left Relative"), Tab::PLeft + Tab::ARelative); + "Left Relative"), Tab::PLEFT + Tab::ARELATIVE); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementRightTop, #else // !NLS 0, 0, #endif // NLS - "Right Top"), Tab::PRight + Tab::ARight); + "Right Top"), Tab::PRIGHT + Tab::ARIGHT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementRightCenter, #else // !NLS 0, 0, #endif // NLS - "Right Center"), Tab::PRight + Tab::ACenter); + "Right Center"), Tab::PRIGHT + Tab::ACENTER); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementRightBottom, #else // !NLS 0, 0, #endif // NLS - "Right Bottom"), Tab::PRight + Tab::ALeft); + "Right Bottom"), Tab::PRIGHT + Tab::ALEFT); insert(i18n->getMessage( #ifdef NLS CommonSet, CommonPlacementRightRelative, #else // !NLS 0, 0, #endif // NLS - "Right Relative"), Tab::PRight + Tab::ARelative); + "Right Relative"), Tab::PRIGHT + Tab::ARELATIVE); insert(i18n->getMessage( #ifdef NLS ConfigmenuSet, ConfigmenuTabRotateVertical, @@ -662,127 +662,127 @@ void Configmenu::Tabmenu::itemSelected(int button, int index) { BasemenuItem *item = find(index); switch (item->function()) { - case (Tab::PTop + Tab::ALeft): - configmenu->screen->saveTabPlacement(Tab::PTop); - configmenu->screen->saveTabAlignment(Tab::ALeft); + case (Tab::PTOP + Tab::ALEFT): + configmenu->screen->saveTabPlacement(Tab::PTOP); + configmenu->screen->saveTabAlignment(Tab::ALEFT); configmenu->screen->reconfigure(); break; - case (Tab::PTop + Tab::ACenter): - configmenu->screen->saveTabPlacement(Tab::PTop); - configmenu->screen->saveTabAlignment(Tab::ACenter); + case (Tab::PTOP + Tab::ACENTER): + configmenu->screen->saveTabPlacement(Tab::PTOP); + configmenu->screen->saveTabAlignment(Tab::ACENTER); configmenu->screen->reconfigure(); break; - case (Tab::PTop + Tab::ARight): - configmenu->screen->saveTabPlacement(Tab::PTop); - configmenu->screen->saveTabAlignment(Tab::ARight); + case (Tab::PTOP + Tab::ARIGHT): + configmenu->screen->saveTabPlacement(Tab::PTOP); + configmenu->screen->saveTabAlignment(Tab::ARIGHT); configmenu->screen->reconfigure(); break; - case (Tab::PTop + Tab::ARelative): - configmenu->screen->saveTabPlacement(Tab::PTop); - configmenu->screen->saveTabAlignment(Tab::ARelative); + case (Tab::PTOP + Tab::ARELATIVE): + configmenu->screen->saveTabPlacement(Tab::PTOP); + configmenu->screen->saveTabAlignment(Tab::ARELATIVE); configmenu->screen->reconfigure(); break; - case (Tab::PBottom + Tab::ALeft): - configmenu->screen->saveTabPlacement(Tab::PBottom); - configmenu->screen->saveTabAlignment(Tab::ALeft); + case (Tab::PBOTTOM + Tab::ALEFT): + configmenu->screen->saveTabPlacement(Tab::PBOTTOM); + configmenu->screen->saveTabAlignment(Tab::ALEFT); configmenu->screen->reconfigure(); break; - case (Tab::PBottom + Tab::ACenter): - configmenu->screen->saveTabPlacement(Tab::PBottom); - configmenu->screen->saveTabAlignment(Tab::ACenter); + case (Tab::PBOTTOM + Tab::ACENTER): + configmenu->screen->saveTabPlacement(Tab::PBOTTOM); + configmenu->screen->saveTabAlignment(Tab::ACENTER); configmenu->screen->reconfigure(); break; - case (Tab::PBottom + Tab::ARight): - configmenu->screen->saveTabPlacement(Tab::PBottom); - configmenu->screen->saveTabAlignment(Tab::ARight); + case (Tab::PBOTTOM + Tab::ARIGHT): + configmenu->screen->saveTabPlacement(Tab::PBOTTOM); + configmenu->screen->saveTabAlignment(Tab::ARIGHT); configmenu->screen->reconfigure(); break; - case (Tab::PBottom + Tab::ARelative): - configmenu->screen->saveTabPlacement(Tab::PBottom); - configmenu->screen->saveTabAlignment(Tab::ARelative); + case (Tab::PBOTTOM + Tab::ARELATIVE): + configmenu->screen->saveTabPlacement(Tab::PBOTTOM); + configmenu->screen->saveTabAlignment(Tab::ARELATIVE); configmenu->screen->reconfigure(); break; - case (Tab::PLeft + Tab::ARight): - configmenu->screen->saveTabPlacement(Tab::PLeft); - configmenu->screen->saveTabAlignment(Tab::ARight); + case (Tab::PLEFT + Tab::ARIGHT): + configmenu->screen->saveTabPlacement(Tab::PLEFT); + configmenu->screen->saveTabAlignment(Tab::ARIGHT); configmenu->screen->reconfigure(); break; - case (Tab::PLeft + Tab::ACenter): - configmenu->screen->saveTabPlacement(Tab::PLeft); - configmenu->screen->saveTabAlignment(Tab::ACenter); + case (Tab::PLEFT + Tab::ACENTER): + configmenu->screen->saveTabPlacement(Tab::PLEFT); + configmenu->screen->saveTabAlignment(Tab::ACENTER); configmenu->screen->reconfigure(); break; - case (Tab::PLeft + Tab::ALeft): - configmenu->screen->saveTabPlacement(Tab::PLeft); - configmenu->screen->saveTabAlignment(Tab::ALeft); + case (Tab::PLEFT + Tab::ALEFT): + configmenu->screen->saveTabPlacement(Tab::PLEFT); + configmenu->screen->saveTabAlignment(Tab::ALEFT); configmenu->screen->reconfigure(); break; - case (Tab::PLeft + Tab::ARelative): - configmenu->screen->saveTabPlacement(Tab::PLeft); - configmenu->screen->saveTabAlignment(Tab::ARelative); + case (Tab::PLEFT + Tab::ARELATIVE): + configmenu->screen->saveTabPlacement(Tab::PLEFT); + configmenu->screen->saveTabAlignment(Tab::ARELATIVE); configmenu->screen->reconfigure(); break; - case (Tab::PRight + Tab::ARight): - configmenu->screen->saveTabPlacement(Tab::PRight); - configmenu->screen->saveTabAlignment(Tab::ARight); + case (Tab::PRIGHT + Tab::ARIGHT): + configmenu->screen->saveTabPlacement(Tab::PRIGHT); + configmenu->screen->saveTabAlignment(Tab::ARIGHT); configmenu->screen->reconfigure(); break; - case (Tab::PRight + Tab::ACenter): - configmenu->screen->saveTabPlacement(Tab::PRight); - configmenu->screen->saveTabAlignment(Tab::ACenter); + case (Tab::PRIGHT + Tab::ACENTER): + configmenu->screen->saveTabPlacement(Tab::PRIGHT); + configmenu->screen->saveTabAlignment(Tab::ACENTER); configmenu->screen->reconfigure(); break; - case (Tab::PRight + Tab::ALeft): - configmenu->screen->saveTabPlacement(Tab::PRight); - configmenu->screen->saveTabAlignment(Tab::ALeft); + case (Tab::PRIGHT + Tab::ALEFT): + configmenu->screen->saveTabPlacement(Tab::PRIGHT); + configmenu->screen->saveTabAlignment(Tab::ALEFT); configmenu->screen->reconfigure(); break; - case (Tab::PRight + Tab::ARelative): - configmenu->screen->saveTabPlacement(Tab::PRight); - configmenu->screen->saveTabAlignment(Tab::ARelative); + case (Tab::PRIGHT + Tab::ARELATIVE): + configmenu->screen->saveTabPlacement(Tab::PRIGHT); + configmenu->screen->saveTabAlignment(Tab::ARELATIVE); configmenu->screen->reconfigure(); @@ -802,41 +802,41 @@ void Configmenu::Tabmenu::itemSelected(int button, int index) { } void Configmenu::Tabmenu::setSelected(void) { - setItemSelected(0, (configmenu->screen->getTabPlacement() == Tab::PTop && - configmenu->screen->getTabAlignment() == Tab::ALeft)); - setItemSelected(1, (configmenu->screen->getTabPlacement() == Tab::PTop && - configmenu->screen->getTabAlignment() == Tab::ACenter)); - setItemSelected(2, (configmenu->screen->getTabPlacement() == Tab::PTop && - configmenu->screen->getTabAlignment() == Tab::ARight)); - setItemSelected(3, (configmenu->screen->getTabPlacement() == Tab::PTop && - configmenu->screen->getTabAlignment() == Tab::ARelative)); - setItemSelected(4, (configmenu->screen->getTabPlacement() == Tab::PBottom && - configmenu->screen->getTabAlignment() == Tab::ALeft)); - setItemSelected(5, (configmenu->screen->getTabPlacement() == Tab::PBottom && - configmenu->screen->getTabAlignment() == Tab::ACenter)); - setItemSelected(6, (configmenu->screen->getTabPlacement() == Tab::PBottom && - configmenu->screen->getTabAlignment() == Tab::ARight)); - setItemSelected(7, (configmenu->screen->getTabPlacement() == Tab::PBottom && - configmenu->screen->getTabAlignment() == Tab::ARelative)); - setItemSelected(8, (configmenu->screen->getTabPlacement() == Tab::PLeft && - configmenu->screen->getTabAlignment() == Tab::ARight)); - setItemSelected(9, (configmenu->screen->getTabPlacement() == Tab::PLeft && - configmenu->screen->getTabAlignment() == Tab::ACenter)); - setItemSelected(10, (configmenu->screen->getTabPlacement() == Tab::PLeft && - configmenu->screen->getTabAlignment() == Tab::ALeft)); - setItemSelected(11, (configmenu->screen->getTabPlacement() == Tab::PLeft && - configmenu->screen->getTabAlignment() == Tab::ARelative)); - setItemSelected(12, (configmenu->screen->getTabPlacement() == Tab::PRight && - configmenu->screen->getTabAlignment() == Tab::ARight)); - setItemSelected(13, (configmenu->screen->getTabPlacement() == Tab::PRight && - configmenu->screen->getTabAlignment() == Tab::ACenter)); - setItemSelected(14, (configmenu->screen->getTabPlacement() == Tab::PRight && - configmenu->screen->getTabAlignment() == Tab::ALeft)); - setItemSelected(15, (configmenu->screen->getTabPlacement() == Tab::PRight && - configmenu->screen->getTabAlignment() == Tab::ARelative)); - setItemEnabled(16, (configmenu->screen->getTabPlacement() == Tab::PLeft || - configmenu->screen->getTabPlacement() == Tab::PRight)); + setItemSelected(0, (configmenu->screen->getTabPlacement() == Tab::PTOP && + configmenu->screen->getTabAlignment() == Tab::ALEFT)); + setItemSelected(1, (configmenu->screen->getTabPlacement() == Tab::PTOP && + configmenu->screen->getTabAlignment() == Tab::ACENTER)); + setItemSelected(2, (configmenu->screen->getTabPlacement() == Tab::PTOP && + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + setItemSelected(3, (configmenu->screen->getTabPlacement() == Tab::PTOP && + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + setItemSelected(4, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && + configmenu->screen->getTabAlignment() == Tab::ALEFT)); + setItemSelected(5, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && + configmenu->screen->getTabAlignment() == Tab::ACENTER)); + setItemSelected(6, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + setItemSelected(7, (configmenu->screen->getTabPlacement() == Tab::PBOTTOM && + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + setItemSelected(8, (configmenu->screen->getTabPlacement() == Tab::PLEFT && + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + setItemSelected(9, (configmenu->screen->getTabPlacement() == Tab::PLEFT && + configmenu->screen->getTabAlignment() == Tab::ACENTER)); + setItemSelected(10, (configmenu->screen->getTabPlacement() == Tab::PLEFT && + configmenu->screen->getTabAlignment() == Tab::ALEFT)); + setItemSelected(11, (configmenu->screen->getTabPlacement() == Tab::PLEFT && + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + setItemSelected(12, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && + configmenu->screen->getTabAlignment() == Tab::ARIGHT)); + setItemSelected(13, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && + configmenu->screen->getTabAlignment() == Tab::ACENTER)); + setItemSelected(14, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && + configmenu->screen->getTabAlignment() == Tab::ALEFT)); + setItemSelected(15, (configmenu->screen->getTabPlacement() == Tab::PRIGHT && + configmenu->screen->getTabAlignment() == Tab::ARELATIVE)); + setItemEnabled(16, (configmenu->screen->getTabPlacement() == Tab::PLEFT || + configmenu->screen->getTabPlacement() == Tab::PRIGHT)); setItemSelected(16, (configmenu->screen->isTabRotateVertical() && - (configmenu->screen->getTabPlacement() == Tab::PLeft || - configmenu->screen->getTabPlacement() == Tab::PRight))); + (configmenu->screen->getTabPlacement() == Tab::PLEFT || + configmenu->screen->getTabPlacement() == Tab::PRIGHT))); } diff --git a/src/Tab.cc b/src/Tab.cc index 43340a6..410d499 100644 --- a/src/Tab.cc +++ b/src/Tab.cc @@ -32,19 +32,19 @@ using namespace std; bool Tab::m_stoptabs = false; Tab::t_tabplacementlist Tab::m_tabplacementlist[] = { - {PTop, "Top"}, - {PBottom, "Bottom"}, - {PLeft, "Left"}, - {PRight, "Right"}, - {pnone, "none"} + {PTOP, "Top"}, + {PBOTTOM, "Bottom"}, + {PLEFT, "Left"}, + {PRIGHT, "Right"}, + {PNONE, "none"} }; Tab::t_tabplacementlist Tab::m_tabalignmentlist[] = { - {ALeft, "Left"}, - {ACenter, "Center"}, - {ARight, "Right"}, - {ARelative, "Relative"}, - {anone, "none"} + {ALEFT, "Left"}, + {ACENTER, "Center"}, + {ARIGHT, "Right"}, + {ARELATIVE, "Relative"}, + {ANONE, "none"} }; Tab::Tab(FluxboxWindow *win, Tab *prev, Tab *next) { @@ -57,8 +57,8 @@ Tab::Tab(FluxboxWindow *win, Tab *prev, Tab *next) { m_win = win; m_display = Fluxbox::instance()->getXDisplay(); - if ((m_win->getScreen()->getTabPlacement() == PLeft || - m_win->getScreen()->getTabPlacement() == PRight) && + if ((m_win->getScreen()->getTabPlacement() == PLEFT || + m_win->getScreen()->getTabPlacement() == PRIGHT) && m_win->getScreen()->isTabRotateVertical()) { m_size_w = m_win->getScreen()->getTabHeight(); m_size_h = m_win->getScreen()->getTabWidth(); @@ -290,7 +290,7 @@ void Tab::resize() { } // need to resize tabs if in relative mode - if (m_win->getScreen()->getTabAlignment() == ARelative) { + if (m_win->getScreen()->getTabAlignment() == ARELATIVE) { calcIncrease(); setPosition(); } @@ -306,13 +306,13 @@ void Tab::shade() { first->m_win->shade(); } - if (m_win->getScreen()->getTabPlacement() == PLeft || - m_win->getScreen()->getTabPlacement() == PRight) { + if (m_win->getScreen()->getTabPlacement() == PLEFT || + m_win->getScreen()->getTabPlacement() == PRIGHT) { resizeGroup(); calcIncrease(); } - if (!(m_win->getScreen()->getTabPlacement() == PTop)) + if (!(m_win->getScreen()->getTabPlacement() == PTOP)) setPosition(); } @@ -329,8 +329,8 @@ void Tab::draw(bool pressed) { m_win->getScreen()->getWindowStyle()->tab.l_text_unfocus_gc); // Different routines for drawing rotated text - if ((m_win->getScreen()->getTabPlacement() == PLeft || - m_win->getScreen()->getTabPlacement() == PRight) && + if ((m_win->getScreen()->getTabPlacement() == PLEFT || + m_win->getScreen()->getTabPlacement() == PRIGHT) && (!m_win->isShaded() && m_win->getScreen()->isTabRotateVertical())) { tabtext_w = Misc::XRotTextWidth(m_win->getScreen()->getWindowStyle()->tab.rot_font, @@ -384,10 +384,10 @@ void Tab::setPosition() { //posible movement to a static member function //Tab placement - if (m_win->getScreen()->getTabPlacement() == PTop) { + if (m_win->getScreen()->getTabPlacement() == PTOP) { pos_y = m_win->frame.y - m_size_h; - } else if (m_win->getScreen()->getTabPlacement() == PBottom || + } else if (m_win->getScreen()->getTabPlacement() == PBOTTOM || m_win->isShaded()) { if (m_win->isShaded()) pos_y = m_win->frame.y + m_win->getTitleHeight() + @@ -397,42 +397,42 @@ void Tab::setPosition() { pos_y = m_win->frame.y + m_win->getHeight() + m_win->getScreen()->getBorderWidth2x(); - } else if (m_win->getScreen()->getTabPlacement() == PLeft) { + } else if (m_win->getScreen()->getTabPlacement() == PLEFT) { pos_x = m_win->frame.x - m_size_w; - } else if (m_win->getScreen()->getTabPlacement() == PRight) { + } else if (m_win->getScreen()->getTabPlacement() == PRIGHT) { pos_x = m_win->frame.x + m_win->frame.width + m_win->getScreen()->getBorderWidth2x(); } //Tab alignment - if (m_win->getScreen()->getTabPlacement() == PTop || - m_win->getScreen()->getTabPlacement() == PBottom || + if (m_win->getScreen()->getTabPlacement() == PTOP || + m_win->getScreen()->getTabPlacement() == PBOTTOM || m_win->isShaded()) { switch(m_win->getScreen()->getTabAlignment()) { - case ARelative: - case ALeft: + case ARELATIVE: + case ALEFT: pos_x = m_win->frame.x; break; - case ACenter: + case ACENTER: pos_x = calcCenterXPos(); break; - case ARight: + case ARIGHT: pos_x = m_win->frame.x + m_win->frame.width + m_win->getScreen()->getBorderWidth2x() - m_size_w; break; } } else { //PLeft | PRight switch(m_win->getScreen()->getTabAlignment()) { - case ALeft: + case ALEFT: pos_y = m_win->frame.y - m_size_h + m_win->frame.height + m_win->getScreen()->getBorderWidth2x(); break; - case ACenter: + case ACENTER: pos_y = calcCenterYPos(); break; - case ARelative: - case ARight: + case ARELATIVE: + case ARIGHT: pos_y = m_win->frame.y; break; } @@ -468,40 +468,40 @@ void Tab::calcIncrease(void) { int inc_x = 0, inc_y = 0; unsigned int tabs = 0, i = 0; - if (m_win->getScreen()->getTabPlacement() == PTop || - m_win->getScreen()->getTabPlacement() == PBottom || + if (m_win->getScreen()->getTabPlacement() == PTOP || + m_win->getScreen()->getTabPlacement() == PBOTTOM || m_win->isShaded()) { inc_y = 0; switch(m_win->getScreen()->getTabAlignment()) { - case ALeft: + case ALEFT: inc_x = m_size_w; break; - case ACenter: + case ACENTER: inc_x = m_size_w; break; - case ARight: + case ARIGHT: inc_x = -m_size_w; break; - case ARelative: + case ARELATIVE: inc_x = calcRelativeWidth(); break; } - } else if (m_win->getScreen()->getTabPlacement() == PLeft || - m_win->getScreen()->getTabPlacement() == PRight) { + } else if (m_win->getScreen()->getTabPlacement() == PLEFT || + m_win->getScreen()->getTabPlacement() == PRIGHT) { inc_x = 0; switch(m_win->getScreen()->getTabAlignment()) { - case ALeft: + case ALEFT: inc_y = -m_size_h; break; - case ACenter: + case ACENTER: inc_y = m_size_h; break; - case ARight: + case ARIGHT: inc_y = m_size_h; break; - case ARelative: + case ARELATIVE: inc_y = calcRelativeHeight(); break; } @@ -512,10 +512,10 @@ void Tab::calcIncrease(void) { for (first = getFirst(this); first!=0; first = first->m_next, i++){ //TODO: move this out from here? - if ((m_win->getScreen()->getTabPlacement() == PTop || - m_win->getScreen()->getTabPlacement() == PBottom || + if ((m_win->getScreen()->getTabPlacement() == PTOP || + m_win->getScreen()->getTabPlacement() == PBOTTOM || m_win->isShaded()) && - m_win->getScreen()->getTabAlignment() == ARelative) { + m_win->getScreen()->getTabAlignment() == ARELATIVE) { if (!((m_win->frame.width + m_win->getScreen()->getBorderWidth2x()) % tabs) || i >= ((m_win->frame.width + @@ -527,7 +527,7 @@ void Tab::calcIncrease(void) { first->m_inc_x = inc_x + 1; } first->m_inc_y = inc_y; - } else if (m_win->getScreen()->getTabAlignment() == ARelative) { + } else if (m_win->getScreen()->getTabAlignment() == ARELATIVE) { if (!((m_win->frame.height + m_win->getScreen()->getBorderWidth2x()) % tabs) || i >= ((m_win->frame.height + @@ -620,32 +620,32 @@ void Tab::buttonReleaseEvent(XButtonEvent *be) { dest_x = be->x_root; dest_y = be->y_root; - if (placement == PTop || placement == PBottom || m_win->isShaded()) { - if (placement == PBottom && !m_win->isShaded()) + if (placement == PTOP || placement == PBOTTOM || m_win->isShaded()) { + if (placement == PBOTTOM && !m_win->isShaded()) dest_y -= m_win->frame.height; - else if (placement != PTop && m_win->isShaded()) + else if (placement != PTOP && m_win->isShaded()) dest_y -= m_win->getTitleHeight(); - else // PTop + else // PTOP dest_y += m_win->getTitleHeight(); switch(m_win->getScreen()->getTabAlignment()) { - case ACenter: + case ACENTER: dest_x -= (m_win->frame.width / 2) - (m_size_w / 2); break; - case ARight: + case ARIGHT: dest_x -= m_win->frame.width - m_size_w; break; } - } else { // PLeft & PRight - if (placement == PRight) + } else { // PLEFT & PRIGHT + if (placement == PRIGHT) dest_x = be->x_root - m_win->frame.width; switch(m_win->getScreen()->getTabAlignment()) { - case ACenter: + case ACENTER: dest_y -= (m_win->frame.height / 2) - (m_size_h / 2); break; - case ALeft: + case ALEFT: dest_y -= m_win->frame.height - m_size_h; break; } @@ -840,8 +840,8 @@ void Tab::insert(Tab *tab) { if (m_win->isShaded() != tab->m_win->isShaded()) { tab->m_stoptabs = true; // we don't want any actions performed on the // tabs, just the tab windows! - if (m_win->getScreen()->getTabPlacement() == PLeft || - m_win->getScreen()->getTabPlacement() == PRight) + if (m_win->getScreen()->getTabPlacement() == PLEFT || + m_win->getScreen()->getTabPlacement() == PRIGHT) resize_tabs = true; // if the window we are grouping to, we need to shade the tab window @@ -874,7 +874,7 @@ void Tab::insert(Tab *tab) { } // resize if in relative mode or resize_tabs is true - if(m_win->getScreen()->getTabAlignment() == ARelative || + if(m_win->getScreen()->getTabAlignment() == ARELATIVE || resize_tabs) { resizeGroup(); calcIncrease(); @@ -903,12 +903,12 @@ void Tab::disconnect() { //reposition the tabs if (tmp) { - if (m_win->getScreen()->getTabAlignment() == ARelative) + if (m_win->getScreen()->getTabAlignment() == ARELATIVE) tmp->calcIncrease(); tmp->setPosition(); } - if (m_win->getScreen()->getTabAlignment() == ARelative) + if (m_win->getScreen()->getTabAlignment() == ARELATIVE) calcIncrease(); setPosition(); @@ -957,8 +957,8 @@ void Tab::resizeGroup(void) { #endif //DEBUG Tab *first; for (first = getFirst(this); first != 0; first = first->m_next) { - if ((m_win->getScreen()->getTabPlacement() == PLeft || - m_win->getScreen()->getTabPlacement() == PRight) && + if ((m_win->getScreen()->getTabPlacement() == PLEFT || + m_win->getScreen()->getTabPlacement() == PRIGHT) && m_win->getScreen()->isTabRotateVertical() && !m_win->isShaded()) { first->setTabWidth(m_win->getScreen()->getTabHeight()); @@ -1026,7 +1026,7 @@ unsigned int Tab::calcCenterYPos() { // tabplacement number on success else 0. //---------------------------------------- const char *Tab::getTabPlacementString(int placement) { - for (int i=0; i<(pnone / 5); i++) { + for (int i=0; i<(PNONE / 5); i++) { if (m_tabplacementlist[i] == placement) return m_tabplacementlist[i].string; } @@ -1039,12 +1039,12 @@ const char *Tab::getTabPlacementString(int placement) { // the type none on failure. //---------------------------------------- int Tab::getTabPlacementNum(const char *string) { - for (int i=0; i<(pnone / 5); i ++) { + for (int i=0; i<(PNONE / 5); i ++) { if (m_tabplacementlist[i] == string) { return m_tabplacementlist[i].tp; } } - return pnone; + return PNONE; } //------- getTabAlignmentString ---------- @@ -1052,7 +1052,7 @@ int Tab::getTabPlacementNum(const char *string) { // tabplacement number on success else 0. //---------------------------------------- const char *Tab::getTabAlignmentString(int placement) { - for (int i=0; igetTabPlacement() == Tab::PTop) + if (screen->getTabPlacement() == Tab::PTOP) real_y -= screen->getTabHeight(); - else if (screen->getTabPlacement() == Tab::PLeft) { + else if (screen->getTabPlacement() == Tab::PLEFT) { if (screen->isTabRotateVertical()) real_x -= screen->getTabHeight(); else @@ -1927,11 +1927,11 @@ void FluxboxWindow::maximize(unsigned int button) { if (hasTab()) { switch(screen->getTabPlacement()) { - case Tab::PTop: + case Tab::PTOP: dy += screen->getTabHeight(); dh -= screen->getTabHeight(); break; - case Tab::PLeft: + case Tab::PLEFT: if (screen->isTabRotateVertical()) { dx += screen->getTabHeight(); dw -= screen->getTabHeight(); @@ -1940,13 +1940,13 @@ void FluxboxWindow::maximize(unsigned int button) { dw -= screen->getTabWidth(); } break; - case Tab::PRight: + case Tab::PRIGHT: if (screen->isTabRotateVertical()) dw -= screen->getTabHeight(); else dw -= screen->getTabWidth(); break; - case Tab::PBottom: + case Tab::PBOTTOM: dh -= screen->getTabHeight(); break; default: diff --git a/src/fluxbox.cc b/src/fluxbox.cc index cdbbac1..4394fbc 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc @@ -2336,7 +2336,7 @@ void Fluxbox::load_rc(BScreen *screen) { &value_type, &value)) { screen->saveTabPlacement(Tab::getTabPlacementNum(value.addr)); } else - screen->saveTabPlacement(Tab::PTop); + screen->saveTabPlacement(Tab::PTOP); sprintf(name_lookup, "session.screen%d.tab.alignment", screen_number); sprintf(class_lookup, "Session.Screen%d.Tab.Alignment", screen_number); @@ -2344,7 +2344,7 @@ void Fluxbox::load_rc(BScreen *screen) { &value_type, &value)) { screen->saveTabAlignment(Tab::getTabAlignmentNum(value.addr)); } else - screen->saveTabAlignment(Tab::ALeft); + screen->saveTabAlignment(Tab::ALEFT); sprintf(name_lookup, "session.screen%d.tab.rotatevertical", screen_number); sprintf(class_lookup, "Session.Screen%d.Tab.RotateVertical", screen_number); -- cgit v0.11.2