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>2011-11-01 10:04:02 (GMT)
commit698a4af938737295494dade50950d1aeebc8b55d (patch)
tree075017c3a59ac2575f708d223cf2391e82b9eb69 /src/Window.cc
parent678a98de943963e993827540496741ae814af8bd (diff)
downloadfluxbox_paul-698a4af938737295494dade50950d1aeebc8b55d.zip
fluxbox_paul-698a4af938737295494dade50950d1aeebc8b55d.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.cc64
1 files changed, 32 insertions, 32 deletions
diff --git a/src/Window.cc b/src/Window.cc
index e8b1c31..a8e4534 100644
--- a/src/Window.cc
+++ b/src/Window.cc
@@ -251,8 +251,8 @@ private:
251 int m_mode; 251 int m_mode;
252}; 252};
253 253
254typedef FbTk::VectorTraits<FbTk::EnumTraits<WinButton::Type> > WinButtonsTraits; 254typedef FbTk::VectorTraits<FbTk::EnumTraits<WinButtonType> > WinButtonsTraits;
255typedef FbTk::Resource<vector<WinButton::Type>, WinButtonsTraits> WinButtonsResource; 255typedef FbTk::Resource<vector<WinButtonType>, WinButtonsTraits> WinButtonsResource;
256 256
257} 257}
258 258
@@ -489,7 +489,7 @@ void FluxboxWindow::init() {
489 m_workspace_number = 489 m_workspace_number =
490 m_client->transientFor()->fbwindow()->workspaceNumber(); 490 m_client->transientFor()->fbwindow()->workspaceNumber();
491 } else // if no parent then set default layer 491 } else // if no parent then set default layer
492 moveToLayer(m_state.layernum, m_state.layernum != ::ResourceLayer::NORMAL); 492 moveToLayer(m_state.layernum, m_state.layernum != LAYERNORMAL);
493 493
494 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor: "<< 494 fbdbg<<"FluxboxWindow::init("<<title().logical()<<") transientFor: "<<
495 m_client->transientFor()<<endl; 495 m_client->transientFor()<<endl;
@@ -1447,9 +1447,9 @@ void FluxboxWindow::setFullscreenLayer() {
1447 getOnHead() != foc->getOnHead() || 1447 getOnHead() != foc->getOnHead() ||
1448 (foc->winClient().isTransient() && 1448 (foc->winClient().isTransient() &&
1449 foc->winClient().transientFor()->fbwindow() == this)) { 1449 foc->winClient().transientFor()->fbwindow() == this)) {
1450 moveToLayer(::ResourceLayer::ABOVE_DOCK); 1450 moveToLayer(LAYERABOVE_DOCK);
1451 } else { 1451 } else {
1452 moveToLayer(::ResourceLayer::DESKTOP); 1452 moveToLayer(LAYERDESKTOP);
1453 } 1453 }
1454 stateSig().emit(*this); 1454 stateSig().emit(*this);
1455 1455
@@ -1686,10 +1686,10 @@ void FluxboxWindow::moveToLayer(int layernum, bool force) {
1686 fbdbg<<"FluxboxWindow("<<title().logical()<<")::moveToLayer("<<layernum<<")"<<endl; 1686 fbdbg<<"FluxboxWindow("<<title().logical()<<")::moveToLayer("<<layernum<<")"<<endl;
1687 1687
1688 // don't let it set its layer into menu area 1688 // don't let it set its layer into menu area
1689 if (layernum <= ::ResourceLayer::MENU) 1689 if (layernum <= LAYERMENU)
1690 layernum = ::ResourceLayer::MENU + 1; 1690 layernum = LAYERMENU + 1;
1691 else if (layernum >= ::ResourceLayer::NUM_LAYERS) 1691 else if (layernum >= NUM_LAYERS)
1692 layernum = ::ResourceLayer::NUM_LAYERS - 1; 1692 layernum = NUM_LAYERS - 1;
1693 1693
1694 if (!m_initialized) 1694 if (!m_initialized)
1695 m_state.layernum = layernum; 1695 m_state.layernum = layernum;
@@ -1761,7 +1761,7 @@ void FluxboxWindow::setFocusFlag(bool focus) {
1761 } 1761 }
1762 1762
1763 if (m_state.fullscreen && focus) { 1763 if (m_state.fullscreen && focus) {
1764 moveToLayer(::ResourceLayer::ABOVE_DOCK); 1764 moveToLayer(LAYERABOVE_DOCK);
1765 leave(screen().focusedWindowSig()); 1765 leave(screen().focusedWindowSig());
1766 } 1766 }
1767 1767
@@ -3208,10 +3208,10 @@ void FluxboxWindow::attachTo(int x, int y, bool interrupted) {
3208 inside_titlebar = client->fbwindow()->hasTitlebar() && 3208 inside_titlebar = client->fbwindow()->hasTitlebar() &&
3209 client->fbwindow()->y() + static_cast<signed>(client->fbwindow()->titlebarHeight()) > dest_y; 3209 client->fbwindow()->y() + static_cast<signed>(client->fbwindow()->titlebarHeight()) > dest_y;
3210 3210
3211 Fluxbox::TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea(); 3211 TabsAttachArea area= Fluxbox::instance()->getTabsAttachArea();
3212 if (area == Fluxbox::ATTACH_AREA_WINDOW) 3212 if (area == ATTACH_AREA_WINDOW)
3213 attach_to_win = client->fbwindow(); 3213 attach_to_win = client->fbwindow();
3214 else if (area == Fluxbox::ATTACH_AREA_TITLEBAR && inside_titlebar) { 3214 else if (area == ATTACH_AREA_TITLEBAR && inside_titlebar) {
3215 attach_to_win = client->fbwindow(); 3215 attach_to_win = client->fbwindow();
3216 } 3216 }
3217 } 3217 }
@@ -3460,18 +3460,18 @@ void FluxboxWindow::setupWindow() {
3460 if (titlebar_side[i] != 0) 3460 if (titlebar_side[i] != 0)
3461 continue; // find next resource too 3461 continue; // find next resource too
3462 3462
3463 WinButton::Type titlebar_left[] = { 3463 WinButtonType titlebar_left[] = {
3464 WinButton::STICK 3464 STICKBUTTON
3465 }; 3465 };
3466 3466
3467 WinButton::Type titlebar_right[] = { 3467 WinButtonType titlebar_right[] = {
3468 WinButton::MINIMIZE, 3468 MINIMIZEBUTTON,
3469 WinButton::MAXIMIZE, 3469 MAXIMIZEBUTTON,
3470 WinButton::CLOSE 3470 CLOSEBUTTON
3471 }; 3471 };
3472 3472
3473 WinButton::Type *begin = 0; 3473 WinButtonType *begin = 0;
3474 WinButton::Type *end = 0; 3474 WinButtonType *end = 0;
3475 3475
3476 if (i == 0) { 3476 if (i == 0) {
3477 begin = titlebar_left; 3477 begin = titlebar_left;
@@ -3544,7 +3544,7 @@ void FluxboxWindow::updateButtons() {
3544 3544
3545 for (size_t c = 0; c < 2 ; c++) { 3545 for (size_t c = 0; c < 2 ; c++) {
3546 // get titlebar configuration for current side 3546 // get titlebar configuration for current side
3547 const vector<WinButton::Type> &dir = *(*titlebar_side[c]); 3547 const vector<WinButtonType> &dir = *(*titlebar_side[c]);
3548 m_titlebar_buttons[c] = dir; 3548 m_titlebar_buttons[c] = dir;
3549 3549
3550 for (size_t i=0; i < dir.size(); ++i) { 3550 for (size_t i=0; i < dir.size(); ++i) {
@@ -3552,17 +3552,17 @@ void FluxboxWindow::updateButtons() {
3552 WinButton *winbtn = 0; 3552 WinButton *winbtn = 0;
3553 3553
3554 switch (dir[i]) { 3554 switch (dir[i]) {
3555 case WinButton::MINIMIZE: 3555 case MINIMIZEBUTTON:
3556 if (isIconifiable() && (m_state.deco_mask & WindowState::DECORM_ICONIFY)) { 3556 if (isIconifiable() && (m_state.deco_mask & WindowState::DECORM_ICONIFY)) {
3557 winbtn = new WinButton(*this, m_button_theme, 3557 winbtn = new WinButton(*this, m_button_theme,
3558 screen().pressedWinButtonTheme(), 3558 screen().pressedWinButtonTheme(),
3559 WinButton::MINIMIZE, 3559 MINIMIZEBUTTON,
3560 frame().titlebar(), 3560 frame().titlebar(),
3561 0, 0, 10, 10); 3561 0, 0, 10, 10);
3562 winbtn->setOnClick(iconify_cmd); 3562 winbtn->setOnClick(iconify_cmd);
3563 } 3563 }
3564 break; 3564 break;
3565 case WinButton::MAXIMIZE: 3565 case MAXIMIZEBUTTON:
3566 if (isMaximizable() && (m_state.deco_mask & WindowState::DECORM_MAXIMIZE) ) { 3566 if (isMaximizable() && (m_state.deco_mask & WindowState::DECORM_MAXIMIZE) ) {
3567 winbtn = new WinButton(*this, m_button_theme, 3567 winbtn = new WinButton(*this, m_button_theme,
3568 screen().pressedWinButtonTheme(), 3568 screen().pressedWinButtonTheme(),
@@ -3575,7 +3575,7 @@ void FluxboxWindow::updateButtons() {
3575 3575
3576 } 3576 }
3577 break; 3577 break;
3578 case WinButton::CLOSE: 3578 case CLOSEBUTTON:
3579 if (m_client->isClosable() && (m_state.deco_mask & WindowState::DECORM_CLOSE)) { 3579 if (m_client->isClosable() && (m_state.deco_mask & WindowState::DECORM_CLOSE)) {
3580 winbtn = new WinButton(*this, m_button_theme, 3580 winbtn = new WinButton(*this, m_button_theme,
3581 screen().pressedWinButtonTheme(), 3581 screen().pressedWinButtonTheme(),
@@ -3588,7 +3588,7 @@ void FluxboxWindow::updateButtons() {
3588 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll)); 3588 FbTk::MemFunIgnoreArgs(*winbtn, &WinButton::updateAll));
3589 } 3589 }
3590 break; 3590 break;
3591 case WinButton::STICK: 3591 case STICKBUTTON:
3592 if (m_state.deco_mask & WindowState::DECORM_STICKY) { 3592 if (m_state.deco_mask & WindowState::DECORM_STICKY) {
3593 winbtn = new WinButton(*this, m_button_theme, 3593 winbtn = new WinButton(*this, m_button_theme,
3594 screen().pressedWinButtonTheme(), 3594 screen().pressedWinButtonTheme(),
@@ -3601,7 +3601,7 @@ void FluxboxWindow::updateButtons() {
3601 winbtn->setOnClick(stick_cmd); 3601 winbtn->setOnClick(stick_cmd);
3602 } 3602 }
3603 break; 3603 break;
3604 case WinButton::SHADE: 3604 case SHADEBUTTON:
3605 if (m_state.deco_mask & WindowState::DECORM_SHADE) { 3605 if (m_state.deco_mask & WindowState::DECORM_SHADE) {
3606 winbtn = new WinButton(*this, m_button_theme, 3606 winbtn = new WinButton(*this, m_button_theme,
3607 screen().pressedWinButtonTheme(), 3607 screen().pressedWinButtonTheme(),
@@ -3613,7 +3613,7 @@ void FluxboxWindow::updateButtons() {
3613 winbtn->setOnClick(shade_cmd); 3613 winbtn->setOnClick(shade_cmd);
3614 } 3614 }
3615 break; 3615 break;
3616 case WinButton::MENUICON: 3616 case MENUICONBUTTON:
3617 winbtn = new WinButton(*this, m_button_theme, 3617 winbtn = new WinButton(*this, m_button_theme,
3618 screen().pressedWinButtonTheme(), 3618 screen().pressedWinButtonTheme(),
3619 dir[i], 3619 dir[i],
@@ -3790,7 +3790,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) {
3790 setMouseFocus(false); 3790 setMouseFocus(false);
3791 setClickFocus(false); 3791 setClickFocus(false);
3792 setDecorationMask(WindowState::DECOR_NONE); 3792 setDecorationMask(WindowState::DECOR_NONE);
3793 moveToLayer(::ResourceLayer::DOCK); 3793 moveToLayer(LAYERDOCK);
3794 break; 3794 break;
3795 case WindowState::TYPE_DESKTOP: 3795 case WindowState::TYPE_DESKTOP:
3796 /* 3796 /*
@@ -3803,7 +3803,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) {
3803 setIconHidden(true); 3803 setIconHidden(true);
3804 setFocusNew(false); 3804 setFocusNew(false);
3805 setMouseFocus(false); 3805 setMouseFocus(false);
3806 moveToLayer(::ResourceLayer::DESKTOP); 3806 moveToLayer(LAYERDESKTOP);
3807 setDecorationMask(WindowState::DECOR_NONE); 3807 setDecorationMask(WindowState::DECOR_NONE);
3808 setTabable(false); 3808 setTabable(false);
3809 setMovable(false); 3809 setMovable(false);
@@ -3838,7 +3838,7 @@ void FluxboxWindow::setWindowType(WindowState::WindowType type) {
3838 */ 3838 */
3839 setDecorationMask(WindowState::DECOR_TOOL); 3839 setDecorationMask(WindowState::DECOR_TOOL);
3840 setIconHidden(true); 3840 setIconHidden(true);
3841 moveToLayer(::ResourceLayer::ABOVE_DOCK); 3841 moveToLayer(LAYERABOVE_DOCK);
3842 break; 3842 break;
3843 case WindowState::TYPE_NORMAL: 3843 case WindowState::TYPE_NORMAL:
3844 default: 3844 default: