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)
* gcc 3 compatibilty (Ben Jansens)
1.0.0:
* maximizing windows takes the slit into account as
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
# gives unlimited permission to copy and/or distribute it,
# 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
cd $(srcdir) && $(ACLOCAL)
config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
config.status: $(srcdir)/configure.in $(CONFIG_STATUS_DEPENDENCIES)
$(SHELL) ./config.status --recheck
$(srcdir)/configure: @MAINTAINER_MODE_TRUE@$(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES)
cd $(srcdir) && $(AUTOCONF)
@ -177,7 +177,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
target=`echo $@ | sed s/-recursive//`; \

View file

@ -99,6 +99,9 @@
/* Define to 1 if you have the <sys/wait.h> header file. */
#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. */
#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_INSTALL
AC_LANG_CPLUSPLUS
AC_CHECK_PROGS(regex_cmd, sed)
if test x$regex_cmd = "x"; then
AC_MSG_ERROR([error. sed is required to build the default menu file.])
fi
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
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
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -136,7 +136,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -182,7 +182,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@ -138,7 +138,7 @@ maintainer-clean-recursive:
dot_seen=no; \
rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \
rev="$$subdir $$rev"; \
test "$$subdir" != "." || dot_seen=yes; \
test "$$subdir" = "." && dot_seen=yes; \
done; \
test "$$dot_seen" = "no" && rev=". $$rev"; \
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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# 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
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

View file

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

View file

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

View file

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

View file

@ -58,9 +58,9 @@
# include <string.h>
#endif // HAVE_STRING_H
#include <vector>
#include <algorithm>
typedef vector<Rect> rectList;
#include <vector>
typedef std::vector<Rect> rectList;
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) {
if ((siter->w() >= win_size.w()) && (siter->h() >= win_size.h())) {
if (best==NULL)
best = siter;
best = &*siter;
else if(siter->w()*siter->h()<best->h()*best->w())
best = siter;
best = &*siter;
}
}
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
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.

View file

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