aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfluxgen <fluxgen>2003-02-23 00:53:31 (GMT)
committerfluxgen <fluxgen>2003-02-23 00:53:31 (GMT)
commite565603f461f3dcfa1940527b567b74667159b05 (patch)
tree9a7df165a8b68ea826b35e534f4cf510cab82e56
parent1178fde5ca6f1f4347c4ffb22fb2b5ac31f457ba (diff)
downloadfluxbox_pavel-e565603f461f3dcfa1940527b567b74667159b05.zip
fluxbox_pavel-e565603f461f3dcfa1940527b567b74667159b05.tar.bz2
restored slit saving...still some stuff to do.
-rw-r--r--src/fluxbox.cc175
1 files changed, 76 insertions, 99 deletions
diff --git a/src/fluxbox.cc b/src/fluxbox.cc
index 4caf6f0..a4832a8 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.99 2003/02/22 16:09:44 rathnor Exp $ 25// $Id: fluxbox.cc,v 1.100 2003/02/23 00:53:31 fluxgen Exp $
26 26
27 27
28#include "fluxbox.hh" 28#include "fluxbox.hh"
@@ -804,18 +804,9 @@ void Fluxbox::handleButtonEvent(XButtonEvent &be) {
804 { 804 {
805 last_time = be.time; 805 last_time = be.time;
806 806
807 FluxboxWindow *win = 0;
808 Tab *tab = 0; 807 Tab *tab = 0;
809 808
810 /* 809 if ((tab = searchTab(be.window))) {
811 if ((win = searchWindow(be.window))) {
812
813 win->buttonPressEvent(be);
814
815 if (be.button == 1)
816 win->installColormap(True);
817 }
818 else*/ if ((tab = searchTab(be.window))) {
819 tab->buttonPressEvent(&be); 810 tab->buttonPressEvent(&be);
820 } else { 811 } else {
821 ScreenList::iterator it = screenList.begin(); 812 ScreenList::iterator it = screenList.begin();
@@ -1678,46 +1669,42 @@ void Fluxbox::save_rc() {
1678 for (; it != it_end; ++it) { 1669 for (; it != it_end; ++it) {
1679 BScreen *screen = *it; 1670 BScreen *screen = *it;
1680 int screen_number = screen->getScreenNumber(); 1671 int screen_number = screen->getScreenNumber();
1681 /* 1672
1682 #ifdef SLIT 1673#ifdef SLIT
1683 string slit_placement; 1674 string slit_placement;
1684 1675
1685 switch (screen->getSlitPlacement()) { 1676 switch (screen->getSlitPlacement()) {
1686 case Slit::TOPLEFT: slit_placement = "TopLeft"; break; 1677 case Slit::TOPLEFT: slit_placement = "TopLeft"; break;
1687 case Slit::CENTERLEFT: slit_placement = "CenterLeft"; break; 1678 case Slit::CENTERLEFT: slit_placement = "CenterLeft"; break;
1688 case Slit::BOTTOMLEFT: slit_placement = "BottomLeft"; break; 1679 case Slit::BOTTOMLEFT: slit_placement = "BottomLeft"; break;
1689 case Slit::TOPCENTER: slit_placement = "TopCenter"; break; 1680 case Slit::TOPCENTER: slit_placement = "TopCenter"; break;
1690 case Slit::BOTTOMCENTER: slit_placement = "BottomCenter"; break; 1681 case Slit::BOTTOMCENTER: slit_placement = "BottomCenter"; break;
1691 case Slit::TOPRIGHT: slit_placement = "TopRight"; break; 1682 case Slit::TOPRIGHT: slit_placement = "TopRight"; break;
1692 case Slit::BOTTOMRIGHT: slit_placement = "BottomRight"; break; 1683 case Slit::BOTTOMRIGHT: slit_placement = "BottomRight"; break;
1693 case Slit::CENTERRIGHT: default: slit_placement = "CenterRight"; break; 1684 case Slit::CENTERRIGHT: default: slit_placement = "CenterRight"; break;
1694 } 1685 }
1695
1696 sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number,
1697 slit_placement.c_str());
1698 XrmPutLineResource(&new_blackboxrc, rc_string);
1699
1700 sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number,
1701 ((screen->getSlitDirection() == Slit::HORIZONTAL) ? "Horizontal" :
1702 "Vertical"));
1703 XrmPutLineResource(&new_blackboxrc, rc_string);
1704 1686
1705 sprintf(rc_string, "session.screen%d.slit.onTop: %s", screen_number, 1687 sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number,
1706 ((screen->getSlit()->isOnTop()) ? "True" : "False")); 1688 slit_placement.c_str());
1707 XrmPutLineResource(&new_blackboxrc, rc_string); 1689 XrmPutLineResource(&new_blackboxrc, rc_string);
1708 1690
1709 sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number, 1691 sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number,
1710 ((screen->getSlit()->doAutoHide()) ? "True" : "False")); 1692 ((screen->getSlitDirection() == Slit::HORIZONTAL) ? "Horizontal" :
1711 XrmPutLineResource(&new_blackboxrc, rc_string); 1693 "Vertical"));
1694 XrmPutLineResource(&new_blackboxrc, rc_string);
1712 1695
1696 sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number,
1697 ((screen->getSlit()->doAutoHide()) ? "True" : "False"));
1698 XrmPutLineResource(&new_blackboxrc, rc_string);
1699 /*
1713 #ifdef XINERAMA 1700 #ifdef XINERAMA
1714 sprintf(rc_string, "session.screen%d.slit.onHead: %d", screen_number, 1701 sprintf(rc_string, "session.screen%d.slit.onHead: %d", screen_number,
1715 screen->getSlitOnHead()); 1702 screen->getSlitOnHead());
1716 XrmPutLineResource(&new_blackboxrc, rc_string); 1703 XrmPutLineResource(&new_blackboxrc, rc_string);
1717 #endif // XINERAMA 1704 #endif // XINERAMA
1718
1719 #endif // SLIT
1720 */ 1705 */
1706#endif // SLIT
1707
1721 sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number, 1708 sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number,
1722 ((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ? 1709 ((screen->getRowPlacementDirection() == BScreen::LEFTRIGHT) ?
1723 "LeftToRight" : "RightToLeft")); 1710 "LeftToRight" : "RightToLeft"));
@@ -1987,64 +1974,54 @@ void Fluxbox::load_rc(BScreen *screen) {
1987 screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT); 1974 screen->savePlacementPolicy(BScreen::CASCADEPLACEMENT);
1988 } else 1975 } else
1989 screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT); 1976 screen->savePlacementPolicy(BScreen::ROWSMARTPLACEMENT);
1990 /* 1977
1991 #ifdef SLIT 1978#ifdef SLIT
1992 sprintf(name_lookup, "session.screen%d.slit.placement", screen_number); 1979 sprintf(name_lookup, "session.screen%d.slit.placement", screen_number);
1993 sprintf(class_lookup, "Session.Screen%d.Slit.Placement", screen_number); 1980 sprintf(class_lookup, "Session.Screen%d.Slit.Placement", screen_number);
1994 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, 1981 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
1995 &value)) { 1982 &value)) {
1996 if (! strncasecmp(value.addr, "TopLeft", value.size)) 1983 if (! strncasecmp(value.addr, "TopLeft", value.size))
1997 screen->saveSlitPlacement(Slit::TOPLEFT); 1984 screen->saveSlitPlacement(Slit::TOPLEFT);
1998 else if (! strncasecmp(value.addr, "CenterLeft", value.size)) 1985 else if (! strncasecmp(value.addr, "CenterLeft", value.size))
1999 screen->saveSlitPlacement(Slit::CENTERLEFT); 1986 screen->saveSlitPlacement(Slit::CENTERLEFT);
2000 else if (! strncasecmp(value.addr, "BottomLeft", value.size)) 1987 else if (! strncasecmp(value.addr, "BottomLeft", value.size))
2001 screen->saveSlitPlacement(Slit::BOTTOMLEFT); 1988 screen->saveSlitPlacement(Slit::BOTTOMLEFT);
2002 else if (! strncasecmp(value.addr, "TopCenter", value.size)) 1989 else if (! strncasecmp(value.addr, "TopCenter", value.size))
2003 screen->saveSlitPlacement(Slit::TOPCENTER); 1990 screen->saveSlitPlacement(Slit::TOPCENTER);
2004 else if (! strncasecmp(value.addr, "BottomCenter", value.size)) 1991 else if (! strncasecmp(value.addr, "BottomCenter", value.size))
2005 screen->saveSlitPlacement(Slit::BOTTOMCENTER); 1992 screen->saveSlitPlacement(Slit::BOTTOMCENTER);
2006 else if (! strncasecmp(value.addr, "TopRight", value.size)) 1993 else if (! strncasecmp(value.addr, "TopRight", value.size))
2007 screen->saveSlitPlacement(Slit::TOPRIGHT); 1994 screen->saveSlitPlacement(Slit::TOPRIGHT);
2008 else if (! strncasecmp(value.addr, "BottomRight", value.size)) 1995 else if (! strncasecmp(value.addr, "BottomRight", value.size))
2009 screen->saveSlitPlacement(Slit::BOTTOMRIGHT); 1996 screen->saveSlitPlacement(Slit::BOTTOMRIGHT);
2010 else 1997 else
2011 screen->saveSlitPlacement(Slit::CENTERRIGHT); 1998 screen->saveSlitPlacement(Slit::CENTERRIGHT);
2012 } else 1999 } else
2013 screen->saveSlitPlacement(Slit::CENTERRIGHT); 2000 screen->saveSlitPlacement(Slit::CENTERRIGHT);
2014
2015 sprintf(name_lookup, "session.screen%d.slit.direction", screen_number);
2016 sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number);
2017 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
2018 &value)) {
2019 if (! strncasecmp(value.addr, "Horizontal", value.size))
2020 screen->saveSlitDirection(Slit::HORIZONTAL);
2021 else
2022 screen->saveSlitDirection(Slit::VERTICAL);
2023 } else
2024 screen->saveSlitDirection(Slit::VERTICAL);
2025 2001
2026 sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number); 2002 sprintf(name_lookup, "session.screen%d.slit.direction", screen_number);
2027 sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number); 2003 sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number);
2028 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type, 2004 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
2029 &value)) { 2005 &value)) {
2030 if (! strncasecmp(value.addr, "True", value.size)) 2006 if (! strncasecmp(value.addr, "Horizontal", value.size))
2031 screen->saveSlitOnTop(True); 2007 screen->saveSlitDirection(Slit::HORIZONTAL);
2032 else 2008 else
2033 screen->saveSlitOnTop(False); 2009 screen->saveSlitDirection(Slit::VERTICAL);
2034 } else 2010 } else
2035 screen->saveSlitOnTop(False); 2011 screen->saveSlitDirection(Slit::VERTICAL);
2036 2012
2037 sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number);
2038 sprintf(class_lookup, "Session.Screen%d.Slit.AutoHide", screen_number);
2039 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
2040 &value)) {
2041 if (! strncasecmp(value.addr, "True", value.size))
2042 screen->saveSlitAutoHide(True);
2043 else
2044 screen->saveSlitAutoHide(False);
2045 } else
2046 screen->saveSlitAutoHide(False);
2047 2013
2014 sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number);
2015 sprintf(class_lookup, "Session.Screen%d.Slit.AutoHide", screen_number);
2016 if (XrmGetResource(*database, name_lookup, class_lookup, &value_type,
2017 &value)) {
2018 if (! strncasecmp(value.addr, "True", value.size))
2019 screen->saveSlitAutoHide(True);
2020 else
2021 screen->saveSlitAutoHide(False);
2022 } else
2023 screen->saveSlitAutoHide(False);
2024 /*
2048 #ifdef XINERAMA 2025 #ifdef XINERAMA
2049 int tmp_head; 2026 int tmp_head;
2050 sprintf(name_lookup, "session.screen%d.slit.onHead", screen_number); 2027 sprintf(name_lookup, "session.screen%d.slit.onHead", screen_number);
@@ -2057,9 +2034,9 @@ void Fluxbox::load_rc(BScreen *screen) {
2057 tmp_head = 0; 2034 tmp_head = 0;
2058 screen->saveSlitOnHead(tmp_head); 2035 screen->saveSlitOnHead(tmp_head);
2059 #endif // XINERAMA 2036 #endif // XINERAMA
2060
2061 #endif // SLIT
2062 */ 2037 */
2038#endif // SLIT
2039
2063#ifdef HAVE_STRFTIME 2040#ifdef HAVE_STRFTIME
2064 sprintf(name_lookup, "session.screen%d.strftimeFormat", screen_number); 2041 sprintf(name_lookup, "session.screen%d.strftimeFormat", screen_number);
2065 sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number); 2042 sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number);