diff options
Diffstat (limited to 'src/Screen.cc')
-rw-r--r-- | src/Screen.cc | 87 |
1 files changed, 28 insertions, 59 deletions
diff --git a/src/Screen.cc b/src/Screen.cc index 36c2c6b..5647495 100644 --- a/src/Screen.cc +++ b/src/Screen.cc | |||
@@ -31,7 +31,6 @@ | |||
31 | #include "Workspace.hh" | 31 | #include "Workspace.hh" |
32 | 32 | ||
33 | #include "Layer.hh" | 33 | #include "Layer.hh" |
34 | #include "FocusControl.hh" | ||
35 | #include "ScreenPlacement.hh" | 34 | #include "ScreenPlacement.hh" |
36 | 35 | ||
37 | // menu items | 36 | // menu items |
@@ -184,7 +183,7 @@ int calcSquareDistance(int x1, int y1, int x2, int y2) { | |||
184 | class TabPlacementMenuItem: public FbTk::RadioMenuItem { | 183 | class TabPlacementMenuItem: public FbTk::RadioMenuItem { |
185 | public: | 184 | public: |
186 | TabPlacementMenuItem(const FbTk::FbString & label, BScreen &screen, | 185 | TabPlacementMenuItem(const FbTk::FbString & label, BScreen &screen, |
187 | FbWinFrame::TabPlacement place): | 186 | Placement place): |
188 | FbTk::RadioMenuItem(label), | 187 | FbTk::RadioMenuItem(label), |
189 | m_screen(screen), | 188 | m_screen(screen), |
190 | m_place(place) { | 189 | m_place(place) { |
@@ -200,42 +199,12 @@ public: | |||
200 | 199 | ||
201 | private: | 200 | private: |
202 | BScreen &m_screen; | 201 | BScreen &m_screen; |
203 | FbWinFrame::TabPlacement m_place; | 202 | Placement m_place; |
204 | }; | 203 | }; |
205 | 204 | ||
206 | struct TabPlacementString { | ||
207 | FbWinFrame::TabPlacement placement; | ||
208 | const char* str; | ||
209 | }; | ||
210 | |||
211 | |||
212 | |||
213 | } // end anonymous namespace | 205 | } // end anonymous namespace |
214 | 206 | ||
215 | 207 | ||
216 | |||
217 | namespace FbTk { | ||
218 | |||
219 | template<> | ||
220 | const EnumTraits<FbWinFrame::TabPlacement>::Pair EnumTraits<FbWinFrame::TabPlacement>::s_map[] = { | ||
221 | { "TopLeft", FbWinFrame::TOPLEFT }, | ||
222 | { "Top", FbWinFrame::TOP }, | ||
223 | { "TopRight", FbWinFrame::TOPRIGHT }, | ||
224 | { "BottomLeft", FbWinFrame::BOTTOMLEFT }, | ||
225 | { "Bottom", FbWinFrame::BOTTOM }, | ||
226 | { "BottomRight", FbWinFrame::BOTTOMRIGHT }, | ||
227 | { "LeftBottom", FbWinFrame::LEFTBOTTOM }, | ||
228 | { "Left", FbWinFrame::LEFT }, | ||
229 | { "LeftTop", FbWinFrame::LEFTTOP }, | ||
230 | { "RightBottom", FbWinFrame::RIGHTBOTTOM }, | ||
231 | { "Right", FbWinFrame::RIGHT }, | ||
232 | { "RightTop", FbWinFrame::RIGHTTOP }, | ||
233 | { NULL, FbWinFrame::RIGHTTOP } | ||
234 | }; | ||
235 | |||
236 | } // end namespace FbTk | ||
237 | |||
238 | |||
239 | BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager_base &rm, | 208 | BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager_base &rm, |
240 | const string &scrname): | 209 | const string &scrname): |
241 | workspace_names(rm, std::vector<std::string>(), scrname + ".workspaceNames", | 210 | workspace_names(rm, std::vector<std::string>(), scrname + ".workspaceNames", |
@@ -250,7 +219,7 @@ BScreen::ScreenResource::ScreenResource(FbTk::ResourceManager_base &rm, | |||
250 | auto_raise(rm, true, scrname+".autoRaise"), | 219 | auto_raise(rm, true, scrname+".autoRaise"), |
251 | click_raises(rm, true, scrname+".clickRaises"), | 220 | click_raises(rm, true, scrname+".clickRaises"), |
252 | default_deco(rm, "NORMAL", scrname+".defaultDeco"), | 221 | default_deco(rm, "NORMAL", scrname+".defaultDeco"), |
253 | tab_placement(rm, FbWinFrame::TOPLEFT, scrname+".tab.placement"), | 222 | tab_placement(rm, TOPLEFT, scrname+".tab.placement"), |
254 | windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu.lua"), scrname+".windowMenu"), | 223 | windowmenufile(rm, Fluxbox::instance()->getDefaultDataFilename("windowmenu.lua"), scrname+".windowMenu"), |
255 | typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay"), | 224 | typing_delay(rm, 0, scrname+".noFocusWhileTypingDelay"), |
256 | workspaces(rm, 4, scrname+".workspaces"), | 225 | workspaces(rm, 4, scrname+".workspaces"), |
@@ -460,7 +429,7 @@ BScreen::BScreen(FbTk::ResourceManager_base &rm, | |||
460 | changeWorkspaceID(first_desktop); | 429 | changeWorkspaceID(first_desktop); |
461 | 430 | ||
462 | #ifdef SLIT | 431 | #ifdef SLIT |
463 | m_slit.reset(new Slit(*this, *layerManager().getLayer(ResourceLayer::DESKTOP))); | 432 | m_slit.reset(new Slit(*this, *layerManager().getLayer(LAYERDESKTOP))); |
464 | #endif // SLIT | 433 | #endif // SLIT |
465 | 434 | ||
466 | XFlush(disp); | 435 | XFlush(disp); |
@@ -539,7 +508,7 @@ void BScreen::initWindows() { | |||
539 | 508 | ||
540 | #ifdef USE_TOOLBAR | 509 | #ifdef USE_TOOLBAR |
541 | m_toolbar.reset(new Toolbar(*this, | 510 | m_toolbar.reset(new Toolbar(*this, |
542 | *layerManager().getLayer(::ResourceLayer::NORMAL))); | 511 | *layerManager().getLayer(LAYERNORMAL))); |
543 | #endif // USE_TOOLBAR | 512 | #endif // USE_TOOLBAR |
544 | 513 | ||
545 | unsigned int nchild; | 514 | unsigned int nchild; |
@@ -796,7 +765,7 @@ void BScreen::cycleFocus(int options, const ClientPattern *pat, bool reverse) { | |||
796 | FbMenu *BScreen::createMenu(const string &label) { | 765 | FbMenu *BScreen::createMenu(const string &label) { |
797 | FbMenu *menu = new FbMenu(menuTheme(), | 766 | FbMenu *menu = new FbMenu(menuTheme(), |
798 | imageControl(), | 767 | imageControl(), |
799 | *layerManager().getLayer(ResourceLayer::MENU)); | 768 | *layerManager().getLayer(LAYERMENU)); |
800 | if (!label.empty()) | 769 | if (!label.empty()) |
801 | menu->setLabel(label); | 770 | menu->setLabel(label); |
802 | 771 | ||
@@ -806,7 +775,7 @@ FbMenu *BScreen::createMenu(const string &label) { | |||
806 | FbMenu *BScreen::createToggleMenu(const string &label) { | 775 | FbMenu *BScreen::createToggleMenu(const string &label) { |
807 | FbMenu *menu = new ToggleMenu(menuTheme(), | 776 | FbMenu *menu = new ToggleMenu(menuTheme(), |
808 | imageControl(), | 777 | imageControl(), |
809 | *layerManager().getLayer(ResourceLayer::MENU)); | 778 | *layerManager().getLayer(LAYERMENU)); |
810 | if (!label.empty()) | 779 | if (!label.empty()) |
811 | menu->setLabel(label); | 780 | menu->setLabel(label); |
812 | 781 | ||
@@ -1511,24 +1480,24 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1511 | 1480 | ||
1512 | _FOCUSITEM(Configmenu, ClickFocus, | 1481 | _FOCUSITEM(Configmenu, ClickFocus, |
1513 | "Click To Focus", "Click to focus", | 1482 | "Click To Focus", "Click to focus", |
1514 | FocusControl::CLICKFOCUS); | 1483 | CLICKFOCUS); |
1515 | _FOCUSITEM(Configmenu, MouseFocus, | 1484 | _FOCUSITEM(Configmenu, MouseFocus, |
1516 | "Mouse Focus (Keyboard Friendly)", | 1485 | "Mouse Focus (Keyboard Friendly)", |
1517 | "Mouse Focus (Keyboard Friendly)", | 1486 | "Mouse Focus (Keyboard Friendly)", |
1518 | FocusControl::MOUSEFOCUS); | 1487 | MOUSEFOCUS); |
1519 | _FOCUSITEM(Configmenu, StrictMouseFocus, | 1488 | _FOCUSITEM(Configmenu, StrictMouseFocus, |
1520 | "Mouse Focus (Strict)", | 1489 | "Mouse Focus (Strict)", |
1521 | "Mouse Focus (Strict)", | 1490 | "Mouse Focus (Strict)", |
1522 | FocusControl::STRICTMOUSEFOCUS); | 1491 | STRICTMOUSEFOCUS); |
1523 | #undef _FOCUSITEM | 1492 | #undef _FOCUSITEM |
1524 | 1493 | ||
1525 | focus_menu->insert(new FbTk::MenuSeparator()); | 1494 | focus_menu->insert(new FbTk::MenuSeparator()); |
1526 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, | 1495 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, |
1527 | ClickTabFocus, "ClickTabFocus", "Click tab to focus windows"), | 1496 | ClickTabFocus, "ClickTabFocus", "Click tab to focus windows"), |
1528 | focusControl(), FocusControl::CLICKTABFOCUS, reconf_cmd)); | 1497 | focusControl(), CLICKTABFOCUS, reconf_cmd)); |
1529 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, | 1498 | focus_menu->insert(new TabFocusModelMenuItem(_FB_XTEXT(Configmenu, |
1530 | MouseTabFocus, "MouseTabFocus", "Hover over tab to focus windows"), | 1499 | MouseTabFocus, "MouseTabFocus", "Hover over tab to focus windows"), |
1531 | focusControl(), FocusControl::MOUSETABFOCUS, reconf_cmd)); | 1500 | focusControl(), MOUSETABFOCUS, reconf_cmd)); |
1532 | focus_menu->insert(new FbTk::MenuSeparator()); | 1501 | focus_menu->insert(new FbTk::MenuSeparator()); |
1533 | 1502 | ||
1534 | try { | 1503 | try { |
@@ -1610,25 +1579,25 @@ void BScreen::setupConfigmenu(FbTk::Menu &menu) { | |||
1610 | // menu is 3 wide, 5 down | 1579 | // menu is 3 wide, 5 down |
1611 | struct PlacementP { | 1580 | struct PlacementP { |
1612 | const FbTk::FbString label; | 1581 | const FbTk::FbString label; |
1613 | FbWinFrame::TabPlacement placement; | 1582 | Placement placement; |
1614 | }; | 1583 | }; |
1615 | static const PlacementP place_menu[] = { | 1584 | static const PlacementP place_menu[] = { |
1616 | 1585 | ||
1617 | { _FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), FbWinFrame::TOPLEFT}, | 1586 | { _FB_XTEXT(Align, TopLeft, "Top Left", "Top Left"), TOPLEFT}, |
1618 | { _FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), FbWinFrame::LEFTTOP}, | 1587 | { _FB_XTEXT(Align, LeftTop, "Left Top", "Left Top"), LEFTTOP}, |
1619 | { _FB_XTEXT(Align, LeftCenter, "Left Center", "Left Center"), FbWinFrame::LEFT}, | 1588 | { _FB_XTEXT(Align, LeftCenter, "Left Center", "Left Center"), LEFTCENTER}, |
1620 | { _FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), FbWinFrame::LEFTBOTTOM}, | 1589 | { _FB_XTEXT(Align, LeftBottom, "Left Bottom", "Left Bottom"), LEFTBOTTOM}, |
1621 | { _FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), FbWinFrame::BOTTOMLEFT}, | 1590 | { _FB_XTEXT(Align, BottomLeft, "Bottom Left", "Bottom Left"), BOTTOMLEFT}, |
1622 | { _FB_XTEXT(Align, TopCenter, "Top Center", "Top Center"), FbWinFrame::TOP}, | 1591 | { _FB_XTEXT(Align, TopCenter, "Top Center", "Top Center"), TOPCENTER}, |
1623 | { "", FbWinFrame::TOPLEFT}, | 1592 | { "", TOPLEFT}, |
1624 | { "", FbWinFrame::TOPLEFT}, | 1593 | { "", TOPLEFT}, |
1625 | { "", FbWinFrame::TOPLEFT}, | 1594 | { "", TOPLEFT}, |
1626 | { _FB_XTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), FbWinFrame::BOTTOM}, | 1595 | { _FB_XTEXT(Align, BottomCenter, "Bottom Center", "Bottom Center"), BOTTOMCENTER}, |
1627 | { _FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), FbWinFrame::TOPRIGHT}, | 1596 | { _FB_XTEXT(Align, TopRight, "Top Right", "Top Right"), TOPRIGHT}, |
1628 | { _FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), FbWinFrame::RIGHTTOP}, | 1597 | { _FB_XTEXT(Align, RightTop, "Right Top", "Right Top"), RIGHTTOP}, |
1629 | { _FB_XTEXT(Align, RightCenter, "Right Center", "Right Center"), FbWinFrame::RIGHT}, | 1598 | { _FB_XTEXT(Align, RightCenter, "Right Center", "Right Center"), RIGHTCENTER}, |
1630 | { _FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), FbWinFrame::RIGHTBOTTOM}, | 1599 | { _FB_XTEXT(Align, RightBottom, "Right Bottom", "Right Bottom"), RIGHTBOTTOM}, |
1631 | { _FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), FbWinFrame::BOTTOMRIGHT} | 1600 | { _FB_XTEXT(Align, BottomRight, "Bottom Right", "Bottom Right"), BOTTOMRIGHT} |
1632 | }; | 1601 | }; |
1633 | 1602 | ||
1634 | tabplacement_menu->setMinimumColumns(3); | 1603 | tabplacement_menu->setMinimumColumns(3); |