gcc 3 compatibility, converted strstreams to stringstreams

This commit is contained in:
Dana Jansens 2002-05-07 15:34:46 +00:00
parent 4e2c37f2d2
commit 8956328138
31 changed files with 2172 additions and 5334 deletions

View file

@ -16,6 +16,8 @@ Changelog for Openbox:
* save the titlebarLayout in the default config file. (Ben Jansens) * save the titlebarLayout in the default config file. (Ben Jansens)
* gcc 3 compatibilty (Ben Jansens)
1.0.0: 1.0.0:
* maximizing windows takes the slit into account as * maximizing windows takes the slit into account as
well as the toolbar when 'Full Maximization' is off (Ben Jansens) well as the toolbar when 'Full Maximization' is off (Ben Jansens)

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -106,7 +106,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES)
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ configure.in
cd $(srcdir) && $(ACLOCAL) cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck $(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) $(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF) cd $(srcdir) && $(AUTOCONF)
@ -177,7 +177,7 @@ maintainer-clean-recursive:
dot_seen=no; \ dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \ rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \ test "$$subdir" = "." && dot_seen=yes; \
done; \ done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \ test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \ target=`echo $@ | sed s/-recursive//`; \

View file

@ -99,6 +99,9 @@
/* Define to 1 if you have the <sys/wait.h> header file. */ /* Define to 1 if you have the <sys/wait.h> header file. */
#undef HAVE_SYS_WAIT_H #undef HAVE_SYS_WAIT_H
/* Define to 1 if you have the <sstream> header file. */
#undef HAVE_SSTREAM
/* Define to 1 if you have the <time.h> header file. */ /* Define to 1 if you have the <time.h> header file. */
#undef HAVE_TIME_H #undef HAVE_TIME_H

7101
configure vendored

File diff suppressed because it is too large Load diff

View file

@ -15,13 +15,15 @@ AC_PROG_CC
AC_PROG_CXX AC_PROG_CXX
AC_PROG_INSTALL AC_PROG_INSTALL
AC_LANG_CPLUSPLUS
AC_CHECK_PROGS(regex_cmd, sed) AC_CHECK_PROGS(regex_cmd, sed)
if test x$regex_cmd = "x"; then if test x$regex_cmd = "x"; then
AC_MSG_ERROR([error. sed is required to build the default menu file.]) AC_MSG_ERROR([error. sed is required to build the default menu file.])
fi fi
dnl Check for system header files dnl Check for system header files
AC_CHECK_HEADERS(ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.h string.h stdlib.h time.h unistd.h sys/param.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h) AC_CHECK_HEADERS(ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.h string.h stdlib.h time.h unistd.h sys/param.h sys/select.h sys/signal.h sys/stat.h sys/time.h sys/types.h sys/wait.h sstream)
AC_HEADER_TIME AC_HEADER_TIME
dnl Check for existance of basename(), setlocale() and strftime() dnl Check for existance of basename(), setlocale() and strftime()

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -136,7 +136,7 @@ maintainer-clean-recursive:
dot_seen=no; \ dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \ rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \ test "$$subdir" = "." && dot_seen=yes; \
done; \ done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \ test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \ target=`echo $@ | sed s/-recursive//`; \

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -182,7 +182,7 @@ maintainer-clean-recursive:
dot_seen=no; \ dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \ rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \ test "$$subdir" = "." && dot_seen=yes; \
done; \ done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \ test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \ target=`echo $@ | sed s/-recursive//`; \

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.
@ -138,7 +138,7 @@ maintainer-clean-recursive:
dot_seen=no; \ dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \ rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \ test "$$subdir" = "." && dot_seen=yes; \
done; \ done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \ test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \ target=`echo $@ | sed s/-recursive//`; \

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -100,7 +100,9 @@
#define FONT_ELEMENT_SIZE 50 #define FONT_ELEMENT_SIZE 50
#endif // FONT_ELEMENT_SIZE #endif // FONT_ELEMENT_SIZE
#include <strstream> #ifdef HAVE_SSTREAM
# include <sstream>
#endif // HAVE_SSTREAM
#include <string> #include <string>
#include <algorithm> #include <algorithm>
@ -930,35 +932,32 @@ XFontSet BScreen::createFontSet(const char *fontname) {
void BScreen::setSloppyFocus(bool b) { void BScreen::setSloppyFocus(bool b) {
resource.sloppy_focus = b; resource.sloppy_focus = b;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".focusModel" << ends; s << "session.screen" << getScreenNumber() << ".focusModel";
config.setValue(s.str(), config.setValue(s.str(),
(resource.sloppy_focus ? (resource.sloppy_focus ?
(resource.auto_raise ? "AutoRaiseSloppyFocus" : "SloppyFocus") (resource.auto_raise ? "AutoRaiseSloppyFocus" : "SloppyFocus")
: "ClickToFocus")); : "ClickToFocus"));
s.rdbuf()->freeze(0);
} }
void BScreen::setAutoRaise(bool a) { void BScreen::setAutoRaise(bool a) {
resource.auto_raise = a; resource.auto_raise = a;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".focusModel" << ends; s << "session.screen" << getScreenNumber() << ".focusModel";
config.setValue(s.str(), config.setValue(s.str(),
(resource.sloppy_focus ? (resource.sloppy_focus ?
(resource.auto_raise ? "AutoRaiseSloppyFocus" : "SloppyFocus") (resource.auto_raise ? "AutoRaiseSloppyFocus" : "SloppyFocus")
: "ClickToFocus")); : "ClickToFocus"));
s.rdbuf()->freeze(0);
} }
void BScreen::setImageDither(bool d, bool reconfig) { void BScreen::setImageDither(bool d, bool reconfig) {
resource.image_dither = d; resource.image_dither = d;
image_control->setDither(d); image_control->setDither(d);
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".imageDither" << ends; s << "session.screen" << getScreenNumber() << ".imageDither";
config.setValue(s.str(), resource.image_dither); config.setValue(s.str(), resource.image_dither);
s.rdbuf()->freeze(0);
if (reconfig) if (reconfig)
reconfigure(); reconfigure();
} }
@ -966,62 +965,59 @@ void BScreen::setImageDither(bool d, bool reconfig) {
void BScreen::setOpaqueMove(bool o) { void BScreen::setOpaqueMove(bool o) {
resource.opaque_move = o; resource.opaque_move = o;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".opaqueMove" << ends; s << "session.screen" << getScreenNumber() << ".opaqueMove";
config.setValue(s.str(), resource.opaque_move); config.setValue(s.str(), resource.opaque_move);
s.rdbuf()->freeze(0);
} }
void BScreen::setFullMax(bool f) { void BScreen::setFullMax(bool f) {
resource.full_max = f; resource.full_max = f;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".fullMaximization" << ends; s << "session.screen" << getScreenNumber() << ".fullMaximization";
config.setValue(s.str(), resource.full_max); config.setValue(s.str(), resource.full_max);
#ifndef HAVE_SSTREAM
s.rdbuf()->freeze(0); s.rdbuf()->freeze(0);
#endif // HAVE_SSTREAM
} }
void BScreen::setFocusNew(bool f) { void BScreen::setFocusNew(bool f) {
resource.focus_new = f; resource.focus_new = f;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".focusNewWindows" << ends; s << "session.screen" << getScreenNumber() << ".focusNewWindows";
config.setValue(s.str(), resource.focus_new); config.setValue(s.str(), resource.focus_new);
s.rdbuf()->freeze(0);
} }
void BScreen::setFocusLast(bool f) { void BScreen::setFocusLast(bool f) {
resource.focus_last = f; resource.focus_last = f;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".focusLastWindow" << ends; s << "session.screen" << getScreenNumber() << ".focusLastWindow";
config.setValue(s.str(), resource.focus_last); config.setValue(s.str(), resource.focus_last);
s.rdbuf()->freeze(0);
} }
void BScreen::setWindowZones(int z) { void BScreen::setWindowZones(int z) {
resource.zones = z; resource.zones = z;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".windowZones" << ends; s << "session.screen" << getScreenNumber() << ".windowZones";
config.setValue(s.str(), resource.zones); config.setValue(s.str(), resource.zones);
s.rdbuf()->freeze(0);
} }
void BScreen::setWorkspaceCount(int w) { void BScreen::setWorkspaceCount(int w) {
resource.workspaces = w; resource.workspaces = w;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".workspaces" << ends; s << "session.screen" << getScreenNumber() << ".workspaces";
config.setValue(s.str(), resource.workspaces); config.setValue(s.str(), resource.workspaces);
s.rdbuf()->freeze(0);
} }
void BScreen::setPlacementPolicy(int p) { void BScreen::setPlacementPolicy(int p) {
resource.placement_policy = p; resource.placement_policy = p;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".windowPlacement" << ends; s << "session.screen" << getScreenNumber() << ".windowPlacement";
const char *placement; const char *placement;
switch (resource.placement_policy) { switch (resource.placement_policy) {
case CascadePlacement: placement = "CascadePlacement"; break; case CascadePlacement: placement = "CascadePlacement"; break;
@ -1033,40 +1029,34 @@ void BScreen::setPlacementPolicy(int p) {
case RowSmartPlacement: placement = "RowSmartPlacement"; break; case RowSmartPlacement: placement = "RowSmartPlacement"; break;
} }
config.setValue(s.str(), placement); config.setValue(s.str(), placement);
s.rdbuf()->freeze(0);
} }
void BScreen::setEdgeSnapThreshold(int t) { void BScreen::setEdgeSnapThreshold(int t) {
resource.edge_snap_threshold = t; resource.edge_snap_threshold = t;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".edgeSnapThreshold" << ends; s << "session.screen" << getScreenNumber() << ".edgeSnapThreshold";
config.setValue(s.str(), resource.edge_snap_threshold); config.setValue(s.str(), resource.edge_snap_threshold);
s.rdbuf()->freeze(0);
} }
void BScreen::setRowPlacementDirection(int d) { void BScreen::setRowPlacementDirection(int d) {
resource.row_direction = d; resource.row_direction = d;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".rowPlacementDirection" << s << "session.screen" << getScreenNumber() << ".rowPlacementDirection";
ends;
config.setValue(s.str(), config.setValue(s.str(),
resource.row_direction == LeftRight ? resource.row_direction == LeftRight ?
"LeftToRight" : "RightToLeft"); "LeftToRight" : "RightToLeft");
s.rdbuf()->freeze(0);
} }
void BScreen::setColPlacementDirection(int d) { void BScreen::setColPlacementDirection(int d) {
resource.col_direction = d; resource.col_direction = d;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".colPlacementDirection" << s << "session.screen" << getScreenNumber() << ".colPlacementDirection";
ends;
config.setValue(s.str(), config.setValue(s.str(),
resource.col_direction == TopBottom ? resource.col_direction == TopBottom ?
"TopToBottom" : "BottomToTop"); "TopToBottom" : "BottomToTop");
s.rdbuf()->freeze(0);
} }
@ -1089,28 +1079,25 @@ void BScreen::setStrftimeFormat(const char *f) {
delete [] resource.strftime_format; delete [] resource.strftime_format;
resource.strftime_format = bstrdup(f); resource.strftime_format = bstrdup(f);
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".strftimeFormat" << ends; s << "session.screen" << getScreenNumber() << ".strftimeFormat";
config.setValue(s.str(), resource.strftime_format); config.setValue(s.str(), resource.strftime_format);
s.rdbuf()->freeze(0);
} }
#else // !HAVE_STRFTIME #else // !HAVE_STRFTIME
void BScreen::setDateFormat(int f) { void BScreen::setDateFormat(int f) {
resource.date_format = f; resource.date_format = f;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".dateFormat" << ends; s << "session.screen" << getScreenNumber() << ".dateFormat";
config.setValue(s.str(), resource.date_format == B_EuropeanDate ? config.setValue(s.str(), resource.date_format == B_EuropeanDate ?
"European" : "American"); "European" : "American");
s.rdbuf()->freeze(0);
} }
void BScreen::setClock24Hour(Bool c) { void BScreen::setClock24Hour(Bool c) {
resource.clock24hour = c; resource.clock24hour = c;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".clockFormat" << ends; s << "session.screen" << getScreenNumber() << ".clockFormat";
config.setValue(s.str(), resource.clock24hour ? 24 : 12); config.setValue(s.str(), resource.clock24hour ? 24 : 12);
s.rdbuf()->freeze(0);
} }
#endif // HAVE_STRFTIME #endif // HAVE_STRFTIME
@ -1120,14 +1107,13 @@ void BScreen::setHideToolbar(bool b) {
getToolbar()->unMapToolbar(); getToolbar()->unMapToolbar();
else else
getToolbar()->mapToolbar(); getToolbar()->mapToolbar();
std::ostrstream s; std::ostringstream s;
s << "session.screen" << getScreenNumber() << ".hideToolbar" << ends; s << "session.screen" << getScreenNumber() << ".hideToolbar";
config.setValue(s.str(), resource.hide_toolbar ? "True" : "False"); config.setValue(s.str(), resource.hide_toolbar ? "True" : "False");
s.rdbuf()->freeze(0);
} }
void BScreen::saveWorkspaceNames() { void BScreen::saveWorkspaceNames() {
std::ostrstream rc, names; std::ostringstream rc, names;
for (int i = 0; i < resource.workspaces; i++) { for (int i = 0; i < resource.workspaces; i++) {
Workspace *w = getWorkspace(i); Workspace *w = getWorkspace(i);
@ -1137,12 +1123,10 @@ void BScreen::saveWorkspaceNames() {
names << ','; names << ',';
} }
} }
names << ends; names;
rc << "session.screen" << getScreenNumber() << ".workspaceNames" << ends; rc << "session.screen" << getScreenNumber() << ".workspaceNames";
config.setValue(rc.str(), names.str()); config.setValue(rc.str(), names.str());
rc.rdbuf()->freeze(0);
names.rdbuf()->freeze(0);
} }
void BScreen::save() { void BScreen::save() {
@ -1173,14 +1157,14 @@ void BScreen::save() {
} }
void BScreen::load() { void BScreen::load() {
std::ostrstream rscreen, rname, rclass; std::ostringstream rscreen, rname, rclass;
std::string s; std::string s;
bool b; bool b;
long l; long l;
rscreen << "session.screen" << getScreenNumber() << '.' << ends; rscreen << "session.screen" << getScreenNumber() << '.';
rname << rscreen.str() << "hideToolbar" << ends; rname << rscreen.str() << "hideToolbar";
rclass << rscreen.str() << "HideToolbar" << ends; rclass << rscreen.str() << "HideToolbar";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
resource.hide_toolbar = b; resource.hide_toolbar = b;
else else
@ -1194,32 +1178,32 @@ void BScreen::load() {
} }
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "fullMaximization" << ends; rname << rscreen.str() << "fullMaximization";
rclass << rscreen.str() << "FullMaximization" << ends; rclass << rscreen.str() << "FullMaximization";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
resource.full_max = b; resource.full_max = b;
else else
resource.full_max = false; resource.full_max = false;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "focusNewWindows" << ends; rname << rscreen.str() << "focusNewWindows";
rclass << rscreen.str() << "FocusNewWindows" << ends; rclass << rscreen.str() << "FocusNewWindows";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
resource.focus_new = b; resource.focus_new = b;
else else
resource.focus_new = false; resource.focus_new = false;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "focusLastWindow" << ends; rname << rscreen.str() << "focusLastWindow";
rclass << rscreen.str() << "FocusLastWindow" << ends; rclass << rscreen.str() << "FocusLastWindow";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
resource.focus_last = b; resource.focus_last = b;
else else
resource.focus_last = false; resource.focus_last = false;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "rowPlacementDirection" << ends; rname << rscreen.str() << "rowPlacementDirection";
rclass << rscreen.str() << "RowPlacementDirection" << ends; rclass << rscreen.str() << "RowPlacementDirection";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (0 == strncasecmp(s.c_str(), "RightToLeft", s.length())) if (0 == strncasecmp(s.c_str(), "RightToLeft", s.length()))
resource.row_direction = RightLeft; resource.row_direction = RightLeft;
@ -1229,8 +1213,8 @@ void BScreen::load() {
resource.row_direction = LeftRight; resource.row_direction = LeftRight;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "colPlacementDirection" << ends; rname << rscreen.str() << "colPlacementDirection";
rclass << rscreen.str() << "ColPlacementDirection" << ends; rclass << rscreen.str() << "ColPlacementDirection";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (0 == strncasecmp(s.c_str(), "BottomToTop", s.length())) if (0 == strncasecmp(s.c_str(), "BottomToTop", s.length()))
resource.col_direction = BottomTop; resource.col_direction = BottomTop;
@ -1240,8 +1224,8 @@ void BScreen::load() {
resource.col_direction = TopBottom; resource.col_direction = TopBottom;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "workspaces" << ends; rname << rscreen.str() << "workspaces";
rclass << rscreen.str() << "Workspaces" << ends; rclass << rscreen.str() << "Workspaces";
if (config.getValue(rname.str(), rclass.str(), l)) if (config.getValue(rname.str(), rclass.str(), l))
resource.workspaces = l; resource.workspaces = l;
else else
@ -1249,8 +1233,8 @@ void BScreen::load() {
removeWorkspaceNames(); removeWorkspaceNames();
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "workspaceNames" << ends; rname << rscreen.str() << "workspaceNames";
rclass << rscreen.str() << "WorkspaceNames" << ends; rclass << rscreen.str() << "WorkspaceNames";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
std::string::const_iterator it = s.begin(), end = s.end(); std::string::const_iterator it = s.begin(), end = s.end();
while(1) { while(1) {
@ -1265,8 +1249,8 @@ void BScreen::load() {
} }
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "focusModel" << ends; rname << rscreen.str() << "focusModel";
rclass << rscreen.str() << "FocusModel" << ends; rclass << rscreen.str() << "FocusModel";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (0 == strncasecmp(s.c_str(), "ClickToFocus", s.length())) { if (0 == strncasecmp(s.c_str(), "ClickToFocus", s.length())) {
resource.auto_raise = false; resource.auto_raise = false;
@ -1285,16 +1269,16 @@ void BScreen::load() {
} }
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "windowZones" << ends; rname << rscreen.str() << "windowZones";
rclass << rscreen.str() << "WindowZones" << ends; rclass << rscreen.str() << "WindowZones";
if (config.getValue(rname.str(), rclass.str(), l)) if (config.getValue(rname.str(), rclass.str(), l))
resource.zones = (l == 1 || l == 2 || l == 4) ? l : 1; resource.zones = (l == 1 || l == 2 || l == 4) ? l : 1;
else else
resource.zones = 4; resource.zones = 4;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "windowPlacement" << ends; rname << rscreen.str() << "windowPlacement";
rclass << rscreen.str() << "WindowPlacement" << ends; rclass << rscreen.str() << "WindowPlacement";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (0 == strncasecmp(s.c_str(), "RowSmartPlacement", s.length())) if (0 == strncasecmp(s.c_str(), "RowSmartPlacement", s.length()))
resource.placement_policy = RowSmartPlacement; resource.placement_policy = RowSmartPlacement;
@ -1313,8 +1297,8 @@ void BScreen::load() {
#ifdef HAVE_STRFTIME #ifdef HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "strftimeFormat" << ends; rname << rscreen.str() << "strftimeFormat";
rclass << rscreen.str() << "StrftimeFormat" << ends; rclass << rscreen.str() << "StrftimeFormat";
if (resource.strftime_format != NULL) if (resource.strftime_format != NULL)
delete [] resource.strftime_format; delete [] resource.strftime_format;
@ -1325,8 +1309,8 @@ void BScreen::load() {
resource.strftime_format = bstrdup("%I:%M %p"); resource.strftime_format = bstrdup("%I:%M %p");
#else // !HAVE_STRFTIME #else // !HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "dateFormat" << ends; rname << rscreen.str() << "dateFormat";
rclass << rscreen.str() << "DateFormat" << ends; rclass << rscreen.str() << "DateFormat";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (strncasecmp(s.c_str(), "European", s.length())) if (strncasecmp(s.c_str(), "European", s.length()))
resource.date_format = B_EuropeanDate; resource.date_format = B_EuropeanDate;
@ -1336,8 +1320,8 @@ void BScreen::load() {
resource.date_format = B_AmericanDate; resource.date_format = B_AmericanDate;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "clockFormat" << ends; rname << rscreen.str() << "clockFormat";
rclass << rscreen.str() << "ClockFormat" << ends; rclass << rscreen.str() << "ClockFormat";
if (config.getValue(rname.str(), rclass.str(), l)) { if (config.getValue(rname.str(), rclass.str(), l)) {
if (clock == 24) if (clock == 24)
resource.clock24hour = true; resource.clock24hour = true;
@ -1348,24 +1332,24 @@ void BScreen::load() {
#endif // HAVE_STRFTIME #endif // HAVE_STRFTIME
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "edgeSnapThreshold" << ends; rname << rscreen.str() << "edgeSnapThreshold";
rclass << rscreen.str() << "EdgeSnapThreshold" << ends; rclass << rscreen.str() << "EdgeSnapThreshold";
if (config.getValue(rname.str(), rclass.str(), l)) if (config.getValue(rname.str(), rclass.str(), l))
resource.edge_snap_threshold = l; resource.edge_snap_threshold = l;
else else
resource.edge_snap_threshold = 4; resource.edge_snap_threshold = 4;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "imageDither" << ends; rname << rscreen.str() << "imageDither";
rclass << rscreen.str() << "ImageDither" << ends; rclass << rscreen.str() << "ImageDither";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
resource.image_dither = b; resource.image_dither = b;
else else
resource.image_dither = true; resource.image_dither = true;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "rootCommand" << ends; rname << rscreen.str() << "rootCommand";
rclass << rscreen.str() << "RootCommand" << ends; rclass << rscreen.str() << "RootCommand";
if (resource.root_command != NULL) if (resource.root_command != NULL)
delete [] resource.root_command; delete [] resource.root_command;
@ -1376,16 +1360,12 @@ void BScreen::load() {
resource.root_command = NULL; resource.root_command = NULL;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "opaqueMove" << ends; rname << rscreen.str() << "opaqueMove";
rclass << rscreen.str() << "OpaqueMove" << ends; rclass << rscreen.str() << "OpaqueMove";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
resource.opaque_move = b; resource.opaque_move = b;
else else
resource.opaque_move = false; resource.opaque_move = false;
rscreen.rdbuf()->freeze(0);
rname.rdbuf()->freeze(0);
rclass.rdbuf()->freeze(0);
} }
void BScreen::reconfigure(void) { void BScreen::reconfigure(void) {

View file

@ -41,8 +41,11 @@
#include "Slit.h" #include "Slit.h"
#include "Toolbar.h" #include "Toolbar.h"
#ifdef HAVE_SSTREAM
# include <sstream>
#endif // HAVE_SSTREAM
#include <string> #include <string>
#include <strstream>
Slit::Slit(BScreen &scr, Resource &conf) : screen(scr), Slit::Slit(BScreen &scr, Resource &conf) : screen(scr),
openbox(scr.getOpenbox()), config(conf) openbox(scr.getOpenbox()), config(conf)
@ -211,25 +214,22 @@ void Slit::removeClient(Window w, Bool remap) {
void Slit::setOnTop(bool b) { void Slit::setOnTop(bool b) {
m_ontop = b; m_ontop = b;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".slit.onTop" << ends; s << "session.screen" << screen.getScreenNumber() << ".slit.onTop";
config.setValue(s.str(), m_ontop ? "True" : "False"); config.setValue(s.str(), m_ontop ? "True" : "False");
s.rdbuf()->freeze(0);
} }
void Slit::setAutoHide(bool b) { void Slit::setAutoHide(bool b) {
m_autohide = b; m_autohide = b;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".slit.autoHide" << ends; s << "session.screen" << screen.getScreenNumber() << ".slit.autoHide";
config.setValue(s.str(), m_autohide ? "True" : "False"); config.setValue(s.str(), m_autohide ? "True" : "False");
s.rdbuf()->freeze(0);
} }
void Slit::setPlacement(int p) { void Slit::setPlacement(int p) {
m_placement = p; m_placement = p;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".slit.placement" << s << "session.screen" << screen.getScreenNumber() << ".slit.placement";
ends;
const char *placement; const char *placement;
switch (m_placement) { switch (m_placement) {
case TopLeft: placement = "TopLeft"; break; case TopLeft: placement = "TopLeft"; break;
@ -242,17 +242,14 @@ void Slit::setPlacement(int p) {
case CenterRight: default: placement = "CenterRight"; break; case CenterRight: default: placement = "CenterRight"; break;
} }
config.setValue(s.str(), placement); config.setValue(s.str(), placement);
s.rdbuf()->freeze(0);
} }
void Slit::setDirection(int d) { void Slit::setDirection(int d) {
m_direction = d; m_direction = d;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".slit.direction" << s << "session.screen" << screen.getScreenNumber() << ".slit.direction";
ends;
config.setValue(s.str(), config.setValue(s.str(),
m_direction == Horizontal ? "Horizontal" : "Vertical"); m_direction == Horizontal ? "Horizontal" : "Vertical");
s.rdbuf()->freeze(0);
} }
void Slit::save() { void Slit::save() {
@ -263,13 +260,13 @@ void Slit::save() {
} }
void Slit::load() { void Slit::load() {
std::ostrstream rscreen, rname, rclass; std::ostringstream rscreen, rname, rclass;
std::string s; std::string s;
bool b; bool b;
rscreen << "session.screen" << screen.getScreenNumber() << '.' << ends; rscreen << "session.screen" << screen.getScreenNumber() << '.';
rname << rscreen.str() << "slit.placement" << ends; rname << rscreen.str() << "slit.placement";
rclass << rscreen.str() << "Slit.Placement" << ends; rclass << rscreen.str() << "Slit.Placement";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (0 == strncasecmp(s.c_str(), "TopLeft", s.length())) if (0 == strncasecmp(s.c_str(), "TopLeft", s.length()))
m_placement = TopLeft; m_placement = TopLeft;
@ -291,8 +288,8 @@ void Slit::load() {
m_placement = CenterRight; m_placement = CenterRight;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "slit.direction" << ends; rname << rscreen.str() << "slit.direction";
rclass << rscreen.str() << "Slit.Direction" << ends; rclass << rscreen.str() << "Slit.Direction";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (0 == strncasecmp(s.c_str(), "Horizontal", s.length())) if (0 == strncasecmp(s.c_str(), "Horizontal", s.length()))
m_direction = Horizontal; m_direction = Horizontal;
@ -302,24 +299,20 @@ void Slit::load() {
m_direction = Vertical; m_direction = Vertical;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "slit.onTop" << ends; rname << rscreen.str() << "slit.onTop";
rclass << rscreen.str() << "Slit.OnTop" << ends; rclass << rscreen.str() << "Slit.OnTop";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
m_ontop = b; m_ontop = b;
else else
m_ontop = false; m_ontop = false;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "slit.autoHide" << ends; rname << rscreen.str() << "slit.autoHide";
rclass << rscreen.str() << "Slit.AutoHide" << ends; rclass << rscreen.str() << "Slit.AutoHide";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
m_hidden = m_autohide = b; m_hidden = m_autohide = b;
else else
m_hidden = m_autohide = false; m_hidden = m_autohide = false;
rscreen.rdbuf()->freeze(0);
rname.rdbuf()->freeze(0);
rclass.rdbuf()->freeze(0);
} }
void Slit::reconfigure(void) { void Slit::reconfigure(void) {

View file

@ -62,7 +62,10 @@
# endif // HAVE_SYS_TIME_H # endif // HAVE_SYS_TIME_H
#endif // TIME_WITH_SYS_TIME #endif // TIME_WITH_SYS_TIME
#include <strstream> #ifdef HAVE_SSTREAM
# include <sstream>
#endif // HAVE_SSTREAM
#include <string> #include <string>
Toolbar::Toolbar(BScreen &scrn, Resource &conf) : screen(scrn), Toolbar::Toolbar(BScreen &scrn, Resource &conf) : screen(scrn),
@ -214,35 +217,30 @@ Toolbar::~Toolbar() {
void Toolbar::setOnTop(bool b) { void Toolbar::setOnTop(bool b) {
m_ontop = b; m_ontop = b;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".toolbar.onTop" << ends; s << "session.screen" << screen.getScreenNumber() << ".toolbar.onTop";
config.setValue(s.str(), m_ontop ? "True" : "False"); config.setValue(s.str(), m_ontop ? "True" : "False");
s.rdbuf()->freeze(0);
} }
void Toolbar::setAutoHide(bool b) { void Toolbar::setAutoHide(bool b) {
m_autohide = b; m_autohide = b;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".toolbar.autoHide" << s << "session.screen" << screen.getScreenNumber() << ".toolbar.autoHide";
ends;
config.setValue(s.str(), m_autohide ? "True" : "False"); config.setValue(s.str(), m_autohide ? "True" : "False");
s.rdbuf()->freeze(0);
} }
void Toolbar::setWidthPercent(int w) { void Toolbar::setWidthPercent(int w) {
m_width_percent = w; m_width_percent = w;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".toolbar.widthPercent" s << "session.screen" << screen.getScreenNumber() << ".toolbar.widthPercent"
<< ends; ;
config.setValue(s.str(), m_width_percent); config.setValue(s.str(), m_width_percent);
s.rdbuf()->freeze(0);
} }
void Toolbar::setPlacement(int p) { void Toolbar::setPlacement(int p) {
m_placement = p; m_placement = p;
std::ostrstream s; std::ostringstream s;
s << "session.screen" << screen.getScreenNumber() << ".toolbar.placement" << s << "session.screen" << screen.getScreenNumber() << ".toolbar.placement";
ends;
const char *placement; const char *placement;
switch (m_placement) { switch (m_placement) {
case TopLeft: placement = "TopLeft"; break; case TopLeft: placement = "TopLeft"; break;
@ -253,7 +251,6 @@ void Toolbar::setPlacement(int p) {
case BottomCenter: default: placement = "BottomCenter"; break; case BottomCenter: default: placement = "BottomCenter"; break;
} }
config.setValue(s.str(), placement); config.setValue(s.str(), placement);
s.rdbuf()->freeze(0);
} }
void Toolbar::save() { void Toolbar::save() {
@ -264,22 +261,22 @@ void Toolbar::save() {
} }
void Toolbar::load() { void Toolbar::load() {
std::ostrstream rscreen, rname, rclass; std::ostringstream rscreen, rname, rclass;
std::string s; std::string s;
bool b; bool b;
long l; long l;
rscreen << "session.screen" << screen.getScreenNumber() << '.' << ends; rscreen << "session.screen" << screen.getScreenNumber() << '.';
rname << rscreen.str() << "toolbar.widthPercent" << ends; rname << rscreen.str() << "toolbar.widthPercent";
rclass << rscreen.str() << "Toolbar.WidthPercent" << ends; rclass << rscreen.str() << "Toolbar.WidthPercent";
if (config.getValue(rname.str(), rclass.str(), l) && (l > 0 && l <= 100)) if (config.getValue(rname.str(), rclass.str(), l) && (l > 0 && l <= 100))
m_width_percent = l; m_width_percent = l;
else else
m_width_percent =66; m_width_percent =66;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "toolbar.placement" << ends; rname << rscreen.str() << "toolbar.placement";
rclass << rscreen.str() << "Toolbar.Placement" << ends; rclass << rscreen.str() << "Toolbar.Placement";
if (config.getValue(rname.str(), rclass.str(), s)) { if (config.getValue(rname.str(), rclass.str(), s)) {
if (0 == strncasecmp(s.c_str(), "TopLeft", s.length())) if (0 == strncasecmp(s.c_str(), "TopLeft", s.length()))
m_placement = TopLeft; m_placement = TopLeft;
@ -297,24 +294,20 @@ void Toolbar::load() {
m_placement = BottomCenter; m_placement = BottomCenter;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "toolbar.onTop" << ends; rname << rscreen.str() << "toolbar.onTop";
rclass << rscreen.str() << "Toolbar.OnTop" << ends; rclass << rscreen.str() << "Toolbar.OnTop";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
m_ontop = b; m_ontop = b;
else else
m_ontop = false; m_ontop = false;
rname.seekp(0); rclass.seekp(0); rname.seekp(0); rclass.seekp(0);
rname << rscreen.str() << "toolbar.autoHide" << ends; rname << rscreen.str() << "toolbar.autoHide";
rclass << rscreen.str() << "Toolbar.AutoHide" << ends; rclass << rscreen.str() << "Toolbar.AutoHide";
if (config.getValue(rname.str(), rclass.str(), b)) if (config.getValue(rname.str(), rclass.str(), b))
m_hidden = m_autohide = b; m_hidden = m_autohide = b;
else else
m_hidden = m_autohide = false; m_hidden = m_autohide = false;
rscreen.rdbuf()->freeze(0);
rname.rdbuf()->freeze(0);
rclass.rdbuf()->freeze(0);
} }
void Toolbar::reconfigure() { void Toolbar::reconfigure() {

View file

@ -58,9 +58,9 @@
# include <string.h> # include <string.h>
#endif // HAVE_STRING_H #endif // HAVE_STRING_H
#include <vector>
#include <algorithm> #include <algorithm>
typedef vector<Rect> rectList; #include <vector>
typedef std::vector<Rect> rectList;
Workspace::Workspace(BScreen &scrn, int i) : screen(scrn) { Workspace::Workspace(BScreen &scrn, int i) : screen(scrn) {
@ -442,9 +442,9 @@ Point *Workspace::bestFitPlacement(const Size &win_size, const Rect &space) {
for (siter=spaces.begin(); siter!=spaces.end(); ++siter) { for (siter=spaces.begin(); siter!=spaces.end(); ++siter) {
if ((siter->w() >= win_size.w()) && (siter->h() >= win_size.h())) { if ((siter->w() >= win_size.w()) && (siter->h() >= win_size.h())) {
if (best==NULL) if (best==NULL)
best = siter; best = &*siter;
else if(siter->w()*siter->h()<best->h()*best->w()) else if(siter->w()*siter->h()<best->h()*best->w())
best = siter; best = &*siter;
} }
} }
if (best != NULL) { if (best != NULL) {

View file

@ -1,6 +1,6 @@
# Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Makefile.in generated automatically by automake 1.4-p4 from Makefile.am
# Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. # Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc.
# This Makefile.in is free software; the Free Software Foundation # This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it, # gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved. # with or without modifications, as long as this notice is preserved.

View file

@ -2,14 +2,14 @@
# include "../config.h" # include "../config.h"
#endif // HAVE_CONFIG_H #endif // HAVE_CONFIG_H
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif // HAVE_STDLIB_H
#ifdef HAVE_STRING_H #ifdef HAVE_STRING_H
# include <string.h> # include <string.h>
#endif // HAVE_STRING_H #endif // HAVE_STRING_H
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif // HAVE_STDLIB_H
#ifdef HAVE_STDIO_H #ifdef HAVE_STDIO_H
# include <stdio.h> # include <stdio.h>
#endif // HAVE_STDIO_H #endif // HAVE_STDIO_H