diff options
Diffstat (limited to 'src/fluxbox.cc')
-rw-r--r-- | src/fluxbox.cc | 154 |
1 files changed, 96 insertions, 58 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc index a48f0ef..fd3f2f0 100644 --- a/src/fluxbox.cc +++ b/src/fluxbox.cc | |||
@@ -22,7 +22,7 @@ | |||
22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 22 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
23 | // DEALINGS IN THE SOFTWARE. | 23 | // DEALINGS IN THE SOFTWARE. |
24 | 24 | ||
25 | // $Id: fluxbox.cc,v 1.18 2002/01/10 12:51:21 fluxgen Exp $ | 25 | // $Id: fluxbox.cc,v 1.19 2002/01/11 09:17:37 fluxgen Exp $ |
26 | 26 | ||
27 | // stupid macros needed to access some functions in version 2 of the GNU C | 27 | // stupid macros needed to access some functions in version 2 of the GNU C |
28 | // library | 28 | // library |
@@ -192,7 +192,7 @@ Fluxbox::Fluxbox(int m_argc, char **m_argv, char *dpy_name, char *rc) | |||
192 | 192 | ||
193 | no_focus = False; | 193 | no_focus = False; |
194 | resource.titlebar_file = resource.menu_file = resource.style_file = resource.keys_file = 0; | 194 | resource.titlebar_file = resource.menu_file = resource.style_file = resource.keys_file = 0; |
195 | 195 | ||
196 | resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec = 0; | 196 | resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec = 0; |
197 | 197 | ||
198 | focused_window = masked_window = (FluxboxWindow *) 0; | 198 | focused_window = masked_window = (FluxboxWindow *) 0; |
@@ -988,6 +988,7 @@ void Fluxbox::process_event(XEvent *e) { | |||
988 | BScreen *screen = searchScreen(e->xclient.window); | 988 | BScreen *screen = searchScreen(e->xclient.window); |
989 | if (screen) | 989 | if (screen) |
990 | screen->changeWorkspaceID(e->xclient.data.l[0]); | 990 | screen->changeWorkspaceID(e->xclient.data.l[0]); |
991 | |||
991 | } | 992 | } |
992 | #endif //!GNOME | 993 | #endif //!GNOME |
993 | } | 994 | } |
@@ -1017,7 +1018,10 @@ void Fluxbox::process_event(XEvent *e) { | |||
1017 | void Fluxbox::doWindowAction(Keys::KeyAction action) { | 1018 | void Fluxbox::doWindowAction(Keys::KeyAction action) { |
1018 | if (!focused_window) | 1019 | if (!focused_window) |
1019 | return; | 1020 | return; |
1020 | 1021 | ||
1022 | unsigned int t_placement = focused_window->getScreen()->getTabPlacement(); | ||
1023 | unsigned int t_alignment = focused_window->getScreen()->getTabAlignment(); | ||
1024 | |||
1021 | switch (action) { | 1025 | switch (action) { |
1022 | case Keys::ICONIFY: | 1026 | case Keys::ICONIFY: |
1023 | focused_window->iconify(); | 1027 | focused_window->iconify(); |
@@ -1093,24 +1097,56 @@ void Fluxbox::doWindowAction(Keys::KeyAction action) { | |||
1093 | focused_window->configure( | 1097 | focused_window->configure( |
1094 | focused_window->getXFrame(), focused_window->getYFrame(), | 1098 | focused_window->getXFrame(), focused_window->getYFrame(), |
1095 | focused_window->getWidth()+10, focused_window->getHeight()); | 1099 | focused_window->getWidth()+10, focused_window->getHeight()); |
1100 | |||
1101 | if (focused_window->hasTab() && | ||
1102 | (t_placement == Tab::PTOP || t_placement == Tab::PBOTTOM)) { | ||
1103 | if (t_alignment == Tab::ARELATIVE) | ||
1104 | focused_window->getTab()->calcIncrease(); | ||
1105 | if (t_alignment != Tab::PLEFT) | ||
1106 | focused_window->getTab()->setPosition(); | ||
1107 | } | ||
1096 | break; | 1108 | break; |
1097 | case Keys::VERTINC: | 1109 | case Keys::VERTINC: |
1098 | if (focused_window->isResizable()) | 1110 | if (focused_window->isResizable()) |
1099 | focused_window->configure( | 1111 | focused_window->configure( |
1100 | focused_window->getXFrame(), focused_window->getYFrame(), | 1112 | focused_window->getXFrame(), focused_window->getYFrame(), |
1101 | focused_window->getWidth(), focused_window->getHeight()+10); | 1113 | focused_window->getWidth(), focused_window->getHeight()+10); |
1114 | |||
1115 | if (focused_window->hasTab() && | ||
1116 | (t_placement == Tab::PLEFT || t_placement == Tab::PRIGHT)) { | ||
1117 | if (t_alignment == Tab::ARELATIVE) | ||
1118 | focused_window->getTab()->calcIncrease(); | ||
1119 | if (t_alignment != Tab::PRIGHT) | ||
1120 | focused_window->getTab()->setPosition(); | ||
1121 | } | ||
1102 | break; | 1122 | break; |
1103 | case Keys::HORIZDEC: | 1123 | case Keys::HORIZDEC: |
1104 | if (focused_window->isResizable()) | 1124 | if (focused_window->isResizable()) |
1105 | focused_window->configure( | 1125 | focused_window->configure( |
1106 | focused_window->getXFrame(), focused_window->getYFrame(), | 1126 | focused_window->getXFrame(), focused_window->getYFrame(), |
1107 | focused_window->getWidth()-10, focused_window->getHeight()); | 1127 | focused_window->getWidth()-10, focused_window->getHeight()); |
1128 | |||
1129 | if (focused_window->hasTab() && | ||
1130 | (t_placement == Tab::PTOP || t_placement == Tab::PBOTTOM)) { | ||
1131 | if (t_alignment == Tab::ARELATIVE) | ||
1132 | focused_window->getTab()->calcIncrease(); | ||
1133 | if (t_alignment != Tab::PLEFT) | ||
1134 | focused_window->getTab()->setPosition(); | ||
1135 | } | ||
1108 | break; | 1136 | break; |
1109 | case Keys::VERTDEC: | 1137 | case Keys::VERTDEC: |
1110 | if (focused_window->isResizable()) | 1138 | if (focused_window->isResizable()) |
1111 | focused_window->configure( | 1139 | focused_window->configure( |
1112 | focused_window->getXFrame(), focused_window->getYFrame(), | 1140 | focused_window->getXFrame(), focused_window->getYFrame(), |
1113 | focused_window->getWidth(), focused_window->getHeight()-10); | 1141 | focused_window->getWidth(), focused_window->getHeight()-10); |
1142 | |||
1143 | if (focused_window->hasTab() && | ||
1144 | (t_placement == Tab::PLEFT || t_placement == Tab::PRIGHT)) { | ||
1145 | if (t_alignment == Tab::ARELATIVE) | ||
1146 | focused_window->getTab()->calcIncrease(); | ||
1147 | if (t_alignment != Tab::PRIGHT) | ||
1148 | focused_window->getTab()->setPosition(); | ||
1149 | } | ||
1114 | break; | 1150 | break; |
1115 | default: | 1151 | default: |
1116 | break; | 1152 | break; |
@@ -1417,7 +1453,7 @@ void Fluxbox::save_rc(void) { | |||
1417 | 1453 | ||
1418 | auto_ptr<char> dbfile(getRcFilename()); | 1454 | auto_ptr<char> dbfile(getRcFilename()); |
1419 | 1455 | ||
1420 | // load_rc(); | 1456 | // load_rc(); |
1421 | // This overwrites configs made while running, for example | 1457 | // This overwrites configs made while running, for example |
1422 | // usage of iconbar and tabs | 1458 | // usage of iconbar and tabs |
1423 | 1459 | ||
@@ -1464,14 +1500,14 @@ void Fluxbox::save_rc(void) { | |||
1464 | char *slit_placement = (char *) 0; | 1500 | char *slit_placement = (char *) 0; |
1465 | 1501 | ||
1466 | switch (screen->getSlitPlacement()) { | 1502 | switch (screen->getSlitPlacement()) { |
1467 | case Slit::TopLeft: slit_placement = "TopLeft"; break; | 1503 | case Slit::TOPLEFT: slit_placement = "TopLeft"; break; |
1468 | case Slit::CenterLeft: slit_placement = "CenterLeft"; break; | 1504 | case Slit::CENTERLEFT: slit_placement = "CenterLeft"; break; |
1469 | case Slit::BottomLeft: slit_placement = "BottomLeft"; break; | 1505 | case Slit::BOTTOMLEFT: slit_placement = "BottomLeft"; break; |
1470 | case Slit::TopCenter: slit_placement = "TopCenter"; break; | 1506 | case Slit::TOPCENTER: slit_placement = "TopCenter"; break; |
1471 | case Slit::BottomCenter: slit_placement = "BottomCenter"; break; | 1507 | case Slit::BOTTOMCENTER: slit_placement = "BottomCenter"; break; |
1472 | case Slit::TopRight: slit_placement = "TopRight"; break; | 1508 | case Slit::TOPRIGHT: slit_placement = "TopRight"; break; |
1473 | case Slit::BottomRight: slit_placement = "BottomRight"; break; | 1509 | case Slit::BOTTOMRIGHT: slit_placement = "BottomRight"; break; |
1474 | case Slit::CenterRight: default: slit_placement = "CenterRight"; break; | 1510 | case Slit::CENTERRIGHT: default: slit_placement = "CenterRight"; break; |
1475 | } | 1511 | } |
1476 | 1512 | ||
1477 | sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number, | 1513 | sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number, |
@@ -1479,7 +1515,7 @@ void Fluxbox::save_rc(void) { | |||
1479 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1515 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1480 | 1516 | ||
1481 | sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number, | 1517 | sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number, |
1482 | ((screen->getSlitDirection() == Slit::Horizontal) ? "Horizontal" : | 1518 | ((screen->getSlitDirection() == Slit::HORIZONTAL) ? "Horizontal" : |
1483 | "Vertical")); | 1519 | "Vertical")); |
1484 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1520 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1485 | 1521 | ||
@@ -1506,6 +1542,7 @@ void Fluxbox::save_rc(void) { | |||
1506 | 1542 | ||
1507 | sprintf(rc_string, "session.screen%d.rootCommand: %s", screen_number, | 1543 | sprintf(rc_string, "session.screen%d.rootCommand: %s", screen_number, |
1508 | screen->getRootCommand().c_str()); | 1544 | screen->getRootCommand().c_str()); |
1545 | |||
1509 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1546 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1510 | 1547 | ||
1511 | sprintf(rc_string, "session.screen%d.focusNewWindows: %s", screen_number, | 1548 | sprintf(rc_string, "session.screen%d.focusNewWindows: %s", screen_number, |
@@ -1517,13 +1554,13 @@ void Fluxbox::save_rc(void) { | |||
1517 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1554 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1518 | 1555 | ||
1519 | sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number, | 1556 | sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number, |
1520 | ((screen->getRowPlacementDirection() == BScreen::LeftRight) ? | 1557 | ((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ? |
1521 | "LeftToRight" : "RightToLeft")); | 1558 | "LeftToRight" : "RightToLeft")); |
1522 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1559 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1523 | 1560 | ||
1524 | sprintf(rc_string, "session.screen%d.colPlacementDirection: %s", screen_number, | 1561 | sprintf(rc_string, "session.screen%d.colPlacementDirection: %s", screen_number, |
1525 | ((screen->getColPlacementDirection() == BScreen::TopBottom) ? | 1562 | ((screen->getColPlacementDirection() == BScreen::TOPBOTTOM) ? |
1526 | "TopToBottom" : "BottomToTop")); | 1563 | "TopToBottom" : "BottomToTop")); |
1527 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1564 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1528 | 1565 | ||
1529 | char *placement = (char *) 0; | 1566 | char *placement = (char *) 0; |
@@ -1532,16 +1569,16 @@ void Fluxbox::save_rc(void) { | |||
1532 | ((screen->doMaxOverSlit()) ? "True" : "False")); | 1569 | ((screen->doMaxOverSlit()) ? "True" : "False")); |
1533 | XrmPutLineResource(&new_blackboxrc, rc_string); | 1570 | XrmPutLineResource(&new_blackboxrc, rc_string); |
1534 | switch (screen->getPlacementPolicy()) { | 1571 | switch (screen->getPlacementPolicy()) { |
1535 | case BScreen::CascadePlacement: | 1572 | case BScreen::CASCADEPLACEMENT: |
1536 | placement = "CascadePlacement"; | 1573 | placement = "CascadePlacement"; |
1537 | break; | 1574 | break; |
1538 | 1575 | ||
1539 | case BScreen::ColSmartPlacement: | 1576 | case BScreen::COLSMARTPLACEMENT: |
1540 | placement = "ColSmartPlacement"; | 1577 | placement = "ColSmartPlacement"; |
1541 | break; | 1578 | break; |
1542 | 1579 | ||
1543 | default: | 1580 | default: |
1544 | case BScreen::RowSmartPlacement: | 1581 | case BScreen::ROWSMARTPLACEMENT: |
1545 | placement = "RowSmartPlacement"; | 1582 | placement = "RowSmartPlacement"; |
1546 | break; | 1583 | break; |
1547 | } | 1584 | } |
@@ -1679,7 +1716,7 @@ void Fluxbox::save_rc(void) { | |||
1679 | XrmPutFileDatabase(old_blackboxrc, dbfile.get()); | 1716 | XrmPutFileDatabase(old_blackboxrc, dbfile.get()); |
1680 | XrmDestroyDatabase(old_blackboxrc); | 1717 | XrmDestroyDatabase(old_blackboxrc); |
1681 | // XrmDestroyDatabase(new_blackboxrc); | 1718 | // XrmDestroyDatabase(new_blackboxrc); |
1682 | 1719 | ||
1683 | } | 1720 | } |
1684 | 1721 | ||
1685 | //-------- getRcFilename ------------- | 1722 | //-------- getRcFilename ------------- |
@@ -1690,8 +1727,9 @@ char *Fluxbox::getRcFilename() { | |||
1690 | char *dbfile=0; | 1727 | char *dbfile=0; |
1691 | 1728 | ||
1692 | if (!rc_file) { | 1729 | if (!rc_file) { |
1693 | string str(getenv("HOME")+string("/.")+RC_PATH+string("/")+RC_INIT_FILE); | 1730 | string str(getenv("HOME")+string("/.")+RC_PATH+string("/")+RC_INIT_FILE); |
1694 | return StringUtil::strdup(str.c_str()); | 1731 | return StringUtil::strdup(str.c_str()); |
1732 | |||
1695 | } else | 1733 | } else |
1696 | dbfile = StringUtil::strdup(rc_file); | 1734 | dbfile = StringUtil::strdup(rc_file); |
1697 | 1735 | ||
@@ -1853,17 +1891,17 @@ void Fluxbox::setTitlebar(vector<Fluxbox::Titlebar>& dir, const char *arg) { | |||
1853 | vector<string> argv = parseTitleArgs(arg); | 1891 | vector<string> argv = parseTitleArgs(arg); |
1854 | for (unsigned int i=0; i<argv.size(); i++) { | 1892 | for (unsigned int i=0; i<argv.size(); i++) { |
1855 | if (argv[i]==NAME_STICKY) | 1893 | if (argv[i]==NAME_STICKY) |
1856 | dir.push_back(Stick); | 1894 | dir.push_back(STICK); |
1857 | else if (argv[i]==NAME_MAXIMIZE) | 1895 | else if (argv[i]==NAME_MAXIMIZE) |
1858 | dir.push_back(Maximize); | 1896 | dir.push_back(MAXIMIZE); |
1859 | else if (argv[i]==NAME_MINIMIZE) | 1897 | else if (argv[i]==NAME_MINIMIZE) |
1860 | dir.push_back(Minimize); | 1898 | dir.push_back(MINIMIZE); |
1861 | else if (argv[i]== NAME_CLOSE) | 1899 | else if (argv[i]== NAME_CLOSE) |
1862 | dir.push_back(Close); | 1900 | dir.push_back(CLOSE); |
1863 | else if (argv[i]==NAME_SHADE) | 1901 | else if (argv[i]==NAME_SHADE) |
1864 | dir.push_back(Shade); | 1902 | dir.push_back(SHADE); |
1865 | else if (argv[i]==NAME_MENU) | 1903 | else if (argv[i]==NAME_MENU) |
1866 | dir.push_back(Menu); | 1904 | dir.push_back(MENU); |
1867 | else if(argv[i]==NAME_NONE);//do nothing | 1905 | else if(argv[i]==NAME_NONE);//do nothing |
1868 | else | 1906 | else |
1869 | cerr<<"Fluxbox::Titlebar Unknown type: \""<<argv[i]<<"\""<<endl; | 1907 | cerr<<"Fluxbox::Titlebar Unknown type: \""<<argv[i]<<"\""<<endl; |
@@ -1890,7 +1928,7 @@ void Fluxbox::loadTitlebar() { | |||
1890 | cerr<<"Fluxbox: \'Left\' not found in "<<resource.titlebar_file<<endl; | 1928 | cerr<<"Fluxbox: \'Left\' not found in "<<resource.titlebar_file<<endl; |
1891 | cerr<<"Using default."<<endl; | 1929 | cerr<<"Using default."<<endl; |
1892 | //default settings | 1930 | //default settings |
1893 | titlebar.left.push_back(Shade); | 1931 | titlebar.left.push_back(SHADE); |
1894 | } | 1932 | } |
1895 | 1933 | ||
1896 | if (XrmGetResource(database, "right", "Right", &value_type, &value)) { | 1934 | if (XrmGetResource(database, "right", "Right", &value_type, &value)) { |
@@ -1899,10 +1937,10 @@ void Fluxbox::loadTitlebar() { | |||
1899 | cerr<<"Fluxbox: \'Right\' not found in "<<resource.titlebar_file<<endl; | 1937 | cerr<<"Fluxbox: \'Right\' not found in "<<resource.titlebar_file<<endl; |
1900 | cerr<<"Using default."<<endl; | 1938 | cerr<<"Using default."<<endl; |
1901 | //default settings | 1939 | //default settings |
1902 | titlebar.right.push_back(Stick); | 1940 | titlebar.right.push_back(STICK); |
1903 | titlebar.right.push_back(Minimize); | 1941 | titlebar.right.push_back(MINIMIZE); |
1904 | titlebar.right.push_back(Maximize); | 1942 | titlebar.right.push_back(MAXIMIZE); |
1905 | titlebar.right.push_back(Close); | 1943 | titlebar.right.push_back(CLOSE); |
1906 | } | 1944 | } |
1907 | 1945 | ||
1908 | // XrmDestroyDatabase(database); | 1946 | // XrmDestroyDatabase(database); |
@@ -1916,12 +1954,11 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
1916 | database = XrmGetFileDatabase(dbfile.get()); | 1954 | database = XrmGetFileDatabase(dbfile.get()); |
1917 | if (!database) | 1955 | if (!database) |
1918 | database = XrmGetFileDatabase(DEFAULT_INITFILE); | 1956 | database = XrmGetFileDatabase(DEFAULT_INITFILE); |
1919 | 1957 | ||
1920 | XrmValue value; | 1958 | XrmValue value; |
1921 | char *value_type, name_lookup[1024], class_lookup[1024]; | 1959 | char *value_type, name_lookup[1024], class_lookup[1024]; |
1922 | int screen_number = screen->getScreenNumber(); | 1960 | int screen_number = screen->getScreenNumber(); |
1923 | 1961 | ||
1924 | |||
1925 | sprintf(name_lookup, "session.screen%d.fullMaximization", screen_number); | 1962 | sprintf(name_lookup, "session.screen%d.fullMaximization", screen_number); |
1926 | sprintf(class_lookup, "Session.Screen%d.FullMaximization", screen_number); | 1963 | sprintf(class_lookup, "Session.Screen%d.FullMaximization", screen_number); |
1927 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, | 1964 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, |
@@ -1968,7 +2005,7 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
1968 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, | 2005 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, |
1969 | &value)) { | 2006 | &value)) { |
1970 | if (! strncasecmp(value.addr, "righttoleft", value.size)) | 2007 | if (! strncasecmp(value.addr, "righttoleft", value.size)) |
1971 | screen->saveRowPlacementDirection(BScreen::RightLeft); | 2008 | screen->saveRowPlacementDirection(BScreen::RIGHTLEFT); |
1972 | else | 2009 | else |
1973 | 2010 | ||
1974 | sprintf(name_lookup, "session.screen%d.maxOverSlit", screen_number); | 2011 | sprintf(name_lookup, "session.screen%d.maxOverSlit", screen_number); |
@@ -1981,20 +2018,20 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
1981 | screen->saveMaxOverSlit(False); | 2018 | screen->saveMaxOverSlit(False); |
1982 | } else | 2019 | } else |
1983 | screen->saveMaxOverSlit(False); | 2020 | screen->saveMaxOverSlit(False); |
1984 | screen->saveRowPlacementDirection(BScreen::LeftRight); | 2021 | screen->saveRowPlacementDirection(BScreen::LEFTRIGHT); |
1985 | } else | 2022 | } else |
1986 | screen->saveRowPlacementDirection(BScreen::LeftRight); | 2023 | screen->saveRowPlacementDirection(BScreen::LEFTRIGHT); |
1987 | 2024 | ||
1988 | sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number); | 2025 | sprintf(name_lookup, "session.screen%d.colPlacementDirection", screen_number); |
1989 | sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number); | 2026 | sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", screen_number); |
1990 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, | 2027 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, |
1991 | &value)) { | 2028 | &value)) { |
1992 | if (! strncasecmp(value.addr, "bottomtotop", value.size)) | 2029 | if (! strncasecmp(value.addr, "bottomtotop", value.size)) |
1993 | screen->saveColPlacementDirection(BScreen::BottomTop); | 2030 | screen->saveColPlacementDirection(BScreen::BOTTOMTOP); |
1994 | else | 2031 | else |
1995 | screen->saveColPlacementDirection(BScreen::TopBottom); | 2032 | screen->saveColPlacementDirection(BScreen::TOPBOTTOM); |
1996 | } else | 2033 | } else |
1997 | screen->saveColPlacementDirection(BScreen::TopBottom); | 2034 | screen->saveColPlacementDirection(BScreen::TOPBOTTOM); |
1998 | 2035 | ||
1999 | sprintf(name_lookup, "session.screen%d.workspaces", screen_number); | 2036 | sprintf(name_lookup, "session.screen%d.workspaces", screen_number); |
2000 | sprintf(class_lookup, "Session.Screen%d.Workspaces", screen_number); | 2037 | sprintf(class_lookup, "Session.Screen%d.Workspaces", screen_number); |
@@ -2128,13 +2165,13 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
2128 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, | 2165 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, |
2129 | &value)) | 2166 | &value)) |
2130 | if (! strncasecmp(value.addr, "RowSmartPlacement", value.size)) | 2167 | if (! strncasecmp(value.addr, "RowSmartPlacement", value.size)) |
2131 | screen->savePlacementPolicy(BScreen::RowSmartPlacement); | 2168 | screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); |
2132 | else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size)) | 2169 | else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size)) |
2133 | screen->savePlacementPolicy(BScreen::ColSmartPlacement); | 2170 | screen->savePlacementPolicy(BScreen::COLSMARTPLACEMENT); |
2134 | else | 2171 | else |
2135 | screen->savePlacementPolicy(BScreen::CascadePlacement); | 2172 | screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT); |
2136 | else | 2173 | else |
2137 | screen->savePlacementPolicy(BScreen::RowSmartPlacement); | 2174 | screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); |
2138 | 2175 | ||
2139 | #ifdef SLIT | 2176 | #ifdef SLIT |
2140 | sprintf(name_lookup, "session.screen%d.slit.placement", screen_number); | 2177 | sprintf(name_lookup, "session.screen%d.slit.placement", screen_number); |
@@ -2142,34 +2179,34 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
2142 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, | 2179 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, |
2143 | &value)) | 2180 | &value)) |
2144 | if (! strncasecmp(value.addr, "TopLeft", value.size)) | 2181 | if (! strncasecmp(value.addr, "TopLeft", value.size)) |
2145 | screen->saveSlitPlacement(Slit::TopLeft); | 2182 | screen->saveSlitPlacement(Slit::TOPLEFT); |
2146 | else if (! strncasecmp(value.addr, "CenterLeft", value.size)) | 2183 | else if (! strncasecmp(value.addr, "CenterLeft", value.size)) |
2147 | screen->saveSlitPlacement(Slit::CenterLeft); | 2184 | screen->saveSlitPlacement(Slit::CENTERLEFT); |
2148 | else if (! strncasecmp(value.addr, "BottomLeft", value.size)) | 2185 | else if (! strncasecmp(value.addr, "BottomLeft", value.size)) |
2149 | screen->saveSlitPlacement(Slit::BottomLeft); | 2186 | screen->saveSlitPlacement(Slit::BOTTOMLEFT); |
2150 | else if (! strncasecmp(value.addr, "TopCenter", value.size)) | 2187 | else if (! strncasecmp(value.addr, "TopCenter", value.size)) |
2151 | screen->saveSlitPlacement(Slit::TopCenter); | 2188 | screen->saveSlitPlacement(Slit::TOPCENTER); |
2152 | else if (! strncasecmp(value.addr, "BottomCenter", value.size)) | 2189 | else if (! strncasecmp(value.addr, "BottomCenter", value.size)) |
2153 | screen->saveSlitPlacement(Slit::BottomCenter); | 2190 | screen->saveSlitPlacement(Slit::BOTTOMCENTER); |
2154 | else if (! strncasecmp(value.addr, "TopRight", value.size)) | 2191 | else if (! strncasecmp(value.addr, "TopRight", value.size)) |
2155 | screen->saveSlitPlacement(Slit::TopRight); | 2192 | screen->saveSlitPlacement(Slit::TOPRIGHT); |
2156 | else if (! strncasecmp(value.addr, "BottomRight", value.size)) | 2193 | else if (! strncasecmp(value.addr, "BottomRight", value.size)) |
2157 | screen->saveSlitPlacement(Slit::BottomRight); | 2194 | screen->saveSlitPlacement(Slit::BOTTOMRIGHT); |
2158 | else | 2195 | else |
2159 | screen->saveSlitPlacement(Slit::CenterRight); | 2196 | screen->saveSlitPlacement(Slit::CENTERRIGHT); |
2160 | else | 2197 | else |
2161 | screen->saveSlitPlacement(Slit::CenterRight); | 2198 | screen->saveSlitPlacement(Slit::CENTERRIGHT); |
2162 | 2199 | ||
2163 | sprintf(name_lookup, "session.screen%d.slit.direction", screen_number); | 2200 | sprintf(name_lookup, "session.screen%d.slit.direction", screen_number); |
2164 | sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number); | 2201 | sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number); |
2165 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, | 2202 | if (XrmGetResource(database, name_lookup, class_lookup, &value_type, |
2166 | &value)) | 2203 | &value)) |
2167 | if (! strncasecmp(value.addr, "Horizontal", value.size)) | 2204 | if (! strncasecmp(value.addr, "Horizontal", value.size)) |
2168 | screen->saveSlitDirection(Slit::Horizontal); | 2205 | screen->saveSlitDirection(Slit::HORIZONTAL); |
2169 | else | 2206 | else |
2170 | screen->saveSlitDirection(Slit::Vertical); | 2207 | screen->saveSlitDirection(Slit::VERTICAL); |
2171 | else | 2208 | else |
2172 | screen->saveSlitDirection(Slit::Vertical); | 2209 | screen->saveSlitDirection(Slit::VERTICAL); |
2173 | 2210 | ||
2174 | sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number); | 2211 | sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number); |
2175 | sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number); | 2212 | sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number); |
@@ -2341,7 +2378,7 @@ void Fluxbox::load_rc(BScreen *screen) { | |||
2341 | 2378 | ||
2342 | void Fluxbox::loadRootCommand(BScreen *screen) { | 2379 | void Fluxbox::loadRootCommand(BScreen *screen) { |
2343 | XrmDatabase database = (XrmDatabase) 0; | 2380 | XrmDatabase database = (XrmDatabase) 0; |
2344 | 2381 | ||
2345 | auto_ptr<char> dbfile(getRcFilename()); | 2382 | auto_ptr<char> dbfile(getRcFilename()); |
2346 | 2383 | ||
2347 | database = XrmGetFileDatabase(dbfile.get()); | 2384 | database = XrmGetFileDatabase(dbfile.get()); |
@@ -2359,6 +2396,7 @@ void Fluxbox::loadRootCommand(BScreen *screen) { | |||
2359 | screen->saveRootCommand(""); | 2396 | screen->saveRootCommand(""); |
2360 | 2397 | ||
2361 | } | 2398 | } |
2399 | |||
2362 | void Fluxbox::reload_rc(void) { | 2400 | void Fluxbox::reload_rc(void) { |
2363 | load_rc(); | 2401 | load_rc(); |
2364 | reconfigure(); | 2402 | reconfigure(); |