aboutsummaryrefslogtreecommitdiff
path: root/src/Window.cc
diff options
context:
space:
mode:
authorPavel Labath <pavelo@centrum.sk>2011-08-15 21:03:57 (GMT)
committerPavel Labath <pavelo@centrum.sk>2013-02-18 21:04:26 (GMT)
commitcab5fa69f059033c4e304076f1892d9cf7c84031 (patch)
treedd56d66c9f19dbdc606c144e8c6af2a6a444c324 /src/Window.cc
parenta897844ea1cfa6303112fd3f0d472d3e135bdc6d (diff)
downloadfluxbox_pavel-cab5fa69f059033c4e304076f1892d9cf7c84031.zip
fluxbox_pavel-cab5fa69f059033c4e304076f1892d9cf7c84031.tar.bz2
Move declarations of Resource enums to a separate file
The reason for this is that I need to access those enums from fluxbox-update_configs and I don't want to #include and link everything in src. I also merged Slit::Placement, Toolbar::Placement and FbWinFrame::TabPlacement into one enum.
Diffstat (limited to 'src/Window.cc')
-rw-r--r--src/Window.cc68
1 files changed, 34 insertions, 34 deletions
diff --git a/src/Window.cc b/src/Window.cc
index 5d64667..2ccd157 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -263,8 +263,8 @@ struct TestCornerHelper {
263 } 263 }
264}; 264};
265 265
266typedef FbTk::VectorTraits<FbTk::EnumTraits<WinButton::Type> > WinButtonsTraits; 266typedef FbTk::VectorTraits<FbTk::EnumTraits<WinButtonType> > WinButtonsTraits;
267typedef FbTk::Resource<vector<WinButton::Type>, WinButtonsTraits> WinButtonsResource; 267typedef FbTk::Resource<vector<WinButtonType>, WinButtonsTraits> WinButtonsResource;
268 268
269} 269}
270 270
@@ -505,7 +505,7 @@ void FluxboxWindow::init() {
505 m_workspace_number = 505 m_workspace_number =
506 m_client->transientFor()->fbwindow()->workspaceNumber(); 506 m_client->transientFor()->fbwindow()->workspaceNumber();
507 } else // if no parent then set default layer 507 } else // if no parent then set default layer
508 moveToLayer(m_state.layernum, m_state.layernum != ::ResourceLayer::NORMAL); 508 moveToLayer(m_state.layernum, m_state.layernum != LAYERNORMAL);
509 509
510 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor: "<< 510 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor: "<<
511 m_client->transientFor()<<endl; 511 m_client->transientFor()<<endl;
@@ -1457,9 +1457,9 @@ void FluxboxWindow::setFullscreenLayer() {
1457 getOnHead() != foc->getOnHead() || 1457 getOnHead() != foc->getOnHead() ||
1458 (foc->winClient().isTransient() && 1458 (foc->winClient().isTransient() &&
1459 foc->winClient().transientFor()->fbwindow() == this)) { 1459 foc->winClient().transientFor()->fbwindow() == this)) {
1460 moveToLayer(::ResourceLayer::ABOVE_DOCK); 1460 moveToLayer(LAYERABOVE_DOCK);
1461 } else { 1461 } else {
1462 moveToLayer(::ResourceLayer::DESKTOP); 1462 moveToLayer(LAYERDESKTOP);
1463 } 1463 }
1464 stateSig().emit(*this); 1464 stateSig().emit(*this);
1465 1465
@@ -1696,10 +1696,10 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) {
1696 fbdbg<<"FluxboxWindow("<<title().logical()<<")::moveToLayer("<<layernum<<")"<<endl; 1696 fbdbg<<"FluxboxWindow("<<title().logical()<<")::moveToLayer("<<layernum<<")"<<endl;
1697 1697
1698 // don't let it set its layer into menu area 1698 // don't let it set its layer into menu area
1699 if (layernum <= ::ResourceLayer::MENU) 1699 if (layernum <= LAYERMENU)
1700 layernum = ::ResourceLayer::MENU + 1; 1700 layernum = LAYERMENU + 1;
1701 else if (layernum >= ::ResourceLayer::NUM_LAYERS) 1701 else if (layernum >= NUM_LAYERS)
1702 layernum = ::ResourceLayer::NUM_LAYERS - 1; 1702 layernum = NUM_LAYERS - 1;
1703 1703
1704 if (!m_initialized) 1704 if (!m_initialized)
1705 m_state.layernum = layernum; 1705 m_state.layernum = layernum;
@@ -1771,7 +1771,7 @@ void FluxboxWindow::setFocusFlag(bool focus) {
1771 } 1771 }
1772 1772
1773 if (m_state.fullscreen && focus) { 1773 if (m_state.fullscreen && focus) {
1774 moveToLayer(::ResourceLayer::ABOVE_DOCK); 1774 moveToLayer(LAYERABOVE_DOCK);
1775 leave(screen().focusedWindowSig()); 1775 leave(screen().focusedWindowSig());
1776 } 1776 }
1777 1777
@@ -3189,10 +3189,10 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
3189 inside_titlebar = client->fbwindow()->hasTitlebar() && 3189 inside_titlebar = client->fbwindow()->hasTitlebar() &&
3190 client->fbwindow()->y() + static_cast<signed>(client->fbwindow()->titlebarHeight()) > dest_y; 3190 client->fbwindow()->y() + static_cast<signed>(client->fbwindow()->titlebarHeight()) > dest_y;
3191 3191
3192 Fluxbox::TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea(); 3192 TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea();
3193 if (area == Fluxbox::ATTACH_AREA_WINDOW) 3193 if (area == ATTACH_AREA_WINDOW)
3194 attach_to_win = client->fbwindow(); 3194 attach_to_win = client->fbwindow();
3195 else if (area == Fluxbox::ATTACH_AREA_TITLEBAR && inside_titlebar) { 3195 else if (area == ATTACH_AREA_TITLEBAR && inside_titlebar) {
3196 attach_to_win = client->fbwindow(); 3196 attach_to_win = client->fbwindow();
3197 } 3197 }
3198 } 3198 }
@@ -3445,18 +3445,18 @@ void FluxboxWindow::setupWindow() {
3445 if (titlebar_side[i] != 0) 3445 if (titlebar_side[i] != 0)
3446 continue; // find next resource too 3446 continue; // find next resource too
3447 3447
3448 WinButton::Type titlebar_left[] = { 3448 WinButtonType titlebar_left[] = {
3449 WinButton::STICK 3449 STICKBUTTON
3450 }; 3450 };
3451 3451
3452 WinButton::Type titlebar_right[] = { 3452 WinButtonType titlebar_right[] = {
3453 WinButton::MINIMIZE, 3453 MINIMIZEBUTTON,
3454 WinButton::MAXIMIZE, 3454 MAXIMIZEBUTTON,
3455 WinButton::CLOSE 3455 CLOSEBUTTON
3456 }; 3456 };
3457 3457
3458 WinButton::Type *begin = 0; 3458 WinButtonType *begin = 0;
3459 WinButton::Type *end = 0; 3459 WinButtonType *end = 0;
3460 3460
3461 if (i == 0) { 3461 if (i == 0) {
3462 begin = titlebar_left; 3462 begin = titlebar_left;
@@ -3529,7 +3529,7 @@ void FluxboxWindow::updateButtons() {
3529 3529
3530 for (size_t c = 0; c < 2 ; c++) { 3530 for (size_t c = 0; c < 2 ; c++) {
3531 // get titlebar configuration for current side 3531 // get titlebar configuration for current side
3532 const vector<WinButton::Type> &dir = *(*titlebar_side[c]); 3532 const vector<WinButtonType> &dir = *(*titlebar_side[c]);
3533 m_titlebar_buttons[c] = dir; 3533 m_titlebar_buttons[c] = dir;
3534 3534
3535 for (size_t i=0; i < dir.size(); ++i) { 3535 for (size_t i=0; i < dir.size(); ++i) {
@@ -3537,17 +3537,17 @@ void FluxboxWindow::updateButtons() {
3537 WinButton *winbtn = 0; 3537 WinButton *winbtn = 0;
3538 3538
3539 switch (dir[i]) { 3539 switch (dir[i]) {
3540 case WinButton::MINIMIZE: 3540 case MINIMIZEBUTTON:
3541 if (isIconifiable() && (m_state.deco_mask & WindowState::DECORM_ICONIFY)) { 3541 if (isIconifiable() && (m_state.deco_mask & WindowState::DECORM_ICONIFY)) {
3542 winbtn = new WinButton(*this, m_button_theme, 3542 winbtn = new WinButton(*this, m_button_theme,
3543 screen().pressedWinButtonTheme(), 3543 screen().pressedWinButtonTheme(),
3544 WinButton::MINIMIZE, 3544 MINIMIZEBUTTON,
3545 frame().titlebar(), 3545 frame().titlebar(),
3546 0, 0, 10, 10); 3546 0, 0, 10, 10);
3547 winbtn->setOnClick(iconify_cmd); 3547 winbtn->setOnClick(iconify_cmd);
3548 } 3548 }
3549 break; 3549 break;
3550 case WinButton::MAXIMIZE: 3550 case MAXIMIZEBUTTON:
3551 if (isMaximizable() && (m_state.deco_mask & WindowState::DECORM_MAXIMIZE) ) { 3551 if (isMaximizable() && (m_state.deco_mask & WindowState::DECORM_MAXIMIZE) ) {
3552 winbtn = new WinButton(*this, m_button_theme, 3552 winbtn = new WinButton(*this, m_button_theme,
3553 screen().pressedWinButtonTheme(), 3553 screen().pressedWinButtonTheme(),
@@ -3560,7 +3560,7 @@ void FluxboxWindow::updateButtons() {
3560 3560
3561 } 3561 }
3562 break; 3562 break;
3563 case WinButton::CLOSE: 3563 case CLOSEBUTTON:
3564 if (m_client->isClosable() && (m_state.deco_mask & WindowState::DECORM_CLOSE)) { 3564 if (m_client->isClosable() && (m_state.deco_mask & WindowState::DECORM_CLOSE)) {
3565 winbtn = new WinButton(*this, m_button_theme, 3565 winbtn = new WinButton(*this, m_button_theme,
3566 screen().pressedWinButtonTheme(), 3566 screen().pressedWinButtonTheme(),
@@ -3573,7 +3573,7 @@ void FluxboxWindow::updateButtons() {
3573 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll)); 3573 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll));
3574 } 3574 }
3575 break; 3575 break;
3576 case WinButton::STICK: 3576 case STICKBUTTON:
3577 if (m_state.deco_mask & WindowState::DECORM_STICKY) { 3577 if (m_state.deco_mask & WindowState::DECORM_STICKY) {
3578 winbtn = new WinButton(*this, m_button_theme, 3578 winbtn = new WinButton(*this, m_button_theme,
3579 screen().pressedWinButtonTheme(), 3579 screen().pressedWinButtonTheme(),
@@ -3586,7 +3586,7 @@ void FluxboxWindow::updateButtons() {
3586 winbtn->setOnClick(stick_cmd); 3586 winbtn->setOnClick(stick_cmd);
3587 } 3587 }
3588 break; 3588 break;
3589 case WinButton::SHADE: 3589 case SHADEBUTTON:
3590 if (m_state.deco_mask & WindowState::DECORM_SHADE) { 3590 if (m_state.deco_mask & WindowState::DECORM_SHADE) {
3591 winbtn = new WinButton(*this, m_button_theme, 3591 winbtn = new WinButton(*this, m_button_theme,
3592 screen().pressedWinButtonTheme(), 3592 screen().pressedWinButtonTheme(),
@@ -3598,7 +3598,7 @@ void FluxboxWindow::updateButtons() {
3598 winbtn->setOnClick(shade_cmd); 3598 winbtn->setOnClick(shade_cmd);
3599 } 3599 }
3600 break; 3600 break;
3601 case WinButton::MENUICON: 3601 case MENUICONBUTTON:
3602 if (m_state.deco_mask & WindowState::DECORM_MENU) { 3602 if (m_state.deco_mask & WindowState::DECORM_MENU) {
3603 winbtn = new WinButton(*this, m_button_theme, 3603 winbtn = new WinButton(*this, m_button_theme,
3604 screen().pressedWinButtonTheme(), 3604 screen().pressedWinButtonTheme(),
@@ -3611,7 +3611,7 @@ void FluxboxWindow::updateButtons() {
3611 } 3611 }
3612 break; 3612 break;
3613 3613
3614 case WinButton::LEFT_HALF: 3614 case LEFT_HALFBUTTON:
3615 { 3615 {
3616 winbtn = new WinButton(*this, m_button_theme, 3616 winbtn = new WinButton(*this, m_button_theme,
3617 screen().pressedWinButtonTheme(), 3617 screen().pressedWinButtonTheme(),
@@ -3624,7 +3624,7 @@ void FluxboxWindow::updateButtons() {
3624 } 3624 }
3625 break; 3625 break;
3626 3626
3627 case WinButton::RIGHT_HALF: 3627 case RIGHT_HALFBUTTON:
3628 { 3628 {
3629 winbtn = new WinButton(*this, m_button_theme, 3629 winbtn = new WinButton(*this, m_button_theme,
3630 screen().pressedWinButtonTheme(), 3630 screen().pressedWinButtonTheme(),
@@ -3812,7 +3812,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) {
3812 setMouseFocus(false); 3812 setMouseFocus(false);
3813 setClickFocus(false); 3813 setClickFocus(false);
3814 setDecorationMask(WindowState::DECOR_NONE); 3814 setDecorationMask(WindowState::DECOR_NONE);
3815 moveToLayer(::ResourceLayer::DOCK); 3815 moveToLayer(LAYERDOCK);
3816 break; 3816 break;
3817 case WindowState::TYPE_DESKTOP: 3817 case WindowState::TYPE_DESKTOP:
3818 /* 3818 /*
@@ -3825,7 +3825,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) {
3825 setIconHidden(true); 3825 setIconHidden(true);
3826 setFocusNew(false); 3826 setFocusNew(false);
3827 setMouseFocus(false); 3827 setMouseFocus(false);
3828 moveToLayer(::ResourceLayer::DESKTOP); 3828 moveToLayer(LAYERDESKTOP);
3829 setDecorationMask(WindowState::DECOR_NONE); 3829 setDecorationMask(WindowState::DECOR_NONE);
3830 setTabable(false); 3830 setTabable(false);
3831 setMovable(false); 3831 setMovable(false);
@@ -3860,7 +3860,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) {
3860 */ 3860 */
3861 setDecorationMask(WindowState::DECOR_TOOL); 3861 setDecorationMask(WindowState::DECOR_TOOL);
3862 setIconHidden(true); 3862 setIconHidden(true);
3863 moveToLayer(::ResourceLayer::ABOVE_DOCK); 3863 moveToLayer(LAYERABOVE_DOCK);
3864 break; 3864 break;
3865 case WindowState::TYPE_NORMAL: 3865 case WindowState::TYPE_NORMAL:
3866 default: 3866 default: