From: unknown Date: Sat, 8 Jun 2002 17:35:44 +0000 (+0000) Subject: This commit was manufactured by cvs2svn to create tag X-Git-Tag: openbox-1_2_3 X-Git-Url: http://git.openbox.org/?a=commitdiff_plain;h=77b6002e1bbdcca47dd55d73c009405b73a8d5cb;p=dana%2Fopenbox.git This commit was manufactured by cvs2svn to create tag 'openbox-1_2_3'. --- 77b6002e1bbdcca47dd55d73c009405b73a8d5cb diff --cc BUGS index 48032b48,00000000..e69de29b mode 100644,000000..100644 --- a/BUGS +++ b/BUGS diff --cc CHANGELOG index 00000000,ad395411..3e538218 mode 000000,100644..100644 --- a/CHANGELOG +++ b/CHANGELOG @@@ -1,0 -1,153 +1,201 @@@ + Changelog for Openbox: + -2.0.0: - * fix compliling with --disable-slit or --disable-nls. (Ben Jansens) ++1.2.3: ++ * properly map iconified windows, especially on ++ restart. (bbkeys stays iconified.) (Ben Jansens) + - * fixed sticky windows behavior. (Ben Jansens) ++ * fix bug where iconic sticky windows would randomly ++ not be iconified when they were mapped. (Ben Jansens) ++ ++ * snap windows to the slit as well as toolbar, and to ++ the screen edges also. (Only when Full Max is off.) (Ben Jansens) ++ ++ * new options: snap windows to other windows, and ++ snap windows to other windows' corners. (Ben Jansens) ++ ++ * fix some off-by-one window placement problems. (Ruhi Bloodworth) ++ ++ * Fix bug where bbtools could end up with an extra ++ window when deleting a sticky window. (Ben Jansens) ++ ++ * better allow windows to set sticky on startup. (Ben Jansens) ++ ++ * use a different method to focus the root window as ++ the focus fallback. (Ben Jansens) ++ ++1.2.2: ++ * ignore fully maximized windows while placing new ++ windows. (Ben Jansens) ++ ++ * change cascade's behavior to be less likely to place ++ over a window and to reset when the workspace is ++ empty. (Ben Jansens) ++ ++ * fixes for bsetroot support of Eterm/Esetroot atoms. (Ben Jansens) ++ ++ * make reconfigure save where you are in the menu ++ properly, and restore it as best it can (i.e. it ++ used to save only 1 level, now it saves them all). (Ben Jansens) ++ ++ * fix bug when removing a workspace with windows. (stl ++ misuse, an iterator became invalidated.) (Ben Jansens) ++ ++ * back out all changes for sticky windows as it is not ++ about to work. This will be implemented in the next ++ development series instead. Use a slightly improved ++ focus model for sticky windows, in the meantime. (Ben Jansens) ++ ++1.2.1: ++ * fix compiling with --disable-slit and --disable-nls. (Ben Jansens) ++ ++ * better sticky windows behavior. Sticky windows ++ appear in the window lists on all workspaces and ++ obey focus order rules on each workspace the same as ++ non-sticky windows. (Ben Jansens) + + * make reconfigure reset the timeout values for + windows, the slit, and the toolbar, so that a new + autoRaiseDelay value will take effect without having + to restart. (Ben Jansens) + + * fix for loading the autoRaiseDelay value. (Ben Jansens) + + 1.2.0: + * fix off-by-one window resizing bug. (Ben Jansens) + + * fix for slit menu not using the correct style when + the style changed. (Ben Jansens) + + * changed the menu from an rcfile option to a command- + line option. use 'openbox -menu ' to select an + alternate menu. The default menu used is + ~/.openbox/menu. If the default, or the file you + specify does not exist, the global menu is tried. + And if the global menu also does not exist, a + simple, internal menu is used instead. (Ben Jansens) + + * new version of bsetroot ported from blackbox cvs + with intent to support Eterm/Esetroot. (Sean Perry) + + * make bsetroot behave properly with Eterm/Esetroot. (Ben Jansens) + + * new version of bsetbg. (Timothy King) + + * fix the 'wrong window move' bug displayed by apps + such as bbkeys. (Sean Perry) + + * fix bug when removing and then readding a titlebar + button without restarting (by reconfiguring). (Ben Jansens) + + * more focus code changes. also fixes a segfault from + last round of focus changes. (Ben Jansens) + + * make image dithering value load correctly. (Ben Jansens) + + * fix segfault with multiple screens. (Sean Perry) + + 1.1.0: + * improved focused window logic to remove a segfault + when the focused window on an inactive workspace + closes, and focusLastWindow is enabled. (Ben Jansens) + + * bsetroot supports transparent applications by + setting the xrootpmap_id property on the root + window (Sean Perry) + + * added ClickMouse window placement algorithm/type. (Ben Jansens) + + * added UnderMouse window placement algorithm/type. (Ben Jansens) + + * improved logic for decorating windows when the + decoration level is changed (Ben Jansens) + + * fix positioning of the window menu (Ben Jansens) + + * 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) + + * better handling of the rc file and its configuration + options. The file is written each time an option in + the file is changed, instead of being written at + shutdown. This means that you can edit the file by + hand while in Openbox, and then choose reconfig or + restart to have it use the new rc file. (Ben Jansens) + + * added a runtime option for hiding the toolbar. (Scott Moynes) + + * made shaded windows edge-snap correctly to the + bottom for their size instead for their unshaded + size. (Ben Jansens) + + * added BestFit window placement algorithm/type. (Ruhi Bloodworth) + + * forced a redraw of the close button after pressing + it. Some applications (eg. acroread) ignore the + close request and you end up with a funky close + button. (Scott Moynes) + + * fix positioning of the window menu (Ben Jansens) + + 0.99.0: + * renamed header files from *.hh to *.h. (Ben Jansens) + + * fix clipping of the date/time in the toolbar with + proportional fonts. (Sean Perry, Ben Jansens) + + * added a --enable-clobber configuration option to + allow users to turn off the event clobbering by + hitting the numlock or scroll lock keys. (Scott Moynes) + + * window menu is inconsistant in that other menus + ignore mouse button 2, but it did not, because of + the maximize option. Now all options in the window + menu ignore mouse button 2 to be consistant. (Scott Moynes) + + * changed the default configuration file from + ~/.blackboxrc to ~/.openbox/rc. (Ben Jansens) + + * ignore fully-maximized windows when smart + placing windows. (Ben Jansens) + + * windows snaps to both sides of the screen's edge, + i.e. they have double the snapping area, half + inside and half outside the visible screen. (Ben Jansens) + + * a rootCommand per-screen in the rc file which + will override the rootCommand in styles for that + screen. (Ben Jansens) + + * rolling the mouse wheel on a window's title bar + will shade/unshade the window. rolling the mouse + wheel on the root window will change workspaces (John Kennis, Ben Jansens) + + * new button press/release code in Window class, + gives window buttons more consistent behavior. (Ben Jansens) + + * custom ordering of windows' titlebar elements + with a titlebarLayout option added to the + rc file (MrFab, Ben Jansens) + + * when resizing a window in non-opaque mode, fixed + the drawn rectangle so that it is drawn entirely + within the bounds of the new window. it used to + be drawn in the area of the window + 1. (Ben Jansens) + + * changed the background of the toolbar's workspace + label when it is being edited. The text color + being used was that of the active window label, + but the background remained that of the toolbar. + Changed to use the background of the active + window label. (Ben Jansens) + + * added windowZones to the rc file specifying + the number of zones to divide a window into for + alt-drag resizing, and code to resize windows + with the number of zones specified. (Nicolas Delon, Ben Jansens) + diff --cc CodingStyle index 00000000,00000000..729e37c0 new file mode 100644 --- /dev/null +++ b/CodingStyle @@@ -1,0 -1,0 +1,13 @@@ ++Openbox coding style: ++ ++2 space indent, expanded to spaces. No actual tab characters. ++ ++Braces do not get a \n before the top one, for example: ++ if () { ++ } ++ ++Put a space between an if/while/etc and the ()'s (see above example) ++ ++ ++If you see anythig not laid out, mention it and we can decide what is right and ++add it to this file! diff --cc Makefile.in index e1ddc32e,00000000..a1769664 mode 100644,000000..100644 --- a/Makefile.in +++ b/Makefile.in @@@ -1,381 -1,0 +1,376 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = . + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +AUTOMAKE_OPTIONS = foreign + +SUBDIRS = data doc nls src util +MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = version.h - DIST_COMMON = README ./stamp-h.in AUTHORS ChangeLog INSTALL Makefile.am \ ++DIST_COMMON = README ./stamp-h.in AUTHORS INSTALL Makefile.am \ +Makefile.in TODO aclocal.m4 config.h.in configure configure.in \ +install-sh missing mkinstalldirs version.h.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +$(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) + +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @echo timestamp > stamp-h 2> /dev/null +$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@$(srcdir)/stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/stamp-h.in; \ + $(MAKE) $(srcdir)/stamp-h.in; \ + else :; fi +$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOHEADER) + @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null + +mostlyclean-hdr: + +clean-hdr: + +distclean-hdr: + -rm -f config.h + +maintainer-clean-hdr: +version.h: $(top_builddir)/config.status version.h.in + cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + 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//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(PACKAGE)-$(VERSION) +top_distdir = $(distdir) + +# This target untars the dist file and tries a VPATH configuration. Then +# it guarantees that the distribution is self-contained by making another +# tarfile. +distcheck: dist + -rm -rf $(distdir) + GZIP=$(GZIP_ENV) $(TAR) zxf $(distdir).tar.gz + mkdir $(distdir)/=build + mkdir $(distdir)/=inst + dc_install_base=`cd $(distdir)/=inst && pwd`; \ + cd $(distdir)/=build \ + && ../configure --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --foreign Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +all-recursive-am: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-local +uninstall: uninstall-recursive +all-am: Makefile config.h +all-redirect: all-recursive-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-hdr clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-hdr distclean-tags distclean-generic clean-am \ + distclean-local + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ +install-data-recursive uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ +install-exec-am install-exec install-data-am install-data install-am \ +install uninstall-local uninstall-am uninstall all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +uninstall-local: + -rmdir $(pkgdatadir) + +distclean-local: + rm -f *\~ gmon.out + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc TODO index 90deacec,12111896..f155b740 --- a/TODO +++ b/TODO @@@ -1,16 -1,35 +1,35 @@@ - Openbox TODO list: + Goals for future releases of Openbox (THIS CAN AND WILL CHANGE): + 2.0: -* Add XEventHandler class to make event handling better than ever! ++* rewrite of the window manager. complete class reorganization and cleanup. ++ Separate X class layer (XDisplay/XScreen/XWindow/etc) which does all ++ interaction with the X server. - * add asserts all throughout the code to catch bugs. + * using std::string instead of char *'s. bool instead of Bool. proper consting + everywhere where appropriate. unsigned ints where appropriate. etc. + + * support for NETWM atoms + + * separate Font class with support for Xfonts, xfontsets, and xft. + + 3.0: -* reorganization of class model. Add XWidget class (contains an X drawable). - + * key/mouse/action bindings - * new configuration class which handles the X db, with better functionality. - i.e. make changes in the configuraiton save instantly, and stop saving over - the config file on shutdown/reconfig. + * break the themeing into a replaceable plugin/script of some form and possibly + also for the bindings. - * convert char *'s to stl's std::string. + 4.0: + * have plugins/scripts for most everything as deemed appropriate. + + Openbox TODO list: + * get translations for new NLS entries + + * make Escape key cancel moving/resizing a window + + * add asserts all throughout the code to catch bugs. - * make the toolbar a compile-time option so it can be disabled entirely. + * convert char *'s to stl's std::string. ?? this is a memory leak like no other! - * make it possible to cuycle workspaces by moving the mouse past the edge of + * make it possible to cycle workspaces by moving the mouse past the edge of the desktop? * make the wheel mouse functionality optional? diff --cc aclocal.m4 index 29290472,00000000..579ccff5 mode 100644,000000..100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@@ -1,160 -1,0 +1,160 @@@ - dnl aclocal.m4 generated automatically by aclocal 1.4-p5 ++dnl aclocal.m4 generated automatically by aclocal 1.4-p4 + - dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. ++dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. +dnl This file is free software; the Free Software Foundation +dnl gives unlimited permission to copy and/or distribute it, +dnl with or without modifications, as long as this notice is preserved. + +dnl This program is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +dnl PARTICULAR PURPOSE. + +# Do all the work for Automake. This macro actually does too much -- +# some checks are only needed if your package does certain things. +# But this isn't really a big deal. + +# serial 1 + +dnl Usage: +dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + - AC_DEFUN([AM_INIT_AUTOMAKE], ++AC_DEFUN(AM_INIT_AUTOMAKE, +[AC_REQUIRE([AC_PROG_INSTALL]) +PACKAGE=[$1] +AC_SUBST(PACKAGE) +VERSION=[$2] +AC_SUBST(VERSION) +dnl test to see if srcdir already configured +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) +fi +ifelse([$3],, +AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package]) +AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])) +AC_REQUIRE([AM_SANITY_CHECK]) +AC_REQUIRE([AC_ARG_PROGRAM]) +dnl FIXME This is truly gross. +missing_dir=`cd $ac_aux_dir && pwd` +AM_MISSING_PROG(ACLOCAL, aclocal, $missing_dir) +AM_MISSING_PROG(AUTOCONF, autoconf, $missing_dir) +AM_MISSING_PROG(AUTOMAKE, automake, $missing_dir) +AM_MISSING_PROG(AUTOHEADER, autoheader, $missing_dir) +AM_MISSING_PROG(MAKEINFO, makeinfo, $missing_dir) +AC_REQUIRE([AC_PROG_MAKE_SET])]) + +# +# Check to make sure that the build environment is sane. +# + - AC_DEFUN([AM_SANITY_CHECK], ++AC_DEFUN(AM_SANITY_CHECK, +[AC_MSG_CHECKING([whether build environment is sane]) +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "[$]*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "[$]*" != "X $srcdir/configure conftestfile" \ + && test "[$]*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken +alias in your environment]) + fi + + test "[$]2" = conftestfile + ) +then + # Ok. + : +else + AC_MSG_ERROR([newly created file is older than distributed files! +Check your system clock]) +fi +rm -f conftest* +AC_MSG_RESULT(yes)]) + +dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) +dnl The program must properly implement --version. - AC_DEFUN([AM_MISSING_PROG], ++AC_DEFUN(AM_MISSING_PROG, +[AC_MSG_CHECKING(for working $2) +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if ($2 --version) < /dev/null > /dev/null 2>&1; then + $1=$2 + AC_MSG_RESULT(found) +else + $1="$3/missing $2" + AC_MSG_RESULT(missing) +fi +AC_SUBST($1)]) + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + - AC_DEFUN([AM_MAINTAINER_MODE], ++AC_DEFUN(AM_MAINTAINER_MODE, +[AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +[ --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer], + USE_MAINTAINER_MODE=$enableval, + USE_MAINTAINER_MODE=no) + AC_MSG_RESULT($USE_MAINTAINER_MODE) + AM_CONDITIONAL(MAINTAINER_MODE, test $USE_MAINTAINER_MODE = yes) + MAINT=$MAINTAINER_MODE_TRUE + AC_SUBST(MAINT)dnl +] +) + +# Define a conditional. + - AC_DEFUN([AM_CONDITIONAL], ++AC_DEFUN(AM_CONDITIONAL, +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + - AC_DEFUN([AM_CONFIG_HEADER], ++AC_DEFUN(AM_CONFIG_HEADER, +[AC_PREREQ([2.12]) +AC_CONFIG_HEADER([$1]) +dnl When config.status generates a header, we must update the stamp-h file. +dnl This file resides in the same directory as the config header +dnl that is generated. We must strip everything past the first ":", +dnl and everything past the last "/". +AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl +ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, +<>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, +<>; do + case " <<$>>CONFIG_HEADERS " in + *" <<$>>am_file "*<<)>> + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx + ;; + esac + am_indx=`expr "<<$>>am_indx" + 1` +done<<>>dnl>>) +changequote([,]))]) + diff --cc autom4te.cache/output.0 index 2278bbf1,00000000..fa6bba89 mode 100644,000000..100644 --- a/autom4te.cache/output.0 +++ b/autom4te.cache/output.0 @@@ -1,6539 -1,0 +1,6541 @@@ +@%:@! /bin/sh +@%:@ Guess values for system-dependent variables and create Makefiles. +@%:@ Generated by GNU Autoconf 2.53. +@%:@ +@%:@ Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +@%:@ Free Software Foundation, Inc. +@%:@ This configure script is free software; the Free Software Foundation +@%:@ gives unlimited permission to copy, distribute and modify it. + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + + +# Name of the host. +# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +# so uname gets run too. +ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` + +exec 6>&1 + +# +# Initializations. +# +ac_default_prefix=/usr/local +cross_compiling=no +subdirs= +MFLAGS= +MAKEFLAGS= +SHELL=${CONFIG_SHELL-/bin/sh} + +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + +# Identity of this package. +PACKAGE_NAME= +PACKAGE_TARNAME= +PACKAGE_VERSION= +PACKAGE_STRING= +PACKAGE_BUGREPORT= + +ac_unique_file="src/openbox.cc" +# Factoring default headers for most tests. +ac_includes_default="\ +#include +#if HAVE_SYS_TYPES_H +# include +#endif +#if HAVE_SYS_STAT_H +# include +#endif +#if STDC_HEADERS +# include +# include +#else +# if HAVE_STDLIB_H +# include +# endif +#endif +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H +# include +# endif +# include +#endif +#if HAVE_STRINGS_H +# include +#endif +#if HAVE_INTTYPES_H +# include +#else +# if HAVE_STDINT_H +# include +# endif +#endif +#if HAVE_UNISTD_H +# include +#endif" + + +# Initialize some variables set by options. +ac_init_help= +ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. +cache_file=/dev/null +exec_prefix=NONE +no_create= +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= +verbose= +x_includes=NONE +x_libraries=NONE + +# Installation directory options. +# These are left unexpanded so users can "make install exec_prefix=/foo" +# and all the variables that are supposed to be based on exec_prefix +# by default will actually change. +# Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + +ac_prev= +for ac_option +do + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + + # Accept the important Cygnus configure options, so we can diagnose typos. + + case $ac_option in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) + bindir=$ac_optarg ;; + + -build | --build | --buil | --bui | --bu) + ac_prev=build_alias ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + build_alias=$ac_optarg ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) + cache_file=$ac_optarg ;; + + --config-cache | -C) + cache_file=config.cache ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir=$ac_optarg ;; + + -disable-* | --disable-*) + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; + + -enable-* | --enable-*) + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + { (exit 1); exit 1; }; } + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) + exec_prefix=$ac_optarg ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + + -help | --help | --hel | --he | -h) + ac_init_help=long ;; + -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) + ac_init_help=recursive ;; + -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) + ac_init_help=short ;; + + -host | --host | --hos | --ho) + ac_prev=host_alias ;; + -host=* | --host=* | --hos=* | --ho=*) + host_alias=$ac_optarg ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) + includedir=$ac_optarg ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) + infodir=$ac_optarg ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) + libdir=$ac_optarg ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) + libexecdir=$ac_optarg ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + localstatedir=$ac_optarg ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) + mandir=$ac_optarg ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) + oldincludedir=$ac_optarg ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) + prefix=$ac_optarg ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) + program_prefix=$ac_optarg ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) + program_suffix=$ac_optarg ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) + program_transform_name=$ac_optarg ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) + sbindir=$ac_optarg ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) + sharedstatedir=$ac_optarg ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) + site=$ac_optarg ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) + srcdir=$ac_optarg ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) + sysconfdir=$ac_optarg ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) + ac_prev=target_alias ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target_alias=$ac_optarg ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers | -V) + ac_init_version=: ;; + + -with-* | --with-*) + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + # Reject names that are not valid shell variable names. + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 + { (exit 1); exit 1; }; } + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) + x_includes=$ac_optarg ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) + x_libraries=$ac_optarg ;; + + -*) { echo "$as_me: error: unrecognized option: $ac_option +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; } + ;; + + *=*) + ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` + # Reject names that are not valid shell variable names. + expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { (exit 1); exit 1; }; } + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" + export $ac_envvar ;; + + *) + # FIXME: should be removed in autoconf 3.0. + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} + ;; + + esac +done + +if test -n "$ac_prev"; then + ac_option=--`echo $ac_prev | sed 's/_/-/g'` + { echo "$as_me: error: missing argument to $ac_option" >&2 + { (exit 1); exit 1; }; } +fi + +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# There might be people who depend on the old broken behavior: `$host' +# used to hold the argument of --host etc. +# FIXME: To remove some day. +build=$build_alias +host=$host_alias +target=$target_alias + +# FIXME: To remove some day. +if test "x$host_alias" != x; then + if test "x$build_alias" = x; then + cross_compiling=maybe + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + If a cross compiler is detected then cross compile mode will be used." >&2 + elif test "x$build_alias" != "x$host_alias"; then + cross_compiling=yes + fi +fi + +ac_tool_prefix= +test -n "$host_alias" && ac_tool_prefix=$host_alias- + +test "$silent" = yes && exec 6>/dev/null + + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$0" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 + { (exit 1); exit 1; }; } + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { (exit 1); exit 1; }; } + fi +fi +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CXX_set=${CXX+set} +ac_env_CXX_value=$CXX +ac_cv_env_CXX_set=${CXX+set} +ac_cv_env_CXX_value=$CXX +ac_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_env_CXXFLAGS_value=$CXXFLAGS +ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} +ac_cv_env_CXXFLAGS_value=$CXXFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP + +# +# Report the --help message. +# +if test "$ac_init_help" = "long"; then + # Omit some internal or obsolete options to make the list less imposing. + # This message is too long to be a string in the A/UX 3.1 sh. + cat <<_ACEOF +\`configure' configures this package to adapt to many kinds of systems. + +Usage: $0 [OPTION]... [VAR=VALUE]... + +To assign environment variables (e.g., CC, CFLAGS...), specify them as +VAR=VALUE. See below for descriptions of some of the useful variables. + +Defaults for the options are specified in brackets. + +Configuration: + -h, --help display this help and exit + --help=short display options specific to this package + --help=recursive display the short help of all the included packages + -V, --version display version information and exit + -q, --quiet, --silent do not print \`checking...' messages + --cache-file=FILE cache test results in FILE [disabled] + -C, --config-cache alias for \`--cache-file=config.cache' + -n, --no-create do not create output files + --srcdir=DIR find the sources in DIR [configure dir or \`..'] + +_ACEOF + + cat <<_ACEOF +Installation directories: + --prefix=PREFIX install architecture-independent files in PREFIX + [$ac_default_prefix] + --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX + [PREFIX] + +By default, \`make install' will install all the files in +\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +an installation prefix other than \`$ac_default_prefix' using \`--prefix', +for instance \`--prefix=\$HOME'. + +For better control, use the options below. + +Fine tuning of the installation directories: + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] +_ACEOF + + cat <<\_ACEOF + +Program names: + --program-prefix=PREFIX prepend PREFIX to installed program names + --program-suffix=SUFFIX append SUFFIX to installed program names + --program-transform-name=PROGRAM run sed PROGRAM on installed program names + +X features: + --x-includes=DIR X include files are in DIR + --x-libraries=DIR X library files are in DIR +_ACEOF +fi + +if test -n "$ac_init_help"; then + + cat <<\_ACEOF + +Optional Features: + --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) + --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-shape enable support of the XShape extension default=yes + --enable-slit include code for the Slit default=yes + --enable-newspec include code for the new WM Spec (DOES NOTHING) + default=no + --enable-interlace include code for image interlacing default=yes + --enable-ordered-pseudo include code for ordered pseudocolor (8bpp) + dithering default=no + --enable-clobber intercept mouse events to clients when num lock + or scroll lock are on default=yes + --enable-debug include verbose debugging code default=no + --enable-nls include natural language support default=yes + --enable-timed-cache use new timed pixmap cache default=yes + --enable-maintainer-mode enable make rules and dependencies not useful + (and sometimes confusing) to the casual installer + +Optional Packages: + --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] + --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) + --with-x use the X Window System + +Some influential environment variables: + CC C compiler command + CFLAGS C compiler flags + LDFLAGS linker flags, e.g. -L if you have libraries in a + nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory + CXX C++ compiler command + CXXFLAGS C++ compiler flags + CPP C preprocessor + +Use these variables to override the choices made by `configure' or to help +it to find libraries and programs with nonstandard names/locations. + +_ACEOF +fi + +if test "$ac_init_help" = "recursive"; then + # If there are subdirs, report their specific --help. + ac_popdir=`pwd` + for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue + test -d $ac_dir || continue + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help + else + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + fi + cd $ac_popdir + done +fi + +test -n "$ac_init_help" && exit 0 +if $ac_init_version; then + cat <<\_ACEOF + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +Free Software Foundation, Inc. +This configure script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it. +_ACEOF + exit 0 +fi +exec 5>config.log +cat >&5 <<_ACEOF +This file contains any messages produced by compilers while +running configure, to aid debugging if configure makes a mistake. + +It was created by $as_me, which was +generated by GNU Autoconf 2.53. Invocation command line was + + $ $0 $@ + +_ACEOF +{ +cat <<_ASUNAME +@%:@@%:@ --------- @%:@@%:@ +@%:@@%:@ Platform. @%:@@%:@ +@%:@@%:@ --------- @%:@@%:@ + +hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +uname -m = `(uname -m) 2>/dev/null || echo unknown` +uname -r = `(uname -r) 2>/dev/null || echo unknown` +uname -s = `(uname -s) 2>/dev/null || echo unknown` +uname -v = `(uname -v) 2>/dev/null || echo unknown` + +/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` + +/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` + +_ASUNAME + +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + echo "PATH: $as_dir" +done + +} >&5 + +cat >&5 <<_ACEOF + + +@%:@@%:@ ----------- @%:@@%:@ +@%:@@%:@ Core tests. @%:@@%:@ +@%:@@%:@ ----------- @%:@@%:@ + +_ACEOF + + +# Keep a trace of the command line. +# Strip out --no-create and --no-recursion so they do not pile up. +# Also quote any args containing shell meta-characters. +ac_configure_args= +ac_sep= +for ac_arg +do + case $ac_arg in + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ + | --no-cr | --no-c | -n ) continue ;; + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + continue ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + ac_sep=" " ;; + esac + # Get rid of the leading space. +done + +# When interrupted or exit'd, cleanup temporary files, and complete +# config.log. We remove comments because anyway the quotes in there +# would cause problems or look ugly. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. +trap 'exit_status=$? + # Save into config.log some information that might help in debugging. + { + echo + cat <<\_ASBOX +@%:@@%:@ ---------------- @%:@@%:@ +@%:@@%:@ Cache variables. @%:@@%:@ +@%:@@%:@ ---------------- @%:@@%:@ +_ASBOX + echo + # The following way of writing the cache mishandles newlines in values, +{ + (set) 2>&1 | + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) + sed -n \ + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" + ;; + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} + echo + if test -s confdefs.h; then + cat <<\_ASBOX +@%:@@%:@ ----------- @%:@@%:@ +@%:@@%:@ confdefs.h. @%:@@%:@ +@%:@@%:@ ----------- @%:@@%:@ +_ASBOX + echo + sed "/^$/d" confdefs.h + echo + fi + test "$ac_signal" != 0 && + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" + } >&5 + rm -f core core.* *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && + exit $exit_status + ' 0 +for ac_signal in 1 2 13 15; do + trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +done +ac_signal=0 + +# confdefs.h avoids OS command line length limits that DEFS can exceed. +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h + +# Predefined preprocessor variables. + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_NAME "$PACKAGE_NAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_TARNAME "$PACKAGE_TARNAME" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_VERSION "$PACKAGE_VERSION" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_STRING "$PACKAGE_STRING" +_ACEOF + + +cat >>confdefs.h <<_ACEOF +@%:@define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +_ACEOF + + +# Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} + sed 's/^/| /' "$ac_site_file" >&5 + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + # Some versions of bash will fail to source /dev/null (special + # files actually), so we avoid doing that. + if test -f "$cache_file"; then + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} + case $cache_file in + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; + esac + fi +else + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} + >$cache_file +fi + +# Check that the precious variables saved in the cache have kept the same +# value. +ac_cache_corrupted=false +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do + eval ac_old_set=\$ac_cv_env_${ac_var}_set + eval ac_new_set=\$ac_env_${ac_var}_set + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" + case $ac_old_set,$ac_new_set in + set,) + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,set) + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + ac_cache_corrupted=: ;; + ,);; + *) + if test "x$ac_old_val" != "x$ac_new_val"; then + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: + fi;; + esac + # Pass precious variables to config.status. + if test "$ac_new_set" = set; then + case $ac_new_val in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *) ac_arg=$ac_var=$ac_new_val ;; + esac + case " $ac_configure_args " in + *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. + *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; + esac + fi +done +if $ac_cache_corrupted; then + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + + + + + + + + + + + + + + + + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break + elif test -f $ac_dir/shtool; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/shtool install -c" + break + fi +done +if test -z "$ac_aux_dir"; then + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { (exit 1); exit 1; }; } +fi +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo "$as_me:$LINENO: checking whether build environment is sane" >&5 +echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". + { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&5 +echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken +alias in your environment" >&2;} + { (exit 1); exit 1; }; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else + { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! +Check your system clock" >&5 +echo "$as_me: error: newly created file is older than distributed files! +Check your system clock" >&2;} + { (exit 1); exit 1; }; } +fi +rm -f conftest* +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 +test "$program_prefix" != NONE && + program_transform_name="s,^,$program_prefix,;$program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + program_transform_name="s,\$,$program_suffix,;$program_transform_name" +# Double any \ or $. echo might interpret backslashes. +# By default was `s,x,x', remove it if useless. +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm conftest.sed + +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.make <<\_ACEOF +all: + @echo 'ac_maketemp="${MAKE}"' +_ACEOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi +rm -f conftest.make +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SET_MAKE= +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=openbox + - VERSION=0.99.0 ++VERSION=1.0.0 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 +echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} + { (exit 1); exit 1; }; } +fi + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo "$as_me:$LINENO: checking for working aclocal" >&5 +echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:$LINENO: checking for working autoconf" >&5 +echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:$LINENO: checking for working automake" >&5 +echo $ECHO_N "checking for working automake... $ECHO_C" >&6 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:$LINENO: checking for working autoheader" >&5 +echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + +echo "$as_me:$LINENO: checking for working makeinfo" >&5 +echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo + echo "$as_me:$LINENO: result: found" >&5 +echo "${ECHO_T}found" >&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$as_me:$LINENO: result: missing" >&5 +echo "${ECHO_T}missing" >&6 +fi + + + +test x$prefix = "xNONE" && prefix="$ac_default_prefix" + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +set dummy ${ac_tool_prefix}gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "gcc", so it can be a program name with args. +set dummy gcc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="gcc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +set dummy ${ac_tool_prefix}cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="${ac_tool_prefix}cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + +fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else + ac_prog_rejected=no +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then + ac_prog_rejected=yes + continue + fi + ac_cv_prog_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift + if test $@%:@ != 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift + set dummy "$as_dir/$ac_word" ${1+"$@"} + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$CC"; then + if test -n "$ac_tool_prefix"; then + for ac_prog in cl + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CC="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CC=$ac_cv_prog_CC +if test -n "$CC"; then + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CC" && break + done +fi +if test -z "$CC"; then + ac_ct_CC=$CC + for ac_prog in cl +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CC" && break +done + + CC=$ac_ct_CC +fi + +fi + + +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 +echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} + { (exit 1); exit 1; }; } + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files a.out a.exe" +# Try to create an executable without -o first, disregard a.out. +# It will help us diagnose broken compilers, and finding out an intuition +# of exeext. +echo "$as_me:$LINENO: checking for C compiler default output" >&5 +echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; + ls a.out conftest 2>/dev/null; + ls a.* conftest.* 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; + a.out ) # We found the default executable, but exeext='' is most + # certainly right. + break;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool --akim. + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 +echo "$as_me: error: C compiler cannot create executables" >&2;} + { (exit 77); exit 77; }; } +fi + +ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 + +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +# If not cross compiling, check that we can run a simple program. +if test "$cross_compiling" != yes; then + if { ac_try='./$ac_file' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cross_compiling=no + else + if test "$cross_compiling" = maybe; then + cross_compiling=yes + else + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&5 +echo "$as_me: error: cannot run C compiled programs. +If you meant to cross compile, use \`--host'." >&2;} + { (exit 1); exit 1; }; } + fi + fi +fi +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + +rm -f a.out a.exe conftest$ac_cv_exeext +ac_clean_files=$ac_clean_files_save +# Check the compiler produces executables we can run. If not, either +# the compiler is broken, or we cross compile. +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 + +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + # If both `conftest.exe' and `conftest' are `present' (well, observable) +# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +# work properly (i.e., refer to `conftest.exe'), while it won't with +# `rm'. +for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext + break;; + * ) break;; + esac +done +else + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 + +rm -f conftest.$ac_ext +EXEEXT=$ac_cv_exeext +ac_exeext=$EXEEXT +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +if test "${ac_cv_objext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.o conftest.obj +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; then + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` + break;; + esac +done +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 +echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} + { (exit 1); exit 1; }; } +fi + +rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 +OBJEXT=$ac_cv_objext +ac_objext=$OBJEXT +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +if test "${ac_cv_c_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_c_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +GCC=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CFLAGS=${CFLAGS+set} +ac_save_CFLAGS=$CFLAGS +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cc_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +if test "$ac_test_CFLAGS" = set; then + CFLAGS=$ac_save_CFLAGS +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +@%:@ifndef __cplusplus + choke me +@%:@endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +ac_ext=cc +ac_cpp='$CXXCPP $CPPFLAGS' +ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_cxx_compiler_gnu +if test -n "$ac_tool_prefix"; then + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC + do + # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +CXX=$ac_cv_prog_CXX +if test -n "$CXX"; then + echo "$as_me:$LINENO: result: $CXX" >&5 +echo "${ECHO_T}$CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CXX" && break + done +fi +if test -z "$CXX"; then + ac_ct_CXX=$CXX + for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CXX"; then + ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CXX="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +ac_ct_CXX=$ac_cv_prog_ac_ct_CXX +if test -n "$ac_ct_CXX"; then + echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 +echo "${ECHO_T}$ac_ct_CXX" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ac_ct_CXX" && break +done +test -n "$ac_ct_CXX" || ac_ct_CXX="g++" + + CXX=$ac_ct_CXX +fi + + +# Provide some information about the compiler. +echo "$as_me:$LINENO:" \ + "checking for C++ compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } + +echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 +if test "${ac_cv_cxx_compiler_gnu+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +#ifndef __GNUC__ + choke me +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_compiler_gnu=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_compiler_gnu=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +ac_cv_cxx_compiler_gnu=$ac_compiler_gnu + +fi +echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 +GXX=`test $ac_compiler_gnu = yes && echo yes` +ac_test_CXXFLAGS=${CXXFLAGS+set} +ac_save_CXXFLAGS=$CXXFLAGS +CXXFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 +echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 +if test "${ac_cv_prog_cxx_g+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cxx_g=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_prog_cxx_g=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 +if test "$ac_test_CXXFLAGS" = set; then + CXXFLAGS=$ac_save_CXXFLAGS +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi +for ac_declaration in \ + ''\ + '#include ' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +continue +fi +rm -f conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_declaration +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install +# AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +if test -z "$INSTALL"; then +if test "${ac_cv_path_install+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + # Account for people who put trailing slashes in PATH elements. +case $as_dir/ in + ./ | .// | /cC/* | \ + /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ + /usr/ucb/* ) ;; + *) + # OSF1 and SCO ODT 3.0 have their own names for install. + # Don't use installbsd from OSF since it installs stuff as root + # by default. + for ac_prog in ginstall scoinst install; do + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if test $ac_prog = install && + grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # AIX install. It has an incompatible calling convention. + : + elif test $ac_prog = install && + grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then + # program-specific install script used by HP pwplus--don't use. + : + else + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi + fi + done + done + ;; +esac +done + + +fi + if test "${ac_cv_path_install+set}" = set; then + INSTALL=$ac_cv_path_install + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. + INSTALL=$ac_install_sh + fi +fi +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + +test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +for ac_prog in sed +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_regex_cmd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$regex_cmd"; then + ac_cv_prog_regex_cmd="$regex_cmd" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_regex_cmd="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +regex_cmd=$ac_cv_prog_regex_cmd +if test -n "$regex_cmd"; then + echo "$as_me:$LINENO: result: $regex_cmd" >&5 +echo "${ECHO_T}$regex_cmd" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$regex_cmd" && break +done + +if test x$regex_cmd = "x"; then + { { echo "$as_me:$LINENO: error: error. sed is required to build the default menu file." >&5 +echo "$as_me: error: error. sed is required to build the default menu file." >&2;} + { (exit 1); exit 1; }; } +fi + + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then + if test "${ac_cv_prog_CPP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Double quotes because CPP needs to be expanded + for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" + do + ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + break +fi + + done + ac_cv_prog_CPP=$CPP + +fi + CPP=$ac_cv_prog_CPP +else + ac_cv_prog_CPP=$CPP +fi +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 +ac_preproc_ok=false +for ac_c_preproc_warn_flag in '' yes +do + # Use a header file that comes with gcc, so configuring glibc + # with a fresh cross-compiler works. + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. "Syntax error" is here to catch this case. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include + Syntax error +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + : +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Broken: fails on valid input. +continue +fi +rm -f conftest.err conftest.$ac_ext + + # OK, works on sane cases. Now check whether non-existent headers + # can be detected and how. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # Broken: success on invalid input. +continue +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + # Passes both tests. +ac_preproc_ok=: +break +fi +rm -f conftest.err conftest.$ac_ext + +done +# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +rm -f conftest.err conftest.$ac_ext +if $ac_preproc_ok; then + : +else + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} + { (exit 1); exit 1; }; } +fi + +ac_ext=c +ac_cpp='$CPP $CPPFLAGS' +ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +ac_compiler_gnu=$ac_cv_c_compiler_gnu + + +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +if test "${ac_cv_header_stdc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include +#include + +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_cv_header_stdc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_cv_header_stdc=no +fi +rm -f conftest.err conftest.$ac_ext + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include + +_ACEOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. + if test "$cross_compiling" = yes; then + : +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#if ((' ' & 0x0FF) == 0x020) +# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#else +# define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ + || ('j' <= (c) && (c) <= 'r') \ + || ('s' <= (c) && (c) <= 'z')) +# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +#endif + +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int +main () +{ + int i; + for (i = 0; i < 256; i++) + if (XOR (islower (i), ISLOWER (i)) + || toupper (i) != TOUPPER (i)) + exit(2); + exit (0); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +( exit $ac_status ) +ac_cv_header_stdc=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 +if test $ac_cv_header_stdc = yes; then + +cat >>confdefs.h <<\_ACEOF +@%:@define STDC_HEADERS 1 +_ACEOF + +fi + +# On IRIX 5.3, sys/types and inttypes.h are conflicting. + + + + + + + + + +for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default + +@%:@include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Header=no" +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + + + + + + + + + + + + + + + + + + + + + - for ac_header in ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.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 ++ ++ ++for ac_header in 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 +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +else + # Is the header compilable? +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +$ac_includes_default +@%:@include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_header_compiler=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 + +# Is the header present? +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include <$ac_header> +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + ac_header_preproc=no +fi +rm -f conftest.err conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc in + yes:no ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; + no:yes ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +esac +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=$ac_header_preproc" +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +fi + +done + +echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 +echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 +if test "${ac_cv_header_time+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +if ((struct tm *) 0) +return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_time=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_header_time=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 +echo "${ECHO_T}$ac_cv_header_time" >&6 +if test $ac_cv_header_time = yes; then + +cat >>confdefs.h <<\_ACEOF +@%:@define TIME_WITH_SYS_TIME 1 +_ACEOF + +fi + + + +for ac_func in basename +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +else + echo "$as_me:$LINENO: checking for basename in -lgen" >&5 +echo $ECHO_N "checking for basename in -lgen... $ECHO_C" >&6 +if test "${ac_cv_lib_gen_basename+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgen $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char basename (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +basename (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gen_basename=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gen_basename=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_gen_basename" >&5 +echo "${ECHO_T}$ac_cv_lib_gen_basename" >&6 +if test $ac_cv_lib_gen_basename = yes; then + cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_BASENAME 1 +_ACEOF + LIBS="$LIBS -lgen" +fi + +fi +done + + + + + + + + + + + +for ac_func in getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +@%:@define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + +echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 +echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_t_open+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char t_open (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +t_open (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_t_open=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_nsl_t_open=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6 +if test $ac_cv_lib_nsl_t_open = yes; then + LIBS="$LIBS -lnsl" +fi + +echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 +echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_socket+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +socket (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_socket=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_socket_socket=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 +if test $ac_cv_lib_socket_socket = yes; then + LIBS="$LIBS -lsocket" +fi + + +echo "$as_me:$LINENO: checking for X" >&5 +echo $ECHO_N "checking for X... $ECHO_C" >&6 + + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" + +fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else + if test "${ac_cv_have_x+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # One or both of the vars are not set, and there is no cached value. +ac_x_includes=no ac_x_libraries=no +rm -fr conftest.dir +if mkdir conftest.dir; then + cd conftest.dir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat >Imakefile <<'_ACEOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +_ACEOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && + test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. + case $ac_im_incroot in + /usr/include) ;; + *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; + esac + case $ac_im_usrlibdir in + /usr/lib | /lib) ;; + *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; + esac + fi + cd .. + rm -fr conftest.dir +fi + +# Standard set of common directories for X headers. +# Check X11 before X11Rn because it is often a symlink to the current release. +ac_x_header_dirs=' +/usr/X11/include +/usr/X11R6/include +/usr/X11R5/include +/usr/X11R4/include + +/usr/include/X11 +/usr/include/X11R6 +/usr/include/X11R5 +/usr/include/X11R4 + +/usr/local/X11/include +/usr/local/X11R6/include +/usr/local/X11R5/include +/usr/local/X11R4/include + +/usr/local/include/X11 +/usr/local/include/X11R6 +/usr/local/include/X11R5 +/usr/local/include/X11R4 + +/usr/X386/include +/usr/x386/include +/usr/XFree86/include/X11 + +/usr/include +/usr/local/include +/usr/unsupported/include +/usr/athena/include +/usr/local/x11r5/include +/usr/lpp/Xamples/include + +/usr/openwin/include +/usr/openwin/share/include' + +if test "$ac_x_includes" = no; then + # Guess where to find include files, by looking for Intrinsic.h. + # First, try using that file with no special directory specified. + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include +_ACEOF +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + # We can compile using X headers with no special include directory. +ac_x_includes= +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + for ac_dir in $ac_x_header_dirs; do + if test -r "$ac_dir/X11/Intrinsic.h"; then + ac_x_includes=$ac_dir + break + fi +done +fi +rm -f conftest.err conftest.$ac_ext +fi # $ac_x_includes = no + +if test "$ac_x_libraries" = no; then + # Check for the libraries. + # See if we find them without any special options. + # Don't add to $LIBS permanently. + ac_save_LIBS=$LIBS + LIBS="-lXt $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +@%:@include +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +XtMalloc (0) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + LIBS=$ac_save_LIBS +# We can link X programs with no special library path. +ac_x_libraries= +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +LIBS=$ac_save_LIBS +for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` +do + # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do + if test -r $ac_dir/libXt.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi # $ac_x_libraries = no + +if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi + + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then + echo "$as_me:$LINENO: result: $have_x" >&5 +echo "${ECHO_T}$have_x" >&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" + echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 +echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. + +cat >>confdefs.h <<\_ACEOF +@%:@define X_DISPLAY_MISSING 1 +_ACEOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . + case `(uname -sr) 2>/dev/null` in + "SunOS 5"*) + echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 +echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 + ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_nospace=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_R_nospace=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + if test $ac_R_nospace = yes; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_R_space=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_R_space=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + if test $ac_R_space = yes; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$as_me:$LINENO: result: neither works" >&5 +echo "${ECHO_T}neither works" >&6 + fi + fi + LIBS=$ac_xsave_LIBS + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else + # Martyn Johnson says this is needed for Ultrix, if the X + # libraries were built with DECnet support. And Karl Berry says + # the Alpha needs dnet_stub (dnet does not exist). + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XOpenDisplay (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dnet_dnet_ntoa=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then + echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 +echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 +if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-ldnet_stub $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char dnet_ntoa (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +dnet_ntoa (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_dnet_stub_dnet_ntoa=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_dnet_stub_dnet_ntoa=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 +echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 +if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" +fi + + fi +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display + # on Irix 5.2, according to T.E. Dickey. + # The functions gethostbyname, getservbyname, and inet_addr are + # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. + echo "$as_me:$LINENO: checking for gethostbyname" >&5 +echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 +if test "${ac_cv_func_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else +f = gethostbyname; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 + + if test $ac_cv_func_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 +echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 +if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnsl $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_nsl_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_nsl_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 +if test $ac_cv_lib_nsl_gethostbyname = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +fi + + if test $ac_cv_lib_nsl_gethostbyname = no; then + echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 +echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 +if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lbsd $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +gethostbyname (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_bsd_gethostbyname=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_bsd_gethostbyname=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 +echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 +if test $ac_cv_lib_bsd_gethostbyname = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" +fi + + fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary + # on later versions), says Simon Leinen: it contains gethostby* + # variants that don't use the nameserver (or something). -lsocket + # must be given before -lnsl if both are needed. We assume that + # if connect needs -lnsl, so does gethostbyname. + echo "$as_me:$LINENO: checking for connect" >&5 +echo $ECHO_N "checking for connect... $ECHO_C" >&6 +if test "${ac_cv_func_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else +f = connect; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_connect=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 +echo "${ECHO_T}$ac_cv_func_connect" >&6 + + if test $ac_cv_func_connect = no; then + echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 +echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 +if test "${ac_cv_lib_socket_connect+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +connect (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_socket_connect=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_socket_connect=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 +echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 +if test $ac_cv_lib_socket_connect = yes; then + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" +fi + + fi + + # Guillermo Gomez says -lposix is necessary on A/UX. + echo "$as_me:$LINENO: checking for remove" >&5 +echo $ECHO_N "checking for remove... $ECHO_C" >&6 +if test "${ac_cv_func_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_remove) || defined (__stub___remove) +choke me +#else +f = remove; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_remove=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_remove=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 +echo "${ECHO_T}$ac_cv_func_remove" >&6 + + if test $ac_cv_func_remove = no; then + echo "$as_me:$LINENO: checking for remove in -lposix" >&5 +echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 +if test "${ac_cv_lib_posix_remove+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lposix $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +remove (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_posix_remove=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_posix_remove=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 +echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 +if test $ac_cv_lib_posix_remove = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. + echo "$as_me:$LINENO: checking for shmat" >&5 +echo $ECHO_N "checking for shmat... $ECHO_C" >&6 +if test "${ac_cv_func_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat (); below. */ +#include +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat (); +char (*f) (); + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shmat) || defined (__stub___shmat) +choke me +#else +f = shmat; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_shmat=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_shmat=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 +echo "${ECHO_T}$ac_cv_func_shmat" >&6 + + if test $ac_cv_func_shmat = no; then + echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 +echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 +if test "${ac_cv_lib_ipc_shmat+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lipc $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +shmat (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ipc_shmat=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_ipc_shmat=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 +echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 +if test $ac_cv_lib_ipc_shmat = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. + ac_save_LDFLAGS=$LDFLAGS + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. + # John Interrante, Karl Berry + echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 +echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 +if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lICE $X_EXTRA_LIBS $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char IceConnectionNumber (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +IceConnectionNumber (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_ICE_IceConnectionNumber=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_ICE_IceConnectionNumber=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 +echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 +if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" +fi + + LDFLAGS=$ac_save_LDFLAGS + +fi + + +test x$no_x = "xyes" && { { echo "$as_me:$LINENO: error: Openbox requires the X Window System libraries and headers." >&5 +echo "$as_me: error: Openbox requires the X Window System libraries and headers." >&2;} + { (exit 1); exit 1; }; } + +test x$x_includes = "x" && x_includes="/usr/include" +test x$x_libraries = "x" && x_libraries="/usr/lib" + +CFLAGS="$CFLAGS $X_CFLAGS" +CXXFLAGS="$CXXFLAGS $X_CFLAGS" +LIBS="$LIBS $X_LIBS" +LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS" + +echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 +echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 +if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lX11 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XOpenDisplay (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +XOpenDisplay (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_X11_XOpenDisplay=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_X11_XOpenDisplay=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 +echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 +if test $ac_cv_lib_X11_XOpenDisplay = yes; then + LIBS="$LIBS -lX11" +else + { { echo "$as_me:$LINENO: error: Could not find XOpenDisplay in -lX11." >&5 +echo "$as_me: error: Could not find XOpenDisplay in -lX11." >&2;} + { (exit 1); exit 1; }; } + +fi + + +LIBS="$LIBS $X_EXTRA_LIBS" + +Xext_lib="" + +SHAPE="" +echo "$as_me:$LINENO: checking whether to build support for the XShape extension" >&5 +echo $ECHO_N "checking whether to build support for the XShape extension... $ECHO_C" >&6 +# Check whether --enable-shape or --disable-shape was given. +if test "${enable_shape+set}" = set; then + enableval="$enable_shape" + +fi; + +: ${enableval="yes"} +if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + echo "$as_me:$LINENO: checking for XShapeCombineShape in -lXext" >&5 +echo $ECHO_N "checking for XShapeCombineShape in -lXext... $ECHO_C" >&6 +if test "${ac_cv_lib_Xext_XShapeCombineShape+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXext $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XShapeCombineShape (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +XShapeCombineShape (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xext_XShapeCombineShape=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_Xext_XShapeCombineShape=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeCombineShape" >&5 +echo "${ECHO_T}$ac_cv_lib_Xext_XShapeCombineShape" >&6 +if test $ac_cv_lib_Xext_XShapeCombineShape = yes; then + echo "$as_me:$LINENO: checking for X11/extensions/shape.h" >&5 +echo $ECHO_N "checking for X11/extensions/shape.h... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +long foo = ShapeSet + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SHAPE="-DSHAPE"; Xext_lib="-lXext" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +fi + +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + +LIBS="$LIBS $Xext_lib" + +SLIT="" +echo "$as_me:$LINENO: checking whether to include the Slit" >&5 +echo $ECHO_N "checking whether to include the Slit... $ECHO_C" >&6 +# Check whether --enable-slit or --disable-slit was given. +if test "${enable_slit+set}" = set; then + enableval="$enable_slit" + if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SLIT="-DSLIT" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SLIT="-DSLIT" + +fi; + + +NEWWMSPEC="" +echo "$as_me:$LINENO: checking whether to include the new WM Spec (DOES NOTHING)" >&5 +echo $ECHO_N "checking whether to include the new WM Spec (DOES NOTHING)... $ECHO_C" >&6 +# Check whether --enable-newspec or --disable-newspec was given. +if test "${enable_newspec+set}" = set; then + enableval="$enable_newspec" + if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + NEWWMSPEC="-DNEWWMSPEC" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi; + + + +INTERLACE="" +echo "$as_me:$LINENO: checking whether to include interlacing image code" >&5 +echo $ECHO_N "checking whether to include interlacing image code... $ECHO_C" >&6 +# Check whether --enable-interlace or --disable-interlace was given. +if test "${enable_interlace+set}" = set; then + enableval="$enable_interlace" + if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + INTERLACE="-DINTERLACE" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + INTERLACE="-DINTERLACE" + +fi; + + +ORDEREDPSEUDO="" +echo "$as_me:$LINENO: checking whether to include Pseudocolor ordered dithering code" >&5 +echo $ECHO_N "checking whether to include Pseudocolor ordered dithering code... $ECHO_C" >&6 +# Check whether --enable-ordered-pseudo or --disable-ordered-pseudo was given. +if test "${enable_ordered_pseudo+set}" = set; then + enableval="$enable_ordered_pseudo" + if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + ORDEREDPSEUDO="-DORDEREDPSEUDO" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi; + + +CLOBBER="" +echo "$as_me:$LINENO: checking whether to intercept mouse events to clients" >&5 +echo $ECHO_N "checking whether to intercept mouse events to clients... $ECHO_C" >&6 +# Check whether --enable-clobber or --disable-clobber was given. +if test "${enable_clobber+set}" = set; then + enableval="$enable_clobber" + if test x$enableval = "xno"; then + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + CLOBBER="-DNOCLOBBER" + else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + fi +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi; + + +DEBUG="" +echo "$as_me:$LINENO: checking whether to include verbose debugging code" >&5 +echo $ECHO_N "checking whether to include verbose debugging code... $ECHO_C" >&6 +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + DEBUG="-DDEBUG" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi; + + +NLS="" +echo "$as_me:$LINENO: checking whether to include NLS support" >&5 +echo $ECHO_N "checking whether to include NLS support... $ECHO_C" >&6 +# Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + NLS="-DNLS" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + NLS="-DNLS" + +fi; + + +echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5 +echo $ECHO_N "checking for setlocale in -lxpg4... $ECHO_C" >&6 +if test "${ac_cv_lib_xpg4_setlocale+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lxpg4 $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setlocale (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +setlocale (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_xpg4_setlocale=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_xpg4_setlocale=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5 +echo "${ECHO_T}$ac_cv_lib_xpg4_setlocale" >&6 +if test $ac_cv_lib_xpg4_setlocale = yes; then + LIBS="$LIBS -lxpg4" +fi + + +for ac_prog in gencat +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_gencat_cmd+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$gencat_cmd"; then + ac_cv_prog_gencat_cmd="$gencat_cmd" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_gencat_cmd="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done + +fi +fi +gencat_cmd=$ac_cv_prog_gencat_cmd +if test -n "$gencat_cmd"; then + echo "$as_me:$LINENO: result: $gencat_cmd" >&5 +echo "${ECHO_T}$gencat_cmd" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$gencat_cmd" && break +done + +if test x$gencat_cmd = "x"; then + NLS="" +fi + + +TIMEDCACHE="" +echo "$as_me:$LINENO: checking whether to use the new timed pixmap cache" >&5 +echo $ECHO_N "checking whether to use the new timed pixmap cache... $ECHO_C" >&6 +# Check whether --enable-timed-cache or --disable-timed-cache was given. +if test "${enable_timed_cache+set}" = set; then + enableval="$enable_timed_cache" + if test x$enableval = "xyes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + TIMEDCACHE="-DTIMEDCACHE" + else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + fi +else + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + TIMEDCACHE="-DTIMEDCACHE" + +fi; + + +echo "$as_me:$LINENO: checking return type of signal handlers" >&5 +echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 +if test "${ac_cv_type_signal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#ifdef signal +# undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +int i; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_signal=void +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_signal=int +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 +echo "${ECHO_T}$ac_cv_type_signal" >&6 + +cat >>confdefs.h <<_ACEOF +@%:@define RETSIGTYPE $ac_cv_type_signal +_ACEOF + + + +echo "$as_me:$LINENO: checking whether to enable maintainer-specific portions of Makefiles" >&5 +echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no +fi; + echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 +echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 + + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE + + + +echo "$as_me:$LINENO: result: " >&5 +echo "${ECHO_T}" >&6 +echo "$as_me:$LINENO: result: $PACKAGE version $VERSION configured successfully." >&5 +echo "${ECHO_T} $PACKAGE version $VERSION configured successfully." >&6 +echo "$as_me:$LINENO: result: " >&5 +echo "${ECHO_T}" >&6 +echo "$as_me:$LINENO: result: Using '$prefix' for installation." >&5 +echo "${ECHO_T}Using '$prefix' for installation." >&6 +echo "$as_me:$LINENO: result: Using '$CXX' for C++ compiler." >&5 +echo "${ECHO_T}Using '$CXX' for C++ compiler." >&6 +echo "$as_me:$LINENO: result: Building with '$CXXFLAGS' for C++ compiler flags." >&5 +echo "${ECHO_T}Building with '$CXXFLAGS' for C++ compiler flags." >&6 +echo "$as_me:$LINENO: result: Building with '$LIBS' for linker flags." >&5 +echo "${ECHO_T}Building with '$LIBS' for linker flags." >&6 +echo "$as_me:$LINENO: result: " >&5 +echo "${ECHO_T}" >&6 + + +ac_config_headers="$ac_config_headers config.h" + +ac_config_commands="$ac_config_commands default-1" + +ac_config_files="$ac_config_files Makefile src/Makefile util/Makefile data/Makefile data/styles/Makefile doc/Makefile nls/Makefile nls/C/Makefile nls/da_DK/Makefile nls/de_DE/Makefile nls/es_ES/Makefile nls/et_EE/Makefile nls/fr_FR/Makefile nls/it_IT/Makefile nls/ja_JP/Makefile nls/nl_NL/Makefile nls/pt_BR/Makefile nls/ru_RU/Makefile nls/sl_SI/Makefile nls/sv_SE/Makefile nls/tr_TR/Makefile nls/zh_CN/Makefile version.h" +cat >confcache <<\_ACEOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs, see configure's option --config-cache. +# It is not useful on other systems. If it contains results you don't +# want to keep, you may remove or edit it. +# +# config.status only pays attention to the cache file if you give it +# the --recheck option to rerun configure. +# +# `ac_cv_env_foo' variables (set or unset) will be overriden when +# loading this file, other *unset* `ac_cv_foo' will be assigned the +# following values. + +_ACEOF + +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +{ + (set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote + # substitution turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + "s/'/'\\\\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} | + sed ' + t clear + : clear + s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ + t end + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if cmp -s $cache_file confcache; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + cat confcache >$cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + +DEFS=-DHAVE_CONFIG_H + + +: ${CONFIG_STATUS=./config.status} +ac_clean_files_save=$ac_clean_files +ac_clean_files="$ac_clean_files $CONFIG_STATUS" +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF +#! $SHELL +# Generated by $as_me. +# Run this file to recreate the current configuration. +# Compiler output produced by configure, useful for debugging +# configure, is in config.log if it exists. + +debug=false +SHELL=\${CONFIG_SHELL-$SHELL} +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +## --------------------- ## +## M4sh Initialization. ## +## --------------------- ## + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi + +# NLS nuisances. +# Support unset when possible. +if (FOO=FOO; unset FOO) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi + +(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && + { $as_unset LANG || test "${LANG+set}" != set; } || + { LANG=C; export LANG; } +(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && + { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || + { LC_ALL=C; export LC_ALL; } +(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && + { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || + { LC_TIME=C; export LC_TIME; } +(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && + { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || + { LC_CTYPE=C; export LC_CTYPE; } +(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && + { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || + { LANGUAGE=C; export LANGUAGE; } +(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && + { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || + { LC_COLLATE=C; export LC_COLLATE; } +(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && + { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || + { LC_NUMERIC=C; export LC_NUMERIC; } +(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && + { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || + { LC_MESSAGES=C; export LC_MESSAGES; } + + +# Name of the executable. +as_me=`(basename "$0") 2>/dev/null || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + +# PATH needs CR, and LINENO needs CR and PATH. +# Avoid depending upon Character Ranges. +as_cr_letters='abcdefghijklmnopqrstuvwxyz' +as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +as_cr_Letters=$as_cr_letters$as_cr_LETTERS +as_cr_digits='0123456789' +as_cr_alnum=$as_cr_Letters$as_cr_digits + +# The user is always right. +if test "${PATH_SEPARATOR+set}" != set; then + echo "#! /bin/sh" >conftest.sh + echo "exit 0" >>conftest.sh + chmod +x conftest.sh + if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conftest.sh +fi + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +done + + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 + fi + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac + + # Create $as_me.lineno as a copy of $as_myself, but with $LINENO + # uniformly replaced by the line number. The first 'sed' inserts a + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. + # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | + sed ' + N + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + t loop + s,-$,, + s,^['$as_cr_digits']*\n,, + ' >$as_me.lineno && + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + { (exit 1); exit 1; }; } + + # Don't try to exec as it changes $[0], causing all sort of problems + # (the dirname of $[0] is not the place where we might find the + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno + # Exit status is that of the last command. + exit +} + + +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +esac + +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +rm -f conf$$ conf$$.exe conf$$.file +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links + as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln +else + as_ln_s='cp -p' +fi +rm -f conf$$ conf$$.exe conf$$.file + +as_executable_p="test -f" + +# Sed expression to map a string onto a valid CPP name. +as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" + +# Sed expression to map a string onto a valid variable name. +as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" + + +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } + +exec 6>&1 + +# Open the log real soon, to keep \$[0] and so on meaningful, and to +# report actual input values of CONFIG_FILES etc. instead of their +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../@%:@@%:@ /;s/...$/ @%:@@%:@/;p;x;p;x' <<_ASBOX +@%:@@%:@ Running $as_me. @%:@@%:@ +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by $as_me, which was +generated by GNU Autoconf 2.53. Invocation command line was + + CONFIG_FILES = $CONFIG_FILES + CONFIG_HEADERS = $CONFIG_HEADERS + CONFIG_LINKS = $CONFIG_LINKS + CONFIG_COMMANDS = $CONFIG_COMMANDS + $ $0 $@ + +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 +_ACEOF + +# Files that config.status was made for. +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi + +cat >>$CONFIG_STATUS <<\_ACEOF + +ac_cs_usage="\ +\`$as_me' instantiates files from templates according to the +current configuration. + +Usage: $0 [OPTIONS] [FILE]... + + -h, --help print this help, then exit + -V, --version print version number, then exit + -d, --debug don't remove temporary files + --recheck update $as_me by reconfiguring in the same conditions + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE + +Configuration files: +$config_files + +Configuration headers: +$config_headers + +Configuration commands: +$config_commands + +Report bugs to ." +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +ac_cs_version="\\ +config.status +configured by $0, generated by GNU Autoconf 2.53, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" + +Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +Free Software Foundation, Inc. +This config.status script is free software; the Free Software Foundation +gives unlimited permission to copy, distribute and modify it." +srcdir=$srcdir +INSTALL="$INSTALL" +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. +ac_need_defaults=: +while test $# != 0 +do + case $1 in + --*=*) + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + shift + set dummy "$ac_option" "$ac_optarg" ${1+"$@"} + shift + ;; + -*);; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_need_defaults=false;; + esac + + case $1 in + # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" + exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) + debug=: ;; + --file | --fil | --fi | --f ) + shift + CONFIG_FILES="$CONFIG_FILES $1" + ac_need_defaults=false;; + --header | --heade | --head | --hea ) + shift + CONFIG_HEADERS="$CONFIG_HEADERS $1" + ac_need_defaults=false;; + + # This is an error. + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; } ;; + + *) ac_config_targets="$ac_config_targets $1" ;; + + esac + shift +done + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF +# +# INIT-COMMANDS section. +# + + + +_ACEOF + + + +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_config_target in $ac_config_targets +do + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; + "util/Makefile" ) CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; + "data/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; + "data/styles/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/styles/Makefile" ;; + "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; + "nls/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/Makefile" ;; + "nls/C/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/C/Makefile" ;; + "nls/da_DK/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/da_DK/Makefile" ;; + "nls/de_DE/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/de_DE/Makefile" ;; + "nls/es_ES/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/es_ES/Makefile" ;; + "nls/et_EE/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/et_EE/Makefile" ;; + "nls/fr_FR/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/fr_FR/Makefile" ;; + "nls/it_IT/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/it_IT/Makefile" ;; + "nls/ja_JP/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/ja_JP/Makefile" ;; + "nls/nl_NL/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/nl_NL/Makefile" ;; + "nls/pt_BR/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/pt_BR/Makefile" ;; + "nls/ru_RU/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/ru_RU/Makefile" ;; + "nls/sl_SI/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/sl_SI/Makefile" ;; + "nls/sv_SE/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/sv_SE/Makefile" ;; + "nls/tr_TR/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/tr_TR/Makefile" ;; + "nls/zh_CN/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/zh_CN/Makefile" ;; + "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;; + "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + { (exit 1); exit 1; }; };; + esac +done + +# If the user did not use the arguments to specify the items to instantiate, +# then the envvar interface is used. Set only those that are not. +# We use the long form for the default assignment because of an extremely +# bizarre bug on SunOS 4.1.3. +if $ac_need_defaults; then + test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files + test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers + test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands +fi + +# Create a temporary directory, and hook for its removal unless debugging. +$debug || +{ + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + trap '{ (exit 1); exit 1; }' 1 2 13 15 +} + +# Create a (secure) tmp directory for tmp files. +: ${TMPDIR=/tmp} +{ + tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && + test -n "$tmp" && test -d "$tmp" +} || +{ + tmp=$TMPDIR/cs$$-$RANDOM + (umask 077 && mkdir $tmp) +} || +{ + echo "$me: cannot create a temporary directory in $TMPDIR" >&2 + { (exit 1); exit 1; } +} + +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + +# +# CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@PACKAGE@,$PACKAGE,;t t +s,@VERSION@,$VERSION,;t t +s,@ACLOCAL@,$ACLOCAL,;t t +s,@AUTOCONF@,$AUTOCONF,;t t +s,@AUTOMAKE@,$AUTOMAKE,;t t +s,@AUTOHEADER@,$AUTOHEADER,;t t +s,@MAKEINFO@,$MAKEINFO,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CXX@,$CXX,;t t +s,@CXXFLAGS@,$CXXFLAGS,;t t +s,@ac_ct_CXX@,$ac_ct_CXX,;t t +s,@regex_cmd@,$regex_cmd,;t t +s,@CPP@,$CPP,;t t +s,@X_CFLAGS@,$X_CFLAGS,;t t +s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t +s,@X_LIBS@,$X_LIBS,;t t +s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t +s,@SHAPE@,$SHAPE,;t t +s,@SLIT@,$SLIT,;t t +s,@NEWWMSPEC@,$NEWWMSPEC,;t t +s,@INTERLACE@,$INTERLACE,;t t +s,@ORDEREDPSEUDO@,$ORDEREDPSEUDO,;t t +s,@CLOBBER@,$CLOBBER,;t t +s,@DEBUG@,$DEBUG,;t t +s,@NLS@,$NLS,;t t +s,@gencat_cmd@,$gencat_cmd,;t t +s,@TIMEDCACHE@,$TIMEDCACHE,;t t +s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t +s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t +s,@MAINT@,$MAINT,;t t +CEOF + +_ACEOF + + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat + fi +fi # test -n "$CONFIG_FILES" + +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + case $INSTALL in + [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + esac + + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub +$extrasub +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +:t +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi + +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo $f;; + *) # Relative + if test -f "$f"; then + # Build tree + echo $f + elif test -f "$srcdir/$f"; then + # Source tree + echo $srcdir/$f + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + +_ACEOF + +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +_ACEOF + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines +echo ' fi # egrep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs + +cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in + if test x"$ac_file" != x-; then + if cmp -s $ac_file $tmp/config.h 2>/dev/null; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} + else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { case "$ac_dir" in + [\\/]* | ?:[\\/]* ) as_incr_dir=;; + *) as_incr_dir=.;; +esac +as_dummy="$ac_dir" +for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do + case $as_mkdir_dir in + # Skip DOS drivespec + ?:) as_incr_dir=$as_mkdir_dir ;; + *) + as_incr_dir=$as_incr_dir/$as_mkdir_dir + test -d "$as_incr_dir" || + mkdir "$as_incr_dir" || + { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; } + ;; + esac +done; } + + rm -f $ac_file + mv $tmp/config.h $ac_file + fi + else + cat $tmp/config.h + rm -f $tmp/config.h + fi +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_COMMANDS section. +# +for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + ac_builddir=. + +if test "$ac_dir" != .; then + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac +# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +# absolute. +ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` + + + { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 +echo "$as_me: executing $ac_dest commands" >&6;} + case $ac_dest in + default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;; + esac +done +_ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF + +{ (exit 0); exit 0; } +_ACEOF +chmod +x $CONFIG_STATUS +ac_clean_files=$ac_clean_files_save + + +# configure is writing to config.log, and then calls config.status. +# config.status does its own redirection, appending to config.log. +# Unfortunately, on DOS this fails, as config.log is still kept open +# by configure, so config.status won't be able to write to it; its +# output is simply discarded. So we exec the FD to /dev/null, +# effectively closing config.log, so it can be properly (re)opened and +# appended to by config.status. When coming back to configure, we +# need to make the FD available again. +if test "$no_create" != yes; then + ac_cs_success=: + exec 5>/dev/null + $SHELL $CONFIG_STATUS || ac_cs_success=false + exec 5>>config.log + # Use ||, not &&, to avoid exiting from the if with $? = 1, which + # would make configure fail if this is the last instruction. + $ac_cs_success || { (exit 1); exit 1; } +fi + diff --cc autom4te.cache/requests index b14da9fd,00000000..3452fdff mode 100644,000000..100644 --- a/autom4te.cache/requests +++ b/autom4te.cache/requests @@@ -1,94 -1,0 +1,94 @@@ +# This file was created by autom4te. +# It contains the lists of macros which have been traced. +# It can be safely removed. + +@request = ( + bless( [ + '0', + 1, + [ + '/usr/share/autoconf' + ], + [ + '--reload-state=/usr/share/autoconf/autoconf/autoconf.m4f', + 'aclocal.m4', + 'configure.in' + ], + { + 'AC_HEADER_STAT' => 1, + 'AC_FUNC_STRFTIME' => 1, + 'AC_PROG_RANLIB' => 1, + 'AC_FUNC_WAIT3' => 1, + 'AC_FUNC_SETPGRP' => 1, + 'AC_HEADER_TIME' => 1, + 'AC_FUNC_SETVBUF_REVERSED' => 1, + 'AC_HEADER_SYS_WAIT' => 1, + 'AC_TYPE_UID_T' => 1, - 'AM_CONDITIONAL' => 1, + 'AC_CHECK_LIB' => 1, ++ 'AM_CONDITIONAL' => 1, + 'AC_PROG_LN_S' => 1, + 'AC_FUNC_MEMCMP' => 1, + 'AC_FUNC_FORK' => 1, + 'AC_FUNC_GETGROUPS' => 1, + 'AC_HEADER_MAJOR' => 1, + 'AC_FUNC_STRTOD' => 1, + 'AC_HEADER_DIRENT' => 1, + 'AC_FUNC_UTIME_NULL' => 1, + 'AC_CONFIG_FILES' => 1, + 'AC_FUNC_ALLOCA' => 1, + 'AC_C_CONST' => 1, + 'include' => 1, + 'AC_FUNC_OBSTACK' => 1, + 'AC_FUNC_LSTAT' => 1, + 'AC_STRUCT_TIMEZONE' => 1, + 'AC_FUNC_GETPGRP' => 1, + 'AC_DEFINE_TRACE_LITERAL' => 1, + 'AC_CHECK_HEADERS' => 1, + 'AC_TYPE_MODE_T' => 1, + 'AC_CHECK_TYPES' => 1, + 'AC_PROG_YACC' => 1, - 'AC_TYPE_PID_T' => 1, + 'AC_FUNC_STRERROR_R' => 1, ++ 'AC_TYPE_PID_T' => 1, + 'AC_STRUCT_ST_BLOCKS' => 1, + 'AC_PROG_GCC_TRADITIONAL' => 1, + 'AC_TYPE_SIGNAL' => 1, + 'AC_FUNC_FNMATCH' => 1, + 'AC_PROG_CPP' => 1, + 'AM_PROG_LIBTOOL' => 1, + 'AC_FUNC_STAT' => 1, + 'AC_PROG_INSTALL' => 1, + 'AM_GNU_GETTEXT' => 1, + 'AC_FUNC_STRCOLL' => 1, + 'AC_LIBSOURCE' => 1, + 'AC_C_INLINE' => 1, + 'AC_FUNC_CHOWN' => 1, + 'AC_PROG_LEX' => 1, + 'AH_OUTPUT' => 1, + 'AC_HEADER_STDC' => 1, + 'AC_FUNC_GETLOADAVG' => 1, + 'AC_CHECK_FUNCS' => 1, + 'AC_TYPE_SIZE_T' => 1, + 'AC_DECL_SYS_SIGLIST' => 1, + 'AC_FUNC_MKTIME' => 1, + 'AC_PROG_MAKE_SET' => 1, + 'AC_PROG_CXX' => 1, + 'm4_pattern_allow' => 1, + 'm4_include' => 1, + 'm4_pattern_forbid' => 1, + 'AC_PROG_AWK' => 1, + 'AC_FUNC_VPRINTF' => 1, + 'AC_CONFIG_HEADERS' => 1, + 'AC_PATH_X' => 1, + 'AC_TYPE_OFF_T' => 1, + 'AC_FUNC_MALLOC' => 1, + 'AC_FUNC_ERROR_AT_LINE' => 1, + 'AC_FUNC_FSEEKO' => 1, - 'AC_FUNC_MMAP' => 1, + 'AC_STRUCT_TM' => 1, ++ 'AC_FUNC_MMAP' => 1, + 'AC_SUBST' => 1, - 'AC_PROG_CC' => 1, - 'AC_PROG_LIBTOOL' => 1 ++ 'AC_PROG_LIBTOOL' => 1, ++ 'AC_PROG_CC' => 1 + } + ], 'Request' ) + ); + diff --cc autom4te.cache/traces.0 index a729f18c,00000000..3a10c9db mode 100644,000000..100644 --- a/autom4te.cache/traces.0 +++ b/autom4te.cache/traces.0 @@@ -1,370 -1,0 +1,374 @@@ +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?A[CHUM]_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([_AC_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^LIBOBJS$], [do not use LIBOBJS directly, use AC_LIBOBJ (see section `AC_LIBOBJ vs. LIBOBJS']) +m4trace:configure.in:3: -1- m4_pattern_allow([^AS_FLAGS$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?m4_]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^dnl$]) +m4trace:configure.in:3: -1- m4_pattern_forbid([^_?AS_]) +m4trace:configure.in:3: -1- AC_SUBST([SHELL], [${CONFIG_SHELL-/bin/sh}]) +m4trace:configure.in:3: -1- AC_SUBST([PATH_SEPARATOR]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_NAME], [m4_ifdef([AC_PACKAGE_NAME], ['AC_PACKAGE_NAME'])]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_TARNAME], [m4_ifdef([AC_PACKAGE_TARNAME], ['AC_PACKAGE_TARNAME'])]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_VERSION], [m4_ifdef([AC_PACKAGE_VERSION], ['AC_PACKAGE_VERSION'])]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_STRING], [m4_ifdef([AC_PACKAGE_STRING], ['AC_PACKAGE_STRING'])]) +m4trace:configure.in:3: -1- AC_SUBST([PACKAGE_BUGREPORT], [m4_ifdef([AC_PACKAGE_BUGREPORT], ['AC_PACKAGE_BUGREPORT'])]) +m4trace:configure.in:3: -1- AC_SUBST([exec_prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST([prefix], [NONE]) +m4trace:configure.in:3: -1- AC_SUBST([program_transform_name], [s,x,x,]) +m4trace:configure.in:3: -1- AC_SUBST([bindir], ['${exec_prefix}/bin']) +m4trace:configure.in:3: -1- AC_SUBST([sbindir], ['${exec_prefix}/sbin']) +m4trace:configure.in:3: -1- AC_SUBST([libexecdir], ['${exec_prefix}/libexec']) +m4trace:configure.in:3: -1- AC_SUBST([datadir], ['${prefix}/share']) +m4trace:configure.in:3: -1- AC_SUBST([sysconfdir], ['${prefix}/etc']) +m4trace:configure.in:3: -1- AC_SUBST([sharedstatedir], ['${prefix}/com']) +m4trace:configure.in:3: -1- AC_SUBST([localstatedir], ['${prefix}/var']) +m4trace:configure.in:3: -1- AC_SUBST([libdir], ['${exec_prefix}/lib']) +m4trace:configure.in:3: -1- AC_SUBST([includedir], ['${prefix}/include']) +m4trace:configure.in:3: -1- AC_SUBST([oldincludedir], ['/usr/include']) +m4trace:configure.in:3: -1- AC_SUBST([infodir], ['${prefix}/info']) +m4trace:configure.in:3: -1- AC_SUBST([mandir], ['${prefix}/man']) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_NAME]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_NAME], [/* Define to the full name of this package. */ +#undef PACKAGE_NAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_TARNAME], [/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_VERSION]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_VERSION], [/* Define to the version of this package. */ +#undef PACKAGE_VERSION]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_STRING]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_STRING], [/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING]) +m4trace:configure.in:3: -1- AC_DEFINE_TRACE_LITERAL([PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- AH_OUTPUT([PACKAGE_BUGREPORT], [/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT]) +m4trace:configure.in:3: -1- AC_SUBST([build_alias]) +m4trace:configure.in:3: -1- AC_SUBST([host_alias]) +m4trace:configure.in:3: -1- AC_SUBST([target_alias]) +m4trace:configure.in:3: -1- AC_SUBST([DEFS]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_C]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_N]) +m4trace:configure.in:3: -1- AC_SUBST([ECHO_T]) +m4trace:configure.in:3: -1- AC_SUBST([LIBS]) +m4trace:configure.in:4: -1- AC_PROG_INSTALL +m4trace:configure.in:4: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.in:4: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.in:4: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.in:4: -1- AC_SUBST([PACKAGE]) +m4trace:configure.in:4: -1- AC_SUBST([VERSION]) +m4trace:configure.in:4: -2- AC_DEFINE_TRACE_LITERAL([PACKAGE]) +m4trace:configure.in:4: -2- AH_OUTPUT([PACKAGE], [/* Name of package */ +#undef PACKAGE]) +m4trace:configure.in:4: -2- AC_DEFINE_TRACE_LITERAL([VERSION]) +m4trace:configure.in:4: -2- AH_OUTPUT([VERSION], [/* Version number of package */ +#undef VERSION]) +m4trace:configure.in:4: -1- AC_SUBST([ACLOCAL]) +m4trace:configure.in:4: -1- AC_SUBST([AUTOCONF]) +m4trace:configure.in:4: -1- AC_SUBST([AUTOMAKE]) +m4trace:configure.in:4: -1- AC_SUBST([AUTOHEADER]) +m4trace:configure.in:4: -1- AC_SUBST([MAKEINFO]) +m4trace:configure.in:4: -1- AC_PROG_MAKE_SET +m4trace:configure.in:4: -1- AC_SUBST([SET_MAKE]) +m4trace:configure.in:14: -1- AC_PROG_CC +m4trace:configure.in:14: -1- AC_SUBST([CC]) +m4trace:configure.in:14: -1- AC_SUBST([CFLAGS]) +m4trace:configure.in:14: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.in:14: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:14: -1- AC_SUBST([CC]) +m4trace:configure.in:14: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.in:14: -1- AC_SUBST([CC]) +m4trace:configure.in:14: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.in:14: -1- AC_SUBST([CC]) +m4trace:configure.in:14: -1- AC_SUBST([CC]) +m4trace:configure.in:14: -1- AC_SUBST([ac_ct_CC]) +m4trace:configure.in:14: -1- AC_SUBST([EXEEXT], [$ac_cv_exeext]) +m4trace:configure.in:14: -1- AC_SUBST([OBJEXT], [$ac_cv_objext]) +m4trace:configure.in:15: -1- AC_PROG_CXX +m4trace:configure.in:15: -1- AC_SUBST([CXX]) +m4trace:configure.in:15: -1- AC_SUBST([CXXFLAGS]) +m4trace:configure.in:15: -1- AC_SUBST([LDFLAGS]) +m4trace:configure.in:15: -1- AC_SUBST([CPPFLAGS]) +m4trace:configure.in:15: -1- AC_SUBST([CXX]) +m4trace:configure.in:15: -1- AC_SUBST([ac_ct_CXX]) +m4trace:configure.in:16: -1- AC_PROG_INSTALL +m4trace:configure.in:16: -1- AC_SUBST([INSTALL_PROGRAM]) +m4trace:configure.in:16: -1- AC_SUBST([INSTALL_SCRIPT]) +m4trace:configure.in:16: -1- AC_SUBST([INSTALL_DATA]) +m4trace:configure.in:18: -1- AC_SUBST([regex_cmd]) - m4trace:configure.in:24: -1- AC_HEADER_STDC - m4trace:configure.in:24: -1- AC_PROG_CPP - m4trace:configure.in:24: -1- AC_SUBST([CPP]) - m4trace:configure.in:24: -1- AC_SUBST([CPPFLAGS]) - m4trace:configure.in:24: -1- AC_SUBST([CPP]) - m4trace:configure.in:24: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) - m4trace:configure.in:24: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ - #undef STDC_HEADERS]) - m4trace:configure.in:25: -1- AC_CHECK_HEADERS([ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.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]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_CTYPE_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- 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]) ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_CTYPE_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_DIRENT_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_DIRENT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_DIRENT_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_FCNTL_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_LIBGEN_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_LIBGEN_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_LOCALE_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_LOCALE_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_NL_TYPES_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_NL_TYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_NL_TYPES_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_PROCESS_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_PROCESS_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_PROCESS_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SIGNAL_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SIGNAL_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_STDARG_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STDARG_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_STDIO_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STDIO_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_TIME_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ ++#undef HAVE_STRING_H]) ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ ++#undef HAVE_STDLIB_H]) ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_TIME_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_PARAM_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_SELECT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_SIGNAL_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_SIGNAL_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNAL_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_TIME_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_WAIT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H]) - m4trace:configure.in:25: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ ++m4trace:configure.in:24: -1- AC_HEADER_STDC ++m4trace:configure.in:24: -1- AC_PROG_CPP ++m4trace:configure.in:24: -1- AC_SUBST([CPP]) ++m4trace:configure.in:24: -1- AC_SUBST([CPPFLAGS]) ++m4trace:configure.in:24: -1- AC_SUBST([CPP]) ++m4trace:configure.in:24: -1- AC_DEFINE_TRACE_LITERAL([STDC_HEADERS]) ++m4trace:configure.in:24: -1- AH_OUTPUT([STDC_HEADERS], [/* Define to 1 if you have the ANSI C header files. */ ++#undef STDC_HEADERS]) ++m4trace:configure.in:24: -1- AC_CHECK_HEADERS([sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ + inttypes.h stdint.h unistd.h], [], [], [$ac_includes_default]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_TYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_SYS_STAT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STDLIB_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STRING_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_MEMORY_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STRINGS_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_INTTYPES_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_STDINT_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H]) - m4trace:configure.in:25: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ ++m4trace:configure.in:24: -1- AH_OUTPUT([HAVE_UNISTD_H], [/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H]) - m4trace:configure.in:26: -1- AC_HEADER_TIME - m4trace:configure.in:26: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) - m4trace:configure.in:26: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both and . */ ++m4trace:configure.in:25: -1- AC_HEADER_TIME ++m4trace:configure.in:25: -1- AC_DEFINE_TRACE_LITERAL([TIME_WITH_SYS_TIME]) ++m4trace:configure.in:25: -1- AH_OUTPUT([TIME_WITH_SYS_TIME], [/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME]) - m4trace:configure.in:30: -3- AC_DEFINE_TRACE_LITERAL([HAVE_BASENAME]) - m4trace:configure.in:30: -2- AC_CHECK_LIB([gen], [basename], [cat >>confdefs.h <<\_ACEOF ++m4trace:configure.in:29: -3- AC_DEFINE_TRACE_LITERAL([HAVE_BASENAME]) ++m4trace:configure.in:29: -2- AC_CHECK_LIB([gen], [basename], [cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_BASENAME 1 +_ACEOF + LIBS="$LIBS -lgen"]) - m4trace:configure.in:30: -1- AC_CHECK_FUNCS([basename], [], [echo "$as_me:$LINENO: checking for basename in -lgen" >&5 ++m4trace:configure.in:29: -1- AC_CHECK_FUNCS([basename], [], [echo "$as_me:$LINENO: checking for basename in -lgen" >&5 +echo $ECHO_N "checking for basename in -lgen... $ECHO_C" >&6 +if test "${ac_cv_lib_gen_basename+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgen $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" + +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char basename (); +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +basename (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gen_basename=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gen_basename=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_gen_basename" >&5 +echo "${ECHO_T}$ac_cv_lib_gen_basename" >&6 +if test $ac_cv_lib_gen_basename = yes; then + cat >>confdefs.h <<\_ACEOF +@%:@define HAVE_BASENAME 1 +_ACEOF + LIBS="$LIBS -lgen" +fi +]) - m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_BASENAME], [/* Define to 1 if you have the \`basename' function. */ ++m4trace:configure.in:29: -1- AH_OUTPUT([HAVE_BASENAME], [/* Define to 1 if you have the \`basename' function. */ +#undef HAVE_BASENAME]) - m4trace:configure.in:31: -1- AC_CHECK_FUNCS([getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_GETPID], [/* Define to 1 if you have the \`getpid' function. */ ++m4trace:configure.in:30: -1- AC_CHECK_FUNCS([getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose]) ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_GETPID], [/* Define to 1 if you have the \`getpid' function. */ +#undef HAVE_GETPID]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_SETLOCALE], [/* Define to 1 if you have the \`setlocale' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_SETLOCALE], [/* Define to 1 if you have the \`setlocale' function. */ +#undef HAVE_SETLOCALE]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \`sigaction' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_SIGACTION], [/* Define to 1 if you have the \`sigaction' function. */ +#undef HAVE_SIGACTION]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_STRFTIME], [/* Define to 1 if you have the \`strftime' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_STRFTIME], [/* Define to 1 if you have the \`strftime' function. */ +#undef HAVE_STRFTIME]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_STRCASESTR], [/* Define to 1 if you have the \`strcasestr' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_STRCASESTR], [/* Define to 1 if you have the \`strcasestr' function. */ +#undef HAVE_STRCASESTR]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \`snprintf' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_SNPRINTF], [/* Define to 1 if you have the \`snprintf' function. */ +#undef HAVE_SNPRINTF]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_VSNPRINTF], [/* Define to 1 if you have the \`vsnprintf' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_VSNPRINTF], [/* Define to 1 if you have the \`vsnprintf' function. */ +#undef HAVE_VSNPRINTF]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_CATOPEN], [/* Define to 1 if you have the \`catopen' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_CATOPEN], [/* Define to 1 if you have the \`catopen' function. */ +#undef HAVE_CATOPEN]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_CATGETS], [/* Define to 1 if you have the \`catgets' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_CATGETS], [/* Define to 1 if you have the \`catgets' function. */ +#undef HAVE_CATGETS]) - m4trace:configure.in:31: -1- AH_OUTPUT([HAVE_CATCLOSE], [/* Define to 1 if you have the \`catclose' function. */ ++m4trace:configure.in:30: -1- AH_OUTPUT([HAVE_CATCLOSE], [/* Define to 1 if you have the \`catclose' function. */ +#undef HAVE_CATCLOSE]) - m4trace:configure.in:32: -1- AC_CHECK_LIB([nsl], [t_open], [LIBS="$LIBS -lnsl"]) - m4trace:configure.in:33: -1- AC_CHECK_LIB([socket], [socket], [LIBS="$LIBS -lsocket"]) - m4trace:configure.in:36: -1- AC_PATH_X - m4trace:configure.in:37: -1- AC_DEFINE_TRACE_LITERAL([X_DISPLAY_MISSING]) - m4trace:configure.in:37: -1- AH_OUTPUT([X_DISPLAY_MISSING], [/* Define to 1 if the X Window System is missing or not being used. */ ++m4trace:configure.in:31: -1- AC_CHECK_LIB([nsl], [t_open], [LIBS="$LIBS -lnsl"]) ++m4trace:configure.in:32: -1- AC_CHECK_LIB([socket], [socket], [LIBS="$LIBS -lsocket"]) ++m4trace:configure.in:35: -1- AC_PATH_X ++m4trace:configure.in:36: -1- AC_DEFINE_TRACE_LITERAL([X_DISPLAY_MISSING]) ++m4trace:configure.in:36: -1- AH_OUTPUT([X_DISPLAY_MISSING], [/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([dnet], [dnet_ntoa], [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([dnet_stub], [dnet_ntoa], [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([nsl], [gethostbyname], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([bsd], [gethostbyname], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([socket], [connect], [X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"], [], [$X_EXTRA_LIBS]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([posix], [remove], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([ipc], [shmat], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"]) - m4trace:configure.in:37: -1- AC_CHECK_LIB([ICE], [IceConnectionNumber], [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], [], [$X_EXTRA_LIBS]) - m4trace:configure.in:37: -1- AC_SUBST([X_CFLAGS]) - m4trace:configure.in:37: -1- AC_SUBST([X_PRE_LIBS]) - m4trace:configure.in:37: -1- AC_SUBST([X_LIBS]) - m4trace:configure.in:37: -1- AC_SUBST([X_EXTRA_LIBS]) - m4trace:configure.in:53: -1- AC_CHECK_LIB([X11], [XOpenDisplay], [LIBS="$LIBS -lX11"], [{ { echo "$as_me:$LINENO: error: Could not find XOpenDisplay in -lX11." >&5 ++m4trace:configure.in:36: -1- AC_CHECK_LIB([dnet], [dnet_ntoa], [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet"]) ++m4trace:configure.in:36: -1- AC_CHECK_LIB([dnet_stub], [dnet_ntoa], [X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"]) ++m4trace:configure.in:36: -1- AC_CHECK_LIB([nsl], [gethostbyname], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"]) ++m4trace:configure.in:36: -1- AC_CHECK_LIB([bsd], [gethostbyname], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd"]) ++m4trace:configure.in:36: -1- AC_CHECK_LIB([socket], [connect], [X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS"], [], [$X_EXTRA_LIBS]) ++m4trace:configure.in:36: -1- AC_CHECK_LIB([posix], [remove], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix"]) ++m4trace:configure.in:36: -1- AC_CHECK_LIB([ipc], [shmat], [X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc"]) ++m4trace:configure.in:36: -1- AC_CHECK_LIB([ICE], [IceConnectionNumber], [X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE"], [], [$X_EXTRA_LIBS]) ++m4trace:configure.in:36: -1- AC_SUBST([X_CFLAGS]) ++m4trace:configure.in:36: -1- AC_SUBST([X_PRE_LIBS]) ++m4trace:configure.in:36: -1- AC_SUBST([X_LIBS]) ++m4trace:configure.in:36: -1- AC_SUBST([X_EXTRA_LIBS]) ++m4trace:configure.in:52: -1- AC_CHECK_LIB([X11], [XOpenDisplay], [LIBS="$LIBS -lX11"], [{ { echo "$as_me:$LINENO: error: Could not find XOpenDisplay in -lX11." >&5 +echo "$as_me: error: Could not find XOpenDisplay in -lX11." >&2;} + { (exit 1); exit 1; }; } +]) - m4trace:configure.in:79: -1- AC_CHECK_LIB([Xext], [XShapeCombineShape], [echo "$as_me:$LINENO: checking for X11/extensions/shape.h" >&5 ++m4trace:configure.in:78: -1- AC_CHECK_LIB([Xext], [XShapeCombineShape], [echo "$as_me:$LINENO: checking for X11/extensions/shape.h" >&5 +echo $ECHO_N "checking for X11/extensions/shape.h... $ECHO_C" >&6 + cat >conftest.$ac_ext <<_ACEOF +#line $LINENO "configure" +#include "confdefs.h" +#include +#include +#include + +#ifdef F77_DUMMY_MAIN +# ifdef __cplusplus + extern "C" +# endif + int F77_DUMMY_MAIN() { return 1; } +#endif +int +main () +{ +long foo = ShapeSet + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 + SHAPE="-DSHAPE"; Xext_lib="-lXext" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 + +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + ]) - m4trace:configure.in:83: -1- AC_SUBST([SHAPE]) - m4trace:configure.in:101: -1- AC_SUBST([SLIT]) - m4trace:configure.in:118: -1- AC_SUBST([NEWWMSPEC]) - m4trace:configure.in:135: -1- AC_SUBST([INTERLACE]) - m4trace:configure.in:151: -1- AC_SUBST([ORDEREDPSEUDO]) - m4trace:configure.in:167: -1- AC_SUBST([CLOBBER]) - m4trace:configure.in:182: -1- AC_SUBST([DEBUG]) - m4trace:configure.in:198: -1- AC_SUBST([NLS]) - m4trace:configure.in:200: -1- AC_CHECK_LIB([xpg4], [setlocale], [LIBS="$LIBS -lxpg4"]) - m4trace:configure.in:202: -1- AC_SUBST([gencat_cmd]) - m4trace:configure.in:223: -1- AC_SUBST([TIMEDCACHE]) - m4trace:configure.in:226: -1- AC_TYPE_SIGNAL - m4trace:configure.in:226: -1- AC_DEFINE_TRACE_LITERAL([RETSIGTYPE]) - m4trace:configure.in:226: -1- AH_OUTPUT([RETSIGTYPE], [/* Define as the return type of signal handlers (\`int' or \`void'). */ ++m4trace:configure.in:82: -1- AC_SUBST([SHAPE]) ++m4trace:configure.in:100: -1- AC_SUBST([SLIT]) ++m4trace:configure.in:117: -1- AC_SUBST([NEWWMSPEC]) ++m4trace:configure.in:134: -1- AC_SUBST([INTERLACE]) ++m4trace:configure.in:150: -1- AC_SUBST([ORDEREDPSEUDO]) ++m4trace:configure.in:166: -1- AC_SUBST([CLOBBER]) ++m4trace:configure.in:181: -1- AC_SUBST([DEBUG]) ++m4trace:configure.in:197: -1- AC_SUBST([NLS]) ++m4trace:configure.in:199: -1- AC_CHECK_LIB([xpg4], [setlocale], [LIBS="$LIBS -lxpg4"]) ++m4trace:configure.in:201: -1- AC_SUBST([gencat_cmd]) ++m4trace:configure.in:222: -1- AC_SUBST([TIMEDCACHE]) ++m4trace:configure.in:225: -1- AC_TYPE_SIGNAL ++m4trace:configure.in:225: -1- AC_DEFINE_TRACE_LITERAL([RETSIGTYPE]) ++m4trace:configure.in:225: -1- AH_OUTPUT([RETSIGTYPE], [/* Define as the return type of signal handlers (\`int' or \`void'). */ +#undef RETSIGTYPE]) - m4trace:configure.in:229: -1- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) - m4trace:configure.in:229: -1- AC_SUBST([MAINTAINER_MODE_TRUE]) - m4trace:configure.in:229: -1- AC_SUBST([MAINTAINER_MODE_FALSE]) - m4trace:configure.in:229: -1- AC_SUBST([MAINT]) - m4trace:configure.in:242: -1- AC_CONFIG_HEADERS([config.h]) - m4trace:configure.in:268: -1- AC_CONFIG_FILES([Makefile ++m4trace:configure.in:228: -1- AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) ++m4trace:configure.in:228: -1- AC_SUBST([MAINTAINER_MODE_TRUE]) ++m4trace:configure.in:228: -1- AC_SUBST([MAINTAINER_MODE_FALSE]) ++m4trace:configure.in:228: -1- AC_SUBST([MAINT]) ++m4trace:configure.in:241: -1- AC_CONFIG_HEADERS([config.h]) ++m4trace:configure.in:267: -1- AC_CONFIG_FILES([Makefile +src/Makefile +util/Makefile +data/Makefile +data/styles/Makefile +doc/Makefile +nls/Makefile +nls/C/Makefile +nls/da_DK/Makefile +nls/de_DE/Makefile +nls/es_ES/Makefile +nls/et_EE/Makefile +nls/fr_FR/Makefile +nls/it_IT/Makefile +nls/ja_JP/Makefile +nls/nl_NL/Makefile +nls/pt_BR/Makefile +nls/ru_RU/Makefile +nls/sl_SI/Makefile +nls/sv_SE/Makefile +nls/tr_TR/Makefile +nls/zh_CN/Makefile +version.h]) diff --cc config.h.in index b4f73d3f,00000000..cb7c7ee7 mode 100644,000000..100644 --- a/config.h.in +++ b/config.h.in @@@ -1,142 -1,0 +1,145 @@@ +/* config.h.in. Generated from configure.in by autoheader. */ + +/* Define to 1 if you have the `basename' function. */ +#undef HAVE_BASENAME + +/* Define to 1 if you have the `catclose' function. */ +#undef HAVE_CATCLOSE + +/* Define to 1 if you have the `catgets' function. */ +#undef HAVE_CATGETS + +/* Define to 1 if you have the `catopen' function. */ +#undef HAVE_CATOPEN + +/* Define to 1 if you have the header file. */ +#undef HAVE_CTYPE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_DIRENT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_FCNTL_H + +/* Define to 1 if you have the `getpid' function. */ +#undef HAVE_GETPID + +/* Define to 1 if you have the header file. */ +#undef HAVE_INTTYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LIBGEN_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_LOCALE_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_MEMORY_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_NL_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_PROCESS_H + +/* Define to 1 if you have the `setlocale' function. */ +#undef HAVE_SETLOCALE + +/* Define to 1 if you have the `sigaction' function. */ +#undef HAVE_SIGACTION + +/* Define to 1 if you have the header file. */ +#undef HAVE_SIGNAL_H + +/* Define to 1 if you have the `snprintf' function. */ +#undef HAVE_SNPRINTF + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDARG_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDINT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDIO_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STDLIB_H + +/* Define to 1 if you have the `strcasestr' function. */ +#undef HAVE_STRCASESTR + +/* Define to 1 if you have the `strftime' function. */ +#undef HAVE_STRFTIME + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRINGS_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_STRING_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_SIGNAL_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_STAT_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_SYS_WAIT_H + ++/* Define to 1 if you have the header file. */ ++#undef HAVE_SSTREAM ++ +/* Define to 1 if you have the header file. */ +#undef HAVE_TIME_H + +/* Define to 1 if you have the header file. */ +#undef HAVE_UNISTD_H + +/* Define to 1 if you have the `vsnprintf' function. */ +#undef HAVE_VSNPRINTF + +/* Name of package */ +#undef PACKAGE + +/* Define to the address where bug reports for this package should be sent. */ +#undef PACKAGE_BUGREPORT + +/* Define to the full name of this package. */ +#undef PACKAGE_NAME + +/* Define to the full name and version of this package. */ +#undef PACKAGE_STRING + +/* Define to the one symbol short name of this package. */ +#undef PACKAGE_TARNAME + +/* Define to the version of this package. */ +#undef PACKAGE_VERSION + +/* Define as the return type of signal handlers (`int' or `void'). */ +#undef RETSIGTYPE + +/* Define to 1 if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define to 1 if you can safely include both and . */ +#undef TIME_WITH_SYS_TIME + +/* Version number of package */ +#undef VERSION + +/* Define to 1 if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING diff --cc configure index 6c1c5dd7,00000000..ae87a59a mode 100644,000000..100644 --- a/configure +++ b/configure @@@ -1,6539 -1,0 +1,3378 @@@ +#! /bin/sh ++ +# Guess values for system-dependent variables and create Makefiles. - # Generated by GNU Autoconf 2.53. ++# Generated automatically using autoconf version 2.13 ++# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# - # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 - # Free Software Foundation, Inc. +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + - if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr - else - as_expr=false - fi - - - ## --------------------- ## - ## M4sh Initialization. ## - ## --------------------- ## - - # Be Bourne compatible - if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix - fi - - # NLS nuisances. - # Support unset when possible. - if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset - else - as_unset=false - fi - - (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } - (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } - (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } - (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } - (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } - (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } - (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } - (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } - - - # Name of the executable. - as_me=`(basename "$0") 2>/dev/null || - $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || - echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - # PATH needs CR, and LINENO needs CR and PATH. - # Avoid depending upon Character Ranges. - as_cr_letters='abcdefghijklmnopqrstuvwxyz' - as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' - as_cr_Letters=$as_cr_letters$as_cr_LETTERS - as_cr_digits='0123456789' - as_cr_alnum=$as_cr_Letters$as_cr_digits - - # The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conftest.sh - fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done - done - ;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit - } - - - case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' - ' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; - esac - - if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr - else - as_expr=false - fi - - rm -f conf$$ conf$$.exe conf$$.file - echo >conf$$.file - if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi - rm -f conf$$ conf$$.exe conf$$.file - - as_executable_p="test -f" - - # Sed expression to map a string onto a valid CPP name. - as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - - # Sed expression to map a string onto a valid variable name. - as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - - # IFS - # We need space, tab and new line, in precisely that order. - as_nl=' - ' - IFS=" $as_nl" - - # CDPATH. - $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } - - - # Name of the host. - # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, - # so uname gets run too. - ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - - exec 6>&1 - - # - # Initializations. - # ++# Defaults: ++ac_help= +ac_default_prefix=/usr/local - cross_compiling=no - subdirs= - MFLAGS= - MAKEFLAGS= - SHELL=${CONFIG_SHELL-/bin/sh} - - # Maximum number of lines to put in a shell here document. - # This variable seems obsolete. It should probably be removed, and - # only ac_max_sed_lines should be used. - : ${ac_max_here_lines=38} - - # Identity of this package. - PACKAGE_NAME= - PACKAGE_TARNAME= - PACKAGE_VERSION= - PACKAGE_STRING= - PACKAGE_BUGREPORT= - - ac_unique_file="src/openbox.cc" - # Factoring default headers for most tests. - ac_includes_default="\ - #include - #if HAVE_SYS_TYPES_H - # include - #endif - #if HAVE_SYS_STAT_H - # include - #endif - #if STDC_HEADERS - # include - # include - #else - # if HAVE_STDLIB_H - # include - # endif - #endif - #if HAVE_STRING_H - # if !STDC_HEADERS && HAVE_MEMORY_H - # include - # endif - # include - #endif - #if HAVE_STRINGS_H - # include - #endif - #if HAVE_INTTYPES_H - # include - #else - # if HAVE_STDINT_H - # include - # endif - #endif - #if HAVE_UNISTD_H - # include - #endif" - ++# Any additions from configure.in: ++ac_help="$ac_help ++ --with-x use the X Window System" ++ac_help="$ac_help ++ --enable-shape enable support of the XShape extension [default=yes]" ++ac_help="$ac_help ++ --enable-slit include code for the Slit [default=yes]" ++ac_help="$ac_help ++ --enable-newspec include code for the new WM Spec (DOES NOTHING) ++ [default=no]" ++ac_help="$ac_help ++ --enable-interlace include code for image interlacing [default=yes]" ++ac_help="$ac_help ++ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp) ++ dithering [default=no]" ++ac_help="$ac_help ++ --enable-clobber intercept mouse events to clients when num lock ++ or scroll lock are on [default=yes]" ++ac_help="$ac_help ++ --enable-debug include verbose debugging code [default=no]" ++ac_help="$ac_help ++ --enable-nls include natural language support [default=yes]" ++ac_help="$ac_help ++ --enable-timed-cache use new timed pixmap cache [default=yes]" ++ac_help="$ac_help ++ --enable-maintainer-mode enable make rules and dependencies not useful ++ (and sometimes confusing) to the casual installer" + +# Initialize some variables set by options. - ac_init_help= - ac_init_version=false +# The variables have the same names as the options, with +# dashes changed to underlines. - cache_file=/dev/null ++build=NONE ++cache_file=./config.cache +exec_prefix=NONE ++host=NONE +no_create= ++nonopt=NONE +no_recursion= +prefix=NONE +program_prefix=NONE +program_suffix=NONE +program_transform_name=s,x,x, +silent= +site= +srcdir= ++target=NONE +verbose= +x_includes=NONE +x_libraries=NONE - - # Installation directory options. - # These are left unexpanded so users can "make install exec_prefix=/foo" - # and all the variables that are supposed to be based on exec_prefix - # by default will actually change. - # Use braces instead of parens because sh, perl, etc. also accept them. +bindir='${exec_prefix}/bin' +sbindir='${exec_prefix}/sbin' +libexecdir='${exec_prefix}/libexec' +datadir='${prefix}/share' +sysconfdir='${prefix}/etc' +sharedstatedir='${prefix}/com' +localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' +includedir='${prefix}/include' +oldincludedir='/usr/include' +infodir='${prefix}/info' +mandir='${prefix}/man' + ++# Initialize some other variables. ++subdirs= ++MFLAGS= MAKEFLAGS= ++SHELL=${CONFIG_SHELL-/bin/sh} ++# Maximum number of lines to put in a shell here document. ++ac_max_here_lines=12 ++ +ac_prev= +for ac_option +do ++ + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" + ac_prev= + continue + fi + - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` ++ case "$ac_option" in ++ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; ++ *) ac_optarg= ;; ++ esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + - case $ac_option in ++ case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; ++ bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; ++ ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; ++ build="$ac_optarg" ;; + + -cache-file | --cache-file | --cache-fil | --cache-fi \ + | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) + ac_prev=cache_file ;; + -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ + | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; ++ cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) - datadir=$ac_optarg ;; ++ datadir="$ac_optarg" ;; + + -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` ++ ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; ++ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } ++ fi ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'` ++ eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` ++ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; ++ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } ++ fi ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'` ++ case "$ac_option" in ++ *=*) ;; + *) ac_optarg=yes ;; + esac - eval "enable_$ac_feature='$ac_optarg'" ;; ++ eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ + | --exec | --exe | --ex) + ac_prev=exec_prefix ;; + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; ++ exec_prefix="$ac_optarg" ;; + + -gas | --gas | --ga | --g) + # Obsolete; use --with-gas. + with_gas=yes ;; + - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; ++ -help | --help | --hel | --he) ++ # Omit some internal or obsolete options to make the list less imposing. ++ # This message is too long to be a string in the A/UX 3.1 sh. ++ cat << EOF ++Usage: configure [options] [host] ++Options: [defaults in brackets after descriptions] ++Configuration: ++ --cache-file=FILE cache test results in FILE ++ --help print this message ++ --no-create do not create output files ++ --quiet, --silent do not print \`checking...' messages ++ --version print the version of autoconf that created configure ++Directory and file names: ++ --prefix=PREFIX install architecture-independent files in PREFIX ++ [$ac_default_prefix] ++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX ++ [same as prefix] ++ --bindir=DIR user executables in DIR [EPREFIX/bin] ++ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] ++ --libexecdir=DIR program executables in DIR [EPREFIX/libexec] ++ --datadir=DIR read-only architecture-independent data in DIR ++ [PREFIX/share] ++ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] ++ --sharedstatedir=DIR modifiable architecture-independent data in DIR ++ [PREFIX/com] ++ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] ++ --libdir=DIR object code libraries in DIR [EPREFIX/lib] ++ --includedir=DIR C header files in DIR [PREFIX/include] ++ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] ++ --infodir=DIR info documentation in DIR [PREFIX/info] ++ --mandir=DIR man documentation in DIR [PREFIX/man] ++ --srcdir=DIR find the sources in DIR [configure dir or ..] ++ --program-prefix=PREFIX prepend PREFIX to installed program names ++ --program-suffix=SUFFIX append SUFFIX to installed program names ++ --program-transform-name=PROGRAM ++ run sed PROGRAM on installed program names ++EOF ++ cat << EOF ++Host type: ++ --build=BUILD configure for building on BUILD [BUILD=HOST] ++ --host=HOST configure for HOST [guessed] ++ --target=TARGET configure for TARGET [TARGET=HOST] ++Features and packages: ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --x-includes=DIR X include files are in DIR ++ --x-libraries=DIR X library files are in DIR ++EOF ++ if test -n "$ac_help"; then ++ echo "--enable and --with options recognized:$ac_help" ++ fi ++ exit 0 ;; + + -host | --host | --hos | --ho) - ac_prev=host_alias ;; ++ ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; ++ host="$ac_optarg" ;; + + -includedir | --includedir | --includedi | --included | --include \ + | --includ | --inclu | --incl | --inc) + ac_prev=includedir ;; + -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ + | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; ++ includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; ++ infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; ++ libdir="$ac_optarg" ;; + + -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ + | --libexe | --libex | --libe) + ac_prev=libexecdir ;; + -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ + | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; ++ libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) + ac_prev=localstatedir ;; + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) - localstatedir=$ac_optarg ;; ++ localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; ++ mandir="$ac_optarg" ;; + + -nfp | --nfp | --nf) + # Obsolete; use --without-fp. + with_fp=no ;; + + -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) ++ | --no-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ + | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) + no_recursion=yes ;; + + -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ + | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ + | --oldin | --oldi | --old | --ol | --o) + ac_prev=oldincludedir ;; + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; ++ oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; ++ prefix="$ac_optarg" ;; + + -program-prefix | --program-prefix | --program-prefi | --program-pref \ + | --program-pre | --program-pr | --program-p) + ac_prev=program_prefix ;; + -program-prefix=* | --program-prefix=* | --program-prefi=* \ + | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; ++ program_prefix="$ac_optarg" ;; + + -program-suffix | --program-suffix | --program-suffi | --program-suff \ + | --program-suf | --program-su | --program-s) + ac_prev=program_suffix ;; + -program-suffix=* | --program-suffix=* | --program-suffi=* \ + | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; ++ program_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ + | --program-transform-n | --program-transform- \ + | --program-transform | --program-transfor \ + | --program-transfo | --program-transf \ + | --program-trans | --program-tran \ + | --progr-tra | --program-tr | --program-t) + ac_prev=program_transform_name ;; + -program-transform-name=* | --program-transform-name=* \ + | --program-transform-nam=* | --program-transform-na=* \ + | --program-transform-n=* | --program-transform-=* \ + | --program-transform=* | --program-transfor=* \ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; ++ program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) + silent=yes ;; + + -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; ++ sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ + | --sharedst | --shareds | --shared | --share | --shar \ + | --sha | --sh) + ac_prev=sharedstatedir ;; + -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; ++ sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) - site=$ac_optarg ;; ++ site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; ++ srcdir="$ac_optarg" ;; + + -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ + | --syscon | --sysco | --sysc | --sys | --sy) + ac_prev=sysconfdir ;; + -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ + | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; ++ sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; ++ ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; ++ target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; ++ -version | --version | --versio | --versi | --vers) ++ echo "configure generated by autoconf version 2.13" ++ exit 0 ;; + + -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` ++ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } ++ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ++ fi + ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; ++ case "$ac_option" in ++ *=*) ;; + *) ac_optarg=yes ;; + esac - eval "with_$ac_package='$ac_optarg'" ;; ++ eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` ++ ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; ++ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ++ fi ++ ac_package=`echo $ac_package| sed 's/-/_/g'` ++ eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. + with_x=yes ;; + + -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ + | --x-incl | --x-inc | --x-in | --x-i) + ac_prev=x_includes ;; + -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ + | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; ++ x_includes="$ac_optarg" ;; + + -x-libraries | --x-libraries | --x-librarie | --x-librari \ + | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) + ac_prev=x_libraries ;; + -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ + | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; ++ x_libraries="$ac_optarg" ;; + - -*) { echo "$as_me: error: unrecognized option: $ac_option - Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ++ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" - export $ac_envvar ;; - + *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ++ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then ++ echo "configure: warning: $ac_option: invalid host type" 1>&2 ++ fi ++ if test "x$nonopt" != xNONE; then ++ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ++ fi ++ nonopt="$ac_option" + ;; + + esac +done + +if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } ++ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + - # Be sure to have absolute paths. - for ac_var in exec_prefix prefix - do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac - done ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ++ ++# File descriptor usage: ++# 0 standard input ++# 1 file creation ++# 2 errors and warnings ++# 3 some systems may open it to /dev/tty ++# 4 used on the Kubota Titan ++# 6 checking for... messages and results ++# 5 compiler messages saved in config.log ++if test "$silent" = yes; then ++ exec 6>/dev/null ++else ++ exec 6>&1 ++fi ++exec 5>./config.log + - # Be sure to have absolute paths. - for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir ++echo "\ ++This file contains any messages produced by compilers while ++running configure, to aid debugging if configure makes a mistake. ++" 1>&5 ++ ++# Strip out --no-create and --no-recursion so they do not pile up. ++# Also quote any args containing shell metacharacters. ++ac_configure_args= ++for ac_arg +do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; ++ case "$ac_arg" in ++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ ++ | --no-cr | --no-c) ;; ++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ ++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; ++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ++ ac_configure_args="$ac_configure_args '$ac_arg'" ;; ++ *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac +done + - # There might be people who depend on the old broken behavior: `$host' - # used to hold the argument of --host etc. - # FIXME: To remove some day. - build=$build_alias - host=$host_alias - target=$target_alias - - # FIXME: To remove some day. - if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi - fi - - ac_tool_prefix= - test -n "$host_alias" && ac_tool_prefix=$host_alias- ++# NLS nuisances. ++# Only set these to C if already set. These must not be set unconditionally ++# because not all systems understand e.g. LANG=C (notably SCO). ++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! ++# Non-C LC_CTYPE values break the ctype check. ++if test "${LANG+set}" = set; then LANG=C; export LANG; fi ++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi ++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi ++if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + - test "$silent" = yes && exec 6>/dev/null ++# confdefs.h avoids OS command line length limits that DEFS can exceed. ++rm -rf conftest* confdefs.h ++# AIX cpp loses on an empty file, so make sure it contains at least a newline. ++echo > confdefs.h + ++# A filename unique to this package, relative to the directory that ++# configure is in, which we can look for to find out if srcdir is correct. ++ac_unique_file=src/openbox.cc + +# Find the source files, if location was not specified. +if test -z "$srcdir"; then + ac_srcdir_defaulted=yes + # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || - $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || - echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` ++ ac_prog=$0 ++ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` ++ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. + fi +else + ac_srcdir_defaulted=no +fi +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 - { (exit 1); exit 1; }; } ++ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } ++ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi - srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` - ac_env_build_alias_set=${build_alias+set} - ac_env_build_alias_value=$build_alias - ac_cv_env_build_alias_set=${build_alias+set} - ac_cv_env_build_alias_value=$build_alias - ac_env_host_alias_set=${host_alias+set} - ac_env_host_alias_value=$host_alias - ac_cv_env_host_alias_set=${host_alias+set} - ac_cv_env_host_alias_value=$host_alias - ac_env_target_alias_set=${target_alias+set} - ac_env_target_alias_value=$target_alias - ac_cv_env_target_alias_set=${target_alias+set} - ac_cv_env_target_alias_value=$target_alias - ac_env_CC_set=${CC+set} - ac_env_CC_value=$CC - ac_cv_env_CC_set=${CC+set} - ac_cv_env_CC_value=$CC - ac_env_CFLAGS_set=${CFLAGS+set} - ac_env_CFLAGS_value=$CFLAGS - ac_cv_env_CFLAGS_set=${CFLAGS+set} - ac_cv_env_CFLAGS_value=$CFLAGS - ac_env_LDFLAGS_set=${LDFLAGS+set} - ac_env_LDFLAGS_value=$LDFLAGS - ac_cv_env_LDFLAGS_set=${LDFLAGS+set} - ac_cv_env_LDFLAGS_value=$LDFLAGS - ac_env_CPPFLAGS_set=${CPPFLAGS+set} - ac_env_CPPFLAGS_value=$CPPFLAGS - ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} - ac_cv_env_CPPFLAGS_value=$CPPFLAGS - ac_env_CXX_set=${CXX+set} - ac_env_CXX_value=$CXX - ac_cv_env_CXX_set=${CXX+set} - ac_cv_env_CXX_value=$CXX - ac_env_CXXFLAGS_set=${CXXFLAGS+set} - ac_env_CXXFLAGS_value=$CXXFLAGS - ac_cv_env_CXXFLAGS_set=${CXXFLAGS+set} - ac_cv_env_CXXFLAGS_value=$CXXFLAGS - ac_env_CPP_set=${CPP+set} - ac_env_CPP_value=$CPP - ac_cv_env_CPP_set=${CPP+set} - ac_cv_env_CPP_value=$CPP - - # - # Report the --help message. - # - if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF - \`configure' configures this package to adapt to many kinds of systems. - - Usage: $0 [OPTION]... [VAR=VALUE]... - - To assign environment variables (e.g., CC, CFLAGS...), specify them as - VAR=VALUE. See below for descriptions of some of the useful variables. - - Defaults for the options are specified in brackets. - - Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - - _ACEOF - - cat <<_ACEOF - Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - - By default, \`make install' will install all the files in - \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify - an installation prefix other than \`$ac_default_prefix' using \`--prefix', - for instance \`--prefix=\$HOME'. - - For better control, use the options below. - - Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] - _ACEOF - - cat <<\_ACEOF - - Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - - X features: - --x-includes=DIR X include files are in DIR - --x-libraries=DIR X library files are in DIR - _ACEOF - fi - - if test -n "$ac_init_help"; then - - cat <<\_ACEOF - - Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-shape enable support of the XShape extension default=yes - --enable-slit include code for the Slit default=yes - --enable-newspec include code for the new WM Spec (DOES NOTHING) - default=no - --enable-interlace include code for image interlacing default=yes - --enable-ordered-pseudo include code for ordered pseudocolor (8bpp) - dithering default=no - --enable-clobber intercept mouse events to clients when num lock - or scroll lock are on default=yes - --enable-debug include verbose debugging code default=no - --enable-nls include natural language support default=yes - --enable-timed-cache use new timed pixmap cache default=yes - --enable-maintainer-mode enable make rules and dependencies not useful - (and sometimes confusing) to the casual installer - - Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-x use the X Window System - - Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory - CXX C++ compiler command - CXXFLAGS C++ compiler flags - CPP C preprocessor - - Use these variables to override the choices made by `configure' or to help - it to find libraries and programs with nonstandard names/locations. - - _ACEOF - fi - - if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - ac_popdir=`pwd` - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue - ac_builddir=. - - if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` - else - ac_dir_suffix= ac_top_builddir= - fi - - case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; - esac - # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be - # absolute. - ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` - ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` - ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` - ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir - done - fi - - test -n "$ac_init_help" && exit 0 - if $ac_init_version; then - cat <<\_ACEOF - - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 - Free Software Foundation, Inc. - This configure script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it. - _ACEOF - exit 0 - fi - exec 5>config.log - cat >&5 <<_ACEOF - This file contains any messages produced by compilers while - running configure, to aid debugging if configure makes a mistake. - - It was created by $as_me, which was - generated by GNU Autoconf 2.53. Invocation command line was - - $ $0 $@ - - _ACEOF - { - cat <<_ASUNAME - ## --------- ## - ## Platform. ## - ## --------- ## - - hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` - uname -m = `(uname -m) 2>/dev/null || echo unknown` - uname -r = `(uname -r) 2>/dev/null || echo unknown` - uname -s = `(uname -s) 2>/dev/null || echo unknown` - uname -v = `(uname -v) 2>/dev/null || echo unknown` - - /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` - /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - - /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` - /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` - /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` - hostinfo = `(hostinfo) 2>/dev/null || echo unknown` - /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` - /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` - /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - - _ASUNAME - - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" - done - - } >&5 - - cat >&5 <<_ACEOF - - - ## ----------- ## - ## Core tests. ## - ## ----------- ## - - _ACEOF - - - # Keep a trace of the command line. - # Strip out --no-create and --no-recursion so they do not pile up. - # Also quote any args containing shell meta-characters. - ac_configure_args= - ac_sep= - for ac_arg - do - case $ac_arg in - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n ) continue ;; - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - ac_sep=" " ;; - esac - # Get rid of the leading space. - done - - # When interrupted or exit'd, cleanup temporary files, and complete - # config.log. We remove comments because anyway the quotes in there - # would cause problems or look ugly. - # WARNING: Be sure not to use single quotes in there, as some shells, - # such as our DU 5.0 friend, will then `close' the trap. - trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - cat <<\_ASBOX - ## ---------------- ## - ## Cache variables. ## - ## ---------------- ## - _ASBOX - echo - # The following way of writing the cache mishandles newlines in values, - { - (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) - sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; - *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; - } - echo - if test -s confdefs.h; then - cat <<\_ASBOX - ## ----------- ## - ## confdefs.h. ## - ## ----------- ## - _ASBOX - echo - sed "/^$/d" confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core core.* *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status - ' 0 - for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal - done - ac_signal=0 - - # confdefs.h avoids OS command line length limits that DEFS can exceed. - rm -rf conftest* confdefs.h - # AIX cpp loses on an empty file, so make sure it contains at least a newline. - echo >confdefs.h - - # Predefined preprocessor variables. - - cat >>confdefs.h <<_ACEOF - #define PACKAGE_NAME "$PACKAGE_NAME" - _ACEOF - ++srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + - cat >>confdefs.h <<_ACEOF - #define PACKAGE_TARNAME "$PACKAGE_TARNAME" - _ACEOF - - - cat >>confdefs.h <<_ACEOF - #define PACKAGE_VERSION "$PACKAGE_VERSION" - _ACEOF - - - cat >>confdefs.h <<_ACEOF - #define PACKAGE_STRING "$PACKAGE_STRING" - _ACEOF - - - cat >>confdefs.h <<_ACEOF - #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" - _ACEOF - - - # Let the site file select an alternate cache file if it wants to. +# Prefer explicitly selected file to automatically selected ones. +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi +fi +for ac_site_file in $CONFIG_SITE; do + if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 - echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 ++ echo "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 - echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; - esac - fi ++ echo "loading cache $cache_file" ++ . $cache_file +else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 - echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file - fi - - # Check that the precious variables saved in the cache have kept the same - # value. - ac_cache_corrupted=false - for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 - echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 - echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 - echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 - echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 - echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi - done - if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 - echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 - echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } ++ echo "creating cache $cache_file" ++ > $cache_file +fi + +ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross ++ ++ac_exeext= ++ac_objext=o ++if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then ++ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. ++ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ++ ac_n= ac_c=' ++' ac_t=' ' ++ else ++ ac_n=-n ac_c= ac_t= ++ fi ++else ++ ac_n= ac_c='\c' ac_t= ++fi + + +ac_aux_dir= +for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" + break + elif test -f $ac_dir/install.sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install.sh -c" + break - elif test -f $ac_dir/shtool; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break + fi +done +if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 - echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} - { (exit 1); exit 1; }; } ++ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi - ac_config_guess="$SHELL $ac_aux_dir/config.guess" - ac_config_sub="$SHELL $ac_aux_dir/config.sub" - ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ++ac_config_guess=$ac_aux_dir/config.guess ++ac_config_sub=$ac_aux_dir/config.sub ++ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install - # AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. - echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 - echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 ++echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ++echo "configure:582: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then - if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. - case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi ++if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" ++ for ac_dir in $PATH; do ++ # Account for people who put trailing slashes in PATH elements. ++ case "$ac_dir/" in ++ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; ++ *) ++ # OSF1 and SCO ODT 3.0 have their own names for install. ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do ++ if test -f $ac_dir/$ac_prog; then ++ if test $ac_prog = install && ++ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then ++ # AIX install. It has an incompatible calling convention. ++ : ++ else ++ ac_cv_path_install="$ac_dir/$ac_prog -c" ++ break 2 ++ fi ++ fi + done - done - ;; - esac - done - ++ ;; ++ esac ++ done ++ IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install ++ INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. - INSTALL=$ac_install_sh ++ INSTALL="$ac_install_sh" + fi +fi - echo "$as_me:$LINENO: result: $INSTALL" >&5 - echo "${ECHO_T}$INSTALL" >&6 ++echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + - test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + - echo "$as_me:$LINENO: checking whether build environment is sane" >&5 - echo $ECHO_N "checking whether build environment is sane... $ECHO_C" >&6 ++echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 ++echo "configure:635: checking whether build environment is sane" >&5 +# Just in case +sleep 1 +echo timestamp > conftestfile +# Do `set' in a subshell so we don't clobber the current shell's +# arguments. Must try -L first in case configure is actually a +# symlink; some systems play weird games with the mod time of symlinks +# (eg FreeBSD returns the mod time of the symlink's containing +# directory). +if ( + set X `ls -Lt $srcdir/configure conftestfile 2> /dev/null` + if test "$*" = "X"; then + # -L didn't work. + set X `ls -t $srcdir/configure conftestfile` + fi + if test "$*" != "X $srcdir/configure conftestfile" \ + && test "$*" != "X conftestfile $srcdir/configure"; then + + # If neither matched, then we have a broken ls. This can happen + # if, for instance, CONFIG_SHELL is bash and it inherits a + # broken ls alias from the environment. This has actually + # happened. Such a system could not be considered "sane". - { { echo "$as_me:$LINENO: error: ls -t appears to fail. Make sure there is not a broken - alias in your environment" >&5 - echo "$as_me: error: ls -t appears to fail. Make sure there is not a broken - alias in your environment" >&2;} - { (exit 1); exit 1; }; } ++ { echo "configure: error: ls -t appears to fail. Make sure there is not a broken ++alias in your environment" 1>&2; exit 1; } + fi + + test "$2" = conftestfile + ) +then + # Ok. + : +else - { { echo "$as_me:$LINENO: error: newly created file is older than distributed files! - Check your system clock" >&5 - echo "$as_me: error: newly created file is older than distributed files! - Check your system clock" >&2;} - { (exit 1); exit 1; }; } ++ { echo "configure: error: newly created file is older than distributed files! ++Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++echo "$ac_t""yes" 1>&6 ++if test "$program_transform_name" = s,x,x,; then ++ program_transform_name= ++else ++ # Double any \ or $. echo might interpret backslashes. ++ cat <<\EOF_SED > conftestsed ++s,\\,\\\\,g; s,\$,$$,g ++EOF_SED ++ program_transform_name="`echo $program_transform_name|sed -f conftestsed`" ++ rm -f conftestsed ++fi +test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" ++ program_transform_name="s,^,${program_prefix},; $program_transform_name" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" - # Double any \ or $. echo might interpret backslashes. - # By default was `s,x,x', remove it if useless. - cat <<\_ACEOF >conftest.sed - s/[\\$]/&&/g;s/;s,x,x,$// - _ACEOF - program_transform_name=`echo $program_transform_name | sed -f conftest.sed` - rm conftest.sed - - echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \${MAKE}" >&5 - echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 - set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` - if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.make <<\_ACEOF ++ program_transform_name="s,\$\$,${program_suffix},; $program_transform_name" ++ ++# sed with no file args requires a program. ++test "$program_transform_name" = "" && program_transform_name="s,x,x," ++ ++echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 ++echo "configure:692: checking whether ${MAKE-make} sets \${MAKE}" >&5 ++set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftestmake <<\EOF +all: + @echo 'ac_maketemp="${MAKE}"' - _ACEOF ++EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. - eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` ++eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi - rm -f conftest.make ++rm -f conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + SET_MAKE= +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=openbox + - VERSION=0.99.0 ++VERSION=1.2.3 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then - { { echo "$as_me:$LINENO: error: source directory already configured; run \"make distclean\" there first" >&5 - echo "$as_me: error: source directory already configured; run \"make distclean\" there first" >&2;} - { (exit 1); exit 1; }; } ++ { echo "configure: error: source directory already configured; run "make distclean" there first" 1>&2; exit 1; } +fi + + + +missing_dir=`cd $ac_aux_dir && pwd` - echo "$as_me:$LINENO: checking for working aclocal" >&5 - echo $ECHO_N "checking for working aclocal... $ECHO_C" >&6 ++echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 ++echo "configure:731: checking for working aclocal" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (aclocal --version) < /dev/null > /dev/null 2>&1; then + ACLOCAL=aclocal - echo "$as_me:$LINENO: result: found" >&5 - echo "${ECHO_T}found" >&6 ++ echo "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" - echo "$as_me:$LINENO: result: missing" >&5 - echo "${ECHO_T}missing" >&6 ++ echo "$ac_t""missing" 1>&6 +fi + - echo "$as_me:$LINENO: checking for working autoconf" >&5 - echo $ECHO_N "checking for working autoconf... $ECHO_C" >&6 ++echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 ++echo "configure:744: checking for working autoconf" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoconf --version) < /dev/null > /dev/null 2>&1; then + AUTOCONF=autoconf - echo "$as_me:$LINENO: result: found" >&5 - echo "${ECHO_T}found" >&6 ++ echo "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" - echo "$as_me:$LINENO: result: missing" >&5 - echo "${ECHO_T}missing" >&6 ++ echo "$ac_t""missing" 1>&6 +fi + - echo "$as_me:$LINENO: checking for working automake" >&5 - echo $ECHO_N "checking for working automake... $ECHO_C" >&6 ++echo $ac_n "checking for working automake""... $ac_c" 1>&6 ++echo "configure:757: checking for working automake" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (automake --version) < /dev/null > /dev/null 2>&1; then + AUTOMAKE=automake - echo "$as_me:$LINENO: result: found" >&5 - echo "${ECHO_T}found" >&6 ++ echo "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" - echo "$as_me:$LINENO: result: missing" >&5 - echo "${ECHO_T}missing" >&6 ++ echo "$ac_t""missing" 1>&6 +fi + - echo "$as_me:$LINENO: checking for working autoheader" >&5 - echo $ECHO_N "checking for working autoheader... $ECHO_C" >&6 ++echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 ++echo "configure:770: checking for working autoheader" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (autoheader --version) < /dev/null > /dev/null 2>&1; then + AUTOHEADER=autoheader - echo "$as_me:$LINENO: result: found" >&5 - echo "${ECHO_T}found" >&6 ++ echo "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" - echo "$as_me:$LINENO: result: missing" >&5 - echo "${ECHO_T}missing" >&6 ++ echo "$ac_t""missing" 1>&6 +fi + - echo "$as_me:$LINENO: checking for working makeinfo" >&5 - echo $ECHO_N "checking for working makeinfo... $ECHO_C" >&6 ++echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 ++echo "configure:783: checking for working makeinfo" >&5 +# Run test in a subshell; some versions of sh will print an error if +# an executable is not found, even if stderr is redirected. +# Redirect stdin to placate older versions of autoconf. Sigh. +if (makeinfo --version) < /dev/null > /dev/null 2>&1; then + MAKEINFO=makeinfo - echo "$as_me:$LINENO: result: found" >&5 - echo "${ECHO_T}found" >&6 ++ echo "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" - echo "$as_me:$LINENO: result: missing" >&5 - echo "${ECHO_T}missing" >&6 ++ echo "$ac_t""missing" 1>&6 +fi + + + +test x$prefix = "xNONE" && prefix="$ac_default_prefix" + + - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. - set dummy ${ac_tool_prefix}gcc; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++# Extract the first word of "gcc", so it can be a program name with args. ++set dummy gcc; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:803: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - - fi - fi - CC=$ac_cv_prog_CC - if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 - echo "${ECHO_T}$CC" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - - fi - if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. - set dummy gcc; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - - fi - fi - ac_ct_CC=$ac_cv_prog_ac_ct_CC - if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 - echo "${ECHO_T}$ac_ct_CC" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - - CC=$ac_ct_CC - else - CC="$ac_cv_prog_CC" - fi - - if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. - set dummy ${ac_tool_prefix}cc; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_CC="gcc" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" +fi +fi - CC=$ac_cv_prog_CC ++CC="$ac_cv_prog_CC" +if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 - echo "${ECHO_T}$CC" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - - fi - if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. - set dummy cc; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - - fi - fi - ac_ct_CC=$ac_cv_prog_ac_ct_CC - if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 - echo "${ECHO_T}$ac_ct_CC" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - - CC=$ac_ct_CC ++ echo "$ac_t""$CC" 1>&6 +else - CC="$ac_cv_prog_CC" ++ echo "$ac_t""no" 1>&6 +fi + - fi +if test -z "$CC"; then + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:833: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_prog_rejected=no - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ++ ac_prog_rejected=yes ++ continue ++ fi ++ ac_cv_prog_CC="cc" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" +if test $ac_prog_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $ac_cv_prog_CC + shift - if test $# != 0; then ++ if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same basename, so the bogon will be chosen + # first if we set CC to just the basename; use the full file name. + shift - set dummy "$as_dir/$ac_word" ${1+"$@"} ++ set dummy "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi - CC=$ac_cv_prog_CC ++CC="$ac_cv_prog_CC" +if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 - echo "${ECHO_T}$CC" >&6 ++ echo "$ac_t""$CC" 1>&6 +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 +fi + - fi - if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. - set dummy $ac_tool_prefix$ac_prog; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ if test -z "$CC"; then ++ case "`uname -s`" in ++ *win32* | *WIN32*) ++ # Extract the first word of "cl", so it can be a program name with args. ++set dummy cl; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:884: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CC"; then + ac_cv_prog_CC="$CC" # Let the user override the test. +else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_CC="cl" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" +fi +fi - CC=$ac_cv_prog_CC ++CC="$ac_cv_prog_CC" +if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 - echo "${ECHO_T}$CC" >&6 ++ echo "$ac_t""$CC" 1>&6 +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - - test -n "$CC" && break - done ++ echo "$ac_t""no" 1>&6 +fi - if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl - do - # Extract the first word of "$ac_prog", so it can be a program name with args. - set dummy $ac_prog; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 ++ ;; ++ esac + fi - done - done - - fi - fi - ac_ct_CC=$ac_cv_prog_ac_ct_CC - if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 - echo "${ECHO_T}$ac_ct_CC" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - - test -n "$ac_ct_CC" && break - done - - CC=$ac_ct_CC - fi - ++ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } +fi + ++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ++echo "configure:916: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + - test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 - echo "$as_me: error: no acceptable C compiler found in \$PATH" >&2;} - { (exit 1); exit 1; }; } ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross + - # Provide some information about the compiler. - echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 - ac_compiler=`set X $ac_compile; echo $2` - { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } ++cat > conftest.$ac_ext << EOF + - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++#line 927 "configure" +#include "confdefs.h" + - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - - ; - return 0; - } - _ACEOF - ac_clean_files_save=$ac_clean_files - ac_clean_files="$ac_clean_files a.out a.exe" - # Try to create an executable without -o first, disregard a.out. - # It will help us diagnose broken compilers, and finding out an intuition - # of exeext. - echo "$as_me:$LINENO: checking for C compiler default output" >&5 - echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 - ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is - # not robust to junk in `.', hence go to wildcards (a.*) only as a last - # resort. - - # Be careful to initialize this variable, since it used to be cached. - # Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. - ac_cv_exeext= - for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; - ls a.out conftest 2>/dev/null; - ls a.* conftest.* 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; - a.out ) # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool --akim. - export ac_cv_exeext - break;; - * ) break;; - esac - done - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - { { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 - echo "$as_me: error: C compiler cannot create executables" >&2;} - { (exit 77); exit 77; }; } - fi - - ac_exeext=$ac_cv_exeext - echo "$as_me:$LINENO: result: $ac_file" >&5 - echo "${ECHO_T}$ac_file" >&6 - - # Check the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. - echo "$as_me:$LINENO: checking whether the C compiler works" >&5 - echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 - # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 - # If not cross compiling, check that we can run a simple program. - if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no ++main(){return(0);} ++EOF ++if { (eval echo configure:932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ ac_cv_prog_cc_works=yes ++ # If we can't run a trivial program, we are probably using a cross compiler. ++ if (./conftest; exit) 2>/dev/null; then ++ ac_cv_prog_cc_cross=no + else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. - If you meant to cross compile, use \`--host'." >&5 - echo "$as_me: error: cannot run C compiled programs. - If you meant to cross compile, use \`--host'." >&2;} - { (exit 1); exit 1; }; } - fi ++ ac_cv_prog_cc_cross=yes + fi - fi - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 - - rm -f a.out a.exe conftest$ac_cv_exeext - ac_clean_files=$ac_clean_files_save - # Check the compiler produces executables we can run. If not, either - # the compiler is broken, or we cross compile. - echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 - echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 - echo "$as_me:$LINENO: result: $cross_compiling" >&5 - echo "${ECHO_T}$cross_compiling" >&6 - - echo "$as_me:$LINENO: checking for suffix of executables" >&5 - echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) - # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will - # work properly (i.e., refer to `conftest.exe'), while it won't with - # `rm'. - for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext - break;; - * ) break;; - esac - done +else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 - echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&2;} - { (exit 1); exit 1; }; } ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ ac_cv_prog_cc_works=no +fi ++rm -fr conftest* ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross + - rm -f conftest$ac_cv_exeext - echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 - echo "${ECHO_T}$ac_cv_exeext" >&6 ++echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 ++if test $ac_cv_prog_cc_works = no; then ++ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } ++fi ++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ++echo "configure:958: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 ++cross_compiling=$ac_cv_prog_cc_cross + - rm -f conftest.$ac_ext - EXEEXT=$ac_cv_exeext - ac_exeext=$EXEEXT - echo "$as_me:$LINENO: checking for suffix of object files" >&5 - echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 - if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ++echo "configure:963: checking whether we are using GNU C" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } ++ cat > conftest.c <&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac - done ++EOF ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:972: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++ ac_cv_prog_gcc=yes +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - { { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 - echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&2;} - { (exit 1); exit 1; }; } ++ ac_cv_prog_gcc=no +fi - - rm -f conftest.$ac_cv_objext conftest.$ac_ext +fi - echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 - echo "${ECHO_T}$ac_cv_objext" >&6 - OBJEXT=$ac_cv_objext - ac_objext=$OBJEXT - echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 - echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 - if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" + - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - #ifndef __GNUC__ - choke me - #endif ++echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_compiler_gnu=no - fi - rm -f conftest.$ac_objext conftest.$ac_ext - ac_cv_c_compiler_gnu=$ac_compiler_gnu - - fi - echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 - echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 - GCC=`test $ac_compiler_gnu = yes && echo yes` - ac_test_CFLAGS=${CFLAGS+set} - ac_save_CFLAGS=$CFLAGS - CFLAGS="-g" - echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 - echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 - if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" ++if test $ac_cv_prog_gcc = yes; then ++ GCC=yes ++else ++ GCC= ++fi + - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then ++ac_test_CFLAGS="${CFLAGS+set}" ++ac_save_CFLAGS="$CFLAGS" ++CFLAGS= ++echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ++echo "configure:991: checking whether ${CC-cc} accepts -g" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ echo 'void f(){}' > conftest.c ++if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cc_g=no ++ ac_cv_prog_cc_g=no +fi - rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest* ++ +fi - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 - echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 ++ ++echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 +if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS ++ CFLAGS="$ac_save_CFLAGS" +elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" + else + CFLAGS="-g" + fi +else + if test "$GCC" = yes; then + CFLAGS="-O2" + else + CFLAGS= + fi +fi - # Some people use a C++ compiler to compile C. Since we use `exit', - # in C++ we need to declare it. In case someone uses the same compiler - # for both compiling C and C++ we need to have the C++ compiler decide - # the declaration of exit, since it's the most demanding environment. - cat >conftest.$ac_ext <<_ACEOF - #ifndef __cplusplus - choke me - #endif - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' - do - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - $ac_declaration - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - exit (42); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - continue - fi - rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - $ac_declaration - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - exit (42); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest.$ac_objext conftest.$ac_ext - done - rm -f conftest* - if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h - fi - - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest.$ac_objext conftest.$ac_ext - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu + - ac_ext=cc - ac_cpp='$CXXCPP $CPPFLAGS' - ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_cxx_compiler_gnu - if test -n "$ac_tool_prefix"; then - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. - set dummy $ac_tool_prefix$ac_prog; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++for ac_prog in $CCC c++ g++ gcc CC cxx cc++ cl ++do ++# Extract the first word of "$ac_prog", so it can be a program name with args. ++set dummy $ac_prog; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1027: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$CXX"; then + ac_cv_prog_CXX="$CXX" # Let the user override the test. +else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_CXX="$ac_prog" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" +fi +fi - CXX=$ac_cv_prog_CXX ++CXX="$ac_cv_prog_CXX" +if test -n "$CXX"; then - echo "$as_me:$LINENO: result: $CXX" >&5 - echo "${ECHO_T}$CXX" >&6 ++ echo "$ac_t""$CXX" 1>&6 +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 +fi + - test -n "$CXX" && break - done - fi - if test -z "$CXX"; then - ac_ct_CXX=$CXX - for ac_prog in $CCC g++ c++ gpp aCC CC cxx cc++ cl FCC KCC RCC xlC_r xlC - do - # Extract the first word of "$ac_prog", so it can be a program name with args. - set dummy $ac_prog; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - if test -n "$ac_ct_CXX"; then - ac_cv_prog_ac_ct_CXX="$ac_ct_CXX" # Let the user override the test. - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CXX="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done ++test -n "$CXX" && break +done ++test -n "$CXX" || CXX="gcc" + - fi - fi - ac_ct_CXX=$ac_cv_prog_ac_ct_CXX - if test -n "$ac_ct_CXX"; then - echo "$as_me:$LINENO: result: $ac_ct_CXX" >&5 - echo "${ECHO_T}$ac_ct_CXX" >&6 ++ ++echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ++echo "configure:1059: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ++ ++ac_ext=C ++# CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CXXCPP $CPPFLAGS' ++ac_compile='${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cxx_cross ++ ++cat > conftest.$ac_ext << EOF ++ ++#line 1070 "configure" ++#include "confdefs.h" ++ ++int main(){return(0);} ++EOF ++if { (eval echo configure:1075: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ ac_cv_prog_cxx_works=yes ++ # If we can't run a trivial program, we are probably using a cross compiler. ++ if (./conftest; exit) 2>/dev/null; then ++ ac_cv_prog_cxx_cross=no ++ else ++ ac_cv_prog_cxx_cross=yes ++ fi +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ ac_cv_prog_cxx_works=no +fi ++rm -fr conftest* ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross + - test -n "$ac_ct_CXX" && break - done - test -n "$ac_ct_CXX" || ac_ct_CXX="g++" - - CXX=$ac_ct_CXX - fi - - - # Provide some information about the compiler. - echo "$as_me:$LINENO:" \ - "checking for C++ compiler version" >&5 - ac_compiler=`set X $ac_compile; echo $2` - { (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - { (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - - echo "$as_me:$LINENO: checking whether we are using the GNU C++ compiler" >&5 - echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 - if test "${ac_cv_cxx_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" ++echo "$ac_t""$ac_cv_prog_cxx_works" 1>&6 ++if test $ac_cv_prog_cxx_works = no; then ++ { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } ++fi ++echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ++echo "configure:1101: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 ++cross_compiling=$ac_cv_prog_cxx_cross + - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - #ifndef __GNUC__ - choke me ++echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 ++echo "configure:1106: checking whether we are using GNU C++" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++ ac_cv_prog_gxx=yes ++else ++ ac_cv_prog_gxx=no ++fi ++fi + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_compiler_gnu=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_compiler_gnu=no - fi - rm -f conftest.$ac_objext conftest.$ac_ext - ac_cv_cxx_compiler_gnu=$ac_compiler_gnu - - fi - echo "$as_me:$LINENO: result: $ac_cv_cxx_compiler_gnu" >&5 - echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 - GXX=`test $ac_compiler_gnu = yes && echo yes` - ac_test_CXXFLAGS=${CXXFLAGS+set} - ac_save_CXXFLAGS=$CXXFLAGS - CXXFLAGS="-g" - echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5 - echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 - if test "${ac_cv_prog_cxx_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" ++echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then ++if test $ac_cv_prog_gxx = yes; then ++ GXX=yes ++else ++ GXX= ++fi ++ ++ac_test_CXXFLAGS="${CXXFLAGS+set}" ++ac_save_CXXFLAGS="$CXXFLAGS" ++CXXFLAGS= ++echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 ++echo "configure:1134: checking whether ${CXX-g++} accepts -g" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ echo 'void f(){}' > conftest.cc ++if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then + ac_cv_prog_cxx_g=yes +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_prog_cxx_g=no ++ ac_cv_prog_cxx_g=no +fi - rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest* ++ +fi - echo "$as_me:$LINENO: result: $ac_cv_prog_cxx_g" >&5 - echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 ++ ++echo "$ac_t""$ac_cv_prog_cxx_g" 1>&6 +if test "$ac_test_CXXFLAGS" = set; then - CXXFLAGS=$ac_save_CXXFLAGS ++ CXXFLAGS="$ac_save_CXXFLAGS" +elif test $ac_cv_prog_cxx_g = yes; then + if test "$GXX" = yes; then + CXXFLAGS="-g -O2" + else + CXXFLAGS="-g" + fi +else + if test "$GXX" = yes; then + CXXFLAGS="-O2" + else + CXXFLAGS= + fi +fi - for ac_declaration in \ - ''\ - '#include ' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' - do - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - $ac_declaration - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - exit (42); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - continue - fi - rm -f conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - $ac_declaration - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - exit (42); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - fi - rm -f conftest.$ac_objext conftest.$ac_ext - done - rm -f conftest* - if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h - fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu + +# Find a good install program. We prefer a C program (faster), +# so one script is as good as another. But avoid the broken or +# incompatible versions: +# SysV /etc/install, /usr/sbin/install +# SunOS /usr/etc/install +# IRIX /sbin/install +# AIX /bin/install - # AmigaOS /C/install, which installs bootblocks on floppy discs +# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag +# AFS /usr/afsws/bin/install, which mishandles nonexistent args +# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" +# ./install, which can be erroneously created by make from ./install.sh. - echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 - echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 ++echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ++echo "configure:1177: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then - if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. - case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi ++if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" ++ for ac_dir in $PATH; do ++ # Account for people who put trailing slashes in PATH elements. ++ case "$ac_dir/" in ++ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; ++ *) ++ # OSF1 and SCO ODT 3.0 have their own names for install. ++ # Don't use installbsd from OSF since it installs stuff as root ++ # by default. ++ for ac_prog in ginstall scoinst install; do ++ if test -f $ac_dir/$ac_prog; then ++ if test $ac_prog = install && ++ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then ++ # AIX install. It has an incompatible calling convention. ++ : ++ else ++ ac_cv_path_install="$ac_dir/$ac_prog -c" ++ break 2 ++ fi ++ fi + done - done - ;; - esac - done - ++ ;; ++ esac ++ done ++ IFS="$ac_save_IFS" + +fi + if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install ++ INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. - INSTALL=$ac_install_sh ++ INSTALL="$ac_install_sh" + fi +fi - echo "$as_me:$LINENO: result: $INSTALL" >&5 - echo "${ECHO_T}$INSTALL" >&6 ++echo "$ac_t""$INSTALL" 1>&6 + +# Use test -z because SunOS4 sh mishandles braces in ${var-val}. +# It thinks the first close brace ends the variable substitution. +test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' + - test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' ++test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + +for ac_prog in sed +do - # Extract the first word of "$ac_prog", so it can be a program name with args. ++# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_regex_cmd+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:1235: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_regex_cmd'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$regex_cmd"; then + ac_cv_prog_regex_cmd="$regex_cmd" # Let the user override the test. +else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_regex_cmd="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - - fi - fi - regex_cmd=$ac_cv_prog_regex_cmd - if test -n "$regex_cmd"; then - echo "$as_me:$LINENO: result: $regex_cmd" >&5 - echo "${ECHO_T}$regex_cmd" >&6 - else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - fi - - test -n "$regex_cmd" && break - done - - if test x$regex_cmd = "x"; then - { { echo "$as_me:$LINENO: error: error. sed is required to build the default menu file." >&5 - echo "$as_me: error: error. sed is required to build the default menu file." >&2;} - { (exit 1); exit 1; }; } - fi - - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 - echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 - # On Suns, sometimes $CPP names a directory. - if test -n "$CPP" && test -d "$CPP"; then - CPP= - fi - if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false - for ac_c_preproc_warn_flag in '' yes - do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - Syntax error - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi - else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then - : - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Broken: fails on valid input. - continue - fi - rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi - else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. - continue - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Passes both tests. - ac_preproc_ok=: - break - fi - rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. - rm -f conftest.err conftest.$ac_ext - if $ac_preproc_ok; then - break - fi - - done - ac_cv_prog_CPP=$CPP - - fi - CPP=$ac_cv_prog_CPP - else - ac_cv_prog_CPP=$CPP - fi - echo "$as_me:$LINENO: result: $CPP" >&5 - echo "${ECHO_T}$CPP" >&6 - ac_preproc_ok=false - for ac_c_preproc_warn_flag in '' yes - do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - Syntax error - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi - else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then - : - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Broken: fails on valid input. - continue - fi - rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether non-existent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi - else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then - # Broken: success on invalid input. - continue - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - # Passes both tests. - ac_preproc_ok=: - break - fi - rm -f conftest.err conftest.$ac_ext - - done - # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. - rm -f conftest.err conftest.$ac_ext - if $ac_preproc_ok; then - : - else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 - echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} - { (exit 1); exit 1; }; } - fi - - ac_ext=c - ac_cpp='$CPP $CPPFLAGS' - ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' - ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' - ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - echo "$as_me:$LINENO: checking for ANSI C header files" >&5 - echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 - if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - #include - #include - #include - - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi - else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then - ac_cv_header_stdc=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_stdc=no - fi - rm -f conftest.err conftest.$ac_ext - - if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - - _ACEOF - if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "memchr" >/dev/null 2>&1; then - : - else - ac_cv_header_stdc=no - fi - rm -f conftest* - - fi - - if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - - _ACEOF - if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - egrep "free" >/dev/null 2>&1; then - : - else - ac_cv_header_stdc=no - fi - rm -f conftest* - - fi - - if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - #include - #if ((' ' & 0x0FF) == 0x020) - # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') - # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) - #else - # define ISLOWER(c) (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) - # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) - #endif - - #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) - int - main () - { - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); - } - _ACEOF - rm -f conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : - else - echo "$as_me: program exited with status $ac_status" >&5 - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ( exit $ac_status ) - ac_cv_header_stdc=no - fi - rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext - fi - fi ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_regex_cmd="$ac_prog" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" +fi - echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 - echo "${ECHO_T}$ac_cv_header_stdc" >&6 - if test $ac_cv_header_stdc = yes; then - - cat >>confdefs.h <<\_ACEOF - #define STDC_HEADERS 1 - _ACEOF - ++fi ++regex_cmd="$ac_cv_prog_regex_cmd" ++if test -n "$regex_cmd"; then ++ echo "$ac_t""$regex_cmd" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 +fi + - # On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - - for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_header" >&5 - echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - $ac_includes_default - - #include <$ac_header> - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_Header=yes" - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_Header=no" - fi - rm -f conftest.$ac_objext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF - #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - - fi - - done - - - - - - - - - - - - - - - - - - - ++test -n "$regex_cmd" && break ++done + ++if test x$regex_cmd = "x"; then ++ { echo "configure: error: error. sed is required to build the default menu file." 1>&2; exit 1; } ++fi + - for ac_header in ctype.h dirent.h fcntl.h libgen.h locale.h nl_types.h process.h signal.h stdarg.h stdio.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 - do - as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 - echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 - else - # Is the header compilable? - echo "$as_me:$LINENO: checking $ac_header usability" >&5 - echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ++echo "configure:1269: checking how to run the C preprocessor" >&5 ++# On Suns, sometimes $CPP names a directory. ++if test -n "$CPP" && test -d "$CPP"; then ++ CPP= ++fi ++if test -z "$CPP"; then ++if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ # This must be in double quotes, not single quotes, because CPP may get ++ # substituted into the Makefile and "${CC-cc}" will confuse make. ++ CPP="${CC-cc} -E" ++ # On the NeXT, cc -E runs the code through the compiler's parser, ++ # not just through cpp. ++ cat > conftest.$ac_ext < - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_header_compiler=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_header_compiler=no - fi - rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 - echo "${ECHO_T}$ac_header_compiler" >&6 - - # Is the header present? - echo "$as_me:$LINENO: checking $ac_header presence" >&5 - echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++#include ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:1290: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP="${CC-cc} -E -traditional-cpp" ++ cat > conftest.$ac_ext < - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi ++#include ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:1307: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : +else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then - ac_header_preproc=yes ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ CPP="${CC-cc} -nologo -E" ++ cat > conftest.$ac_ext < ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:1324: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ : +else - echo "$as_me: failed program was:" >&5 ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 - ac_header_preproc=no ++ rm -rf conftest* ++ CPP=/lib/cpp +fi - rm -f conftest.err conftest.$ac_ext - echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 - echo "${ECHO_T}$ac_header_preproc" >&6 - - # So? What about this header? - case $ac_header_compiler:$ac_header_preproc in - yes:no ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 - echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 - echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - no:yes ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 - echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 - echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 - echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; - esac - echo "$as_me:$LINENO: checking for $ac_header" >&5 - echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 - if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++rm -f conftest* ++fi ++rm -f conftest* ++fi ++rm -f conftest* ++ ac_cv_prog_CPP="$CPP" ++fi ++ CPP="$ac_cv_prog_CPP" +else - eval "$as_ac_Header=$ac_header_preproc" ++ ac_cv_prog_CPP="$CPP" +fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 ++echo "$ac_t""$CPP" 1>&6 + ++for ac_hdr in 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 ++do ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:1352: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:1362: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" ++else ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=no" +fi - if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF - #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 - _ACEOF - ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <&6 +fi - +done + - echo "$as_me:$LINENO: checking whether time.h and sys/time.h may both be included" >&5 - echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 - if test "${ac_cv_header_time+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 ++echo "configure:1389: checking whether time.h and sys/time.h may both be included" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ cat > conftest.$ac_ext < +#include +#include - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - if ((struct tm *) 0) - return 0; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then ++int main() { ++struct tm *tp; ++; return 0; } ++EOF ++if { (eval echo configure:1403: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* + ac_cv_header_time=yes +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_header_time=no ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_header_time=no +fi - rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest* +fi - echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5 - echo "${ECHO_T}$ac_cv_header_time" >&6 - if test $ac_cv_header_time = yes; then + - cat >>confdefs.h <<\_ACEOF ++echo "$ac_t""$ac_cv_header_time" 1>&6 ++if test $ac_cv_header_time = yes; then ++ cat >> confdefs.h <<\EOF +#define TIME_WITH_SYS_TIME 1 - _ACEOF ++EOF + +fi + + - +for ac_func in basename +do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_func" >&5 - echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 - if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:1427: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif +/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char $ac_func (); - char (*f) (); - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); ++ ++int main() { ++ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else - f = $ac_func; ++$ac_func(); +#endif + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_var=no" - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 - if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF - #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF - - else - echo "$as_me:$LINENO: checking for basename in -lgen" >&5 - echo $ECHO_N "checking for basename in -lgen... $ECHO_C" >&6 - if test "${ac_cv_lib_gen_basename+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS ++; return 0; } ++EOF ++if { (eval echo configure:1455: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 ++echo $ac_n "checking for basename in -lgen""... $ac_c" 1>&6 ++echo "configure:1477: checking for basename in -lgen" >&5 ++ac_lib_var=`echo gen'_'basename | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" +LIBS="-lgen $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_gen_basename=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_gen_basename=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_gen_basename" >&5 - echo "${ECHO_T}$ac_cv_lib_gen_basename" >&6 - if test $ac_cv_lib_gen_basename = yes; then - cat >>confdefs.h <<\_ACEOF ++ builtin and then its argument prototype would still apply. */ ++char basename(); ++ ++int main() { ++basename() ++; return 0; } ++EOF ++if { (eval echo configure:1496: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ cat >> confdefs.h <<\EOF +#define HAVE_BASENAME 1 - _ACEOF ++EOF + LIBS="$LIBS -lgen" ++else ++ echo "$ac_t""no" 1>&6 +fi + +fi +done + - - - - - - - - - - +for ac_func in getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose +do - as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` - echo "$as_me:$LINENO: checking for $ac_func" >&5 - echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 - if eval "test \"\${$as_ac_var+set}\" = set"; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 ++echo "configure:1525: checking for $ac_func" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif +/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char $ac_func (); - char (*f) (); - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++ builtin and then its argument prototype would still apply. */ ++char $ac_func(); ++ ++int main() { ++ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else - f = $ac_func; ++$ac_func(); +#endif + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - eval "$as_ac_var=yes" - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - eval "$as_ac_var=no" - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 - echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 - if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF - #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 - _ACEOF ++; return 0; } ++EOF ++if { (eval echo configure:1553: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_$ac_func=no" ++fi ++rm -f conftest* ++fi + ++if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` ++ cat >> confdefs.h <&6 +fi +done + - echo "$as_me:$LINENO: checking for t_open in -lnsl" >&5 - echo $ECHO_N "checking for t_open in -lnsl... $ECHO_C" >&6 - if test "${ac_cv_lib_nsl_t_open+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking for t_open in -lnsl""... $ac_c" 1>&6 ++echo "configure:1578: checking for t_open in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'t_open | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_t_open=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_nsl_t_open=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_t_open" >&5 - echo "${ECHO_T}$ac_cv_lib_nsl_t_open" >&6 - if test $ac_cv_lib_nsl_t_open = yes; then ++ builtin and then its argument prototype would still apply. */ ++char t_open(); ++ ++int main() { ++t_open() ++; return 0; } ++EOF ++if { (eval echo configure:1597: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lnsl" ++else ++ echo "$ac_t""no" 1>&6 +fi + - echo "$as_me:$LINENO: checking for socket in -lsocket" >&5 - echo $ECHO_N "checking for socket in -lsocket... $ECHO_C" >&6 - if test "${ac_cv_lib_socket_socket+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 ++echo "configure:1618: checking for socket in -lsocket" >&5 ++ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_socket=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_socket_socket=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5 - echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6 - if test $ac_cv_lib_socket_socket = yes; then - LIBS="$LIBS -lsocket" ++ builtin and then its argument prototype would still apply. */ ++char socket(); ++ ++int main() { ++socket() ++; return 0; } ++EOF ++if { (eval echo configure:1637: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" +fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ LIBS="$LIBS -lsocket" ++else ++ echo "$ac_t""no" 1>&6 ++fi + - echo "$as_me:$LINENO: checking for X" >&5 - echo $ECHO_N "checking for X... $ECHO_C" >&6 + ++# If we find X, set shell vars x_includes and x_libraries to the ++# paths, otherwise set no_x=yes. ++# Uses ac_ vars as temps to allow command line to override cache and checks. ++# --without-x overrides everything else, but does not touch the cache. ++echo $ac_n "checking for X""... $ac_c" 1>&6 ++echo "configure:1663: checking for X" >&5 + +# Check whether --with-x or --without-x was given. +if test "${with_x+set}" = set; then + withval="$with_x" ++ : ++fi + - fi; +# $have_x is `yes', `no', `disabled', or empty when we do not yet know. +if test "x$with_x" = xno; then + # The user explicitly disabled X. + have_x=disabled +else + if test "x$x_includes" != xNONE && test "x$x_libraries" != xNONE; then + # Both variables are already set. + have_x=yes + else - if test "${ac_cv_have_x+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++if eval "test \"`echo '$''{'ac_cv_have_x'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else + # One or both of the vars are not set, and there is no cached value. - ac_x_includes=no ac_x_libraries=no - rm -fr conftest.dir - if mkdir conftest.dir; then - cd conftest.dir ++ac_x_includes=NO ac_x_libraries=NO ++rm -fr conftestdir ++if mkdir conftestdir; then ++ cd conftestdir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. - cat >Imakefile <<'_ACEOF' ++ cat > Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' - _ACEOF ++EOF + if (xmkmf) >/dev/null 2>/dev/null && test -f Makefile; then + # GNU make sometimes prints "make[1]: Entering...", which would confuse us. + eval `${MAKE-make} acfindx 2>/dev/null | grep -v make` + # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR. + for ac_extension in a so sl; do + if test ! -f $ac_im_usrlibdir/libX11.$ac_extension && - test -f $ac_im_libdir/libX11.$ac_extension; then ++ test -f $ac_im_libdir/libX11.$ac_extension; then + ac_im_usrlibdir=$ac_im_libdir; break + fi + done + # Screen out bogus values from the imake configuration. They are + # bogus both because they are the default anyway, and because + # using them would break gcc on systems where it needs fixed includes. - case $ac_im_incroot in ++ case "$ac_im_incroot" in + /usr/include) ;; - *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;; ++ *) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes="$ac_im_incroot" ;; + esac - case $ac_im_usrlibdir in ++ case "$ac_im_usrlibdir" in + /usr/lib | /lib) ;; - *) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;; ++ *) test -d "$ac_im_usrlibdir" && ac_x_libraries="$ac_im_usrlibdir" ;; + esac + fi + cd .. - rm -fr conftest.dir ++ rm -fr conftestdir +fi + - # Standard set of common directories for X headers. - # Check X11 before X11Rn because it is often a symlink to the current release. - ac_x_header_dirs=' - /usr/X11/include - /usr/X11R6/include - /usr/X11R5/include - /usr/X11R4/include - - /usr/include/X11 - /usr/include/X11R6 - /usr/include/X11R5 - /usr/include/X11R4 - - /usr/local/X11/include - /usr/local/X11R6/include - /usr/local/X11R5/include - /usr/local/X11R4/include - - /usr/local/include/X11 - /usr/local/include/X11R6 - /usr/local/include/X11R5 - /usr/local/include/X11R4 - - /usr/X386/include - /usr/x386/include - /usr/XFree86/include/X11 - - /usr/include - /usr/local/include - /usr/unsupported/include - /usr/athena/include - /usr/local/x11r5/include - /usr/lpp/Xamples/include - - /usr/openwin/include - /usr/openwin/share/include' - - if test "$ac_x_includes" = no; then - # Guess where to find include files, by looking for Intrinsic.h. ++if test "$ac_x_includes" = NO; then ++ # Guess where to find include files, by looking for this one X11 .h file. ++ test -z "$x_direct_test_include" && x_direct_test_include=X11/Intrinsic.h ++ + # First, try using that file with no special directory specified. - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext < - _ACEOF - if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 - ac_status=$? - egrep -v '^ *\+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - else - ac_cpp_err= - fi - else - ac_cpp_err=yes - fi - if test -z "$ac_cpp_err"; then ++#include <$x_direct_test_include> ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:1730: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* + # We can compile using X headers with no special include directory. +ac_x_includes= +else - echo "$as_me: failed program was:" >&5 ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 - for ac_dir in $ac_x_header_dirs; do - if test -r "$ac_dir/X11/Intrinsic.h"; then - ac_x_includes=$ac_dir - break - fi - done ++ rm -rf conftest* ++ # Look for the header file in a standard set of common directories. ++# Check X11 before X11Rn because it is often a symlink to the current release. ++ for ac_dir in \ ++ /usr/X11/include \ ++ /usr/X11R6/include \ ++ /usr/X11R5/include \ ++ /usr/X11R4/include \ ++ \ ++ /usr/include/X11 \ ++ /usr/include/X11R6 \ ++ /usr/include/X11R5 \ ++ /usr/include/X11R4 \ ++ \ ++ /usr/local/X11/include \ ++ /usr/local/X11R6/include \ ++ /usr/local/X11R5/include \ ++ /usr/local/X11R4/include \ ++ \ ++ /usr/local/include/X11 \ ++ /usr/local/include/X11R6 \ ++ /usr/local/include/X11R5 \ ++ /usr/local/include/X11R4 \ ++ \ ++ /usr/X386/include \ ++ /usr/x386/include \ ++ /usr/XFree86/include/X11 \ ++ \ ++ /usr/include \ ++ /usr/local/include \ ++ /usr/unsupported/include \ ++ /usr/athena/include \ ++ /usr/local/x11r5/include \ ++ /usr/lpp/Xamples/include \ ++ \ ++ /usr/openwin/include \ ++ /usr/openwin/share/include \ ++ ; \ ++ do ++ if test -r "$ac_dir/$x_direct_test_include"; then ++ ac_x_includes=$ac_dir ++ break ++ fi ++ done +fi - rm -f conftest.err conftest.$ac_ext - fi # $ac_x_includes = no ++rm -f conftest* ++fi # $ac_x_includes = NO + - if test "$ac_x_libraries" = no; then ++if test "$ac_x_libraries" = NO; then + # Check for the libraries. ++ ++ test -z "$x_direct_test_library" && x_direct_test_library=Xt ++ test -z "$x_direct_test_function" && x_direct_test_function=XtMalloc ++ + # See if we find them without any special options. + # Don't add to $LIBS permanently. - ac_save_LIBS=$LIBS - LIBS="-lXt $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ ac_save_LIBS="$LIBS" ++ LIBS="-l$x_direct_test_library $LIBS" ++cat > conftest.$ac_ext < - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - XtMalloc (0) - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - LIBS=$ac_save_LIBS ++ ++int main() { ++${x_direct_test_function}() ++; return 0; } ++EOF ++if { (eval echo configure:1806: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ LIBS="$ac_save_LIBS" +# We can link X programs with no special library path. +ac_x_libraries= +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - LIBS=$ac_save_LIBS - for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g` ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ LIBS="$ac_save_LIBS" ++# First see if replacing the include by lib works. ++# Check X11 before X11Rn because it is often a symlink to the current release. ++for ac_dir in `echo "$ac_x_includes" | sed s/include/lib/` \ ++ /usr/X11/lib \ ++ /usr/X11R6/lib \ ++ /usr/X11R5/lib \ ++ /usr/X11R4/lib \ ++ \ ++ /usr/lib/X11 \ ++ /usr/lib/X11R6 \ ++ /usr/lib/X11R5 \ ++ /usr/lib/X11R4 \ ++ \ ++ /usr/local/X11/lib \ ++ /usr/local/X11R6/lib \ ++ /usr/local/X11R5/lib \ ++ /usr/local/X11R4/lib \ ++ \ ++ /usr/local/lib/X11 \ ++ /usr/local/lib/X11R6 \ ++ /usr/local/lib/X11R5 \ ++ /usr/local/lib/X11R4 \ ++ \ ++ /usr/X386/lib \ ++ /usr/x386/lib \ ++ /usr/XFree86/lib/X11 \ ++ \ ++ /usr/lib \ ++ /usr/local/lib \ ++ /usr/unsupported/lib \ ++ /usr/athena/lib \ ++ /usr/local/x11r5/lib \ ++ /usr/lpp/Xamples/lib \ ++ /lib/usr/lib/X11 \ ++ \ ++ /usr/openwin/lib \ ++ /usr/openwin/share/lib \ ++ ; \ +do - # Don't even attempt the hair of trying to link an X program! + for ac_extension in a so sl; do - if test -r $ac_dir/libXt.$ac_extension; then ++ if test -r $ac_dir/lib${x_direct_test_library}.$ac_extension; then + ac_x_libraries=$ac_dir + break 2 + fi + done +done +fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - fi # $ac_x_libraries = no ++rm -f conftest* ++fi # $ac_x_libraries = NO + - if test "$ac_x_includes" = no || test "$ac_x_libraries" = no; then ++if test "$ac_x_includes" = NO || test "$ac_x_libraries" = NO; then + # Didn't find X anywhere. Cache the known absence of X. + ac_cv_have_x="have_x=no" +else + # Record where we found X for the cache. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$ac_x_includes ac_x_libraries=$ac_x_libraries" +fi +fi - + fi + eval "$ac_cv_have_x" +fi # $with_x != no + +if test "$have_x" != yes; then - echo "$as_me:$LINENO: result: $have_x" >&5 - echo "${ECHO_T}$have_x" >&6 ++ echo "$ac_t""$have_x" 1>&6 + no_x=yes +else + # If each of the values was on the command line, it overrides each guess. + test "x$x_includes" = xNONE && x_includes=$ac_x_includes + test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries + # Update the cache value to reflect the command line values. + ac_cv_have_x="have_x=yes \ + ac_x_includes=$x_includes ac_x_libraries=$x_libraries" - echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5 - echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6 ++ echo "$ac_t""libraries $x_libraries, headers $x_includes" 1>&6 +fi + +if test "$no_x" = yes; then + # Not all programs may use this symbol, but it does not hurt to define it. - - cat >>confdefs.h <<\_ACEOF ++ cat >> confdefs.h <<\EOF +#define X_DISPLAY_MISSING 1 - _ACEOF ++EOF + + X_CFLAGS= X_PRE_LIBS= X_LIBS= X_EXTRA_LIBS= +else + if test -n "$x_includes"; then + X_CFLAGS="$X_CFLAGS -I$x_includes" + fi + + # It would also be nice to do this for all -L options, not just this one. + if test -n "$x_libraries"; then + X_LIBS="$X_LIBS -L$x_libraries" + # For Solaris; some versions of Sun CC require a space after -R and + # others require no space. Words are not sufficient . . . . - case `(uname -sr) 2>/dev/null` in ++ case "`(uname -sr) 2>/dev/null`" in + "SunOS 5"*) - echo "$as_me:$LINENO: checking whether -R must be followed by a space" >&5 - echo $ECHO_N "checking whether -R must be followed by a space... $ECHO_C" >&6 - ac_xsave_LIBS=$LIBS; LIBS="$LIBS -R$x_libraries" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 ++echo "configure:1912: checking whether -R must be followed by a space" >&5 ++ ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" ++ cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then ++int main() { ++ ++; return 0; } ++EOF ++if { (eval echo configure:1922: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* + ac_R_nospace=yes +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_R_nospace=no ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_R_nospace=no +fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest* + if test $ac_R_nospace = yes; then - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + X_LIBS="$X_LIBS -R$x_libraries" + else + LIBS="$ac_xsave_LIBS -R $x_libraries" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then ++int main() { ++ ++; return 0; } ++EOF ++if { (eval echo configure:1945: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* + ac_R_space=yes +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_R_space=no ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_R_space=no +fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext ++rm -f conftest* + if test $ac_R_space = yes; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + X_LIBS="$X_LIBS -R $x_libraries" + else - echo "$as_me:$LINENO: result: neither works" >&5 - echo "${ECHO_T}neither works" >&6 ++ echo "$ac_t""neither works" 1>&6 + fi + fi - LIBS=$ac_xsave_LIBS ++ LIBS="$ac_xsave_LIBS" + esac + fi + + # Check for system-dependent libraries X programs must link with. + # Do this before checking for the system-independent R6 libraries + # (-lICE), since we may need -lsocket or whatever for X linking. + + if test "$ISC" = yes; then + X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet" + else - # Martyn Johnson says this is needed for Ultrix, if the X - # libraries were built with DECnet support. And Karl Berry says ++ # Martyn.Johnson@cl.cam.ac.uk says this is needed for Ultrix, if the X ++ # libraries were built with DECnet support. And karl@cs.umb.edu says + # the Alpha needs dnet_stub (dnet does not exist). - ac_xsave_LIBS="$LIBS"; LIBS="$LIBS $X_LIBS -lX11" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - - /* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif - /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char XOpenDisplay (); - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - XOpenDisplay (); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet" >&5 - echo $ECHO_N "checking for dnet_ntoa in -ldnet... $ECHO_C" >&6 - if test "${ac_cv_lib_dnet_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 ++echo "configure:1977: checking for dnet_ntoa in -ldnet" >&5 ++ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-ldnet $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dnet_dnet_ntoa=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_dnet_dnet_ntoa=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_dnet_ntoa" >&5 - echo "${ECHO_T}$ac_cv_lib_dnet_dnet_ntoa" >&6 - if test $ac_cv_lib_dnet_dnet_ntoa = yes; then ++ builtin and then its argument prototype would still apply. */ ++char dnet_ntoa(); ++ ++int main() { ++dnet_ntoa() ++; return 0; } ++EOF ++if { (eval echo configure:1996: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet" ++else ++ echo "$ac_t""no" 1>&6 +fi + + if test $ac_cv_lib_dnet_dnet_ntoa = no; then - echo "$as_me:$LINENO: checking for dnet_ntoa in -ldnet_stub" >&5 - echo $ECHO_N "checking for dnet_ntoa in -ldnet_stub... $ECHO_C" >&6 - if test "${ac_cv_lib_dnet_stub_dnet_ntoa+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 ++echo "configure:2018: checking for dnet_ntoa in -ldnet_stub" >&5 ++ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-ldnet_stub $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_dnet_stub_dnet_ntoa=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_dnet_stub_dnet_ntoa=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_dnet_stub_dnet_ntoa" >&5 - echo "${ECHO_T}$ac_cv_lib_dnet_stub_dnet_ntoa" >&6 - if test $ac_cv_lib_dnet_stub_dnet_ntoa = yes; then ++ builtin and then its argument prototype would still apply. */ ++char dnet_ntoa(); ++ ++int main() { ++dnet_ntoa() ++; return 0; } ++EOF ++if { (eval echo configure:2037: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub" ++else ++ echo "$ac_t""no" 1>&6 +fi + + fi - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS="$ac_xsave_LIBS" + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. - # Chad R. Larson says the Pyramis MIS-ES running DC/OSx (SVR4) ++ # chad@anasazi.com says the Pyramis MIS-ES running DC/OSx (SVR4) + # needs -lnsl. + # The nsl library prevents programs from opening the X display - # on Irix 5.2, according to T.E. Dickey. - # The functions gethostbyname, getservbyname, and inet_addr are - # in -lbsd on LynxOS 3.0.1/i386, according to Lars Hecking. - echo "$as_me:$LINENO: checking for gethostbyname" >&5 - echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 - if test "${ac_cv_func_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ # on Irix 5.2, according to dickey@clark.net. ++ echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 ++echo "configure:2066: checking for gethostbyname" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif +/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char gethostbyname (); - char (*f) (); - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++ builtin and then its argument prototype would still apply. */ ++char gethostbyname(); ++ ++int main() { ++ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_gethostbyname) || defined (__stub___gethostbyname) +choke me +#else - f = gethostbyname; ++gethostbyname(); +#endif + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_gethostbyname=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_func_gethostbyname=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname" >&5 - echo "${ECHO_T}$ac_cv_func_gethostbyname" >&6 ++; return 0; } ++EOF ++if { (eval echo configure:2094: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_gethostbyname=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_gethostbyname=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'gethostbyname`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ : ++else ++ echo "$ac_t""no" 1>&6 ++fi + + if test $ac_cv_func_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lnsl" >&5 - echo $ECHO_N "checking for gethostbyname in -lnsl... $ECHO_C" >&6 - if test "${ac_cv_lib_nsl_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 ++echo "configure:2115: checking for gethostbyname in -lnsl" >&5 ++ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_nsl_gethostbyname=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_nsl_gethostbyname=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_gethostbyname" >&5 - echo "${ECHO_T}$ac_cv_lib_nsl_gethostbyname" >&6 - if test $ac_cv_lib_nsl_gethostbyname = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" ++ builtin and then its argument prototype would still apply. */ ++char gethostbyname(); ++ ++int main() { ++gethostbyname() ++; return 0; } ++EOF ++if { (eval echo configure:2134: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" +fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" + - if test $ac_cv_lib_nsl_gethostbyname = no; then - echo "$as_me:$LINENO: checking for gethostbyname in -lbsd" >&5 - echo $ECHO_N "checking for gethostbyname in -lbsd... $ECHO_C" >&6 - if test "${ac_cv_lib_bsd_gethostbyname+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl" +else - ac_check_lib_save_LIBS=$LIBS - LIBS="-lbsd $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" - #include "confdefs.h" - - /* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif - /* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char gethostbyname (); - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { - gethostbyname (); - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_bsd_gethostbyname=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_bsd_gethostbyname=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_bsd_gethostbyname" >&5 - echo "${ECHO_T}$ac_cv_lib_bsd_gethostbyname" >&6 - if test $ac_cv_lib_bsd_gethostbyname = yes; then - X_EXTRA_LIBS="$X_EXTRA_LIBS -lbsd" ++ echo "$ac_t""no" 1>&6 +fi + - fi + fi + + # lieder@skyler.mavd.honeywell.com says without -lsocket, + # socket/setsockopt and other routines are undefined under SCO ODT + # 2.0. But -lsocket is broken on IRIX 5.2 (and is not necessary - # on later versions), says Simon Leinen: it contains gethostby* - # variants that don't use the nameserver (or something). -lsocket - # must be given before -lnsl if both are needed. We assume that - # if connect needs -lnsl, so does gethostbyname. - echo "$as_me:$LINENO: checking for connect" >&5 - echo $ECHO_N "checking for connect... $ECHO_C" >&6 - if test "${ac_cv_func_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ # on later versions), says simon@lia.di.epfl.ch: it contains ++ # gethostby* variants that don't use the nameserver (or something). ++ # -lsocket must be given before -lnsl if both are needed. ++ # We assume that if connect needs -lnsl, so does gethostbyname. ++ echo $ac_n "checking for connect""... $ac_c" 1>&6 ++echo "configure:2164: checking for connect" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif +/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char connect (); - char (*f) (); - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++ builtin and then its argument prototype would still apply. */ ++char connect(); ++ ++int main() { ++ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_connect) || defined (__stub___connect) +choke me +#else - f = connect; ++connect(); +#endif + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_connect=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_func_connect=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: $ac_cv_func_connect" >&5 - echo "${ECHO_T}$ac_cv_func_connect" >&6 ++; return 0; } ++EOF ++if { (eval echo configure:2192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_connect=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_connect=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'connect`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ : ++else ++ echo "$ac_t""no" 1>&6 ++fi + + if test $ac_cv_func_connect = no; then - echo "$as_me:$LINENO: checking for connect in -lsocket" >&5 - echo $ECHO_N "checking for connect in -lsocket... $ECHO_C" >&6 - if test "${ac_cv_lib_socket_connect+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 ++echo "configure:2213: checking for connect in -lsocket" >&5 ++ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_socket_connect=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_socket_connect=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_socket_connect" >&5 - echo "${ECHO_T}$ac_cv_lib_socket_connect" >&6 - if test $ac_cv_lib_socket_connect = yes; then ++ builtin and then its argument prototype would still apply. */ ++char connect(); ++ ++int main() { ++connect() ++; return 0; } ++EOF ++if { (eval echo configure:2232: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="-lsocket $X_EXTRA_LIBS" ++else ++ echo "$ac_t""no" 1>&6 +fi + + fi + - # Guillermo Gomez says -lposix is necessary on A/UX. - echo "$as_me:$LINENO: checking for remove" >&5 - echo $ECHO_N "checking for remove... $ECHO_C" >&6 - if test "${ac_cv_func_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. ++ echo $ac_n "checking for remove""... $ac_c" 1>&6 ++echo "configure:2256: checking for remove" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif +/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char remove (); - char (*f) (); - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++ builtin and then its argument prototype would still apply. */ ++char remove(); ++ ++int main() { ++ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_remove) || defined (__stub___remove) +choke me +#else - f = remove; ++remove(); +#endif + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_remove=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_func_remove=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: $ac_cv_func_remove" >&5 - echo "${ECHO_T}$ac_cv_func_remove" >&6 ++; return 0; } ++EOF ++if { (eval echo configure:2284: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_remove=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_remove=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'remove`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ : ++else ++ echo "$ac_t""no" 1>&6 ++fi + + if test $ac_cv_func_remove = no; then - echo "$as_me:$LINENO: checking for remove in -lposix" >&5 - echo $ECHO_N "checking for remove in -lposix... $ECHO_C" >&6 - if test "${ac_cv_lib_posix_remove+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 ++echo "configure:2305: checking for remove in -lposix" >&5 ++ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lposix $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_posix_remove=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_posix_remove=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_posix_remove" >&5 - echo "${ECHO_T}$ac_cv_lib_posix_remove" >&6 - if test $ac_cv_lib_posix_remove = yes; then ++ builtin and then its argument prototype would still apply. */ ++char remove(); ++ ++int main() { ++remove() ++; return 0; } ++EOF ++if { (eval echo configure:2324: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lposix" ++else ++ echo "$ac_t""no" 1>&6 +fi + + fi + + # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. - echo "$as_me:$LINENO: checking for shmat" >&5 - echo $ECHO_N "checking for shmat... $ECHO_C" >&6 - if test "${ac_cv_func_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ echo $ac_n "checking for shmat""... $ac_c" 1>&6 ++echo "configure:2348: checking for shmat" >&5 ++if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ - #ifdef __cplusplus - extern "C" - #endif +/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ - char shmat (); - char (*f) (); - - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++ builtin and then its argument prototype would still apply. */ ++char shmat(); ++ ++int main() { ++ +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_shmat) || defined (__stub___shmat) +choke me +#else - f = shmat; ++shmat(); +#endif + - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_func_shmat=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_func_shmat=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - fi - echo "$as_me:$LINENO: result: $ac_cv_func_shmat" >&5 - echo "${ECHO_T}$ac_cv_func_shmat" >&6 ++; return 0; } ++EOF ++if { (eval echo configure:2376: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_func_shmat=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_func_shmat=no" ++fi ++rm -f conftest* ++fi ++ ++if eval "test \"`echo '$ac_cv_func_'shmat`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ : ++else ++ echo "$ac_t""no" 1>&6 ++fi + + if test $ac_cv_func_shmat = no; then - echo "$as_me:$LINENO: checking for shmat in -lipc" >&5 - echo $ECHO_N "checking for shmat in -lipc... $ECHO_C" >&6 - if test "${ac_cv_lib_ipc_shmat+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++ echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 ++echo "configure:2397: checking for shmat in -lipc" >&5 ++ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lipc $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ipc_shmat=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_ipc_shmat=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_ipc_shmat" >&5 - echo "${ECHO_T}$ac_cv_lib_ipc_shmat" >&6 - if test $ac_cv_lib_ipc_shmat = yes; then ++ builtin and then its argument prototype would still apply. */ ++char shmat(); ++ ++int main() { ++shmat() ++; return 0; } ++EOF ++if { (eval echo configure:2416: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + X_EXTRA_LIBS="$X_EXTRA_LIBS -lipc" ++else ++ echo "$ac_t""no" 1>&6 +fi + + fi + fi + + # Check for libraries that X11R6 Xt/Xaw programs need. - ac_save_LDFLAGS=$LDFLAGS ++ ac_save_LDFLAGS="$LDFLAGS" + test -n "$x_libraries" && LDFLAGS="$LDFLAGS -L$x_libraries" + # SM needs ICE to (dynamically) link under SunOS 4.x (so we have to + # check for ICE first), but we must link in the order -lSM -lICE or + # we get undefined symbols. So assume we have SM if we have ICE. + # These have to be linked with before -lX11, unlike the other + # libraries we check for below, so use a different variable. - # John Interrante, Karl Berry - echo "$as_me:$LINENO: checking for IceConnectionNumber in -lICE" >&5 - echo $ECHO_N "checking for IceConnectionNumber in -lICE... $ECHO_C" >&6 - if test "${ac_cv_lib_ICE_IceConnectionNumber+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS ++ # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. ++ echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 ++echo "configure:2449: checking for IceConnectionNumber in -lICE" >&5 ++ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" +LIBS="-lICE $X_EXTRA_LIBS $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_ICE_IceConnectionNumber=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_ICE_IceConnectionNumber=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_ICE_IceConnectionNumber" >&5 - echo "${ECHO_T}$ac_cv_lib_ICE_IceConnectionNumber" >&6 - if test $ac_cv_lib_ICE_IceConnectionNumber = yes; then ++ builtin and then its argument prototype would still apply. */ ++char IceConnectionNumber(); ++ ++int main() { ++IceConnectionNumber() ++; return 0; } ++EOF ++if { (eval echo configure:2468: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + X_PRE_LIBS="$X_PRE_LIBS -lSM -lICE" ++else ++ echo "$ac_t""no" 1>&6 +fi + - LDFLAGS=$ac_save_LDFLAGS ++ LDFLAGS="$ac_save_LDFLAGS" + +fi + + - test x$no_x = "xyes" && { { echo "$as_me:$LINENO: error: Openbox requires the X Window System libraries and headers." >&5 - echo "$as_me: error: Openbox requires the X Window System libraries and headers." >&2;} - { (exit 1); exit 1; }; } ++test x$no_x = "xyes" && { echo "configure: error: Openbox requires the X Window System libraries and headers." 1>&2; exit 1; } + +test x$x_includes = "x" && x_includes="/usr/include" +test x$x_libraries = "x" && x_libraries="/usr/lib" + +CFLAGS="$CFLAGS $X_CFLAGS" +CXXFLAGS="$CXXFLAGS $X_CFLAGS" +LIBS="$LIBS $X_LIBS" +LDFLAGS="$LDFLAGS $LIBS $X_PRE_LIBS" + - echo "$as_me:$LINENO: checking for XOpenDisplay in -lX11" >&5 - echo $ECHO_N "checking for XOpenDisplay in -lX11... $ECHO_C" >&6 - if test "${ac_cv_lib_X11_XOpenDisplay+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 ++echo "configure:2504: checking for XOpenDisplay in -lX11" >&5 ++ac_lib_var=`echo X11'_'XOpenDisplay | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lX11 $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_X11_XOpenDisplay=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_X11_XOpenDisplay=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_X11_XOpenDisplay" >&5 - echo "${ECHO_T}$ac_cv_lib_X11_XOpenDisplay" >&6 - if test $ac_cv_lib_X11_XOpenDisplay = yes; then ++ builtin and then its argument prototype would still apply. */ ++char XOpenDisplay(); ++ ++int main() { ++XOpenDisplay() ++; return 0; } ++EOF ++if { (eval echo configure:2523: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lX11" +else - { { echo "$as_me:$LINENO: error: Could not find XOpenDisplay in -lX11." >&5 - echo "$as_me: error: Could not find XOpenDisplay in -lX11." >&2;} - { (exit 1); exit 1; }; } ++ echo "$ac_t""no" 1>&6 ++{ echo "configure: error: Could not find XOpenDisplay in -lX11." 1>&2; exit 1; } + +fi + + +LIBS="$LIBS $X_EXTRA_LIBS" + +Xext_lib="" + +SHAPE="" - echo "$as_me:$LINENO: checking whether to build support for the XShape extension" >&5 - echo $ECHO_N "checking whether to build support for the XShape extension... $ECHO_C" >&6 ++echo $ac_n "checking whether to build support for the XShape extension""... $ac_c" 1>&6 ++echo "configure:2552: checking whether to build support for the XShape extension" >&5 +# Check whether --enable-shape or --disable-shape was given. +if test "${enable_shape+set}" = set; then + enableval="$enable_shape" ++ : ++fi + - fi; + +: ${enableval="yes"} +if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 - echo "$as_me:$LINENO: checking for XShapeCombineShape in -lXext" >&5 - echo $ECHO_N "checking for XShapeCombineShape in -lXext... $ECHO_C" >&6 - if test "${ac_cv_lib_Xext_XShapeCombineShape+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 - else - ac_check_lib_save_LIBS=$LIBS ++ echo "$ac_t""yes" 1>&6 ++ echo $ac_n "checking for XShapeCombineShape in -lXext""... $ac_c" 1>&6 ++echo "configure:2564: checking for XShapeCombineShape in -lXext" >&5 ++ac_lib_var=`echo Xext'_'XShapeCombineShape | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ ac_save_LIBS="$LIBS" +LIBS="-lXext $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_Xext_XShapeCombineShape=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_Xext_XShapeCombineShape=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XShapeCombineShape" >&5 - echo "${ECHO_T}$ac_cv_lib_Xext_XShapeCombineShape" >&6 - if test $ac_cv_lib_Xext_XShapeCombineShape = yes; then - echo "$as_me:$LINENO: checking for X11/extensions/shape.h" >&5 - echo $ECHO_N "checking for X11/extensions/shape.h... $ECHO_C" >&6 - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ builtin and then its argument prototype would still apply. */ ++char XShapeCombineShape(); ++ ++int main() { ++XShapeCombineShape() ++; return 0; } ++EOF ++if { (eval echo configure:2583: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ echo $ac_n "checking for X11/extensions/shape.h""... $ac_c" 1>&6 ++echo "configure:2599: checking for X11/extensions/shape.h" >&5 ++ cat > conftest.$ac_ext < +#include +#include + - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++int main() { +long foo = ShapeSet - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext conftest$ac_exeext - if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++; return 0; } ++EOF ++if { (eval echo configure:2611: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ echo "$ac_t""yes" 1>&6 + SHAPE="-DSHAPE"; Xext_lib="-lXext" +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ echo "$ac_t""no" 1>&6 ++ +fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - ++rm -f conftest* ++ ++else ++ echo "$ac_t""no" 1>&6 +fi + +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 +fi + + +LIBS="$LIBS $Xext_lib" + +SLIT="" - echo "$as_me:$LINENO: checking whether to include the Slit" >&5 - echo $ECHO_N "checking whether to include the Slit... $ECHO_C" >&6 ++echo $ac_n "checking whether to include the Slit""... $ac_c" 1>&6 ++echo "configure:2637: checking whether to include the Slit" >&5 +# Check whether --enable-slit or --disable-slit was given. +if test "${enable_slit+set}" = set; then + enableval="$enable_slit" + if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + SLIT="-DSLIT" + else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + fi +else - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + SLIT="-DSLIT" + - fi; ++fi ++ + + +NEWWMSPEC="" - echo "$as_me:$LINENO: checking whether to include the new WM Spec (DOES NOTHING)" >&5 - echo $ECHO_N "checking whether to include the new WM Spec (DOES NOTHING)... $ECHO_C" >&6 ++echo $ac_n "checking whether to include the new WM Spec (DOES NOTHING)""... $ac_c" 1>&6 ++echo "configure:2657: checking whether to include the new WM Spec (DOES NOTHING)" >&5 +# Check whether --enable-newspec or --disable-newspec was given. +if test "${enable_newspec+set}" = set; then + enableval="$enable_newspec" + if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 - NEWWMSPEC="-DNEWWMSPEC" ++ echo "$ac_t""yes" 1>&6 ++ NEWWMSPEC="-DNEWWMSPEC" + else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + fi +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 ++ ++fi + - fi; + + + +INTERLACE="" - echo "$as_me:$LINENO: checking whether to include interlacing image code" >&5 - echo $ECHO_N "checking whether to include interlacing image code... $ECHO_C" >&6 ++echo $ac_n "checking whether to include interlacing image code""... $ac_c" 1>&6 ++echo "configure:2677: checking whether to include interlacing image code" >&5 +# Check whether --enable-interlace or --disable-interlace was given. +if test "${enable_interlace+set}" = set; then + enableval="$enable_interlace" + if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + INTERLACE="-DINTERLACE" + else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + fi +else - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + INTERLACE="-DINTERLACE" + - fi; ++fi ++ + + +ORDEREDPSEUDO="" - echo "$as_me:$LINENO: checking whether to include Pseudocolor ordered dithering code" >&5 - echo $ECHO_N "checking whether to include Pseudocolor ordered dithering code... $ECHO_C" >&6 ++echo $ac_n "checking whether to include Pseudocolor ordered dithering code""... $ac_c" 1>&6 ++echo "configure:2697: checking whether to include Pseudocolor ordered dithering code" >&5 +# Check whether --enable-ordered-pseudo or --disable-ordered-pseudo was given. +if test "${enable_ordered_pseudo+set}" = set; then + enableval="$enable_ordered_pseudo" + if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 - ORDEREDPSEUDO="-DORDEREDPSEUDO" ++ echo "$ac_t""yes" 1>&6 ++ ORDEREDPSEUDO="-DORDEREDPSEUDO" + else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + fi +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 ++ ++fi + - fi; + + +CLOBBER="" - echo "$as_me:$LINENO: checking whether to intercept mouse events to clients" >&5 - echo $ECHO_N "checking whether to intercept mouse events to clients... $ECHO_C" >&6 ++echo $ac_n "checking whether to intercept mouse events to clients""... $ac_c" 1>&6 ++echo "configure:2716: checking whether to intercept mouse events to clients" >&5 +# Check whether --enable-clobber or --disable-clobber was given. +if test "${enable_clobber+set}" = set; then + enableval="$enable_clobber" + if test x$enableval = "xno"; then - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 - CLOBBER="-DNOCLOBBER" ++ echo "$ac_t""no" 1>&6 ++ CLOBBER="-DNOCLOBBER" + else - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + fi +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 ++ ++fi + - fi; + + +DEBUG="" - echo "$as_me:$LINENO: checking whether to include verbose debugging code" >&5 - echo $ECHO_N "checking whether to include verbose debugging code... $ECHO_C" >&6 ++echo $ac_n "checking whether to include verbose debugging code""... $ac_c" 1>&6 ++echo "configure:2735: checking whether to include verbose debugging code" >&5 +# Check whether --enable-debug or --disable-debug was given. +if test "${enable_debug+set}" = set; then + enableval="$enable_debug" + if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 - DEBUG="-DDEBUG" ++ echo "$ac_t""yes" 1>&6 ++ DEBUG="-DDEBUG -Wall -W -pedantic -fno-inline" + else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + fi +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 ++ ++fi + - fi; + + +NLS="" - echo "$as_me:$LINENO: checking whether to include NLS support" >&5 - echo $ECHO_N "checking whether to include NLS support... $ECHO_C" >&6 ++echo $ac_n "checking whether to include NLS support""... $ac_c" 1>&6 ++echo "configure:2754: checking whether to include NLS support" >&5 +# Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + NLS="-DNLS" + else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + fi +else - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + NLS="-DNLS" + - fi; ++fi ++ + + - echo "$as_me:$LINENO: checking for setlocale in -lxpg4" >&5 - echo $ECHO_N "checking for setlocale in -lxpg4... $ECHO_C" >&6 - if test "${ac_cv_lib_xpg4_setlocale+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 ++echo "configure:2773: checking for setlocale in -lxpg4" >&5 ++ac_lib_var=`echo xpg4'_'setlocale | sed 'y%./+-%__p_%'` ++if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - ac_check_lib_save_LIBS=$LIBS ++ ac_save_LIBS="$LIBS" +LIBS="-lxpg4 $LIBS" - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++cat > conftest.$ac_ext <&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_lib_xpg4_setlocale=yes - else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_lib_xpg4_setlocale=no - fi - rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_lib_save_LIBS - fi - echo "$as_me:$LINENO: result: $ac_cv_lib_xpg4_setlocale" >&5 - echo "${ECHO_T}$ac_cv_lib_xpg4_setlocale" >&6 - if test $ac_cv_lib_xpg4_setlocale = yes; then ++ builtin and then its argument prototype would still apply. */ ++char setlocale(); ++ ++int main() { ++setlocale() ++; return 0; } ++EOF ++if { (eval echo configure:2792: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=yes" ++else ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ eval "ac_cv_lib_$ac_lib_var=no" ++fi ++rm -f conftest* ++LIBS="$ac_save_LIBS" ++ ++fi ++if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lxpg4" ++else ++ echo "$ac_t""no" 1>&6 +fi + + +for ac_prog in gencat +do - # Extract the first word of "$ac_prog", so it can be a program name with args. ++# Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 - echo "$as_me:$LINENO: checking for $ac_word" >&5 - echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 - if test "${ac_cv_prog_gencat_cmd+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:2818: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_gencat_cmd'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$gencat_cmd"; then + ac_cv_prog_gencat_cmd="$gencat_cmd" # Let the user override the test. +else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_gencat_cmd="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi - done - done - ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_gencat_cmd="$ac_prog" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" +fi +fi - gencat_cmd=$ac_cv_prog_gencat_cmd ++gencat_cmd="$ac_cv_prog_gencat_cmd" +if test -n "$gencat_cmd"; then - echo "$as_me:$LINENO: result: $gencat_cmd" >&5 - echo "${ECHO_T}$gencat_cmd" >&6 ++ echo "$ac_t""$gencat_cmd" 1>&6 +else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 +fi + - test -n "$gencat_cmd" && break ++test -n "$gencat_cmd" && break +done + +if test x$gencat_cmd = "x"; then + NLS="" +fi + + +TIMEDCACHE="" - echo "$as_me:$LINENO: checking whether to use the new timed pixmap cache" >&5 - echo $ECHO_N "checking whether to use the new timed pixmap cache... $ECHO_C" >&6 ++echo $ac_n "checking whether to use the new timed pixmap cache""... $ac_c" 1>&6 ++echo "configure:2854: checking whether to use the new timed pixmap cache" >&5 +# Check whether --enable-timed-cache or --disable-timed-cache was given. +if test "${enable_timed_cache+set}" = set; then + enableval="$enable_timed_cache" + if test x$enableval = "xyes"; then - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + TIMEDCACHE="-DTIMEDCACHE" + else - echo "$as_me:$LINENO: result: no" >&5 - echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&6 + fi +else - echo "$as_me:$LINENO: result: yes" >&5 - echo "${ECHO_T}yes" >&6 ++ echo "$ac_t""yes" 1>&6 + TIMEDCACHE="-DTIMEDCACHE" + - fi; ++fi ++ + + - echo "$as_me:$LINENO: checking return type of signal handlers" >&5 - echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 - if test "${ac_cv_type_signal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 ++echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 ++echo "configure:2873: checking return type of signal handlers" >&5 ++if eval "test \"`echo '$''{'ac_cv_type_signal'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 +else - cat >conftest.$ac_ext <<_ACEOF - #line $LINENO "configure" ++ cat > conftest.$ac_ext < +#include +#ifdef signal - # undef signal ++#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + - #ifdef F77_DUMMY_MAIN - # ifdef __cplusplus - extern "C" - # endif - int F77_DUMMY_MAIN() { return 1; } - #endif - int - main () - { ++int main() { +int i; - ; - return 0; - } - _ACEOF - rm -f conftest.$ac_objext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then ++; return 0; } ++EOF ++if { (eval echo configure:2895: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ rm -rf conftest* + ac_cv_type_signal=void +else - echo "$as_me: failed program was:" >&5 - cat conftest.$ac_ext >&5 - ac_cv_type_signal=int ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ rm -rf conftest* ++ ac_cv_type_signal=int +fi - rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest* +fi - echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5 - echo "${ECHO_T}$ac_cv_type_signal" >&6 + - cat >>confdefs.h <<_ACEOF ++echo "$ac_t""$ac_cv_type_signal" 1>&6 ++cat >> confdefs.h <&5 - echo $ECHO_N "checking whether to enable maintainer-specific portions of Makefiles... $ECHO_C" >&6 ++echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 ++echo "configure:2915: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. +if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" + USE_MAINTAINER_MODE=$enableval +else + USE_MAINTAINER_MODE=no - fi; - echo "$as_me:$LINENO: result: $USE_MAINTAINER_MODE" >&5 - echo "${ECHO_T}$USE_MAINTAINER_MODE" >&6 ++fi + ++ echo "$ac_t""$USE_MAINTAINER_MODE" 1>&6 ++ + +if test $USE_MAINTAINER_MODE = yes; then + MAINTAINER_MODE_TRUE= + MAINTAINER_MODE_FALSE='#' +else + MAINTAINER_MODE_TRUE='#' + MAINTAINER_MODE_FALSE= +fi + MAINT=$MAINTAINER_MODE_TRUE ++ + + ++echo "$ac_t""" 1>&6 ++echo "$ac_t"" $PACKAGE version $VERSION configured successfully." 1>&6 ++echo "$ac_t""" 1>&6 ++echo "$ac_t""Using '$prefix' for installation." 1>&6 ++echo "$ac_t""Using '$CXX' for C++ compiler." 1>&6 ++echo "$ac_t""Building with '$CXXFLAGS' for C++ compiler flags." 1>&6 ++echo "$ac_t""Building with '$LIBS' for linker flags." 1>&6 ++echo "$ac_t""" 1>&6 + - echo "$as_me:$LINENO: result: " >&5 - echo "${ECHO_T}" >&6 - echo "$as_me:$LINENO: result: $PACKAGE version $VERSION configured successfully." >&5 - echo "${ECHO_T} $PACKAGE version $VERSION configured successfully." >&6 - echo "$as_me:$LINENO: result: " >&5 - echo "${ECHO_T}" >&6 - echo "$as_me:$LINENO: result: Using '$prefix' for installation." >&5 - echo "${ECHO_T}Using '$prefix' for installation." >&6 - echo "$as_me:$LINENO: result: Using '$CXX' for C++ compiler." >&5 - echo "${ECHO_T}Using '$CXX' for C++ compiler." >&6 - echo "$as_me:$LINENO: result: Building with '$CXXFLAGS' for C++ compiler flags." >&5 - echo "${ECHO_T}Building with '$CXXFLAGS' for C++ compiler flags." >&6 - echo "$as_me:$LINENO: result: Building with '$LIBS' for linker flags." >&5 - echo "${ECHO_T}Building with '$LIBS' for linker flags." >&6 - echo "$as_me:$LINENO: result: " >&5 - echo "${ECHO_T}" >&6 + + - ac_config_headers="$ac_config_headers config.h" + - ac_config_commands="$ac_config_commands default-1" - - ac_config_files="$ac_config_files Makefile src/Makefile util/Makefile data/Makefile data/styles/Makefile doc/Makefile nls/Makefile nls/C/Makefile nls/da_DK/Makefile nls/de_DE/Makefile nls/es_ES/Makefile nls/et_EE/Makefile nls/fr_FR/Makefile nls/it_IT/Makefile nls/ja_JP/Makefile nls/nl_NL/Makefile nls/pt_BR/Makefile nls/ru_RU/Makefile nls/sl_SI/Makefile nls/sv_SE/Makefile nls/tr_TR/Makefile nls/zh_CN/Makefile version.h" - cat >confcache <<\_ACEOF ++trap '' 1 2 15 ++cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure - # scripts and configure runs, see configure's option --config-cache. - # It is not useful on other systems. If it contains results you don't - # want to keep, you may remove or edit it. ++# scripts and configure runs. It is not useful on other systems. ++# If it contains results you don't want to keep, you may remove or edit it. +# - # config.status only pays attention to the cache file if you give it - # the --recheck option to rerun configure. ++# By default, configure uses ./config.cache as the cache file, ++# creating it if it does not exist already. You can give configure ++# the --cache-file=FILE option to use a different cache file; that is ++# what configure does when it calls configure scripts in ++# subdirectories, so they share the cache. ++# Giving --cache-file=/dev/null disables caching, for debugging configure. ++# config.status only pays attention to the cache file if you give it the ++# --recheck option to rerun configure. +# - # `ac_cv_env_foo' variables (set or unset) will be overriden when - # loading this file, other *unset* `ac_cv_foo' will be assigned the - # following values. - - _ACEOF - ++EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. - { - (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" - ;; - esac; - } | - sed ' - t clear - : clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache - if cmp -s $cache_file confcache; then :; else ++(set) 2>&1 | ++ case `(ac_space=' '; set | grep ac_space) 2>&1` in ++ *ac_space=\ *) ++ # `set' does not quote correctly, so add quotes (double-quote substitution ++ # turns \\\\ into \\, and sed turns \\ into \). ++ sed -n \ ++ -e "s/'/'\\\\''/g" \ ++ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ++ ;; ++ *) ++ # `set' quotes correctly as required by POSIX, so do not add quotes. ++ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ++ ;; ++ esac >> confcache ++if cmp -s $cache_file confcache; then ++ : ++else + if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" - cat confcache >$cache_file ++ echo "updating cache $cache_file" ++ cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ++ +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + - # VPATH may cause trouble with some makes, so we remove $(srcdir), - # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and - # trailing colons and then remove the whole line if VPATH becomes empty - # (actually we leave an empty line to preserve line numbers). ++# Any assignment to VPATH causes Sun make to only execute ++# the first set of double-colon rules, so remove it if not needed. ++# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ - s/:*\$(srcdir):*/:/; - s/:*\${srcdir}:*/:/; - s/:*@srcdir@:*/:/; - s/^\([^=]*=[ ]*\):*/\1/; - s/:*$//; - s/^[^=]*=[ ]*$//; - }' ++ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + - DEFS=-DHAVE_CONFIG_H ++trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + ++DEFS=-DHAVE_CONFIG_H + ++# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} - ac_clean_files_save=$ac_clean_files - ac_clean_files="$ac_clean_files $CONFIG_STATUS" - { echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 - echo "$as_me: creating $CONFIG_STATUS" >&6;} - cat >$CONFIG_STATUS <<_ACEOF - #! $SHELL - # Generated by $as_me. - # Run this file to recreate the current configuration. - # Compiler output produced by configure, useful for debugging - # configure, is in config.log if it exists. - - debug=false - SHELL=\${CONFIG_SHELL-$SHELL} - _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - - ## --------------------- ## - ## M4sh Initialization. ## - ## --------------------- ## - - # Be Bourne compatible - if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix - fi - - # NLS nuisances. - # Support unset when possible. - if (FOO=FOO; unset FOO) >/dev/null 2>&1; then - as_unset=unset - else - as_unset=false - fi - - (set +x; test -n "`(LANG=C; export LANG) 2>&1`") && - { $as_unset LANG || test "${LANG+set}" != set; } || - { LANG=C; export LANG; } - (set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && - { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || - { LC_ALL=C; export LC_ALL; } - (set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && - { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || - { LC_TIME=C; export LC_TIME; } - (set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && - { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || - { LC_CTYPE=C; export LC_CTYPE; } - (set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && - { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || - { LANGUAGE=C; export LANGUAGE; } - (set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && - { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || - { LC_COLLATE=C; export LC_COLLATE; } - (set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && - { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || - { LC_NUMERIC=C; export LC_NUMERIC; } - (set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && - { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || - { LC_MESSAGES=C; export LC_MESSAGES; } - - - # Name of the executable. - as_me=`(basename "$0") 2>/dev/null || - $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || - echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - # PATH needs CR, and LINENO needs CR and PATH. - # Avoid depending upon Character Ranges. - as_cr_letters='abcdefghijklmnopqrstuvwxyz' - as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' - as_cr_Letters=$as_cr_letters$as_cr_LETTERS - as_cr_digits='0123456789' - as_cr_alnum=$as_cr_Letters$as_cr_digits - - # The user is always right. - if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conftest.sh - echo "exit 0" >>conftest.sh - chmod +x conftest.sh - if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conftest.sh - fi - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in $PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break - done - - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 - echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR - for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH - do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done - done - ;; - esac - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | - sed ' - N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, - t loop - s,-$,, - s,^['$as_cr_digits']*\n,, - ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 - echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno - # Exit status is that of the last command. - exit - } - - - case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' - ' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; - esac - - if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr - else - as_expr=false - fi - - rm -f conf$$ conf$$.exe conf$$.file - echo >conf$$.file - if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links - as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else - as_ln_s='cp -p' - fi - rm -f conf$$ conf$$.exe conf$$.file - - as_executable_p="test -f" - - # Sed expression to map a string onto a valid CPP name. - as_tr_cpp="sed y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g" - - # Sed expression to map a string onto a valid variable name. - as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" - - - # IFS - # We need space, tab and new line, in precisely that order. - as_nl=' - ' - IFS=" $as_nl" - - # CDPATH. - $as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } - - exec 6>&1 - - # Open the log real soon, to keep \$[0] and so on meaningful, and to - # report actual input values of CONFIG_FILES etc. instead of their - # values after options handling. Logging --version etc. is OK. - exec 5>>config.log - { - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX - ## Running $as_me. ## - _ASBOX - } >&5 - cat >&5 <<_CSEOF - - This file was extended by $as_me, which was - generated by GNU Autoconf 2.53. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - - _CSEOF - echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 - echo >&5 - _ACEOF - - # Files that config.status was made for. - if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS - fi - - if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS - fi - - if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS - fi - - if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS - fi - - cat >>$CONFIG_STATUS <<\_ACEOF - - ac_cs_usage="\ - \`$as_me' instantiates files from templates according to the - current configuration. - - Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number, then exit - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - - Configuration files: - $config_files - - Configuration headers: - $config_headers - - Configuration commands: - $config_commands - - Report bugs to ." - _ACEOF - - cat >>$CONFIG_STATUS <<_ACEOF - ac_cs_version="\\ - config.status - configured by $0, generated by GNU Autoconf 2.53, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" - - Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 - Free Software Foundation, Inc. - This config.status script is free software; the Free Software Foundation - gives unlimited permission to copy, distribute and modify it." - srcdir=$srcdir - INSTALL="$INSTALL" - _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # If no file are specified by the user, then we need to provide default - # value. By we need to know if files were specified by the user. - ac_need_defaults=: - while test $# != 0 - do - case $1 in - --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` - shift - set dummy "$ac_option" "$ac_optarg" ${1+"$@"} - shift - ;; - -*);; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_need_defaults=false;; - esac - - case $1 in - # Handling of the options. - _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" - exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 - Try \`$0 --help' for more information." >&5 - echo "$as_me: error: ambiguous option: $1 - Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - shift - CONFIG_FILES="$CONFIG_FILES $1" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - shift - CONFIG_HEADERS="$CONFIG_HEADERS $1" - ac_need_defaults=false;; - - # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 - Try \`$0 --help' for more information." >&5 - echo "$as_me: error: unrecognized option: $1 - Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" ;; - - esac - shift - done - - _ACEOF + - cat >>$CONFIG_STATUS <<_ACEOF ++echo creating $CONFIG_STATUS ++rm -f $CONFIG_STATUS ++cat > $CONFIG_STATUS </dev/null | sed 1q`: +# - # INIT-COMMANDS section. ++# $0 $ac_configure_args +# ++# Compiler output produced by configure, useful for debugging ++# configure, is in ./config.log if it exists. + - - - _ACEOF - - - - cat >>$CONFIG_STATUS <<\_ACEOF - for ac_config_target in $ac_config_targets ++ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" ++for ac_option +do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "src/Makefile" ) CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; - "util/Makefile" ) CONFIG_FILES="$CONFIG_FILES util/Makefile" ;; - "data/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/Makefile" ;; - "data/styles/Makefile" ) CONFIG_FILES="$CONFIG_FILES data/styles/Makefile" ;; - "doc/Makefile" ) CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; - "nls/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/Makefile" ;; - "nls/C/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/C/Makefile" ;; - "nls/da_DK/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/da_DK/Makefile" ;; - "nls/de_DE/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/de_DE/Makefile" ;; - "nls/es_ES/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/es_ES/Makefile" ;; - "nls/et_EE/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/et_EE/Makefile" ;; - "nls/fr_FR/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/fr_FR/Makefile" ;; - "nls/it_IT/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/it_IT/Makefile" ;; - "nls/ja_JP/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/ja_JP/Makefile" ;; - "nls/nl_NL/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/nl_NL/Makefile" ;; - "nls/pt_BR/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/pt_BR/Makefile" ;; - "nls/ru_RU/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/ru_RU/Makefile" ;; - "nls/sl_SI/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/sl_SI/Makefile" ;; - "nls/sv_SE/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/sv_SE/Makefile" ;; - "nls/tr_TR/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/tr_TR/Makefile" ;; - "nls/zh_CN/Makefile" ) CONFIG_FILES="$CONFIG_FILES nls/zh_CN/Makefile" ;; - "version.h" ) CONFIG_FILES="$CONFIG_FILES version.h" ;; - "default-1" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default-1" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 - echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; ++ case "\$ac_option" in ++ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ++ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" ++ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; ++ -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ++ echo "$CONFIG_STATUS generated by autoconf version 2.13" ++ exit 0 ;; ++ -help | --help | --hel | --he | --h) ++ echo "\$ac_cs_usage"; exit 0 ;; ++ *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + - # If the user did not use the arguments to specify the items to instantiate, - # then the envvar interface is used. Set only those that are not. - # We use the long form for the default assignment because of an extremely - # bizarre bug on SunOS 4.1.3. - if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands - fi - - # Create a temporary directory, and hook for its removal unless debugging. - $debug || - { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 - } - - # Create a (secure) tmp directory for tmp files. - : ${TMPDIR=/tmp} - { - tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" - } || - { - tmp=$TMPDIR/cs$$-$RANDOM - (umask 077 && mkdir $tmp) - } || - { - echo "$me: cannot create a temporary directory in $TMPDIR" >&2 - { (exit 1); exit 1; } - } - - _ACEOF - - cat >>$CONFIG_STATUS <<_ACEOF - - # - # CONFIG_FILES section. - # ++ac_given_srcdir=$srcdir ++ac_given_INSTALL="$INSTALL" ++ ++trap 'rm -fr `echo "Makefile ++src/Makefile ++util/Makefile ++data/Makefile ++data/styles/Makefile ++doc/Makefile ++nls/Makefile ++nls/C/Makefile ++nls/da_DK/Makefile ++nls/de_DE/Makefile ++nls/es_ES/Makefile ++nls/et_EE/Makefile ++nls/fr_FR/Makefile ++nls/it_IT/Makefile ++nls/ja_JP/Makefile ++nls/nl_NL/Makefile ++nls/pt_BR/Makefile ++nls/ru_RU/Makefile ++nls/sl_SI/Makefile ++nls/sv_SE/Makefile ++nls/tr_TR/Makefile ++nls/zh_CN/Makefile ++version.h config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 ++EOF ++cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF ++$ac_vpsub ++$extrasub ++s%@SHELL@%$SHELL%g ++s%@CFLAGS@%$CFLAGS%g ++s%@CPPFLAGS@%$CPPFLAGS%g ++s%@CXXFLAGS@%$CXXFLAGS%g ++s%@FFLAGS@%$FFLAGS%g ++s%@DEFS@%$DEFS%g ++s%@LDFLAGS@%$LDFLAGS%g ++s%@LIBS@%$LIBS%g ++s%@exec_prefix@%$exec_prefix%g ++s%@prefix@%$prefix%g ++s%@program_transform_name@%$program_transform_name%g ++s%@bindir@%$bindir%g ++s%@sbindir@%$sbindir%g ++s%@libexecdir@%$libexecdir%g ++s%@datadir@%$datadir%g ++s%@sysconfdir@%$sysconfdir%g ++s%@sharedstatedir@%$sharedstatedir%g ++s%@localstatedir@%$localstatedir%g ++s%@libdir@%$libdir%g ++s%@includedir@%$includedir%g ++s%@oldincludedir@%$oldincludedir%g ++s%@infodir@%$infodir%g ++s%@mandir@%$mandir%g ++s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g ++s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g ++s%@INSTALL_DATA@%$INSTALL_DATA%g ++s%@PACKAGE@%$PACKAGE%g ++s%@VERSION@%$VERSION%g ++s%@ACLOCAL@%$ACLOCAL%g ++s%@AUTOCONF@%$AUTOCONF%g ++s%@AUTOMAKE@%$AUTOMAKE%g ++s%@AUTOHEADER@%$AUTOHEADER%g ++s%@MAKEINFO@%$MAKEINFO%g ++s%@SET_MAKE@%$SET_MAKE%g ++s%@CC@%$CC%g ++s%@CXX@%$CXX%g ++s%@regex_cmd@%$regex_cmd%g ++s%@CPP@%$CPP%g ++s%@X_CFLAGS@%$X_CFLAGS%g ++s%@X_PRE_LIBS@%$X_PRE_LIBS%g ++s%@X_LIBS@%$X_LIBS%g ++s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g ++s%@SHAPE@%$SHAPE%g ++s%@SLIT@%$SLIT%g ++s%@NEWWMSPEC@%$NEWWMSPEC%g ++s%@INTERLACE@%$INTERLACE%g ++s%@ORDEREDPSEUDO@%$ORDEREDPSEUDO%g ++s%@CLOBBER@%$CLOBBER%g ++s%@DEBUG@%$DEBUG%g ++s%@NLS@%$NLS%g ++s%@gencat_cmd@%$gencat_cmd%g ++s%@TIMEDCACHE@%$TIMEDCACHE%g ++s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g ++s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g ++s%@MAINT@%$MAINT%g + - # No need to generate the scripts if there are no CONFIG_FILES. - # This happens for instance when ./config.status config.h - if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF - s,@SHELL@,$SHELL,;t t - s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t - s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t - s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t - s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t - s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t - s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t - s,@exec_prefix@,$exec_prefix,;t t - s,@prefix@,$prefix,;t t - s,@program_transform_name@,$program_transform_name,;t t - s,@bindir@,$bindir,;t t - s,@sbindir@,$sbindir,;t t - s,@libexecdir@,$libexecdir,;t t - s,@datadir@,$datadir,;t t - s,@sysconfdir@,$sysconfdir,;t t - s,@sharedstatedir@,$sharedstatedir,;t t - s,@localstatedir@,$localstatedir,;t t - s,@libdir@,$libdir,;t t - s,@includedir@,$includedir,;t t - s,@oldincludedir@,$oldincludedir,;t t - s,@infodir@,$infodir,;t t - s,@mandir@,$mandir,;t t - s,@build_alias@,$build_alias,;t t - s,@host_alias@,$host_alias,;t t - s,@target_alias@,$target_alias,;t t - s,@DEFS@,$DEFS,;t t - s,@ECHO_C@,$ECHO_C,;t t - s,@ECHO_N@,$ECHO_N,;t t - s,@ECHO_T@,$ECHO_T,;t t - s,@LIBS@,$LIBS,;t t - s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t - s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t - s,@INSTALL_DATA@,$INSTALL_DATA,;t t - s,@PACKAGE@,$PACKAGE,;t t - s,@VERSION@,$VERSION,;t t - s,@ACLOCAL@,$ACLOCAL,;t t - s,@AUTOCONF@,$AUTOCONF,;t t - s,@AUTOMAKE@,$AUTOMAKE,;t t - s,@AUTOHEADER@,$AUTOHEADER,;t t - s,@MAKEINFO@,$MAKEINFO,;t t - s,@SET_MAKE@,$SET_MAKE,;t t - s,@CC@,$CC,;t t - s,@CFLAGS@,$CFLAGS,;t t - s,@LDFLAGS@,$LDFLAGS,;t t - s,@CPPFLAGS@,$CPPFLAGS,;t t - s,@ac_ct_CC@,$ac_ct_CC,;t t - s,@EXEEXT@,$EXEEXT,;t t - s,@OBJEXT@,$OBJEXT,;t t - s,@CXX@,$CXX,;t t - s,@CXXFLAGS@,$CXXFLAGS,;t t - s,@ac_ct_CXX@,$ac_ct_CXX,;t t - s,@regex_cmd@,$regex_cmd,;t t - s,@CPP@,$CPP,;t t - s,@X_CFLAGS@,$X_CFLAGS,;t t - s,@X_PRE_LIBS@,$X_PRE_LIBS,;t t - s,@X_LIBS@,$X_LIBS,;t t - s,@X_EXTRA_LIBS@,$X_EXTRA_LIBS,;t t - s,@SHAPE@,$SHAPE,;t t - s,@SLIT@,$SLIT,;t t - s,@NEWWMSPEC@,$NEWWMSPEC,;t t - s,@INTERLACE@,$INTERLACE,;t t - s,@ORDEREDPSEUDO@,$ORDEREDPSEUDO,;t t - s,@CLOBBER@,$CLOBBER,;t t - s,@DEBUG@,$DEBUG,;t t - s,@NLS@,$NLS,;t t - s,@gencat_cmd@,$gencat_cmd,;t t - s,@TIMEDCACHE@,$TIMEDCACHE,;t t - s,@MAINTAINER_MODE_TRUE@,$MAINTAINER_MODE_TRUE,;t t - s,@MAINTAINER_MODE_FALSE@,$MAINTAINER_MODE_FALSE,;t t - s,@MAINT@,$MAINT,;t t +CEOF - - _ACEOF - - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false ++EOF ++ ++cat >> $CONFIG_STATUS <<\EOF ++ ++# Split the substitutions into bite-sized pieces for seds with ++# small command number limits, like on Digital OSF/1 and HP-UX. ++ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ++ac_file=1 # Number of current file. ++ac_beg=1 # First line for current file. ++ac_end=$ac_max_sed_cmds # Line after last line for current file. ++ac_more_lines=: ++ac_sed_cmds="" ++while $ac_more_lines; do ++ if test $ac_beg -gt 1; then ++ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file ++ else ++ sed "${ac_end}q" conftest.subs > conftest.s$ac_file ++ fi ++ if test ! -s conftest.s$ac_file; then ++ ac_more_lines=false ++ rm -f conftest.s$ac_file ++ else ++ if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds="sed -f conftest.s$ac_file" + else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` ++ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat ++ ac_file=`expr $ac_file + 1` ++ ac_beg=$ac_end ++ ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi - fi # test -n "$CONFIG_FILES" - - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue ++done ++if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds=cat ++fi ++EOF ++ ++cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF ++for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac - - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || - $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || - echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; - esac - as_dummy="$ac_dir" - for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 - echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; ++ case "$ac_file" in ++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; ++ *) ac_file_in="${ac_file}.in" ;; + esac - done; } + - ac_builddir=. ++ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + - if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` - else - ac_dir_suffix= ac_top_builddir= - fi ++ # Remove last slash and all that follows it. Not all systems have dirname. ++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` ++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then ++ # The file is in a subdirectory. ++ test ! -d "$ac_dir" && mkdir "$ac_dir" ++ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" ++ # A "../" for each directory in $ac_dir_suffix. ++ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` ++ else ++ ac_dir_suffix= ac_dots= ++ fi + - case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; ++ case "$ac_given_srcdir" in ++ .) srcdir=. ++ if test -z "$ac_dots"; then top_srcdir=. ++ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; ++ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; - esac - # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be - # absolute. - ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` - ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` - ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` - ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; ++ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" ++ top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 - echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - _ACEOF - cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub - $extrasub - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - :t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b - s,@configure_input@,$configure_input,;t t - s,@srcdir@,$ac_srcdir,;t t - s,@abs_srcdir@,$ac_abs_srcdir,;t t - s,@top_srcdir@,$ac_top_srcdir,;t t - s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t - s,@builddir@,$ac_builddir,;t t - s,@abs_builddir@,$ac_abs_builddir,;t t - s,@top_builddir@,$ac_top_builddir,;t t - s,@abs_top_builddir@,$ac_abs_top_builddir,;t t - s,@INSTALL@,$ac_INSTALL,;t t - " $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi ++ case "$ac_given_INSTALL" in ++ [/$]*) INSTALL="$ac_given_INSTALL" ;; ++ *) INSTALL="$ac_dots$ac_given_INSTALL" ;; ++ esac + - done - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF ++ echo creating "$ac_file" ++ rm -f "$ac_file" ++ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." ++ case "$ac_file" in ++ *Makefile*) ac_comsub="1i\\ ++# $configure_input" ;; ++ *) ac_comsub= ;; ++ esac + - # - # CONFIG_HEADER section. - # ++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` ++ sed -e "$ac_comsub ++s%@configure_input@%$configure_input%g ++s%@srcdir@%$srcdir%g ++s%@top_srcdir@%$top_srcdir%g ++s%@INSTALL@%$INSTALL%g ++" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file ++fi; done ++rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. - ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' - ac_dB='[ ].*$,\1#\2' - ac_dC=' ' - ac_dD=',;t' - # ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". - ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' - ac_uB='$,\1#\2define\3' ++ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ++ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ++ac_dC='\3' ++ac_dD='%g' ++# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ++ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ++ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' - ac_uD=',;t' - - for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue ++ac_uD='\4%g' ++# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ++ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ++ac_eB='$%\1#\2define\3' ++ac_eC=' ' ++ac_eD='%g' ++ ++if test "${CONFIG_HEADERS+set}" != set; then ++EOF ++cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF ++fi ++for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; ++ case "$ac_file" in ++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; ++ *) ac_file_in="${ac_file}.in" ;; + esac + - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 - echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo $f;; - *) # Relative - if test -f "$f"; then - # Build tree - echo $f - elif test -f "$srcdir/$f"; then - # Source tree - echo $srcdir/$f - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 - echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - - _ACEOF - - # Transform confdefs.h into two sed scripts, `conftest.defines' and - # `conftest.undefs', that substitutes the proper values into - # config.h.in to produce config.h. The first handles `#define' - # templates, and the second `#undef' templates. - # And first: Protect against being on the right side of a sed subst in - # config.status. Protect against being in an unquoted here document - # in config.status. - rm -f conftest.defines conftest.undefs - # Using a here document instead of a string reduces the quoting nightmare. - # Putting comments in sed scripts is not portable. - # - # `end' is used to avoid that the second main sed command (meant for - # 0-ary CPP macros) applies to n-ary macro definitions. - # See the Autoconf documentation for `clear'. - cat >confdef2sed.sed <<\_ACEOF - s/[\\&,]/\\&/g - s,[\\$`],\\&,g - t clear - : clear - s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp - t end - s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp - : end - _ACEOF - # If some macros were called several times there might be several times - # the same #defines, which is useless. Nevertheless, we may not want to - # sort them, since we want the *last* AC-DEFINE to be honored. - uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines - sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs - rm -f confdef2sed.sed ++ echo creating $ac_file ++ ++ rm -f conftest.frag conftest.in conftest.out ++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` ++ cat $ac_file_inputs > conftest.in ++ ++EOF ++ ++# Transform confdefs.h into a sed script conftest.vals that substitutes ++# the proper values into config.h.in to produce config.h. And first: ++# Protect against being on the right side of a sed subst in config.status. ++# Protect against being in an unquoted here document in config.status. ++rm -f conftest.vals ++cat > conftest.hdr <<\EOF ++s/[\\&%]/\\&/g ++s%[\\$`]%\\&%g ++s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp ++s%ac_d%ac_u%gp ++s%ac_u%ac_e%gp ++EOF ++sed -n -f conftest.hdr confdefs.h > conftest.vals ++rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. - cat >>conftest.undefs <<\_ACEOF - s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, - _ACEOF - - # Break up conftest.defines because some shells have a limit on the size - # of here documents, and old seds have small limits too (100 cmds). - echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS - echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS - echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS - echo ' :' >>$CONFIG_STATUS - rm -f conftest.tail - while grep . conftest.defines >/dev/null - do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in - ' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail - rm -f conftest.defines - mv conftest.tail conftest.defines - done - rm -f conftest.defines - echo ' fi # egrep' >>$CONFIG_STATUS - echo >>$CONFIG_STATUS ++cat >> conftest.vals <<\EOF ++s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% ++EOF ++ ++# Break up conftest.vals because some shells have a limit on ++# the size of here documents, and old seds have small limits too. + - # Break up conftest.undefs because some shells have a limit on the size - # of here documents, and old seds have small limits too (100 cmds). - echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail - while grep . conftest.undefs >/dev/null ++while : +do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS ++ ac_lines=`grep -c . conftest.vals` ++ # grep -c gives empty output for an empty file on some AIX systems. ++ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi ++ # Write a limited-size here document to conftest.frag. ++ echo ' cat > conftest.frag <> $CONFIG_STATUS ++ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in - ' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs ++ sed -f conftest.frag conftest.in > conftest.out ++ rm -f conftest.in ++ mv conftest.out conftest.in ++' >> $CONFIG_STATUS ++ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail ++ rm -f conftest.vals ++ mv conftest.tail conftest.vals +done - rm -f conftest.undefs - - cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h ++rm -f conftest.vals ++ ++cat >> $CONFIG_STATUS <<\EOF ++ rm -f conftest.frag conftest.h ++ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h ++ cat conftest.in >> conftest.h ++ rm -f conftest.in ++ if cmp -s $ac_file conftest.h 2>/dev/null; then ++ echo "$ac_file is unchanged" ++ rm -f conftest.h + else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in - if test x"$ac_file" != x-; then - if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 - echo "$as_me: $ac_file is unchanged" >&6;} - else - ac_dir=`(dirname "$ac_file") 2>/dev/null || - $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || - echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { case "$ac_dir" in - [\\/]* | ?:[\\/]* ) as_incr_dir=;; - *) as_incr_dir=.;; - esac - as_dummy="$ac_dir" - for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do - case $as_mkdir_dir in - # Skip DOS drivespec - ?:) as_incr_dir=$as_mkdir_dir ;; - *) - as_incr_dir=$as_incr_dir/$as_mkdir_dir - test -d "$as_incr_dir" || - mkdir "$as_incr_dir" || - { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 - echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; } - ;; - esac - done; } - - rm -f $ac_file - mv $tmp/config.h $ac_file ++ # Remove last slash and all that follows it. Not all systems have dirname. ++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` ++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then ++ # The file is in a subdirectory. ++ test ! -d "$ac_dir" && mkdir "$ac_dir" + fi - else - cat $tmp/config.h - rm -f $tmp/config.h ++ rm -f $ac_file ++ mv conftest.h $ac_file + fi - done - _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF ++fi; done + - # - # CONFIG_COMMANDS section. - # - for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_dir=`(dirname "$ac_dest") 2>/dev/null || - $as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || - echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - ac_builddir=. - - if test "$ac_dir" != .; then - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` - else - ac_dir_suffix= ac_top_builddir= - fi - - case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; - esac - # Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be - # absolute. - ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` - ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` - ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` - ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` - - - { echo "$as_me:$LINENO: executing $ac_dest commands" >&5 - echo "$as_me: executing $ac_dest commands" >&6;} - case $ac_dest in - default-1 ) test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ;; - esac - done - _ACEOF ++EOF ++cat >> $CONFIG_STATUS <>$CONFIG_STATUS <<\_ACEOF + - { (exit 0); exit 0; } - _ACEOF ++EOF ++cat >> $CONFIG_STATUS <<\EOF ++test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h ++ ++exit 0 ++EOF +chmod +x $CONFIG_STATUS - ac_clean_files=$ac_clean_files_save - - - # configure is writing to config.log, and then calls config.status. - # config.status does its own redirection, appending to config.log. - # Unfortunately, on DOS this fails, as config.log is still kept open - # by configure, so config.status won't be able to write to it; its - # output is simply discarded. So we exec the FD to /dev/null, - # effectively closing config.log, so it can be properly (re)opened and - # appended to by config.status. When coming back to configure, we - # need to make the FD available again. - if test "$no_create" != yes; then - ac_cs_success=: - exec 5>/dev/null - $SHELL $CONFIG_STATUS || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } - fi ++rm -fr confdefs* $ac_clean_files ++test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + diff --cc configure.in index 65699008,1da34f1b..18ec8d68 --- a/configure.in +++ b/configure.in @@@ -1,7 -1,7 +1,7 @@@ dnl configure.in for Openbox dnl Initialize autoconf and automake -AC_INIT(src/blackbox.cc) -AM_INIT_AUTOMAKE(openbox,2.0.0,no-define) +AC_INIT(src/openbox.cc) - AM_INIT_AUTOMAKE(openbox,0.99.0,no-define) ++AM_INIT_AUTOMAKE(openbox,1.2.3,no-define) dnl Determine default prefix test x$prefix = "xNONE" && prefix="$ac_default_prefix" @@@ -173,11 -145,13 +172,11 @@@ AC_ARG_ENABLE(debug [ --enable-debug include verbose debugging code [default=no]], if test x$enableval = "xyes"; then AC_MSG_RESULT([yes]) - DEBUG="-DDEBUG" - DEBUG="-DDEBUG -Wall -W" ++ DEBUG="-DDEBUG -Wall -W -pedantic -fno-inline" else AC_MSG_RESULT([no]) - DEBUG="-DNDEBUG" fi, AC_MSG_RESULT([no]) - DEBUG="-DNDEBUG" ) AC_SUBST(DEBUG) diff --cc data/Makefile.in index a7e35d44,00000000..898ab160 mode 100644,000000..100644 --- a/data/Makefile.in +++ b/data/Makefile.in @@@ -1,308 -1,0 +1,306 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# data/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +SUBDIRS = styles +CLEANFILES = menu +MAINTAINERCLEANFILES = Makefile.in +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = README Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu data/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps data/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + 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//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = data + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu data/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: install-data-local +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile all-local +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-tags distclean-generic clean-am distclean-local + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: install-data-recursive uninstall-data-recursive \ +install-exec-recursive uninstall-exec-recursive installdirs-recursive \ +uninstalldirs-recursive all-recursive check-recursive \ +installcheck-recursive info-recursive dvi-recursive \ +mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-local install-data-am install-data install-am \ +install uninstall-am uninstall all-local all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +all-local: menu + +distclean-local: + rm -f *\~ + +menu: menu.in + @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," @srcdir@/menu.in > menu + +install-data-local: menu + test -f $(DESTDIR)$(pkgdatadir)/menu || \ + $(INSTALL_DATA) menu $(DESTDIR)$(pkgdatadir) + ++uninstall-am: ++ rm -f $(DESTDIR)$(pkgdatadir)/menu ++ +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc data/styles/Makefile.am index 38053588,fb5dbb92..31458285 --- a/data/styles/Makefile.am +++ b/data/styles/Makefile.am @@@ -2,7 -2,9 +2,9 @@@ styledir = $(pkgdatadir)/styles MAINTAINERCLEANFILES = Makefile.in - style_DATA = artwiz bluebox cthulhain flux nyz nyzclone operation outcomes shade the_orange trisb twice frobozz frobust steelblue steelblue2 + style_DATA = artwiz bluebox cthulhain deep flux frobozz frobust nyz nyzclone operation outcomes shade steelblue steelblue2 the_orange trisb twice distclean-local: - rm -f *\~ .\#* + rm -f *\~ + uninstall-am: + rmdir $(styledir) diff --cc data/styles/Makefile.in index 6df1f4b0,00000000..993830b2 mode 100644,000000..100644 --- a/data/styles/Makefile.in +++ b/data/styles/Makefile.in @@@ -1,215 -1,0 +1,212 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# data/styles/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +styledir = $(pkgdatadir)/styles +MAINTAINERCLEANFILES = Makefile.in - style_DATA = artwiz bluebox cthulhain flux nyz nyzclone operation outcomes shade the_orange trisb twice frobozz frobust steelblue steelblue2 ++style_DATA = artwiz bluebox cthulhain deep flux frobozz frobust nyz nyzclone operation outcomes shade steelblue steelblue2 the_orange trisb twice +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DATA = $(style_DATA) + +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu data/styles/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps data/styles/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-styleDATA: $(style_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(styledir) + @list='$(style_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(styledir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(styledir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(styledir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(styledir)/$$p; \ + fi; fi; \ + done + +uninstall-styleDATA: + @$(NORMAL_UNINSTALL) + list='$(style_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(styledir)/$$p; \ + done +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = data/styles + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu data/styles/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-styleDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-styleDATA +uninstall: uninstall-am +all-am: Makefile $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(styledir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: uninstall-styleDATA install-styleDATA tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +distclean-local: + rm -f *\~ ++uninstall-am: ++ rmdir $(styledir) + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc doc/Makefile.in index 191f9ce5,00000000..96fe5fd0 mode 100644,000000..100644 --- a/doc/Makefile.in +++ b/doc/Makefile.in @@@ -1,351 -1,0 +1,346 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# doc/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +CLEANFILES = openbox.1 +MAINTAINERCLEANFILES = Makefile.in - man_MANS = openbox.1 bsetroot.1 ++man_MANS = openbox.1 bsetroot.1 bsetbg.1 +SUBDIRS = + +DEFAULT_MENU = $(pkgdatadir)/menu +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +man1dir = $(mandir)/man1 +MANS = $(man_MANS) + +NROFF = nroff +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu doc/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps doc/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-man1: + $(mkinstalldirs) $(DESTDIR)$(man1dir) + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + if test -f $(srcdir)/$$i; then file=$(srcdir)/$$i; \ + else file=$$i; fi; \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst"; \ + $(INSTALL_DATA) $$file $(DESTDIR)$(man1dir)/$$inst; \ + done + +uninstall-man1: + @list='$(man1_MANS)'; \ + l2='$(man_MANS)'; for i in $$l2; do \ + case "$$i" in \ + *.1*) list="$$list $$i" ;; \ + esac; \ + done; \ + for i in $$list; do \ + ext=`echo $$i | sed -e 's/^.*\\.//'`; \ + inst=`echo $$i | sed -e 's/\\.[0-9a-z]*$$//'`; \ + inst=`echo $$inst | sed '$(transform)'`.$$ext; \ + echo " rm -f $(DESTDIR)$(man1dir)/$$inst"; \ + rm -f $(DESTDIR)$(man1dir)/$$inst; \ + done +install-man: $(MANS) + @$(NORMAL_INSTALL) + $(MAKE) $(AM_MAKEFLAGS) install-man1 +uninstall-man: + @$(NORMAL_UNINSTALL) + $(MAKE) $(AM_MAKEFLAGS) uninstall-man1 + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + 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//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = doc + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu doc/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: install-man +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-man +uninstall: uninstall-recursive +all-am: Makefile $(MANS) +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(mandir)/man1 + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-tags distclean-generic clean-am distclean-local + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: install-man1 uninstall-man1 install-man uninstall-man \ +install-data-recursive uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs-am \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +distclean-local: + rm -f *\~ + +openbox.1: openbox.1.in + @regex_cmd@ -e "s,@defaultmenu@,$(DEFAULT_MENU)," \ + -e "s,@pkgdatadir@,$(pkgdatadir)," \ + -e "s,@version@,$(VERSION)," \ + @srcdir@/openbox.1.in > openbox.1 + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/C/Configmenu.m index d01e3c15,3143c0d8..e18b084a --- a/nls/C/Configmenu.m +++ b/nls/C/Configmenu.m @@@ -28,6 -36,8 +28,12 @@@ $ #SmartCol # Smart Placement (Columns) $ #Cascade # Cascade Placement ++$ #BestFit ++# Best Fit Placement + $ #UnderMouse + # Under Mouse Placement ++$ #ClickMouse ++# Click Mouse Placement $ #LeftRight # Left to Right $ #RightLeft @@@ -36,3 -46,3 +42,9 @@@ $ #TopBotto # Top to Bottom $ #BottomTop # Bottom to Top ++$ #WindowToWindowSnap ++# Window-To-Window Snapping ++$ #WindowCornerSnap ++# Window Corner Snapping ++$ #HideToolbar ++# Hide Toolbar diff --cc nls/C/Makefile.in index 51a61954,00000000..55fb7edf mode 100644,000000..100644 --- a/nls/C/Makefile.in +++ b/nls/C/Makefile.in @@@ -1,235 -1,0 +1,230 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/C/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/C/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/C/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/C + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/C/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: Translation.m openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/C"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/C; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/C; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/US_ASCII; \ + ln -f -ss C $(DESTDIR)$(pkgdatadir)/nls/US_ASCII; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/POSIX; \ + ln -f -s C $(DESTDIR)$(pkgdatadir)/nls/POSIX; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en_US; \ + ln -f -s C $(DESTDIR)$(pkgdatadir)/nls/en_US; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en; \ + ln -f -s C $(DESTDIR)$(pkgdatadir)/nls/en; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/C/openbox.cat; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/US_ASCII; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/POSIX; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en_US; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/C; \ + fi + +# note... when adding new catalogs... you do not need the +# header=../openbox-nls.h which is passed to awk... we +# only need to generate it once. + +Translation.m: $(MFILES) + awk -f @srcdir@/../convert.awk header=../openbox-nls.h \ + output=Translation.m $(MFILES) + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/C/Screen.m index 128c06e7,128c06e7..f2be3d36 --- a/nls/C/Screen.m +++ b/nls/C/Screen.m @@@ -9,6 -9,6 +9,8 @@@ $ #FontLoadFai # BScreen::LoadStyle(): couldn't load font '%s'\n $ #DefaultFontLoadFail # BScreen::LoadStyle(): couldn't load default font.\n ++$ #DefaultStyleLoadFail ++# BScreen::LoadStyle(): couldn't load default style.\n $ #EmptyMenuFile # %s: empty menu file\n $ #xterm diff --cc nls/C/main.m index e7d9f157,acc29ec4..9174d9da --- a/nls/C/main.m +++ b/nls/C/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # warning: could not set environment variable 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tuse display connection.\n\ -rc \t\t\tuse alternate resource file.\n\ - -menu \t\tuse alternate menu file.\n\ ++ -menu \t\t\tuse alternate menu file.\n\ -version\t\t\tdisplay version and exit.\n\ -help\t\t\t\tdisplay this help text and exit.\n\n $ #CompileOptions diff --cc nls/Makefile.in index d8e81ccf,00000000..cd4a3653 mode 100644,000000..100644 --- a/nls/Makefile.in +++ b/nls/Makefile.in @@@ -1,305 -1,0 +1,300 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +SUBDIRS = C da_DK de_DE es_ES et_EE fr_FR it_IT ja_JP nl_NL pt_BR ru_RU sl_SI sv_SE tr_TR zh_CN + +MAINTAINERCLEANFILES = Makefile.in openbox-nls.h +DISTCLEANFILES = openbox-nls.h +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + 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//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(top_distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-local +uninstall: uninstall-recursive +all-am: Makefile +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-tags distclean-generic clean-am distclean-local + +distclean: distclean-recursive + +maintainer-clean-am: maintainer-clean-tags maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + +.PHONY: install-data-recursive uninstall-data-recursive \ +install-exec-recursive uninstall-exec-recursive installdirs-recursive \ +uninstalldirs-recursive all-recursive check-recursive \ +installcheck-recursive info-recursive dvi-recursive \ +mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-redirect all-am all \ +installdirs-am installdirs mostlyclean-generic distclean-generic \ +clean-generic maintainer-clean-generic clean mostlyclean distclean \ +maintainer-clean + + +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rmdir $(DESTDIR)$(pkgdatadir)/nls; \ + fi +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/da_DK/Makefile.in index a4a68cc5,00000000..1b022c32 mode 100644,000000..100644 --- a/nls/da_DK/Makefile.in +++ b/nls/da_DK/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/da_DK/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/da_DK/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/da_DK/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/da_DK + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/da_DK/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/da_DK"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/da_DK/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/da_DK/main.m index 84926a6d,0089ffab..3fe77d46 --- a/nls/da_DK/main.m +++ b/nls/da_DK/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # advarsel: kunne ikke sætte variablen 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tbrug skærm tilslutning.\n\ -rc \t\t\tbrug alternativ resource fil.\n\ - -menu \t\tbrug alternativ menu fil.\n\ ++ -menu \t\t\tbrug alternativ menu fil.\n\ -version\t\t\tvis versionsnummer og afslut.\n\ -help\t\t\t\tvis denne hjælp og afslut.\n\n $ #CompileOptions diff --cc nls/de_DE/Makefile.in index 0cc0e92f,00000000..9be70554 mode 100644,000000..100644 --- a/nls/de_DE/Makefile.in +++ b/nls/de_DE/Makefile.in @@@ -1,223 -1,0 +1,218 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/de_DE/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/de_DE/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/de_DE/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/de_DE + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/de_DE/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/de_DE"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/de_DE; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/de_DE; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/de; \ + ln -f -s de_DE $(DESTDIR)$(pkgdatadir)/nls/de; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/de_DE/openbox.cat; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/de; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/de_DE; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/de_DE/main.m index d20d1fde,92d83123..c8c13fe0 --- a/nls/de_DE/main.m +++ b/nls/de_DE/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # Achtung: konnte die Umgebungsvariable 'DISPLAY' nicht setzen\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tDisplay Verbindung.\n\ -rc \t\t\talternative Konfigurationsdatei.\n\ - -menu \t\talternate menu file.\n\ ++ -menu \t\t\talternative menu.\n\ -version\t\t\tzeige Versionsnummer und Beendung.\n\ -help\t\t\t\tzeige diesen Hilfstext und Beendung.\n\n $ #CompileOptions diff --cc nls/es_ES/Makefile.in index 5c57f6cd,00000000..71641f97 mode 100644,000000..100644 --- a/nls/es_ES/Makefile.in +++ b/nls/es_ES/Makefile.in @@@ -1,223 -1,0 +1,218 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/es_ES/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/es_ES/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/es_ES/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/es_ES + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/es_ES/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/es_ES"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/es_ES; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/es_ES; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/es; \ + ln -f -s es_ES $(DESTDIR)$(pkgdatadir)/nls/es; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/es_ES/openbox.cat; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/es; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/es_ES; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/es_ES/main.m index d80cf938,c314be9f..5640740e --- a/nls/es_ES/main.m +++ b/nls/es_ES/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # cuidado: no se puede establecer la variable de ambiente 'DISPLAY' $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display conexión de despliegue.\n\ -rc archivo alternativo de recuros.\n\ + -menu archivo alternativo de menu.\n\ -version mostrar la versión y cerrar.\n\ -help mostrar este texto de ayuda y cerrar.\n\n $ #CompileOptions diff --cc nls/et_EE/Makefile.in index 34f1f4e9,00000000..838e347c mode 100644,000000..100644 --- a/nls/et_EE/Makefile.in +++ b/nls/et_EE/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/et_EE/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/et_EE/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/et_EE/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/et_EE + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/et_EE/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/et_EE"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/et_EE ; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/et_EE; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/et_EE/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/et_EE; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/et_EE/main.m index 984b5565,7115f7af..3a3d0d99 --- a/nls/et_EE/main.m +++ b/nls/et_EE/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # hoiatus: ei saanud määrata keskonna muutujat 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tkasuta displei ühendust.\n\ -rc \t\t\tkasuta alternatiivseid resursse.\n\ - -menu \t\tkasuta alternatiivseid menu.\n\ ++ -menu \t\t\tkasuta alternatiivseid menu.\n\ -version\t\t\tnäita versiooninumber ja välju.\n\ -help\t\t\t\tnäita seda abiteksti ja välju.\n\n $ #CompileOptions diff --cc nls/fr_FR/Makefile.in index 97c725c0,00000000..48837bc0 mode 100644,000000..100644 --- a/nls/fr_FR/Makefile.in +++ b/nls/fr_FR/Makefile.in @@@ -1,223 -1,0 +1,218 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/fr_FR/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/fr_FR/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/fr_FR/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/fr_FR + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/fr_FR/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/fr_FR"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/fr_FR; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/fr_FR; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/fr; \ + ln -f -s fr_FR $(DESTDIR)$(pkgdatadir)/nls/fr; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/fr_FR/openbox.cat; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/fr; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/fr_FR; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/fr_FR/main.m index 5963b7c8,8c36b82f..da0a96a2 --- a/nls/fr_FR/main.m +++ b/nls/fr_FR/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # Attention: impossible d'attribuer la variable d'environnement 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tutilise la connexion à l'affichage.\n\ -rc \t\t\tutilise un autre fichier de configuration.\n\ - -menu \t\tutilise un autre fichier de menu.\n\ ++ -menu \t\t\tutilise un autre fichier de menu.\n\ -version\t\t\taffiche la version et quitte.\n\ -help\t\t\t\taffiche ce texte d'aide et quitte.\n\n $ #CompileOptions diff --cc nls/it_IT/Makefile.in index 75fca323,00000000..6d7e6a60 mode 100644,000000..100644 --- a/nls/it_IT/Makefile.in +++ b/nls/it_IT/Makefile.in @@@ -1,223 -1,0 +1,218 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/it_IT/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/it_IT/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/it_IT/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/it_IT + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/it_IT/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/it_IT"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/it_IT; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/it_IT; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/it; \ + ln -f -s it_IT $(DESTDIR)$(pkgdatadir)/nls/it; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/it_IT/openbox.cat; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/it; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/it_IT; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/it_IT/main.m index 0d8507de,23fe6a8c..386c5da1 --- a/nls/it_IT/main.m +++ b/nls/it_IT/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # attenzione: impossibile impostare la variabile d'ambiente 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tusa connessione display.\n\ -rc \t\t\tusa un file risorsa alternativo.\n\ - -menu \t\tusa un file menu alternativo.\n\ ++ -menu \t\t\tusa un file menu alternativo.\n\ -version\t\t\tmostra la versione e esci.\n\ -help\t\t\t\tmostra questo aiuto e esci.\n\n $ #CompileOptions diff --cc nls/ja_JP/Makefile.in index 157e34fe,00000000..388cd807 mode 100644,000000..100644 --- a/nls/ja_JP/Makefile.in +++ b/nls/ja_JP/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/ja_JP/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/ja_JP/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/ja_JP/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/ja_JP + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/ja_JP/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/ja_JP"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/ja_JP; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/ja_JP; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/ja_JP/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/ja_JP; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/ja_JP/main.m index 5aa8b23d,91ad47a7..831ab076 --- a/nls/ja_JP/main.m +++ b/nls/ja_JP/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # ·Ù¹ð: ´Ä¶­ÊÑ¿ô 'DISPLAY' ¤òÀßÄê¤Ç¤­¤Þ¤»¤ó¤Ç¤·¤¿\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\t»ØÄê¥Ç¥£¥¹¥×¥ì¥¤¤ËÀܳ\n\ -rc \t\t\tÂå¤ê¤Î¥ê¥½¡¼¥¹¥Õ¥¡¥¤¥ë¤ò»ÈÍÑ\n\ - -menu \t\tuse alternate menu file.\n\ ++ -menu \t\t\tuse alternate menu file\n\ -version\t\t\t¥Ð¡¼¥¸¥ç¥ó¾ðÊó¤òɽ¼¨¤·¡¢½ªÎ»\n\ -help\t\t\t\t¤³¤Î¥Ø¥ë¥×¤òɽ¼¨¤·¡¢½ªÎ»\n\n $ #CompileOptions diff --cc nls/nl_NL/Makefile.in index daee5edd,00000000..708e6f14 mode 100644,000000..100644 --- a/nls/nl_NL/Makefile.in +++ b/nls/nl_NL/Makefile.in @@@ -1,223 -1,0 +1,218 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/nl_NL/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/nl_NL/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/nl_NL/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/nl_NL + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/nl_NL/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/nl_NL"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/nl_NL; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/nl_NL; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/nl; \ + ln -f -s nl_NL $(DESTDIR)$(pkgdatadir)/nls/nl; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/nl_NL/openbox.cat; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/nl; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/nl_NL; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/nl_NL/main.m index 8cab5381,d6d4fc95..8b5bc568 --- a/nls/nl_NL/main.m +++ b/nls/nl_NL/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # waarschuwing: kan omgevingsvariabele 'DISPLAY' niet instellen\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display gebruik aangegeven display.\n\ -rc gebruik alternatief resource bestand.\n\ + -menu gebruik alternatief menu bestand.\n\ -version toon versie en stop.\n\ -help toon deze hulp tekst en stop.\n\n $ #CompileOptions diff --cc nls/pt_BR/Makefile.in index 4fc147bc,00000000..013aa568 mode 100644,000000..100644 --- a/nls/pt_BR/Makefile.in +++ b/nls/pt_BR/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/pt_BR/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/pt_BR/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/pt_BR/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/pt_BR + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/pt_BR/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/pr_BR"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/pt_BR; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/pt_BR; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/pt_BR/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/pt_BR; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/pt_BR/main.m index a01d01aa,45b12bb1..9aa8898b --- a/nls/pt_BR/main.m +++ b/nls/pt_BR/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # aviso: não foi possivel setar a variavel de ambiente 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tusar conexão com o display.\n\ -rc \t\t\tusar arquivo alternativo de recursos.\n\ - -menu \t\tusar arquivo alternativo de menu.\n\ ++ -menu \t\t\tusar arquivo alternativo de menu.\n\ -version\t\t\tmostrar versao e sair.\n\ -help\t\t\t\tmostrar esta ajuda e sair.\n\n $ #CompileOptions diff --cc nls/ru_RU/Makefile.in index e5ca4ac4,00000000..671db679 mode 100644,000000..100644 --- a/nls/ru_RU/Makefile.in +++ b/nls/ru_RU/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/ru_RU/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/ru_RU/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/ru_RU/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/ru_RU + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/ru_RU/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/ru_RU"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/ru_RU; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/ru_RU; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/ru_RU/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/ru_RU; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/ru_RU/main.m index a91c112e,b9e32f0d..b531fc34 --- a/nls/ru_RU/main.m +++ b/nls/ru_RU/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # ÐÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÎÅ×ÏÚÍÏÖÎÏ ÕÓÔÁÎÏ×ÉÔØ ÐÅÒÅÍÅÎÎÕÀ ÏËÒÕÖÅÎÉÑ 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tÉÓÐÏÌØÚÏ×ÁÔØ ÚÁÄÁÎÎÙÊ ÄÉÓÐÌÅÊ.\n\ -rc \t\t\tÉÓÐÏÌØÚÏ×ÁÔØ ÁÌØÔÅÒÎÁÔÉ×ÎÙÊ ÆÁÊÌ ÒÅÓÕÒÓÏ×.\n\ - -menu \t\tuse alternate menu file.\n\ ++ -menu \t\t\tuse alternate menu file.\n\ -version\t\t\t×Ù×ÅÓÔÉ ÎÏÍÅÒ ×ÅÒÓÉÉ É ×ÙÊÔÉ.\n\ -help\t\t\t\t×Ù×ÅÓÔÉ ÜÔÕ ÐÏÄÓËÁÚËÕ É ×ÙÊÔÉ.\n\n $ #CompileOptions diff --cc nls/sl_SI/Makefile.in index a4ca149b,00000000..ffa6352c mode 100644,000000..100644 --- a/nls/sl_SI/Makefile.in +++ b/nls/sl_SI/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/sl_SI/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/sl_SI/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/sl_SI/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/sl_SI + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/sl_SI/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/sl_SI"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/sl_SI; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/sl_SI; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/sl_SI/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/sl_SI; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/sl_SI/main.m index c6d04725,c77a4ab4..273bcefa --- a/nls/sl_SI/main.m +++ b/nls/sl_SI/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # opozorilo: spremenljivke okolja 'DISPLAY' ni moè nastaviti\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tuporabi prikazovalnik.\n\ -rc \t\t\tuporabi nadomestno datoteko z viri.\n\ - -menu \t\tuse alternate menu file.\n\ ++ -menu \t\t\tuse alternate menu file.\n\ -version\t\t\tprika¾i oznako razlièice in konèaj.\n\ -help\t\t\t\prika¾i ta navodila in konèaj.\n\n $ #CompileOptions diff --cc nls/sv_SE/Makefile.in index 94fbf4cf,00000000..857c30ff mode 100644,000000..100644 --- a/nls/sv_SE/Makefile.in +++ b/nls/sv_SE/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/sv_SE/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/sv_SE/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/sv_SE/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/sv_SE + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/sv_SE/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/sv_SE"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/sv_SE; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/sv_SE; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/sv_SE/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/sv_SE; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/sv_SE/main.m index 6cfcfb5f,81bdd1bb..f229c525 --- a/nls/sv_SE/main.m +++ b/nls/sv_SE/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # varning: kunde inte sätta variabeln 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tanvänd skärmanslutning.\n\ -rc \t\t\tanvänd alternativ resursfil.\n\ - -menu \t\tanvänd alternativ menufil.\n\ ++ -menu \t\t\tanvänd alternativ menu.\n\ -version\t\t\tvisa version och avsluta.\n\ -help\t\t\t\tvisa denna hjälptext och avsluta.\n\n $ #CompileOptions diff --cc nls/tr_TR/Makefile.in index 0f91733a,00000000..26101477 mode 100644,000000..100644 --- a/nls/tr_TR/Makefile.in +++ b/nls/tr_TR/Makefile.in @@@ -1,224 -1,0 +1,219 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/tr_TR/Makefile.am for Openbox +# +# -- Türkce tercüme dizini için bir yapim-dosya-tabaný +# kabalak -- kabalak@gmx.net +# + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/tr_TR/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/tr_TR/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/tr_TR + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/tr_TR/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/tr_TR"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/tr_TR; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/tr_TR; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/tr_TR/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/tr_TR; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/tr_TR/main.m index d8f40ae2,f382efb4..0c582a97 --- a/nls/tr_TR/main.m +++ b/nls/tr_TR/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # ikaz : 'DISPLAY' verisini oturtamadým\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tekraný kullan.\n\ -rc \t\t\tbaþka bir ayarlama dosyasýný kullan.\n\ - -menu \t\tuse alternate menu file.\n\ ++ -menu \t\t\tuse alternate menu file.\n\ -version\t\t\tnesil bilgisini gösterir ve çýkar.\n\ -help\t\t\t\tbu yardým iletisini gösterir ve çýkar.\n\n $ #CompileOptions diff --cc nls/zh_CN/Makefile.in index 96ed28d3,00000000..ea6f4858 mode 100644,000000..100644 --- a/nls/zh_CN/Makefile.in +++ b/nls/zh_CN/Makefile.in @@@ -1,220 -1,0 +1,215 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# nls/zh_CN/Makefile.am for Openbox + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = openbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +DISTCLEANFILES = Translation.m +MFILES = @srcdir@/BaseDisplay.m @srcdir@/Basemenu.m @srcdir@/Configmenu.m @srcdir@/Icon.m @srcdir@/Image.m @srcdir@/Screen.m @srcdir@/Slit.m @srcdir@/Toolbar.m @srcdir@/Window.m @srcdir@/Windowmenu.m @srcdir@/Workspace.m @srcdir@/Workspacemenu.m @srcdir@/openbox.m @srcdir@/common.m @srcdir@/main.m @srcdir@/bsetroot.m +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../../config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +all: all-redirect +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu nls/zh_CN/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps nls/zh_CN/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = nls/zh_CN + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu nls/zh_CN/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-data-local +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-local +uninstall: uninstall-am +all-am: Makefile all-local +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + + +mostlyclean-generic: + +clean-generic: + -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + -test -z "$(DISTCLEANFILES)" || rm -f $(DISTCLEANFILES) + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: tags distdir info-am info dvi-am dvi check check-am \ +installcheck-am installcheck install-exec-am install-exec \ +install-data-local install-data-am install-data install-am install \ +uninstall-local uninstall-am uninstall all-local all-redirect all-am \ +all installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +all-local: openbox.cat +install-data-local: openbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/zh_CN"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/zh_CN; \ + $(INSTALL_DATA) openbox.cat $(DESTDIR)$(pkgdatadir)/nls/zh_CN; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/zh_CN/openbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/zh_CN; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f @srcdir@/../convert.awk output=Translation.m $(MFILES); \ + fi + +openbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) openbox.cat Translation.m; \ + fi + +distclean-local: + rm -f *\~ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc nls/zh_CN/main.m index 15a4b9e7,f1b2d3b9..890338bc --- a/nls/zh_CN/main.m +++ b/nls/zh_CN/main.m @@@ -7,11 -9,12 +9,12 @@@ $ #DISPLAYRequiresAr $ #WarnDisplaySet # ¾¯¸æ: ²»ÄÜÉèÖû·¾³±äÁ¿ 'DISPLAY'\n $ #Usage -# Openbox %s : (c) 2002 - 2002 Ben Jansens\n\ - 2001 - 2002 Sean 'Shaleh' Perry\n\ - 1997 - 2000, 2002 Brad Hughes\n\n\ +# Openbox %s: (c) 2002 - 2002 Ben Jansens\n\ + \t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\ + \t\t\t 1997 - 2000 Brad Hughes\n\n\ -display \t\tʹÓÃÏÔʾÁ¬½Ó.\n\ -rc \t\t\tʹÓÃÆäËûµÄ×ÊÔ´Îļþ.\n\ - -menu \t\tuse alternate menu file.\n\ ++ -menu \t\t\tuse alternate menu file.\n\ -version\t\t\tÏÔʾ°æ±¾.\n\ -help\t\t\t\tÏÔʾÕâ¸ö°ïÖú.\n\n $ #CompileOptions diff --cc src/BaseDisplay.cc index 258e3eab,5c34a727..c99b2b16 --- a/src/BaseDisplay.cc +++ b/src/BaseDisplay.cc @@@ -48,10 -43,13 +48,13 @@@ # include #endif // HAVE_STDIO_H - #ifdef STDC_HEADERS -#ifdef HAVE_STDLIB_H ++#ifdef HAVE_STDLIB_H # include + #endif // HAVE_STDLIB_H + -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include - #endif // STDC_HEADERS + #endif // HAVE_STRING_H #ifdef HAVE_UNISTD_H # include @@@ -78,20 -76,21 +81,21 @@@ # include # include #endif // HAVE_SYS_WAIT_H -} -#include -using std::string; +#if defined(HAVE_PROCESS_H) && defined(__EMX__) +# include +#endif // HAVE_PROCESS_H __EMX__ -#include "i18n.hh" -#include "BaseDisplay.hh" -#include "GCCache.hh" -#include "Timer.hh" -#include "Util.hh" +#include "i18n.h" +#include "BaseDisplay.h" - #include "LinkedList.h" +#include "Timer.h" ++#include + // X error handler to handle any and all X errors while the application is // running -static bool internal_error = False; +static Bool internal_error = False; +static Window last_bad_window = None; BaseDisplay *base_display; @@@ -172,32 -175,10 +176,32 @@@ static void signalhandler(int sig) } -BaseDisplay::BaseDisplay(const char *app_name, const char *dpy_name) { - application_name = app_name; +// convenience functions +#ifndef __EMX__ +void bexec(const char *command, char* displaystring) { + if (! fork()) { + setsid(); + putenv(displaystring); + execl("/bin/sh", "/bin/sh", "-c", command, NULL); + exit(0); + } +} +#endif // !__EMX__ + +char *bstrdup(const char *s) { + const int l = strlen(s) + 1; + char *n = new char[l]; + strncpy(n, s, l); + return n; +} + - BaseDisplay::BaseDisplay(char *app_name, char *dpy_name) { - application_name = app_name; ++BaseDisplay::BaseDisplay(const char *app_name, char *dpy_name) { ++ application_name = bstrdup(app_name); - run_state = STARTUP; + _startup = True; + _shutdown = False; + server_grabs = 0; + last_bad_window = None; ::base_display = this; @@@ -251,95 -232,11 +254,91 @@@ shape.extensions = False; #endif // SHAPE + xa_wm_colormap_windows = + XInternAtom(display, "WM_COLORMAP_WINDOWS", False); + xa_wm_protocols = XInternAtom(display, "WM_PROTOCOLS", False); + xa_wm_state = XInternAtom(display, "WM_STATE", False); + xa_wm_change_state = XInternAtom(display, "WM_CHANGE_STATE", False); + xa_wm_delete_window = XInternAtom(display, "WM_DELETE_WINDOW", False); + xa_wm_take_focus = XInternAtom(display, "WM_TAKE_FOCUS", False); + motif_wm_hints = XInternAtom(display, "_MOTIF_WM_HINTS", False); + + openbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); + openbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); + openbox_change_attributes = + XInternAtom(display, "_BLACKBOX_CHANGE_ATTRIBUTES", False); + + openbox_structure_messages = + XInternAtom(display, "_BLACKBOX_STRUCTURE_MESSAGES", False); + openbox_notify_startup = + XInternAtom(display, "_BLACKBOX_NOTIFY_STARTUP", False); + openbox_notify_window_add = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False); + openbox_notify_window_del = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False); + openbox_notify_current_workspace = + XInternAtom(display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False); + openbox_notify_workspace_count = + XInternAtom(display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False); + openbox_notify_window_focus = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False); + openbox_notify_window_raise = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False); + openbox_notify_window_lower = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False); + + openbox_change_workspace = + XInternAtom(display, "_BLACKBOX_CHANGE_WORKSPACE", False); + openbox_change_window_focus = + XInternAtom(display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False); + openbox_cycle_window_focus = + XInternAtom(display, "_BLACKBOX_CYCLE_WINDOW_FOCUS", False); + +#ifdef NEWWMSPEC + + net_supported = XInternAtom(display, "_NET_SUPPORTED", False); + net_client_list = XInternAtom(display, "_NET_CLIENT_LIST", False); + net_client_list_stacking = XInternAtom(display, "_NET_CLIENT_LIST_STACKING", False); + net_number_of_desktops = XInternAtom(display, "_NET_NUMBER_OF_DESKTOPS", False); + net_desktop_geometry = XInternAtom(display, "_NET_DESKTOP_GEOMETRY", False); + net_desktop_viewport = XInternAtom(display, "_NET_DESKTOP_VIEWPORT", False); + net_current_desktop = XInternAtom(display, "_NET_CURRENT_DESKTOP", False); + net_desktop_names = XInternAtom(display, "_NET_DESKTOP_NAMES", False); + net_active_window = XInternAtom(display, "_NET_ACTIVE_WINDOW", False); + net_workarea = XInternAtom(display, "_NET_WORKAREA", False); + net_supporting_wm_check = XInternAtom(display, "_NET_SUPPORTING_WM_CHECK", False); + net_virtual_roots = XInternAtom(display, "_NET_VIRTUAL_ROOTS", False); + + net_close_window = XInternAtom(display, "_NET_CLOSE_WINDOW", False); + net_wm_moveresize = XInternAtom(display, "_NET_WM_MOVERESIZE", False); + + net_properties = XInternAtom(display, "_NET_PROPERTIES", False); + net_wm_name = XInternAtom(display, "_NET_WM_NAME", False); + net_wm_desktop = XInternAtom(display, "_NET_WM_DESKTOP", False); + net_wm_window_type = XInternAtom(display, "_NET_WM_WINDOW_TYPE", False); + net_wm_state = XInternAtom(display, "_NET_WM_STATE", False); + net_wm_strut = XInternAtom(display, "_NET_WM_STRUT", False); + net_wm_icon_geometry = XInternAtom(display, "_NET_WM_ICON_GEOMETRY", False); + net_wm_icon = XInternAtom(display, "_NET_WM_ICON", False); + net_wm_pid = XInternAtom(display, "_NET_WM_PID", False); + net_wm_handled_icons = XInternAtom(display, "_NET_WM_HANDLED_ICONS", False); + + net_wm_ping = XInternAtom(display, "_NET_WM_PING", False); + +#endif // NEWWMSPEC + + cursor.session = XCreateFontCursor(display, XC_left_ptr); + cursor.move = XCreateFontCursor(display, XC_fleur); + cursor.ll_angle = XCreateFontCursor(display, XC_ll_angle); + cursor.lr_angle = XCreateFontCursor(display, XC_lr_angle); + cursor.ul_angle = XCreateFontCursor(display, XC_ul_angle); + cursor.ur_angle = XCreateFontCursor(display, XC_ur_angle); + XSetErrorHandler((XErrorHandler) handleXErrors); - timerList = new LinkedList; - - screenInfoList = new LinkedList; - for (int i = 0; i < number_of_screens; i++) { - ScreenInfo *screeninfo = new ScreenInfo(this, i); - screenInfoList->insert(screeninfo); - } - screenInfoList.reserve(ScreenCount(display)); - for (int i = 0; i < ScreenCount(display); ++i) - screenInfoList.push_back(ScreenInfo(this, i)); ++ screenInfoList.reserve(numberOfScreens()); ++ for (unsigned int s = 0; s < numberOfScreens(); s++) ++ screenInfoList.push_back(new ScreenInfo(*this, s)); #ifndef NOCLOBBER NumLockMask = ScrollLockMask = 0; @@@ -377,27 -274,19 +376,22 @@@ MaskList[6] = LockMask | ScrollLockMask; MaskList[7] = LockMask | NumLockMask | ScrollLockMask; MaskListLength = sizeof(MaskList) / sizeof(MaskList[0]); - + if (modmap) XFreeModifiermap(const_cast(modmap)); -#else // NOCLOBBER - NumLockMask = 0; - ScrollLockMask = 0; ++#else ++ NumLockMask = Mod2Mask; ++ ScrollLockMask = Mod5Mask; #endif // NOCLOBBER - - gccache = 0; } BaseDisplay::~BaseDisplay(void) { - while (screenInfoList->count()) { - ScreenInfo *si = screenInfoList->first(); - - screenInfoList->remove(si); - delete si; - } - - delete screenInfoList; - - delete gccache; ++ std::for_each(screenInfoList.begin(), screenInfoList.end(), ++ PointerAssassin()); + // we don't create the BTimers, we don't delete them - while (timerList->count()) - timerList->remove(0); - - delete timerList; ++ ++ if (application_name != NULL) ++ delete [] application_name; XCloseDisplay(display); } @@@ -431,32 -309,11 +425,33 @@@ void BaseDisplay::eventLoop(void) FD_ZERO(&rfds); FD_SET(xfd, &rfds); - if (timerList->count()) { - if (! timerList.empty()) { - const BTimer* const timer = timerList.top(); - ++ if (!timerList.empty()) { gettimeofday(&now, 0); - tm = timer->timeRemaining(now); + + tm.tv_sec = tm.tv_usec = 0l; + - BTimer *timer = timerList->first(); ++ BTimer *timer = timerList.front(); ++ ASSERT(timer != NULL); + + tm.tv_sec = timer->getStartTime().tv_sec + + timer->getTimeout().tv_sec - now.tv_sec; + tm.tv_usec = timer->getStartTime().tv_usec + + timer->getTimeout().tv_usec - now.tv_usec; + + while (tm.tv_usec >= 1000000) { + tm.tv_sec++; + tm.tv_usec -= 1000000; + } + + while (tm.tv_usec < 0) { + if (tm.tv_sec > 0) { + tm.tv_sec--; + tm.tv_usec += 1000000; + } else { + tm.tv_usec = 0; + break; + } + } timeout = &tm; } @@@ -466,71 -323,36 +461,82 @@@ // check for timer timeout gettimeofday(&now, 0); - LinkedListIterator it(timerList); - for(BTimer *timer = it.current(); timer; it++, timer = it.current()) { - // there is a small chance for deadlock here: - // *IF* the timer list keeps getting refreshed *AND* the time between - // timer->start() and timer->shouldFire() is within the timer's period - // then the timer will keep firing. This should be VERY near impossible. - while (! timerList.empty()) { - BTimer *timer = timerList.top(); - if (! timer->shouldFire(now)) - break; ++ TimerList::iterator it; ++ for (it = timerList.begin(); it != timerList.end(); ++it) { ++ BTimer *timer = *it; ++ ASSERT(timer != NULL); + - timerList.pop(); + tm.tv_sec = timer->getStartTime().tv_sec + + timer->getTimeout().tv_sec; + tm.tv_usec = timer->getStartTime().tv_usec + + timer->getTimeout().tv_usec; + + if ((now.tv_sec < tm.tv_sec) || + (now.tv_sec == tm.tv_sec && now.tv_usec < tm.tv_usec)) + break; timer->fireTimeout(); - timer->halt(); - if (timer->isRecurring()) + + // restart the current timer so that the start time is updated - if (! timer->doOnce()) timer->start(); - else timer->stop(); ++ if (! timer->doOnce()) { ++ // reorder ++ removeTimer(timer); ++ addTimer(timer); + timer->start(); ++ } else ++ timer->stop(); ++ it = timerList.begin(); // we no longer have any idea if the iterator is ++ // valid, but what was at the front() is no ++ // longer. } } } } +const Bool BaseDisplay::validateWindow(Window window) { + XEvent event; + if (XCheckTypedWindowEvent(display, window, DestroyNotify, &event)) { + XPutBackEvent(display, &event); + + return False; + } + + return True; +} + + +void BaseDisplay::grab(void) { + if (! server_grabs++) + XGrabServer(display); +} + + +void BaseDisplay::ungrab(void) { + if (! --server_grabs) + XUngrabServer(display); - - if (server_grabs < 0) server_grabs = 0; +} + + void BaseDisplay::addTimer(BTimer *timer) { -- if (! timer) return; ++ ASSERT(timer != (BTimer *) 0); + - LinkedListIterator it(timerList); - int index = 0; - for (BTimer *tmp = it.current(); tmp; it++, index++, tmp = it.current()) ++ TimerList::iterator it; ++ for (it = timerList.begin(); it != timerList.end(); ++it) { ++ BTimer *tmp = *it; + if ((tmp->getTimeout().tv_sec > timer->getTimeout().tv_sec) || + ((tmp->getTimeout().tv_sec == timer->getTimeout().tv_sec) && + (tmp->getTimeout().tv_usec >= timer->getTimeout().tv_usec))) + break; ++ } - timerList->insert(timer, index); - timerList.push(timer); ++ timerList.insert(it, timer); } void BaseDisplay::removeTimer(BTimer *timer) { - timerList->remove(timer); - timerList.release(timer); ++ ASSERT(timer != (BTimer *) 0); ++ timerList.remove(timer); } @@@ -571,17 -392,31 +577,17 @@@ void BaseDisplay::ungrabButton(unsigne } - ScreenInfo::ScreenInfo(BaseDisplay *d, int num) { - basedisplay = d; - screen_number = num; -const ScreenInfo* BaseDisplay::getScreenInfo(unsigned int s) const { - if (s < screenInfoList.size()) - return &screenInfoList[s]; - return (const ScreenInfo*) 0; -} - - -BGCCache *BaseDisplay::gcCache(void) const ++ScreenInfo::ScreenInfo(BaseDisplay &d, int num) : basedisplay(d), ++ screen_number(num) + { - if (! gccache) gccache = new BGCCache(this); - return gccache; -} - - root_window = RootWindow(basedisplay->getXDisplay(), screen_number); - depth = DefaultDepth(basedisplay->getXDisplay(), screen_number); -ScreenInfo::ScreenInfo(BaseDisplay *d, unsigned int num) { - basedisplay = d; - screen_number = num; ++ root_window = RootWindow(basedisplay.getXDisplay(), screen_number); ++ depth = DefaultDepth(basedisplay.getXDisplay(), screen_number); - width = - WidthOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), screen_number)); - height = - HeightOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), screen_number)); - root_window = RootWindow(basedisplay->getXDisplay(), screen_number); - depth = DefaultDepth(basedisplay->getXDisplay(), screen_number); - - rect.setSize(WidthOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), - screen_number)), - HeightOfScreen(ScreenOfDisplay(basedisplay->getXDisplay(), - screen_number))); ++ m_size = Size(WidthOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), ++ screen_number)), ++ HeightOfScreen(ScreenOfDisplay(basedisplay.getXDisplay(), ++ screen_number))); // search for a TrueColor Visual... if we can't find one... we will use the // default visual for the screen @@@ -593,10 -428,10 +599,10 @@@ visual = (Visual *) 0; - if ((vinfo_return = XGetVisualInfo(basedisplay->getXDisplay(), - vinfo_return = XGetVisualInfo(basedisplay->getXDisplay(), - VisualScreenMask | VisualClassMask, - &vinfo_template, &vinfo_nitems); - if (vinfo_return && vinfo_nitems > 0) { ++ if ((vinfo_return = XGetVisualInfo(basedisplay.getXDisplay(), + VisualScreenMask | VisualClassMask, + &vinfo_template, &vinfo_nitems)) && + vinfo_nitems > 0) { for (int i = 0; i < vinfo_nitems; i++) { if (depth < (vinfo_return + i)->depth) { depth = (vinfo_return + i)->depth; @@@ -608,10 -443,20 +614,10 @@@ } if (visual) { -- colormap = XCreateColormap(basedisplay->getXDisplay(), root_window, - visual, AllocNone); ++ colormap = XCreateColormap(basedisplay.getXDisplay(), root_window, + visual, AllocNone); } else { -- visual = DefaultVisual(basedisplay->getXDisplay(), screen_number); -- colormap = DefaultColormap(basedisplay->getXDisplay(), screen_number); ++ visual = DefaultVisual(basedisplay.getXDisplay(), screen_number); ++ colormap = DefaultColormap(basedisplay.getXDisplay(), screen_number); } - - // get the default display string and strip the screen number - string default_string = DisplayString(basedisplay->getXDisplay()); - const string::size_type pos = default_string.rfind("."); - if (pos != string::npos) - default_string.resize(pos); - - std::ostringstream formatter; - formatter << "DISPLAY=" << default_string << '.' << screen_number; - display_string = formatter.str(); } diff --cc src/BaseDisplay.h index 2aa82d76,00000000..8bd13e89 mode 100644,000000..100644 --- a/src/BaseDisplay.h +++ b/src/BaseDisplay.h @@@ -1,357 -1,0 +1,367 @@@ +// BaseDisplay.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __BaseDisplay_hh +#define __BaseDisplay_hh + +#include +#include + +// forward declaration +class BaseDisplay; +class ScreenInfo; + - #include "LinkedList.h" +#include "Timer.h" ++#include "Geometry.h" ++#include "Util.h" ++#include ++#include + +#define AttribShaded (1l << 0) +#define AttribMaxHoriz (1l << 1) +#define AttribMaxVert (1l << 2) +#define AttribOmnipresent (1l << 3) +#define AttribWorkspace (1l << 4) +#define AttribStack (1l << 5) +#define AttribDecoration (1l << 6) + +#define StackTop (0) +#define StackNormal (1) +#define StackBottom (2) + +#define DecorNone (0) +#define DecorNormal (1) +#define DecorTiny (2) +#define DecorTool (3) + +typedef struct _openbox_hints { + unsigned long flags, attrib, workspace, stack, decoration; +} OpenboxHints; + +typedef struct _openbox_attributes { + unsigned long flags, attrib, workspace, stack, decoration; + int premax_x, premax_y; + unsigned int premax_w, premax_h; +} OpenboxAttributes; + +#define PropOpenboxHintsElements (5) +#define PropOpenboxAttributesElements (9) + +#ifndef __EMX__ +void bexec(const char *, char *); +#endif // !__EMX__ + +char *bstrdup(const char *); + +class BaseDisplay { +private: + struct cursor { + Cursor session, move, ll_angle, lr_angle, ul_angle, ur_angle; + } cursor; + + struct shape { + Bool extensions; + int event_basep, error_basep; + } shape; + +#ifndef NOCLOBBER + unsigned int MaskList[8]; + size_t MaskListLength; +#endif // NOCLOBBER + + Atom xa_wm_colormap_windows, xa_wm_protocols, xa_wm_state, + xa_wm_delete_window, xa_wm_take_focus, xa_wm_change_state, + motif_wm_hints; + + // NETAttributes + Atom openbox_attributes, openbox_change_attributes, openbox_hints; + + // NETStructureMessages + Atom openbox_structure_messages, openbox_notify_startup, + openbox_notify_window_add, openbox_notify_window_del, + openbox_notify_window_focus, openbox_notify_current_workspace, + openbox_notify_workspace_count, openbox_notify_window_raise, + openbox_notify_window_lower; + + // message_types for client -> wm messages + Atom openbox_change_workspace, openbox_change_window_focus, + openbox_cycle_window_focus; + +#ifdef NEWWMSPEC + + // root window properties + Atom net_supported, net_client_list, net_client_list_stacking, + net_number_of_desktops, net_desktop_geometry, net_desktop_viewport, + net_current_desktop, net_desktop_names, net_active_window, net_workarea, + net_supporting_wm_check, net_virtual_roots; + + // root window messages + Atom net_close_window, net_wm_moveresize; + + // application window properties + Atom net_properties, net_wm_name, net_wm_desktop, net_wm_window_type, + net_wm_state, net_wm_strut, net_wm_icon_geometry, net_wm_icon, net_wm_pid, + net_wm_handled_icons; + + // application protocols + Atom net_wm_ping; + +#endif // NEWWMSPEC + + Bool _startup, _shutdown; + Display *display; - LinkedList *screenInfoList; - LinkedList *timerList; ++ ++ typedef std::vector ScreenInfoList; ++ ScreenInfoList screenInfoList; ++ ++ typedef std::list TimerList; ++ TimerList timerList; + + char *display_name, *application_name; - int number_of_screens, server_grabs, colors_per_channel; ++ unsigned int server_grabs, colors_per_channel; + + +protected: + // pure virtual function... you must override this + virtual void process_event(XEvent *) = 0; + + // the masks of the modifiers which are ignored in button events. + int NumLockMask, ScrollLockMask; + + +public: - BaseDisplay(char *, char * = 0); - virtual ~BaseDisplay(void); ++ BaseDisplay(const char *, char * = 0); ++ virtual ~BaseDisplay(); + - inline const Atom &getWMChangeStateAtom(void) const ++ inline const Atom &getWMChangeStateAtom() const + { return xa_wm_change_state; } - inline const Atom &getWMStateAtom(void) const ++ inline const Atom &getWMStateAtom() const + { return xa_wm_state; } - inline const Atom &getWMDeleteAtom(void) const ++ inline const Atom &getWMDeleteAtom() const + { return xa_wm_delete_window; } - inline const Atom &getWMProtocolsAtom(void) const ++ inline const Atom &getWMProtocolsAtom() const + { return xa_wm_protocols; } - inline const Atom &getWMTakeFocusAtom(void) const ++ inline const Atom &getWMTakeFocusAtom() const + { return xa_wm_take_focus; } - inline const Atom &getWMColormapAtom(void) const ++ inline const Atom &getWMColormapAtom() const + { return xa_wm_colormap_windows; } - inline const Atom &getMotifWMHintsAtom(void) const ++ inline const Atom &getMotifWMHintsAtom() const + { return motif_wm_hints; } + + // this atom is for normal app->WM hints about decorations, stacking, + // starting workspace etc... - inline const Atom &getOpenboxHintsAtom(void) const ++ inline const Atom &getOpenboxHintsAtom() const + { return openbox_hints;} + + // these atoms are for normal app->WM interaction beyond the scope of the + // ICCCM... - inline const Atom &getOpenboxAttributesAtom(void) const ++ inline const Atom &getOpenboxAttributesAtom() const + { return openbox_attributes; } - inline const Atom &getOpenboxChangeAttributesAtom(void) const ++ inline const Atom &getOpenboxChangeAttributesAtom() const + { return openbox_change_attributes; } + + // these atoms are for window->WM interaction, with more control and + // information on window "structure"... common examples are + // notifying apps when windows are raised/lowered... when the user changes + // workspaces... i.e. "pager talk" - inline const Atom &getOpenboxStructureMessagesAtom(void) const ++ inline const Atom &getOpenboxStructureMessagesAtom() const + { return openbox_structure_messages; } + + // *Notify* portions of the NETStructureMessages protocol - inline const Atom &getOpenboxNotifyStartupAtom(void) const ++ inline const Atom &getOpenboxNotifyStartupAtom() const + { return openbox_notify_startup; } - inline const Atom &getOpenboxNotifyWindowAddAtom(void) const ++ inline const Atom &getOpenboxNotifyWindowAddAtom() const + { return openbox_notify_window_add; } - inline const Atom &getOpenboxNotifyWindowDelAtom(void) const ++ inline const Atom &getOpenboxNotifyWindowDelAtom() const + { return openbox_notify_window_del; } - inline const Atom &getOpenboxNotifyWindowFocusAtom(void) const ++ inline const Atom &getOpenboxNotifyWindowFocusAtom() const + { return openbox_notify_window_focus; } - inline const Atom &getOpenboxNotifyCurrentWorkspaceAtom(void) const ++ inline const Atom &getOpenboxNotifyCurrentWorkspaceAtom() const + { return openbox_notify_current_workspace; } - inline const Atom &getOpenboxNotifyWorkspaceCountAtom(void) const ++ inline const Atom &getOpenboxNotifyWorkspaceCountAtom() const + { return openbox_notify_workspace_count; } - inline const Atom &getOpenboxNotifyWindowRaiseAtom(void) const ++ inline const Atom &getOpenboxNotifyWindowRaiseAtom() const + { return openbox_notify_window_raise; } - inline const Atom &getOpenboxNotifyWindowLowerAtom(void) const ++ inline const Atom &getOpenboxNotifyWindowLowerAtom() const + { return openbox_notify_window_lower; } + + // atoms to change that request changes to the desktop environment during + // runtime... these messages can be sent by any client... as the sending + // client window id is not included in the ClientMessage event... - inline const Atom &getOpenboxChangeWorkspaceAtom(void) const ++ inline const Atom &getOpenboxChangeWorkspaceAtom() const + { return openbox_change_workspace; } - inline const Atom &getOpenboxChangeWindowFocusAtom(void) const ++ inline const Atom &getOpenboxChangeWindowFocusAtom() const + { return openbox_change_window_focus; } - inline const Atom &getOpenboxCycleWindowFocusAtom(void) const ++ inline const Atom &getOpenboxCycleWindowFocusAtom() const + { return openbox_cycle_window_focus; } + +#ifdef NEWWMSPEC + + // root window properties - inline const Atom &getNETSupportedAtom(void) const ++ inline const Atom &getNETSupportedAtom() const + { return net_supported; } - inline const Atom &getNETClientListAtom(void) const ++ inline const Atom &getNETClientListAtom() const + { return net_client_list; } - inline const Atom &getNETClientListStackingAtom(void) const ++ inline const Atom &getNETClientListStackingAtom() const + { return net_client_list_stacking; } - inline const Atom &getNETNumberOfDesktopsAtom(void) const ++ inline const Atom &getNETNumberOfDesktopsAtom() const + { return net_number_of_desktops; } - inline const Atom &getNETDesktopGeometryAtom(void) const ++ inline const Atom &getNETDesktopGeometryAtom() const + { return net_desktop_geometry; } - inline const Atom &getNETDesktopViewportAtom(void) const ++ inline const Atom &getNETDesktopViewportAtom() const + { return net_desktop_viewport; } - inline const Atom &getNETCurrentDesktopAtom(void) const ++ inline const Atom &getNETCurrentDesktopAtom() const + { return net_current_desktop; } - inline const Atom &getNETDesktopNamesAtom(void) const ++ inline const Atom &getNETDesktopNamesAtom() const + { return net_desktop_names; } - inline const Atom &getNETActiveWindowAtom(void) const ++ inline const Atom &getNETActiveWindowAtom() const + { return net_active_window; } - inline const Atom &getNETWorkareaAtom(void) const ++ inline const Atom &getNETWorkareaAtom() const + { return net_workarea; } - inline const Atom &getNETSupportingWMCheckAtom(void) const ++ inline const Atom &getNETSupportingWMCheckAtom() const + { return net_supporting_wm_check; } - inline const Atom &getNETVirtualRootsAtom(void) const ++ inline const Atom &getNETVirtualRootsAtom() const + { return net_virtual_roots; } + + // root window messages - inline const Atom &getNETCloseWindowAtom(void) const ++ inline const Atom &getNETCloseWindowAtom() const + { return net_close_window; } - inline const Atom &getNETWMMoveResizeAtom(void) const ++ inline const Atom &getNETWMMoveResizeAtom() const + { return net_wm_moveresize; } + + // application window properties - inline const Atom &getNETPropertiesAtom(void) const ++ inline const Atom &getNETPropertiesAtom() const + { return net_properties; } - inline const Atom &getNETWMNameAtom(void) const ++ inline const Atom &getNETWMNameAtom() const + { return net_wm_name; } - inline const Atom &getNETWMDesktopAtom(void) const ++ inline const Atom &getNETWMDesktopAtom() const + { return net_wm_desktop; } - inline const Atom &getNETWMWindowTypeAtom(void) const ++ inline const Atom &getNETWMWindowTypeAtom() const + { return net_wm_window_type; } - inline const Atom &getNETWMStateAtom(void) const ++ inline const Atom &getNETWMStateAtom() const + { return net_wm_state; } - inline const Atom &getNETWMStrutAtom(void) const ++ inline const Atom &getNETWMStrutAtom() const + { return net_wm_strut; } - inline const Atom &getNETWMIconGeometryAtom(void) const ++ inline const Atom &getNETWMIconGeometryAtom() const + { return net_wm_icon_geometry; } - inline const Atom &getNETWMIconAtom(void) const ++ inline const Atom &getNETWMIconAtom() const + { return net_wm_icon; } - inline const Atom &getNETWMPidAtom(void) const ++ inline const Atom &getNETWMPidAtom() const + { return net_wm_pid; } - inline const Atom &getNETWMHandledIconsAtom(void) const ++ inline const Atom &getNETWMHandledIconsAtom() const + { return net_wm_handled_icons; } + + // application protocols - inline const Atom &getNETWMPingAtom(void) const ++ inline const Atom &getNETWMPingAtom() const + { return net_wm_ping; } + +#endif // NEWWMSPEC + - inline ScreenInfo *getScreenInfo(int s) - { return (ScreenInfo *) screenInfoList->find(s); } ++ inline ScreenInfo *getScreenInfo(unsigned int s) { ++ ASSERT(s < screenInfoList.size()); ++ return screenInfoList[s]; ++ } + - inline const Bool &hasShapeExtensions(void) const ++ inline const Bool &hasShapeExtensions() const + { return shape.extensions; } - inline const Bool &doShutdown(void) const ++ inline const Bool &doShutdown() const + { return _shutdown; } - inline const Bool &isStartup(void) const ++ inline const Bool &isStartup() const + { return _startup; } + - inline const Cursor &getSessionCursor(void) const ++ inline const Cursor &getSessionCursor() const + { return cursor.session; } - inline const Cursor &getMoveCursor(void) const ++ inline const Cursor &getMoveCursor() const + { return cursor.move; } - inline const Cursor &getLowerLeftAngleCursor(void) const ++ inline const Cursor &getLowerLeftAngleCursor() const + { return cursor.ll_angle; } - inline const Cursor &getLowerRightAngleCursor(void) const ++ inline const Cursor &getLowerRightAngleCursor() const + { return cursor.lr_angle; } - inline const Cursor &getUpperLeftAngleCursor(void) const ++ inline const Cursor &getUpperLeftAngleCursor() const + { return cursor.ul_angle; } - inline const Cursor &getUpperRightAngleCursor(void) const ++ inline const Cursor &getUpperRightAngleCursor() const + { return cursor.ur_angle; } + - inline Display *getXDisplay(void) { return display; } ++ inline Display *getXDisplay() { return display; } + - inline const char *getXDisplayName(void) const ++ inline const char *getXDisplayName() const + { return (const char *) display_name; } - inline const char *getApplicationName(void) const ++ inline const char *getApplicationName() const + { return (const char *) application_name; } + - inline const int &getNumberOfScreens(void) const - { return number_of_screens; } - inline const int &getShapeEventBase(void) const ++ inline const unsigned int numberOfScreens() const ++ { return ScreenCount(display); } ++ inline const int &getShapeEventBase() const + { return shape.event_basep; } + - inline void shutdown(void) { _shutdown = True; } - inline void run(void) { _startup = _shutdown = False; } ++ inline void shutdown() { _shutdown = True; } ++ inline void run() { _startup = _shutdown = False; } + + const Bool validateWindow(Window); + + void grabButton(unsigned int, unsigned int, Window, Bool, unsigned int, int, + int, Window, Cursor) const; + void ungrabButton(unsigned int button, unsigned int modifiers, + Window grab_window) const; + - void grab(void); - void ungrab(void); - void eventLoop(void); ++ void grab(); ++ void ungrab(); ++ void eventLoop(); + void addTimer(BTimer *); + void removeTimer(BTimer *); + + // another pure virtual... this is used to handle signals that BaseDisplay + // doesn't understand itself + virtual Bool handleSignal(int) = 0; +}; + + +class ScreenInfo { +private: - BaseDisplay *basedisplay; ++ BaseDisplay &basedisplay; + Visual *visual; + Window root_window; + Colormap colormap; + + int depth, screen_number; - unsigned int width, height; ++ Size m_size; + + +public: - ScreenInfo(BaseDisplay *, int); ++ ScreenInfo(BaseDisplay &, int); + - inline BaseDisplay *getBaseDisplay(void) { return basedisplay; } ++ inline BaseDisplay &getBaseDisplay() { return basedisplay; } + - inline Visual *getVisual(void) { return visual; } - inline const Window &getRootWindow(void) const { return root_window; } - inline const Colormap &getColormap(void) const { return colormap; } ++ inline Visual *getVisual() const { return visual; } ++ inline const Window &getRootWindow() const { return root_window; } ++ inline const Colormap &getColormap() const { return colormap; } + - inline const int &getDepth(void) const { return depth; } - inline const int &getScreenNumber(void) const { return screen_number; } ++ inline const int &getDepth() const { return depth; } ++ inline const int &getScreenNumber() const { return screen_number; } + - inline const unsigned int &getWidth(void) const { return width; } - inline const unsigned int &getHeight(void) const { return height; } ++// inline const unsigned int &getWidth() const { return width; } ++// inline const unsigned int &getHeight() const { return height; } ++ inline const Size &size() const { return m_size; } +}; + + +#endif // __BaseDisplay_hh diff --cc src/Basemenu.cc index b0e97606,575147e6..99dcbfa0 --- a/src/Basemenu.cc +++ b/src/Basemenu.cc @@@ -34,26 -30,35 +34,28 @@@ # include #endif // HAVE_STDIO_H - #ifdef STDC_HEADERS -#ifdef HAVE_STDLIB_H ++#ifdef HAVE_STDLIB_H # include + #endif // HAVE_STDLIB_H + -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include - #endif // STDC_HEADERS + #endif // HAVE_STRING_H -} #include -#include --using namespace std; - -#include "i18n.hh" -#include "blackbox.hh" -#include "Basemenu.hh" -#include "GCCache.hh" -#include "Image.hh" -#include "Screen.hh" -#include "Util.hh" ++using std::min; ++using std::max; +#include "i18n.h" +#include "openbox.h" +#include "Basemenu.h" +#include "Screen.h" static Basemenu *shown = (Basemenu *) 0; --Basemenu::Basemenu(BScreen *scrn) { -- screen = scrn; - openbox = screen->getOpenbox(); - blackbox = screen->getBlackbox(); -- image_ctrl = screen->getImageControl(); - display = openbox->getXDisplay(); - display = blackbox->getXDisplay(); ++Basemenu::Basemenu(BScreen &scrn) : openbox(scrn.getOpenbox()), screen(scrn) { ++ image_ctrl = screen.getImageControl(); ++ display = openbox.getXDisplay(); parent = (Basemenu *) 0; alignment = AlignDontCare; @@@ -83,70 -88,67 +85,68 @@@ menu.hilite_pixmap = menu.sel_pixmap = None; -- menu.bevel_w = screen->getBevelWidth(); ++ menu.bevel_w = screen.getBevelWidth(); - if (i18n.multibyte()) + if (i18n->multibyte()) menu.width = menu.title_h = menu.item_w = menu.frame_h = -- screen->getMenuStyle()->t_fontset_extents->max_ink_extent.height + - (menu.bevel_w * 2); ++ screen.getMenuStyle()->t_fontset_extents->max_ink_extent.height + + (menu.bevel_w * 2); else menu.width = menu.title_h = menu.item_w = menu.frame_h = -- screen->getMenuStyle()->t_font->ascent + - screen->getMenuStyle()->t_font->descent + (menu.bevel_w * 2); - screen->getMenuStyle()->t_font->descent + (menu.bevel_w * 2); - ++ screen.getMenuStyle()->t_font->ascent + ++ screen.getMenuStyle()->t_font->descent + (menu.bevel_w * 2); + + menu.label = 0; + menu.sublevels = menu.persub = menu.minsub = 0; - - MenuStyle *style = screen->getMenuStyle(); - if (i18n.multibyte()) { + - MenuStyle *style = screen->getMenuStyle(); ++ MenuStyle *style = screen.getMenuStyle(); + if (i18n->multibyte()) { menu.item_h = style->f_fontset_extents->max_ink_extent.height + (menu.bevel_w); } else { menu.item_h = style->f_font->ascent + style->f_font->descent + - (menu.bevel_w); + (menu.bevel_w); } - - menu.height = menu.title_h + screen->getBorderWidth() + menu.frame_h; - + - menu.height = menu.title_h + screen->getBorderWidth() + menu.frame_h; ++ menu.height = menu.title_h + screen.getBorderWidth() + menu.frame_h; + unsigned long attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | - CWColormap | CWOverrideRedirect | CWEventMask; + CWColormap | CWOverrideRedirect | CWEventMask; XSetWindowAttributes attrib; attrib.background_pixmap = None; attrib.background_pixel = attrib.border_pixel = - screen->getBorderColor()->getPixel(); - screen->getBorderColor()->pixel(); -- attrib.colormap = screen->getColormap(); ++ screen.getBorderColor()->getPixel(); ++ attrib.colormap = screen.getColormap(); attrib.override_redirect = True; attrib.event_mask = ButtonPressMask | ButtonReleaseMask | - ButtonMotionMask | ExposureMask; + ButtonMotionMask | ExposureMask; menu.window = - XCreateWindow(display, screen->getRootWindow(), menu.x, menu.y, menu.width, - menu.height, screen->getBorderWidth(), screen->getDepth(), - XCreateWindow(display, screen->getRootWindow(), - menu.x, menu.y, menu.width, menu.height, - screen->getBorderWidth(), screen->getDepth(), -- InputOutput, screen->getVisual(), attrib_mask, &attrib); - openbox->saveMenuSearch(menu.window, this); - blackbox->saveMenuSearch(menu.window, this); ++ XCreateWindow(display, screen.getRootWindow(), menu.x, menu.y, menu.width, ++ menu.height, screen.getBorderWidth(), screen.getDepth(), ++ InputOutput, screen.getVisual(), attrib_mask, &attrib); ++ openbox.saveMenuSearch(menu.window, this); attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | CWEventMask; - attrib.background_pixel = screen->getBorderColor()->getPixel(); - attrib.background_pixel = screen->getBorderColor()->pixel(); ++ attrib.background_pixel = screen.getBorderColor()->getPixel(); attrib.event_mask |= EnterWindowMask | LeaveWindowMask; menu.title = XCreateWindow(display, menu.window, 0, 0, menu.width, menu.height, 0, - screen->getDepth(), InputOutput, screen->getVisual(), - screen->getDepth(), InputOutput, screen->getVisual(), - attrib_mask, &attrib); - blackbox->saveMenuSearch(menu.title, this); ++ screen.getDepth(), InputOutput, screen.getVisual(), + attrib_mask, &attrib); - openbox->saveMenuSearch(menu.title, this); ++ openbox.saveMenuSearch(menu.title, this); attrib.event_mask |= PointerMotionMask; menu.frame = XCreateWindow(display, menu.window, 0, - menu.title_h + screen->getBorderWidth(), - menu.title_h + screen->getBorderWidth(), - menu.width, menu.frame_h, 0, - screen->getDepth(), InputOutput, - screen->getVisual(), attrib_mask, &attrib); - blackbox->saveMenuSearch(menu.frame, this); ++ menu.title_h + screen.getBorderWidth(), + menu.width, menu.frame_h, 0, - screen->getDepth(), InputOutput, - screen->getVisual(), attrib_mask, &attrib); - openbox->saveMenuSearch(menu.frame, this); - - menuitems = new LinkedList; ++ screen.getDepth(), InputOutput, ++ screen.getVisual(), attrib_mask, &attrib); ++ openbox.saveMenuSearch(menu.frame, this); // even though this is the end of the constructor the menu is still not // completely created. items must be inserted and it must be update()'d @@@ -159,14 -160,23 +159,11 @@@ Basemenu::~Basemenu(void) if (shown && shown->getWindowID() == getWindowID()) shown = (Basemenu *) 0; - int n = menuitems->count(); - for (int i = 0; i < n; ++i) - MenuItems::const_iterator it = menuitems.begin(); - while (it != menuitems.end()) { - BasemenuItem *item = *it; - if ((! internal_menu)) { - Basemenu *tmp = (Basemenu *) item->submenu(); - if (tmp) { - if (! tmp->internal_menu) { - delete tmp; - } else { - tmp->internal_hide(); - } - } - } - ++it; - } ++ while (!menuitems.empty()) + remove(0); - delete menuitems; - - std::for_each(menuitems.begin(), menuitems.end(), PointerAssassin()); + if (menu.label) + delete [] menu.label; if (menu.title_pixmap) image_ctrl->removeImage(menu.title_pixmap); @@@ -180,151 -190,145 +177,161 @@@ if (menu.sel_pixmap) image_ctrl->removeImage(menu.sel_pixmap); - openbox->removeMenuSearch(menu.title); - blackbox->removeMenuSearch(menu.title); ++ openbox.removeMenuSearch(menu.title); XDestroyWindow(display, menu.title); - openbox->removeMenuSearch(menu.frame); - blackbox->removeMenuSearch(menu.frame); ++ openbox.removeMenuSearch(menu.frame); XDestroyWindow(display, menu.frame); - openbox->removeMenuSearch(menu.window); - blackbox->removeMenuSearch(menu.window); ++ openbox.removeMenuSearch(menu.window); XDestroyWindow(display, menu.window); } -BasemenuItem::~BasemenuItem(void) {} +int Basemenu::insert(const char *l, int function, const char *e, int pos) { + char *label = 0, *exec = 0; + if (l) label = bstrdup(l); + if (e) exec = bstrdup(e); -BasemenuItem *Basemenu::find(int index) { - if (index < 0 || index > static_cast(menuitems.size())) - return (BasemenuItem*) 0; + BasemenuItem *item = new BasemenuItem(label, function, exec); - menuitems->insert(item, pos); ++ if (pos == -1) ++ menuitems.push_back(item); ++ else ++ menuitems.insert(menuitems.begin() + pos, item); - return menuitems->count(); - return *(menuitems.begin() + index); ++ return menuitems.size(); } -int Basemenu::insert(BasemenuItem *item, int pos) { - if (pos < 0) { +int Basemenu::insert(const char *l, Basemenu *submenu, int pos) { + char *label = 0; + + if (l) label = bstrdup(l); + + BasemenuItem *item = new BasemenuItem(label, submenu); - menuitems->insert(item, pos); ++ if (pos == -1) + menuitems.push_back(item); - } else { - assert(pos < static_cast(menuitems.size())); - menuitems.insert((menuitems.begin() + pos), item); - } - return menuitems.size(); -} ++ else ++ menuitems.insert(menuitems.begin() + pos, item); + submenu->parent = this; - return menuitems->count(); -int Basemenu::insert(const string& label, int function, - const string& exec, int pos) { - BasemenuItem *item = new BasemenuItem(label, function, exec); - return insert(item, pos); ++ return menuitems.size(); } -int Basemenu::insert(const string& label, Basemenu *submenu, int pos) { - BasemenuItem *item = new BasemenuItem(label, submenu); - submenu->parent = this; +int Basemenu::insert(const char **ulabel, int pos, int function) { + BasemenuItem *item = new BasemenuItem(ulabel, function); - menuitems->insert(item, pos); ++ if (pos == -1) ++ menuitems.push_back(item); ++ else ++ menuitems.insert(menuitems.begin() + pos, item); - return menuitems->count(); - return insert(item, pos); ++ return menuitems.size(); } int Basemenu::remove(int index) { - if (index < 0 || index > menuitems->count()) return -1; - BasemenuItem *item = find(index); - if (! item) return -1; ++ if (index < 0 || index > (signed)menuitems.size()) return -1; + - BasemenuItem *item = menuitems->remove(index); ++ BasemenuItem *item = menuitems[index]; ++ menuitems.erase(menuitems.begin() + index); + + if (item) { - if ((! internal_menu) && (item->submenu())) { ++ if ((!internal_menu) && (item->submenu())) { + Basemenu *tmp = (Basemenu *) item->submenu(); - if ((! internal_menu)) { - Basemenu *tmp = (Basemenu *) item->submenu(); - if (tmp) { if (! tmp->internal_menu) { - delete tmp; + delete tmp; } else { - tmp->internal_hide(); + tmp->internal_hide(); } } - } - delete item; + if (item->label()) + delete [] item->label(); + + if (item->exec()) + delete [] item->exec(); + + delete item; + } if (which_sub == index) which_sub = -1; else if (which_sub > index) which_sub--; - return menuitems->count(); - menuitems.erase(menuitems.begin() + index); - + return menuitems.size(); } void Basemenu::update(void) { -- MenuStyle *style = screen->getMenuStyle(); - if (i18n.multibyte()) { ++ MenuStyle *style = screen.getMenuStyle(); + if (i18n->multibyte()) { menu.item_h = style->f_fontset_extents->max_ink_extent.height + - menu.bevel_w; + menu.bevel_w; menu.title_h = style->t_fontset_extents->max_ink_extent.height + - (menu.bevel_w * 2); + (menu.bevel_w * 2); } else { menu.item_h = style->f_font->ascent + style->f_font->descent + - menu.bevel_w; + menu.bevel_w; menu.title_h = style->t_font->ascent + style->t_font->descent + - (menu.bevel_w * 2); + (menu.bevel_w * 2); } - + if (title_vis) { - const char *s = getLabel(); + const char *s = (menu.label) ? menu.label : + i18n->getMessage(BasemenuSet, BasemenuOpenboxMenu, + "Openbox Menu"); int l = strlen(s); + - if (i18n.multibyte()) { + if (i18n->multibyte()) { XRectangle ink, logical; -- XmbTextExtents(screen->getMenuStyle()->t_fontset, s, l, &ink, &logical); ++ XmbTextExtents(screen.getMenuStyle()->t_fontset, s, l, &ink, &logical); menu.item_w = logical.width; } else { -- menu.item_w = XTextWidth(screen->getMenuStyle()->t_font, s, l); ++ menu.item_w = XTextWidth(screen.getMenuStyle()->t_font, s, l); } - + menu.item_w += (menu.bevel_w * 2); } else { menu.item_w = 1; } - unsigned int ii = 0; - MenuItems::iterator it = menuitems.begin(), end = menuitems.end(); - for (; it != end; ++it) { - BasemenuItem *tmp = *it; - const char *s = tmp->l.c_str(); + int ii = 0; - LinkedListIterator it(menuitems); - for (BasemenuItem *tmp = it.current(); tmp; it++, tmp = it.current()) { - const char *s = ((tmp->u && *tmp->u) ? *tmp->u : - ((tmp->l) ? tmp->l : (const char *) 0)); ++ menuitemList::const_iterator it = menuitems.begin(); ++ for (; it != menuitems.end(); it++) { ++ const char *s = (((*it)->u && *(*it)->u) ? *(*it)->u : ++ (((*it)->l) ? (*it)->l : (const char *) 0)); int l = strlen(s); - if (i18n.multibyte()) { + if (i18n->multibyte()) { XRectangle ink, logical; -- XmbTextExtents(screen->getMenuStyle()->f_fontset, s, l, &ink, &logical); ++ XmbTextExtents(screen.getMenuStyle()->f_fontset, s, l, &ink, &logical); ii = logical.width; } else -- ii = XTextWidth(screen->getMenuStyle()->f_font, s, l); ++ ii = XTextWidth(screen.getMenuStyle()->f_font, s, l); ii += (menu.bevel_w * 2) + (menu.item_h * 2); - menu.item_w = ((menu.item_w < ii) ? ii : menu.item_w); + menu.item_w = ((menu.item_w < (unsigned int) ii) ? ii : menu.item_w); } - if (menuitems->count()) { - if (! menuitems.empty()) { ++ if (menuitems.size()) { menu.sublevels = 1; - while (((menu.item_h * (menuitems->count() + 1) / menu.sublevels) - + menu.title_h + screen->getBorderWidth()) > - screen->getHeight()) - unsigned int menu_size = menuitems.size(); - while (((menu.item_h * (menu_size + 1) / menu.sublevels) - + menu.title_h + screen->getBorderWidth()) > - screen->getHeight()) ++ while (((menu.item_h * (menuitems.size() + 1) / menu.sublevels) ++ + menu.title_h + screen.getBorderWidth()) > ++ screen.size().h()) menu.sublevels++; if (menu.sublevels < menu.minsub) menu.sublevels = menu.minsub; - menu.persub = menuitems->count() / menu.sublevels; - if (menuitems->count() % menu.sublevels) menu.persub++; - menu.persub = menu_size / menu.sublevels; - if (menu_size % menu.sublevels) menu.persub++; ++ menu.persub = menuitems.size() / menu.sublevels; ++ if (menuitems.size() % menu.sublevels) menu.persub++; } else { menu.sublevels = 0; menu.persub = 0; @@@ -334,8 -338,8 +341,8 @@@ if (! menu.width) menu.width = menu.item_w; menu.frame_h = (menu.item_h * menu.persub); -- menu.height = ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) + - menu.frame_h; ++ menu.height = ((title_vis) ? menu.title_h + screen.getBorderWidth() : 0) + + menu.frame_h; if (! menu.frame_h) menu.frame_h = 1; if (menu.height < 1) menu.height = 1; @@@ -343,14 -347,14 +350,14 @@@ BTexture *texture; if (title_vis) { tmp = menu.title_pixmap; -- texture = &(screen->getMenuStyle()->title); - if (texture->texture() == (BTexture::Flat | BTexture::Solid)) { ++ texture = &(screen.getMenuStyle()->title); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { menu.title_pixmap = None; XSetWindowBackground(display, menu.title, - texture->color().pixel()); + texture->getColor()->getPixel()); } else { menu.title_pixmap = - image_ctrl->renderImage(menu.width, menu.title_h, *texture); + image_ctrl->renderImage(menu.width, menu.title_h, texture); XSetWindowBackgroundPixmap(display, menu.title, menu.title_pixmap); } if (tmp) image_ctrl->removeImage(tmp); @@@ -358,21 -362,21 +365,21 @@@ } tmp = menu.frame_pixmap; -- texture = &(screen->getMenuStyle()->frame); - if (texture->texture() == (BTexture::Flat | BTexture::Solid)) { ++ texture = &(screen.getMenuStyle()->frame); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { menu.frame_pixmap = None; XSetWindowBackground(display, menu.frame, - texture->color().pixel()); + texture->getColor()->getPixel()); } else { menu.frame_pixmap = - image_ctrl->renderImage(menu.width, menu.frame_h, *texture); + image_ctrl->renderImage(menu.width, menu.frame_h, texture); XSetWindowBackgroundPixmap(display, menu.frame, menu.frame_pixmap); } if (tmp) image_ctrl->removeImage(tmp); tmp = menu.hilite_pixmap; -- texture = &(screen->getMenuStyle()->hilite); - if (texture->texture() == (BTexture::Flat | BTexture::Solid)) { ++ texture = &(screen.getMenuStyle()->hilite); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { menu.hilite_pixmap = None; } else { menu.hilite_pixmap = @@@ -396,9 -400,9 +403,9 @@@ XResizeWindow(display, menu.title, menu.width, menu.title_h); XMoveResizeWindow(display, menu.frame, 0, - ((title_vis) ? menu.title_h + - screen->getBorderWidth() : 0), menu.width, - menu.frame_h); + ((title_vis) ? menu.title_h + - screen->getBorderWidth() : 0), menu.width, ++ screen.getBorderWidth() : 0), menu.width, + menu.frame_h); XClearWindow(display, menu.window); XClearWindow(display, menu.title); @@@ -406,7 -410,8 +413,7 @@@ if (title_vis && visible) redrawTitle(); - for (int i = 0; visible && i < menuitems->count(); i++) { - const int menu_size = menuitems.size(); - for (int i = 0; visible && i < menu_size; i++) { ++ for (int i = 0; visible && i < (signed)menuitems.size(); i++) { if (i == which_sub) { drawItem(i, True, 0); drawSubmenu(i); @@@ -449,10 -454,9 +456,10 @@@ void Basemenu::hide(void) void Basemenu::internal_hide(void) { - BasemenuItem *tmp = find(which_sub); - if (tmp) + if (which_sub != -1) { - BasemenuItem *tmp = menuitems->find(which_sub); ++ BasemenuItem *tmp = menuitems[which_sub]; tmp->submenu()->internal_hide(); + } if (parent && (! torn)) { parent->drawItem(parent->which_sub, False, True); @@@ -485,117 -488,118 +492,115 @@@ void Basemenu::redrawTitle(void) int dx = menu.bevel_w, len = strlen(text); unsigned int l; - if (i18n.multibyte()) { + if (i18n->multibyte()) { XRectangle ink, logical; - XmbTextExtents(screen->getMenuStyle()->t_fontset, text, len, &ink, &logical); - XmbTextExtents(screen->getMenuStyle()->t_fontset, text, len, - &ink, &logical); ++ XmbTextExtents(screen.getMenuStyle()->t_fontset, text, len, &ink, &logical); l = logical.width; } else { -- l = XTextWidth(screen->getMenuStyle()->t_font, text, len); ++ l = XTextWidth(screen.getMenuStyle()->t_font, text, len); } l += (menu.bevel_w * 2); -- switch (screen->getMenuStyle()->t_justify) { - case RightJustify: ++ switch (screen.getMenuStyle()->t_justify) { + case BScreen::RightJustify: dx += menu.width - l; break; - case CenterJustify: + case BScreen::CenterJustify: dx += (menu.width - l) / 2; break; - - case LeftJustify: - default: - break; } -- MenuStyle *style = screen->getMenuStyle(); - BPen pen(style->t_text, style->t_font); - if (i18n.multibyte()) - XmbDrawString(display, menu.title, style->t_fontset, pen.gc(), dx, - (menu.bevel_w - style->t_fontset_extents->max_ink_extent.y), - text, len); ++ MenuStyle *style = screen.getMenuStyle(); + if (i18n->multibyte()) + XmbDrawString(display, menu.title, style->t_fontset, style->t_text_gc, dx, + (menu.bevel_w - style->t_fontset_extents->max_ink_extent.y), + text, len); else - XDrawString(display, menu.title, pen.gc(), dx, - (style->t_font->ascent + menu.bevel_w), text, len); + XDrawString(display, menu.title, style->t_text_gc, dx, + (style->t_font->ascent + menu.bevel_w), text, len); } void Basemenu::drawSubmenu(int index) { - BasemenuItem *item = find(which_sub); - if (item && item->submenu() && ! item->submenu()->isTorn() && - which_sub != index) - item->submenu()->internal_hide(); - - item = find(index); - if (! item) - return; - Basemenu *submenu = item->submenu(); - - if (submenu && visible && ! submenu->isTorn() && item->isEnabled()) { - if (submenu->parent != this) submenu->parent = this; - int sbl = index / menu.persub, i = index - (sbl * menu.persub), - x = menu.x + ((menu.item_w * (sbl + 1)) + screen->getBorderWidth()), y; - - if (alignment == AlignTop) { - y = (((shifted) ? menu.y_shift : menu.y) + - ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) - - ((submenu->title_vis) ? - submenu->menu.title_h + screen->getBorderWidth() : 0)); - } else { - y = (((shifted) ? menu.y_shift : menu.y) + - (menu.item_h * i) + - ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) - - ((submenu->title_vis) ? - submenu->menu.title_h + screen->getBorderWidth() : 0)); - } + if (which_sub != -1 && which_sub != index) { - BasemenuItem *itmp = menuitems->find(which_sub); ++ BasemenuItem *itmp = menuitems[which_sub]; - if (alignment == AlignBottom && - (y + submenu->menu.height) > ((shifted) ? menu.y_shift : - menu.y) + menu.height) - y = (((shifted) ? menu.y_shift : menu.y) + - menu.height - submenu->menu.height); - - if ((x + submenu->getWidth()) > screen->getWidth()) - x = ((shifted) ? menu.x_shift : menu.x) - - submenu->getWidth() - screen->getBorderWidth(); - - if (x < 0) x = 0; - - if ((y + submenu->getHeight()) > screen->getHeight()) - y = screen->getHeight() - submenu->getHeight() - - (screen->getBorderWidth() * 2); - if (y < 0) y = 0; - - submenu->move(x, y); - if (! moving) drawItem(index, True); + if (! itmp->submenu()->isTorn()) + itmp->submenu()->internal_hide(); + } - if (index >= 0 && index < menuitems->count()) { - BasemenuItem *item = menuitems->find(index); - if (! submenu->isVisible()) - submenu->show(); - submenu->moving = moving; - which_sub = index; - } else { - which_sub = -1; ++ if (index >= 0 && index < (signed)menuitems.size()) { ++ BasemenuItem *item = menuitems[index]; + if (item->submenu() && visible && (! item->submenu()->isTorn()) && + item->isEnabled()) { + if (item->submenu()->parent != this) item->submenu()->parent = this; + int sbl = index / menu.persub, i = index - (sbl * menu.persub), + x = menu.x + - ((menu.item_w * (sbl + 1)) + screen->getBorderWidth()), y; ++ ((menu.item_w * (sbl + 1)) + screen.getBorderWidth()), y; + + if (alignment == AlignTop) + y = (((shifted) ? menu.y_shift : menu.y) + - ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) - ++ ((title_vis) ? menu.title_h + screen.getBorderWidth() : 0) - + ((item->submenu()->title_vis) ? - item->submenu()->menu.title_h + screen->getBorderWidth() : 0)); ++ item->submenu()->menu.title_h + screen.getBorderWidth() : 0)); + else + y = (((shifted) ? menu.y_shift : menu.y) + + (menu.item_h * i) + - ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) - ++ ((title_vis) ? menu.title_h + screen.getBorderWidth() : 0) - + ((item->submenu()->title_vis) ? - item->submenu()->menu.title_h + screen->getBorderWidth() : 0)); ++ item->submenu()->menu.title_h + screen.getBorderWidth() : 0)); + + if (alignment == AlignBottom && + (y + item->submenu()->menu.height) > ((shifted) ? menu.y_shift : + menu.y) + menu.height) + y = (((shifted) ? menu.y_shift : menu.y) + + menu.height - item->submenu()->menu.height); + - if ((x + item->submenu()->getWidth()) > screen->getWidth()) { ++ if ((x + item->submenu()->getWidth()) > screen.size().w()) { + x = ((shifted) ? menu.x_shift : menu.x) - - item->submenu()->getWidth() - screen->getBorderWidth(); ++ item->submenu()->getWidth() - screen.getBorderWidth(); + } + + if (x < 0) x = 0; + - if ((y + item->submenu()->getHeight()) > screen->getHeight()) - y = screen->getHeight() - item->submenu()->getHeight() - - (screen->getBorderWidth() * 2); ++ if ((y + item->submenu()->getHeight()) > screen.size().h()) ++ y = screen.size().h() - item->submenu()->getHeight() - ++ (screen.getBorderWidth() * 2); + if (y < 0) y = 0; + + item->submenu()->move(x, y); + if (! moving) drawItem(index, True); + + if (! item->submenu()->isVisible()) + item->submenu()->show(); + item->submenu()->moving = moving; + which_sub = index; + } else { + which_sub = -1; + } } } - Bool Basemenu::hasSubmenu(int index) { - if ((index >= 0) && (index < menuitems->count())) - if (menuitems->find(index)->submenu()) - return True; - - return False; + bool Basemenu::hasSubmenu(int index) { - BasemenuItem *item = find(index); - if (item && item->submenu()) - return True; - return False; ++ if (index < 0 | index >= (signed)menuitems.size()) ++ return false; ++ return (menuitems[index]->submenu()); } -void Basemenu::drawItem(int index, bool highlight, bool clear, - int x, int y, unsigned int w, unsigned int h) +void Basemenu::drawItem(int index, Bool highlight, Bool clear, + int x, int y, unsigned int w, unsigned int h) { - if (index < 0 || index > menuitems->count()) return; - BasemenuItem *item = find(index); - if (! item) return; ++ if (index < 0 || index > (signed)menuitems.size()) return; - BasemenuItem *item = menuitems->find(index); - bool dotext = True, dohilite = True, dosel = True; - const char *text = item->label(); ++ BasemenuItem *item = menuitems[index]; + if (! item) return; + + Bool dotext = True, dohilite = True, dosel = True; + const char *text = (item->ulabel()) ? *item->ulabel() : item->label(); int sbl = index / menu.persub, i = index - (sbl * menu.persub); int item_x = (sbl * menu.item_w), item_y = (i * menu.item_h); int hilite_x = item_x, hilite_y = item_y, hoff_x = 0, hoff_y = 0; @@@ -603,49 -607,48 +608,49 @@@ unsigned int hilite_w = menu.item_w, hilite_h = menu.item_h, text_w = 0, text_h = 0; unsigned int half_w = menu.item_h / 2, quarter_w = menu.item_h / 4; - + if (text) { - if (i18n.multibyte()) { + if (i18n->multibyte()) { XRectangle ink, logical; -- XmbTextExtents(screen->getMenuStyle()->f_fontset, - text, len, &ink, &logical); ++ XmbTextExtents(screen.getMenuStyle()->f_fontset, + text, len, &ink, &logical); text_w = logical.width; text_y = item_y + (menu.bevel_w / 2) - - screen->getMenuStyle()->f_fontset_extents->max_ink_extent.y; - screen->getMenuStyle()->f_fontset_extents->max_ink_extent.y; ++ screen.getMenuStyle()->f_fontset_extents->max_ink_extent.y; } else { -- text_w = XTextWidth(screen->getMenuStyle()->f_font, text, len); ++ text_w = XTextWidth(screen.getMenuStyle()->f_font, text, len); text_y = item_y + - screen->getMenuStyle()->f_font->ascent + - screen->getMenuStyle()->f_font->ascent + - (menu.bevel_w / 2); ++ screen.getMenuStyle()->f_font->ascent + + (menu.bevel_w / 2); } - - switch(screen->getMenuStyle()->f_justify) { - case LeftJustify: + - switch(screen->getMenuStyle()->f_justify) { ++ switch(screen.getMenuStyle()->f_justify) { + case BScreen::LeftJustify: text_x = item_x + menu.bevel_w + menu.item_h + 1; break; - - case RightJustify: + + case BScreen::RightJustify: text_x = item_x + menu.item_w - (menu.item_h + menu.bevel_w + text_w); break; - - case CenterJustify: + + case BScreen::CenterJustify: text_x = item_x + ((menu.item_w + 1 - text_w) / 2); break; } - + text_h = menu.item_h - menu.bevel_w; } - - MenuStyle *style = screen->getMenuStyle(); - BPen pen((highlight || item->isSelected()) ? style->h_text : style->f_text), - textpen((highlight) ? style->h_text : - item->isEnabled() ? style->f_text : style->d_text, style->f_font), - hipen(style->hilite.color()); - - + + GC gc = - ((highlight || item->isSelected()) ? screen->getMenuStyle()->h_text_gc : - screen->getMenuStyle()->f_text_gc), ++ ((highlight || item->isSelected()) ? screen.getMenuStyle()->h_text_gc : ++ screen.getMenuStyle()->f_text_gc), + tgc = - ((highlight) ? screen->getMenuStyle()->h_text_gc : - ((item->isEnabled()) ? screen->getMenuStyle()->f_text_gc : - screen->getMenuStyle()->d_text_gc)); ++ ((highlight) ? screen.getMenuStyle()->h_text_gc : ++ ((item->isEnabled()) ? screen.getMenuStyle()->f_text_gc : ++ screen.getMenuStyle()->d_text_gc)); + sel_x = item_x; -- if (screen->getMenuStyle()->bullet_pos == Right) ++ if (screen.getMenuStyle()->bullet_pos == Right) sel_x += (menu.item_w - menu.item_h - menu.bevel_w); sel_x += quarter_w; sel_y = item_y + quarter_w; @@@ -682,61 -685,57 +687,61 @@@ if (dohilite && highlight && (menu.hilite_pixmap != ParentRelative)) { if (menu.hilite_pixmap) XCopyArea(display, menu.hilite_pixmap, menu.frame, - screen->getMenuStyle()->hilite_gc, hoff_x, hoff_y, - hipen.gc(), hoff_x, hoff_y, - hilite_w, hilite_h, hilite_x, hilite_y); ++ screen.getMenuStyle()->hilite_gc, hoff_x, hoff_y, + hilite_w, hilite_h, hilite_x, hilite_y); else - XFillRectangle(display, menu.frame, hipen.gc(), - hilite_x, hilite_y, hilite_w, hilite_h); + XFillRectangle(display, menu.frame, - screen->getMenuStyle()->hilite_gc, ++ screen.getMenuStyle()->hilite_gc, + hilite_x, hilite_y, hilite_w, hilite_h); } else if (dosel && item->isSelected() && - (menu.sel_pixmap != ParentRelative)) { + (menu.sel_pixmap != ParentRelative)) { if (menu.sel_pixmap) - XCopyArea(display, menu.sel_pixmap, menu.frame, hipen.gc(), 0, 0, - half_w, half_w, sel_x, sel_y); + XCopyArea(display, menu.sel_pixmap, menu.frame, - screen->getMenuStyle()->hilite_gc, 0, 0, ++ screen.getMenuStyle()->hilite_gc, 0, 0, + half_w, half_w, sel_x, sel_y); else - XFillRectangle(display, menu.frame, hipen.gc(), sel_x, sel_y, half_w, half_w); + XFillRectangle(display, menu.frame, - screen->getMenuStyle()->hilite_gc, ++ screen.getMenuStyle()->hilite_gc, + sel_x, sel_y, half_w, half_w); } - + if (dotext && text) { - if (i18n.multibyte()) - XmbDrawString(display, menu.frame, screen->getMenuStyle()->f_fontset, - textpen.gc(), text_x, text_y, text, len); + if (i18n->multibyte()) - XmbDrawString(display, menu.frame, screen->getMenuStyle()->f_fontset, ++ XmbDrawString(display, menu.frame, screen.getMenuStyle()->f_fontset, + tgc, text_x, text_y, text, len); else - XDrawString(display, menu.frame, textpen.gc(), text_x, text_y, text, len); + XDrawString(display, menu.frame, tgc, text_x, text_y, text, len); } if (dosel && item->submenu()) { -- switch (screen->getMenuStyle()->bullet) { ++ switch (screen.getMenuStyle()->bullet) { case Square: - XDrawRectangle(display, menu.frame, pen.gc(), sel_x, sel_y, half_w, half_w); + XDrawRectangle(display, menu.frame, gc, sel_x, sel_y, half_w, half_w); break; case Triangle: XPoint tri[3]; -- if (screen->getMenuStyle()->bullet_pos == Right) { ++ if (screen.getMenuStyle()->bullet_pos == Right) { tri[0].x = sel_x + quarter_w - 2; - tri[0].y = sel_y + quarter_w - 2; + tri[0].y = sel_y + quarter_w - 2; tri[1].x = 4; - tri[1].y = 2; + tri[1].y = 2; tri[2].x = -4; - tri[2].y = 2; + tri[2].y = 2; } else { tri[0].x = sel_x + quarter_w - 2; - tri[0].y = item_y + half_w; + tri[0].y = item_y + half_w; tri[1].x = 4; - tri[1].y = 2; + tri[1].y = 2; tri[2].x = 0; - tri[2].y = -4; + tri[2].y = -4; } - - XFillPolygon(display, menu.frame, pen.gc(), tri, 3, Convex, + + XFillPolygon(display, menu.frame, gc, tri, 3, Convex, CoordModePrevious); break; - + case Diamond: XPoint dia[4]; @@@ -766,9 -761,8 +771,9 @@@ void Basemenu::setLabel(const char *l) } - void Basemenu::setItemSelected(int index, Bool sel) { - if (index < 0 || index >= menuitems->count()) return; + void Basemenu::setItemSelected(int index, bool sel) { - assert(index >= 0); ++ if (index < 0 || index >= (signed)menuitems.size()) return; + BasemenuItem *item = find(index); if (! item) return; @@@ -777,19 -771,17 +782,19 @@@ } - Bool Basemenu::isItemSelected(int index) { - if (index < 0 || index >= menuitems->count()) return False; + bool Basemenu::isItemSelected(int index) { - assert(index >= 0); ++ if (index < 0 || index >= (signed)menuitems.size()) return false; + BasemenuItem *item = find(index); -- if (! item) return False; ++ if (! item) return false; return item->isSelected(); } - void Basemenu::setItemEnabled(int index, Bool enable) { - if (index < 0 || index >= menuitems->count()) return; + void Basemenu::setItemEnabled(int index, bool enable) { - assert(index >= 0); ++ if (index < 0 || index >= (signed)menuitems.size()) return; + BasemenuItem *item = find(index); if (! item) return; @@@ -798,9 -790,8 +803,9 @@@ } - Bool Basemenu::isItemEnabled(int index) { - if (index < 0 || index >= menuitems->count()) return False; + bool Basemenu::isItemEnabled(int index) { - assert(index >= 0); ++ if (index < 0 || index >= (signed)menuitems.size()) return false; + BasemenuItem *item = find(index); if (! item) return False; @@@ -813,16 -804,16 +818,16 @@@ void Basemenu::buttonPressEvent(XButton int sbl = (be->x / menu.item_w), i = (be->y / menu.item_h); int w = (sbl * menu.persub) + i; - if (w < menuitems->count() && w >= 0) { - BasemenuItem *item = find(w); - if (item) { ++ if (w < (signed)menuitems.size() && w >= 0) { which_press = i; which_sbl = sbl; - BasemenuItem *item = menuitems->find(w); ++ BasemenuItem *item = menuitems[w]; if (item->submenu()) - drawSubmenu(w); + drawSubmenu(w); else - drawItem(w, (item->isEnabled()), True); + drawItem(w, (item->isEnabled()), True); } } else { menu.x_move = be->x_root - menu.x; @@@ -851,21 -842,22 +856,21 @@@ void Basemenu::buttonReleaseEvent(XButt hide(); } else { int sbl = (re->x / menu.item_w), i = (re->y / menu.item_h), - ix = sbl * menu.item_w, iy = i * menu.item_h, - w = (sbl * menu.persub) + i, - p = (which_sbl * menu.persub) + which_press; + ix = sbl * menu.item_w, iy = i * menu.item_h, + w = (sbl * menu.persub) + i, + p = (which_sbl * menu.persub) + which_press; - if (w < menuitems->count() && w >= 0) { - if (w >= 0 && w < static_cast(menuitems.size())) { - drawItem(p, (p == which_sub), True); ++ if (w < (signed)menuitems.size() && w >= 0) { + drawItem(p, (p == which_sub), True); if (p == w && isItemEnabled(w)) { - if (re->x > ix && re->x < static_cast(ix + menu.item_w) && - re->y > iy && re->y < static_cast(iy + menu.item_h)) { - itemSelected(re->button, w); - } + if (re->x > ix && re->x < (signed) (ix + menu.item_w) && + re->y > iy && re->y < (signed) (iy + menu.item_h)) { + itemSelected(re->button, w); + } } - } else { + } else drawItem(p, False, True); - } } } } @@@ -895,35 -887,35 +900,35 @@@ void Basemenu::motionNotifyEvent(XMotio } } } else if ((! (me->state & Button1Mask)) && me->window == menu.frame && - me->x >= 0 && me->x < static_cast(menu.width) && - me->y >= 0 && me->y < static_cast(menu.frame_h)) { + me->x >= 0 && me->x < (signed) menu.width && + me->y >= 0 && me->y < (signed) menu.frame_h) { int sbl = (me->x / menu.item_w), i = (me->y / menu.item_h), - w = (sbl * menu.persub) + i; + w = (sbl * menu.persub) + i; if ((i != which_press || sbl != which_sbl) && - (w < menuitems->count() && w >= 0)) { - (w >= 0 && w < static_cast(menuitems.size()))) { ++ (w < (signed)menuitems.size() && w >= 0)) { if (which_press != -1 && which_sbl != -1) { - int p = (which_sbl * menu.persub) + which_press; - BasemenuItem *item = find(p); - - drawItem(p, False, True); - if (item->submenu()) - if (item->submenu()->isVisible() && - (! item->submenu()->isTorn())) { - item->submenu()->internal_hide(); - which_sub = -1; - } + int p = (which_sbl * menu.persub) + which_press; - BasemenuItem *item = menuitems->find(p); ++ BasemenuItem *item = menuitems[p]; + + drawItem(p, False, True); + if (item->submenu()) + if (item->submenu()->isVisible() && + (! item->submenu()->isTorn())) { + item->submenu()->internal_hide(); + which_sub = -1; + } } which_press = i; which_sbl = sbl; - BasemenuItem *itmp = menuitems->find(w); - BasemenuItem *itmp = find(w); ++ BasemenuItem *itmp = menuitems[w]; if (itmp->submenu()) - drawSubmenu(w); + drawSubmenu(w); else - drawItem(w, (itmp->isEnabled()), True); + drawItem(w, (itmp->isEnabled()), True); } } } @@@ -946,16 -938,17 +951,16 @@@ void Basemenu::exposeEvent(XExposeEven if (id_d > menu.persub) id_d = menu.persub; // draw the sublevels and the number of items the exposure spans - LinkedListIterator it(menuitems); - MenuItems::iterator it, - end = menuitems.end(); ++ menuitemList::const_iterator it = menuitems.begin(); int i, ii; for (i = sbl; i <= sbl_d; i++) { // set the iterator to the first item in the sublevel needing redrawing - it.set(id + (i * menu.persub)); - for (ii = id; ii <= id_d && it.current(); it++, ii++) { + it = menuitems.begin() + (id + (i * menu.persub)); - for (ii = id; ii <= id_d && it != end; ++it, ii++) { - int index = ii + (i * menu.persub); - // redraw the item - drawItem(index, (which_sub == index), False, - ee->x, ee->y, ee->width, ee->height); ++ for (ii = id; ii <= id_d && it != menuitems.end(); it++, ii++) { + int index = ii + (i * menu.persub); + // redraw the item + drawItem(index, (which_sub == index), False, + ee->x, ee->y, ee->width, ee->height); } } } @@@ -965,21 -958,21 +970,21 @@@ void Basemenu::enterNotifyEvent(XCrossingEvent *ce) { if (ce->window == menu.frame) { menu.x_shift = menu.x, menu.y_shift = menu.y; -- if (menu.x + menu.width > screen->getWidth()) { -- menu.x_shift = screen->getWidth() - menu.width - -- screen->getBorderWidth(); ++ if (menu.x + menu.width > screen.size().w()) { ++ menu.x_shift = screen.size().w() - menu.width - ++ screen.getBorderWidth(); shifted = True; } else if (menu.x < 0) { -- menu.x_shift = -screen->getBorderWidth(); ++ menu.x_shift = -screen.getBorderWidth(); shifted = True; } -- if (menu.y + menu.height > screen->getHeight()) { -- menu.y_shift = screen->getHeight() - menu.height - -- screen->getBorderWidth(); ++ if (menu.y + menu.height > screen.size().h()) { ++ menu.y_shift = screen.size().h() - menu.height - ++ screen.getBorderWidth(); shifted = True; - } else if (menu.y + static_cast(menu.title_h) < 0) { - menu.y_shift = -screen->getBorderWidth(); + } else if (menu.y + (signed) menu.title_h < 0) { - menu.y_shift = -screen->getBorderWidth(); ++ menu.y_shift = -screen.getBorderWidth(); shifted = True; } @@@ -987,17 -980,17 +992,17 @@@ XMoveWindow(display, menu.window, menu.x_shift, menu.y_shift); if (which_sub != -1) { - BasemenuItem *tmp = menuitems->find(which_sub); - BasemenuItem *tmp = find(which_sub); ++ BasemenuItem *tmp = menuitems[which_sub]; if (tmp->submenu()->isVisible()) { - int sbl = (ce->x / menu.item_w), i = (ce->y / menu.item_h), - w = (sbl * menu.persub) + i; + int sbl = (ce->x / menu.item_w), i = (ce->y / menu.item_h), + w = (sbl * menu.persub) + i; - if (w != which_sub && (! tmp->submenu()->isTorn())) { - tmp->submenu()->internal_hide(); + if (w != which_sub && (! tmp->submenu()->isTorn())) { + tmp->submenu()->internal_hide(); - drawItem(which_sub, False, True); - which_sub = -1; - } + drawItem(which_sub, False, True); + which_sub = -1; + } } } } @@@ -1026,11 -1019,18 +1031,11 @@@ void Basemenu::leaveNotifyEvent(XCrossi void Basemenu::reconfigure(void) { XSetWindowBackground(display, menu.window, - screen->getBorderColor()->getPixel()); - screen->getBorderColor()->pixel()); ++ screen.getBorderColor()->getPixel()); XSetWindowBorder(display, menu.window, - screen->getBorderColor()->getPixel()); - screen->getBorderColor()->pixel()); -- XSetWindowBorderWidth(display, menu.window, screen->getBorderWidth()); ++ screen.getBorderColor()->getPixel()); ++ XSetWindowBorderWidth(display, menu.window, screen.getBorderWidth()); -- menu.bevel_w = screen->getBevelWidth(); ++ menu.bevel_w = screen.getBevelWidth(); update(); } - - -void Basemenu::changeItemLabel(unsigned int index, const string& label) { - BasemenuItem *item = find(index); - assert(item); - item->newLabel(label); -} diff --cc src/Basemenu.h index ba28404c,00000000..28217aa5 mode 100644,000000..100644 --- a/src/Basemenu.h +++ b/src/Basemenu.h @@@ -1,170 -1,0 +1,169 @@@ +// Basemenu.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Basemenu_hh +#define __Basemenu_hh + +#include + +class Openbox; +class BImageControl; +class BScreen; +class Basemenu; +class BasemenuItem; - #include "LinkedList.h" - ++#include ++typedef std::vector menuitemList; + +class Basemenu { +private: - LinkedList *menuitems; - Openbox *openbox; ++ menuitemList menuitems; ++ Openbox &openbox; + Basemenu *parent; + BImageControl *image_ctrl; - BScreen *screen; ++ BScreen &screen; + + Bool moving, visible, movable, torn, internal_menu, title_vis, shifted, + hide_tree; + Display *display; + int which_sub, which_press, which_sbl, alignment; + + struct _menu { + Pixmap frame_pixmap, title_pixmap, hilite_pixmap, sel_pixmap; + Window window, frame, title; + + char *label; + int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub, minsub, + grab_x, grab_y; + unsigned int width, height, title_h, frame_h, item_w, item_h, bevel_w, + bevel_h; + } menu; + + +protected: - inline BasemenuItem *find(int index) { return menuitems->find(index); } + inline void setTitleVisibility(Bool b) { title_vis = b; } + inline void setMovable(Bool b) { movable = b; } + inline void setHideTree(Bool h) { hide_tree = h; } + inline void setMinimumSublevels(int m) { menu.minsub = m; } + + virtual void itemSelected(int, int) = 0; + virtual void drawItem(int, Bool = False, Bool = False, + int = -1, int = -1, unsigned int = 0, + unsigned int = 0); + virtual void redrawTitle(); + virtual void internal_hide(void); + + +public: - Basemenu(BScreen *); ++ Basemenu(BScreen &); + virtual ~Basemenu(void); + + inline const Bool &isTorn(void) const { return torn; } + inline const Bool &isVisible(void) const { return visible; } + - inline BScreen *getScreen(void) { return screen; } ++ inline BScreen &getScreen(void) { return screen; } + + inline const Window &getWindowID(void) const { return menu.window; } + + inline const char *getLabel(void) const { return menu.label; } + + int insert(const char *, int = 0, const char * = (const char *) 0, int = -1); + int insert(const char **, int = -1, int = 0); + int insert(const char *, Basemenu *, int = -1); + int remove(int); + - inline const int &getX(void) const { return menu.x; } - inline const int &getY(void) const { return menu.y; } - inline int getCount(void) { return menuitems->count(); } - inline const int &getCurrentSubmenu(void) const { return which_sub; } ++ inline int getX(void) const { return menu.x; } ++ inline int getY(void) const { return menu.y; } ++ inline unsigned int getCount(void) { return menuitems.size(); } ++ inline int getCurrentSubmenu(void) const { return which_sub; } ++ inline BasemenuItem *find(int index) { return menuitems[index]; } + - inline const unsigned int &getWidth(void) const { return menu.width; } - inline const unsigned int &getHeight(void) const { return menu.height; } - inline const unsigned int &getTitleHeight(void) const - { return menu.title_h; } ++ inline unsigned int getWidth(void) const { return menu.width; } ++ inline unsigned int getHeight(void) const { return menu.height; } ++ inline unsigned int getTitleHeight(void) const { return menu.title_h; } + + inline void setInternalMenu(void) { internal_menu = True; } + inline void setAlignment(int a) { alignment = a; } + inline void setTorn(void) { torn = True; } + inline void removeParent(void) + { if (internal_menu) parent = (Basemenu *) 0; } + - Bool hasSubmenu(int); - Bool isItemSelected(int); - Bool isItemEnabled(int); ++ bool hasSubmenu(int); ++ bool isItemSelected(int); ++ bool isItemEnabled(int); + + void buttonPressEvent(XButtonEvent *); + void buttonReleaseEvent(XButtonEvent *); + void motionNotifyEvent(XMotionEvent *); + void enterNotifyEvent(XCrossingEvent *); + void leaveNotifyEvent(XCrossingEvent *); + void exposeEvent(XExposeEvent *); + void reconfigure(void); + void setLabel(const char *n); + void move(int, int); + void update(void); - void setItemSelected(int, Bool); - void setItemEnabled(int, Bool); ++ void setItemSelected(int, bool); ++ void setItemEnabled(int, bool); + + virtual void drawSubmenu(int); + virtual void show(void); + virtual void hide(void); + + enum { AlignDontCare = 1, AlignTop, AlignBottom }; + enum { Right = 1, Left }; + enum { Empty = 0, Square, Triangle, Diamond }; +}; + + +class BasemenuItem { +private: + Basemenu *s; + const char **u, *l, *e; + int f, enabled, selected; + + friend class Basemenu; + +protected: + +public: + BasemenuItem(const char *lp, int fp, const char *ep = (const char *) 0): + s(0), u(0), l(lp), e(ep), f(fp), enabled(1), selected(0) {} + + BasemenuItem(const char *lp, Basemenu *mp): s(mp), u(0), l(lp), e(0), f(0), + enabled(1), selected(0) {} + + BasemenuItem(const char **up, int fp): s(0), u(up), l(0), e(0), f(fp), + enabled(1), selected(0) {} + + inline const char *exec(void) const { return e; } + inline const char *label(void) const { return l; } + inline const char **ulabel(void) const { return u; } + inline const int &function(void) const { return f; } + inline Basemenu *submenu(void) { return s; } + + inline const int &isEnabled(void) const { return enabled; } + inline void setEnabled(int e) { enabled = e; } + inline const int &isSelected(void) const { return selected; } + inline void setSelected(int s) { selected = s; } +}; + + +#endif // __Basemenu_hh diff --cc src/Clientmenu.cc index 2191f2a5,07f70439..34ed6f11 --- a/src/Clientmenu.cc +++ b/src/Clientmenu.cc @@@ -30,35 -25,35 +30,34 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -#include "blackbox.hh" -#include "Clientmenu.hh" -#include "Screen.hh" -#include "Window.hh" -#include "Workspace.hh" -#include "Workspacemenu.hh" - +#include "openbox.h" +#include "Clientmenu.h" +#include "Screen.h" +#include "Window.h" +#include "Workspace.h" +#include "Workspacemenu.h" -Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) { - wkspc = ws; - Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) { - wkspc = ws; - screen = wkspc->getScreen(); - ++Clientmenu::Clientmenu(Workspace &ws) : Basemenu(ws.getScreen()), ++ screen(ws.getScreen()), wkspc(ws) ++{ setInternalMenu(); } -void Clientmenu::itemSelected(int button, unsigned int index) { +void Clientmenu::itemSelected(int button, int index) { if (button > 2) return; - OpenboxWindow *win = wkspc->getWindow(index); - BlackboxWindow *win = wkspc->getWindow(index); ++ OpenboxWindow *win = wkspc.getWindow(index); if (win) { if (button == 1) { -- if (! wkspc->isCurrent()) wkspc->setCurrent(); ++ if (! wkspc.isCurrent()) wkspc.setCurrent(); } else if (button == 2) { -- if (! wkspc->isCurrent()) win->deiconify(True, False); ++ if (! wkspc.isCurrent()) win->deiconify(True, False); } -- wkspc->raiseWindow(win); ++ wkspc.raiseWindow(win); win->setInputFocus(); } - if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) hide(); - Workspacemenu* wkspcmenu = wkspc->getScreen()->getWorkspacemenu(); - if (! (wkspcmenu->isTorn() || isTorn())) hide(); ++ if (! (screen.getWorkspacemenu()->isTorn() || isTorn())) hide(); } diff --cc src/Clientmenu.h index 3b9792e1,70cc2aa0..88aeba6c --- a/src/Clientmenu.h +++ b/src/Clientmenu.h @@@ -29,14 -30,16 +29,14 @@@ class BScreen class Clientmenu : public Basemenu { private: - BScreen *screen; -- Workspace *wkspc; - - Clientmenu(const Clientmenu&); - Clientmenu& operator=(const Clientmenu&); ++ BScreen &screen; ++ Workspace &wkspc; protected: - virtual void itemSelected(int button, unsigned int index); + virtual void itemSelected(int, int); public: - Clientmenu(Workspace *); - Clientmenu(Workspace *ws); ++ Clientmenu(Workspace &); }; diff --cc src/Configmenu.cc index 97faf779,3a8a6e45..3eccbfcc --- a/src/Configmenu.cc +++ b/src/Configmenu.cc @@@ -1,5 -1,6 +1,6 @@@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// Configmenu.cc for Blackbox - An X11 Window Manager -// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry +// Configmenu.cc for Openbox ++// Copyright (c) 2002 - 2002 Ben Jansens +// Copyright (c) 2001 Sean 'Shaleh' Perry // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a @@@ -30,46 -25,61 +31,61 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -#include "i18n.hh" -#include "Configmenu.hh" -#include "Image.hh" -#include "Toolbar.hh" -#include "Window.hh" -#include "Screen.hh" +#include "i18n.h" +#include "Configmenu.h" +#include "Toolbar.h" +#include "Window.h" +#include "Screen.h" --Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) { - screen = scr; - openbox = screen->getOpenbox(); - setLabel(i18n(ConfigmenuSet, ConfigmenuConfigOptions, "Config options")); ++Configmenu::Configmenu(BScreen &scr) : Basemenu(scr), screen(scr) ++{ + setLabel(i18n->getMessage(ConfigmenuSet, ConfigmenuConfigOptions, + "Config options")); setInternalMenu(); focusmenu = new Focusmenu(this); placementmenu = new Placementmenu(this); - insert(i18n(ConfigmenuSet, ConfigmenuFocusModel, - "Focus Model"), focusmenu); - insert(i18n(ConfigmenuSet, ConfigmenuWindowPlacement, - "Window Placement"), placementmenu); - insert(i18n(ConfigmenuSet, ConfigmenuImageDithering, - "Image Dithering"), 1); - insert(i18n(ConfigmenuSet, ConfigmenuOpaqueMove, - "Opaque Window Moving"), 2); - insert(i18n(ConfigmenuSet, ConfigmenuFullMax, - "Full Maximization"), 3); - insert(i18n(ConfigmenuSet, ConfigmenuFocusNew, - "Focus New Windows"), 4); - insert(i18n(ConfigmenuSet, ConfigmenuFocusLast, - "Focus Last Window on Workspace"), 5); - insert(i18n(ConfigmenuSet, ConfigmenuWindowToWindowSnap, - "Window-To-Window Snapping"), 6); - insert(i18n(ConfigmenuSet, ConfigmenuWindowCornerSnap, - "Window Corner Snapping"), 7); - insert(i18n(ConfigmenuSet, ConfigmenuHideToolbar, - "Hide Toolbar"), 8); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuFocusModel, + "Focus Model"), focusmenu); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuWindowPlacement, + "Window Placement"), placementmenu); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuImageDithering, + "Image Dithering"), 1); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuOpaqueMove, + "Opaque Window Moving"), 2); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuFullMax, + "Full Maximization"), 3); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuFocusNew, + "Focus New Windows"), 4); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuFocusLast, + "Focus Last Window on Workspace"), 5); ++ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuWindowToWindowSnap, ++ "Window-To-Window Snapping"), 6); ++ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuWindowCornerSnap, ++ "Window Corner Snapping"), 7); ++ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuHideToolbar, ++ "Hide toolbar"), 8); update(); + - setItemSelected(2, screen->getImageControl()->doDither()); - setItemSelected(3, screen->doOpaqueMove()); - setItemSelected(4, screen->doFullMax()); - setItemSelected(5, screen->doFocusNew()); - setItemSelected(6, screen->doFocusLast()); + setValues(); } - Configmenu::~Configmenu(void) { ++void Configmenu::setValues() { ++ setItemSelected(2, screen.imageDither()); ++ setItemSelected(3, screen.opaqueMove()); ++ setItemSelected(4, screen.fullMax()); ++ setItemSelected(5, screen.focusNew()); ++ setItemSelected(6, screen.focusLast()); ++ setItemSelected(7, screen.windowToWindowSnap()); + -void Configmenu::setValues(void) { - setItemSelected(2, getScreen()->doImageDither()); - setItemSelected(3, getScreen()->doOpaqueMove()); - setItemSelected(4, getScreen()->doFullMax()); - setItemSelected(5, getScreen()->doFocusNew()); - setItemSelected(6, getScreen()->doFocusLast()); - setItemSelected(7, getScreen()->getWindowToWindowSnap()); ++ setItemSelected(8, screen.windowCornerSnap()); ++ setItemEnabled(8, screen.windowToWindowSnap()); + - setItemSelected(8, getScreen()->getWindowCornerSnap()); - setItemEnabled(8, getScreen()->getWindowToWindowSnap()); - - setItemSelected(9, getScreen()->doHideToolbar()); ++ setItemSelected(9, screen.hideToolbar()); + } + - -Configmenu::~Configmenu(void) { ++Configmenu::~Configmenu() { delete focusmenu; delete placementmenu; } @@@ -84,74 -94,89 +100,88 @@@ void Configmenu::itemSelected(int butto return; switch(item->function()) { - case 1: { // dither - screen->getImageControl()-> - setDither((! screen->getImageControl()->doDither())); - - setItemSelected(index, screen->getImageControl()->doDither()); - + case 1: // dither - getScreen()->saveImageDither(! getScreen()->doImageDither()); - setItemSelected(index, getScreen()->doImageDither()); ++ screen.setImageDither(!screen.imageDither()); ++ setItemSelected(index, screen.imageDither()); break; - } - - case 2: { // opaque move - screen->saveOpaqueMove((! screen->doOpaqueMove())); - - setItemSelected(index, screen->doOpaqueMove()); -- ++ + case 2: // opaque move - getScreen()->saveOpaqueMove(! getScreen()->doOpaqueMove()); - setItemSelected(index, getScreen()->doOpaqueMove()); ++ screen.setOpaqueMove(!screen.opaqueMove()); ++ setItemSelected(index, screen.opaqueMove()); break; - } - - case 3: { // full maximization - screen->saveFullMax((! screen->doFullMax())); - - setItemSelected(index, screen->doFullMax()); -- ++ + case 3: // full maximization - getScreen()->saveFullMax(! getScreen()->doFullMax()); - setItemSelected(index, getScreen()->doFullMax()); ++ screen.setFullMax(!screen.fullMax()); ++ setItemSelected(index, screen.fullMax()); + break; - ++ + case 4: // focus new windows - getScreen()->saveFocusNew(! getScreen()->doFocusNew()); - setItemSelected(index, getScreen()->doFocusNew()); ++ screen.setFocusNew(!screen.focusNew()); ++ setItemSelected(index, screen.focusNew()); + break; - ++ + case 5: // focus last window on workspace - getScreen()->saveFocusLast(! getScreen()->doFocusLast()); - setItemSelected(index, getScreen()->doFocusLast()); ++ screen.setFocusLast(!screen.focusLast()); ++ setItemSelected(index, screen.focusLast()); + break; - ++ + case 6: // window-to-window snapping - getScreen()->saveWindowToWindowSnap(! getScreen()->getWindowToWindowSnap()); - setItemSelected(index, getScreen()->getWindowToWindowSnap()); - setItemEnabled(index + 1, getScreen()->getWindowToWindowSnap()); ++ screen.setWindowToWindowSnap(! screen.windowToWindowSnap()); ++ setItemSelected(index, screen.windowToWindowSnap()); ++ setItemEnabled(index + 1, screen.windowToWindowSnap()); break; - } - case 4: { // focus new windows - screen->saveFocusNew((! screen->doFocusNew())); - setItemSelected(index, screen->doFocusNew()); + case 7: // window corner snapping - getScreen()->saveWindowCornerSnap(! getScreen()->getWindowCornerSnap()); - setItemSelected(index, getScreen()->getWindowCornerSnap()); ++ screen.setWindowCornerSnap(! screen.windowCornerSnap()); ++ setItemSelected(index, screen.windowCornerSnap()); break; - } - case 5: { // focus last window on workspace - screen->saveFocusLast((! screen->doFocusLast())); - setItemSelected(index, screen->doFocusLast()); - case 8: // hide toolbar - getScreen()->saveHideToolbar(! getScreen()->doHideToolbar()); - setItemSelected(index, getScreen()->doHideToolbar()); ++ case 8: //toggle toolbar hide ++ screen.setHideToolbar(!screen.hideToolbar()); ++ setItemSelected(index, screen.hideToolbar()); break; } - } // switch } - --void Configmenu::reconfigure(void) { ++void Configmenu::reconfigure() { + setValues(); focusmenu->reconfigure(); placementmenu->reconfigure(); Basemenu::reconfigure(); } +Configmenu::Focusmenu::Focusmenu(Configmenu *cm) : Basemenu(cm->screen) { + configmenu = cm; -Configmenu::Focusmenu::Focusmenu(Configmenu *cm) : Basemenu(cm->getScreen()) { - setLabel(i18n(ConfigmenuSet, ConfigmenuFocusModel, "Focus Model")); + setLabel(i18n->getMessage(ConfigmenuSet, ConfigmenuFocusModel, + "Focus Model")); setInternalMenu(); - insert(i18n(ConfigmenuSet, ConfigmenuClickToFocus, "Click To Focus"), 1); - insert(i18n(ConfigmenuSet, ConfigmenuSloppyFocus, "Sloppy Focus"), 2); - insert(i18n(ConfigmenuSet, ConfigmenuAutoRaise, "Auto Raise"), 3); - insert(i18n(ConfigmenuSet, ConfigmenuClickRaise, "Click Raise"), 4); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuClickToFocus, + "Click To Focus"), 1); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuSloppyFocus, + "Sloppy Focus"), 2); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuAutoRaise, + "Auto Raise"), 3); update(); + - setItemSelected(0, (! configmenu->screen->isSloppyFocus())); - setItemSelected(1, configmenu->screen->isSloppyFocus()); - setItemEnabled(2, configmenu->screen->isSloppyFocus()); - setItemSelected(2, configmenu->screen->doAutoRaise()); + setValues(); + } + - -void Configmenu::Focusmenu::setValues(void) { - setItemSelected(0, ! getScreen()->isSloppyFocus()); - setItemSelected(1, getScreen()->isSloppyFocus()); - setItemEnabled(2, getScreen()->isSloppyFocus()); - setItemSelected(2, getScreen()->doAutoRaise()); - setItemEnabled(3, getScreen()->isSloppyFocus()); - setItemSelected(3, getScreen()->doClickRaise()); ++void Configmenu::Focusmenu::setValues() { ++ setItemSelected(0, !configmenu->screen.sloppyFocus()); ++ setItemSelected(1, configmenu->screen.sloppyFocus()); ++ setItemEnabled(2, configmenu->screen.sloppyFocus()); ++ setItemSelected(2, configmenu->screen.autoRaise()); + } + - -void Configmenu::Focusmenu::reconfigure(void) { ++void Configmenu::Focusmenu::reconfigure() { + setValues(); + Basemenu::reconfigure(); } - -void Configmenu::Focusmenu::itemSelected(int button, unsigned int index) { +void Configmenu::Focusmenu::itemSelected(int button, int index) { if (button != 1) return; @@@ -162,96 -187,83 +192,101 @@@ switch (item->function()) { case 1: // click to focus - configmenu->screen->saveSloppyFocus(False); - configmenu->screen->saveAutoRaise(False); - - if (! configmenu->screen->getOpenbox()->getFocusedWindow()) - XSetInputFocus(configmenu->screen->getOpenbox()->getXDisplay(), - configmenu->screen->getToolbar()->getWindowID(), - RevertToParent, CurrentTime); - else - XSetInputFocus(configmenu->screen->getOpenbox()->getXDisplay(), - configmenu->screen->getOpenbox()-> - getFocusedWindow()->getClientWindow(), - RevertToParent, CurrentTime); - - configmenu->screen->reconfigure(); - - getScreen()->toggleFocusModel(BScreen::ClickToFocus); ++ configmenu->screen.setSloppyFocus(false); ++ configmenu->screen.setAutoRaise(false); ++ // make windows all grab button1 clicks ++ configmenu->screen.reconfigure(); break; case 2: // sloppy focus - configmenu->screen->saveSloppyFocus(True); - - configmenu->screen->reconfigure(); - - getScreen()->toggleFocusModel(BScreen::SloppyFocus); ++ configmenu->screen.setSloppyFocus(true); ++ // make windows stop grabbing button1 clicks ++ configmenu->screen.reconfigure(); break; case 3: // auto raise with sloppy focus - Bool change = ((configmenu->screen->doAutoRaise()) ? False : True); - configmenu->screen->saveAutoRaise(change); - getScreen()->saveAutoRaise(! getScreen()->doAutoRaise()); - break; -- - case 4: // click raise with sloppy focus - getScreen()->saveClickRaise(! getScreen()->doClickRaise()); - getScreen()->updateFocusModel(); ++ configmenu->screen.setAutoRaise(!configmenu->screen.autoRaise()); break; } - setValues(); + - setItemSelected(0, (! configmenu->screen->isSloppyFocus())); - setItemSelected(1, configmenu->screen->isSloppyFocus()); - setItemEnabled(2, configmenu->screen->isSloppyFocus()); - setItemSelected(2, configmenu->screen->doAutoRaise()); ++ setItemSelected(0, !configmenu->screen.sloppyFocus()); ++ setItemSelected(1, configmenu->screen.sloppyFocus()); ++ setItemEnabled(2, configmenu->screen.sloppyFocus()); ++ setItemSelected(2, configmenu->screen.autoRaise()); } +Configmenu::Placementmenu::Placementmenu(Configmenu *cm) : + Basemenu(cm->screen) { + configmenu = cm; -Configmenu::Placementmenu::Placementmenu(Configmenu *cm): - Basemenu(cm->getScreen()) { - setLabel(i18n(ConfigmenuSet, ConfigmenuWindowPlacement, "Window Placement")); + setLabel(i18n->getMessage(ConfigmenuSet, ConfigmenuWindowPlacement, + "Window Placement")); setInternalMenu(); -- - insert(i18n(ConfigmenuSet, ConfigmenuSmartRows, "Smart Placement (Rows)"), - BScreen::RowSmartPlacement); - insert(i18n(ConfigmenuSet, ConfigmenuSmartCols, "Smart Placement (Columns)"), - BScreen::ColSmartPlacement); - insert(i18n(ConfigmenuSet, ConfigmenuCascade, "Cascade Placement"), - BScreen::CascadePlacement); - insert(i18n(ConfigmenuSet, ConfigmenuUnderMouse, "Under Mouse Placement"), ++ + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuSmartRows, + "Smart Placement (Rows)"), + BScreen::RowSmartPlacement); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuSmartCols, + "Smart Placement (Columns)"), + BScreen::ColSmartPlacement); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuCascade, + "Cascade Placement"), BScreen::CascadePlacement); ++ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuBestFit, ++ "Best Fit Placement"), BScreen::BestFitPlacement); ++ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuUnderMouse, ++ "Under Mouse Placement"), + BScreen::UnderMousePlacement); - insert(i18n(ConfigmenuSet, ConfigmenuLeftRight, "Left to Right"), - BScreen::LeftRight); - insert(i18n(ConfigmenuSet, ConfigmenuRightLeft, "Right to Left"), - BScreen::RightLeft); - insert(i18n(ConfigmenuSet, ConfigmenuTopBottom, "Top to Bottom"), - BScreen::TopBottom); - insert(i18n(ConfigmenuSet, ConfigmenuBottomTop, "Bottom to Top"), - BScreen::BottomTop); ++ insert(i18n->getMessage(ConfigmenuSet, ConfigmenuClickMouse, ++ "Click Mouse Placement"), ++ BScreen::ClickMousePlacement); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuLeftRight, + "Left to Right"), BScreen::LeftRight); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuRightLeft, + "Right to Left"), BScreen::RightLeft); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuTopBottom, + "Top to Bottom"), BScreen::TopBottom); + insert(i18n->getMessage(ConfigmenuSet, ConfigmenuBottomTop, + "Bottom to Top"), BScreen::BottomTop); update(); + - switch (configmenu->screen->getPlacementPolicy()) { - case BScreen::RowSmartPlacement: - setItemSelected(0, True); - break; + setValues(); + } - case BScreen::ColSmartPlacement: - setItemSelected(1, True); - break; - -void Configmenu::Placementmenu::setValues(void) { - int placement = getScreen()->getPlacementPolicy(); - - setItemSelected(0, placement == BScreen::RowSmartPlacement); - setItemSelected(1, placement == BScreen::ColSmartPlacement); - setItemSelected(2, placement == BScreen::CascadePlacement); - setItemSelected(3, placement == BScreen::UnderMousePlacement); - - bool rl = (getScreen()->getRowPlacementDirection() == BScreen::LeftRight), - tb = (getScreen()->getColPlacementDirection() == BScreen::TopBottom), - e = placement != BScreen::UnderMousePlacement; - - setItemSelected(4, rl); - setItemSelected(5, ! rl); - setItemEnabled(4, e); - setItemEnabled(5, e); - - setItemSelected(6, tb); - setItemSelected(7, ! tb); - setItemEnabled(6, e); - setItemEnabled(7, e); ++void Configmenu::Placementmenu::setValues() { ++ const int p = configmenu->screen.placementPolicy(); ++ setItemSelected(0, p == BScreen::RowSmartPlacement); ++ setItemSelected(1, p == BScreen::ColSmartPlacement); ++ setItemSelected(2, p == BScreen::CascadePlacement); ++ setItemSelected(3, p == BScreen::BestFitPlacement); ++ setItemSelected(4, p == BScreen::UnderMousePlacement); ++ setItemSelected(5, p == BScreen::ClickMousePlacement); + - case BScreen::CascadePlacement: - setItemSelected(2, True); - break; - } - - Bool rl = (configmenu->screen->getRowPlacementDirection() == ++ bool rl = (configmenu->screen.rowPlacementDirection() == + BScreen::LeftRight), - tb = (configmenu->screen->getColPlacementDirection() == ++ tb = (configmenu->screen.colPlacementDirection() == + BScreen::TopBottom); + - setItemSelected(3, rl); - setItemSelected(4, ! rl); ++ setItemSelected(6, rl); ++ setItemEnabled(6, (p != BScreen::UnderMousePlacement && ++ p != BScreen::ClickMousePlacement)); ++ setItemSelected(7, !rl); ++ setItemEnabled(7, (p != BScreen::UnderMousePlacement && ++ p != BScreen::ClickMousePlacement)); ++ ++ setItemSelected(8, tb); ++ setItemEnabled(8, (p != BScreen::UnderMousePlacement && ++ p != BScreen::ClickMousePlacement)); ++ setItemSelected(9, !tb); ++ setItemEnabled(9, (p != BScreen::UnderMousePlacement && ++ p != BScreen::ClickMousePlacement)); + } - setItemSelected(5, tb); - setItemSelected(6, ! tb); - -void Configmenu::Placementmenu::reconfigure(void) { ++void Configmenu::Placementmenu::reconfigure() { + setValues(); + Basemenu::reconfigure(); } - -void Configmenu::Placementmenu::itemSelected(int button, unsigned int index) { +void Configmenu::Placementmenu::itemSelected(int button, int index) { if (button != 1) return; @@@ -262,62 -274,91 +297,44 @@@ switch (item->function()) { case BScreen::RowSmartPlacement: - configmenu->screen->savePlacementPolicy(item->function()); - getScreen()->savePlacementPolicy(item->function()); -- - setItemSelected(0, True); - setItemSelected(1, False); - setItemSelected(2, False); - setItemSelected(0, true); - setItemSelected(1, false); - setItemSelected(2, false); - setItemSelected(3, false); - setItemEnabled(4, true); - setItemEnabled(5, true); - setItemEnabled(6, true); - setItemEnabled(7, true); -- ++ configmenu->screen.setPlacementPolicy(item->function()); break; case BScreen::ColSmartPlacement: - configmenu->screen->savePlacementPolicy(item->function()); - getScreen()->savePlacementPolicy(item->function()); -- - setItemSelected(0, False); - setItemSelected(1, True); - setItemSelected(2, False); - setItemSelected(0, false); - setItemSelected(1, true); - setItemSelected(2, false); - setItemSelected(3, false); - setItemEnabled(4, true); - setItemEnabled(5, true); - setItemEnabled(6, true); - setItemEnabled(7, true); -- ++ configmenu->screen.setPlacementPolicy(item->function()); break; case BScreen::CascadePlacement: - configmenu->screen->savePlacementPolicy(item->function()); - getScreen()->savePlacementPolicy(item->function()); -- - setItemSelected(0, False); - setItemSelected(1, False); - setItemSelected(2, True); - setItemSelected(0, false); - setItemSelected(1, false); - setItemSelected(2, true); - setItemSelected(3, false); - setItemEnabled(4, true); - setItemEnabled(5, true); - setItemEnabled(6, true); - setItemEnabled(7, true); ++ configmenu->screen.setPlacementPolicy(item->function()); ++ break; ++ case BScreen::BestFitPlacement: ++ configmenu->screen.setPlacementPolicy(item->function()); break; - case BScreen::LeftRight: - configmenu->screen->saveRowPlacementDirection(BScreen::LeftRight); + case BScreen::UnderMousePlacement: - getScreen()->savePlacementPolicy(item->function()); - - setItemSelected(0, false); - setItemSelected(1, false); - setItemSelected(2, false); - setItemSelected(3, true); - setItemEnabled(4, false); - setItemEnabled(5, false); - setItemEnabled(6, false); - setItemEnabled(7, false); ++ configmenu->screen.setPlacementPolicy(item->function()); ++ break; - setItemSelected(3, True); - setItemSelected(4, False); ++ case BScreen::ClickMousePlacement: ++ configmenu->screen.setPlacementPolicy(item->function()); + break; + case BScreen::LeftRight: - getScreen()->saveRowPlacementDirection(BScreen::LeftRight); - - setItemSelected(4, true); - setItemSelected(5, false); - ++ configmenu->screen.setRowPlacementDirection(BScreen::LeftRight); break; case BScreen::RightLeft: - configmenu->screen->saveRowPlacementDirection(BScreen::RightLeft); - getScreen()->saveRowPlacementDirection(BScreen::RightLeft); -- - setItemSelected(3, False); - setItemSelected(4, True); - setItemSelected(4, false); - setItemSelected(5, true); -- ++ configmenu->screen.setRowPlacementDirection(BScreen::RightLeft); break; case BScreen::TopBottom: - configmenu->screen->saveColPlacementDirection(BScreen::TopBottom); - getScreen()->saveColPlacementDirection(BScreen::TopBottom); -- - setItemSelected(5, True); - setItemSelected(6, False); - setItemSelected(6, true); - setItemSelected(7, false); -- ++ configmenu->screen.setColPlacementDirection(BScreen::TopBottom); break; case BScreen::BottomTop: - configmenu->screen->saveColPlacementDirection(BScreen::BottomTop); - getScreen()->saveColPlacementDirection(BScreen::BottomTop); -- - setItemSelected(5, False); - setItemSelected(6, True); - setItemSelected(6, false); - setItemSelected(7, true); -- ++ configmenu->screen.setColPlacementDirection(BScreen::BottomTop); break; } ++ setValues(); } diff --cc src/Configmenu.h index c9d8f805,c3631fae..dd343b6a --- a/src/Configmenu.h +++ b/src/Configmenu.h @@@ -34,45 -35,53 +34,51 @@@ class Configmenu : public Basemenu private: class Focusmenu : public Basemenu { private: - Focusmenu(const Focusmenu&); - Focusmenu& operator=(const Focusmenu&); + Configmenu *configmenu; protected: - virtual void itemSelected(int button, unsigned int index); - virtual void setValues(void); + virtual void itemSelected(int, int); ++ virtual void setValues(); public: - Focusmenu(Configmenu *cm); - virtual void reconfigure(void); + Focusmenu(Configmenu *); ++ void reconfigure(); }; class Placementmenu : public Basemenu { private: - Placementmenu(const Placementmenu&); - Placementmenu& operator=(const Placementmenu&); + Configmenu *configmenu; protected: - virtual void itemSelected(int button, unsigned int index); - virtual void setValues(void); + virtual void itemSelected(int, int); ++ virtual void setValues(); ++ public: - Placementmenu(Configmenu *cm); - virtual void reconfigure(void); + Placementmenu(Configmenu *); ++ void reconfigure(); }; - Openbox *openbox; - BScreen *screen; ++ BScreen &screen; Focusmenu *focusmenu; Placementmenu *placementmenu; friend class Focusmenu; friend class Placementmenu; - Configmenu(const Configmenu&); - Configmenu& operator=(const Configmenu&); - protected: - virtual void itemSelected(int button, unsigned int index); - virtual void setValues(void); + virtual void itemSelected(int, int); ++ virtual void setValues(); ++ public: - Configmenu(BScreen *); - Configmenu(BScreen *scr); -- virtual ~Configmenu(void); ++ Configmenu(BScreen &); ++ virtual ~Configmenu(); -- inline Basemenu *getFocusmenu(void) { return focusmenu; } -- inline Basemenu *getPlacementmenu(void) { return placementmenu; } ++ inline Basemenu *getFocusmenu() { return focusmenu; } ++ inline Basemenu *getPlacementmenu() { return placementmenu; } - void reconfigure(void); - virtual void reconfigure(void); ++ void reconfigure(); }; #endif // __Configmenu_hh diff --cc src/Geometry.cc index 00000000,00000000..762d0966 new file mode 100644 --- /dev/null +++ b/src/Geometry.cc @@@ -1,0 -1,0 +1,161 @@@ ++// Geometry.cc for Openbox ++// Copyright (c) 2002 - 2002 ben Jansens (ben@orodu.net) ++// ++// Permission is hereby granted, free of charge, to any person obtaining a ++// copy of this software and associated documentation files (the "Software"), ++// to deal in the Software without restriction, including without limitation ++// the rights to use, copy, modify, merge, publish, distribute, sublicense, ++// and/or sell copies of the Software, and to permit persons to whom the ++// Software is furnished to do so, subject to the following conditions: ++// ++// The above copyright notice and this permission notice shall be included in ++// all copies or substantial portions of the Software. ++// ++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++// DEALINGS IN THE SOFTWARE. ++ ++#include "Geometry.h" ++ ++Point::Point() : m_x(0), m_y(0) { ++} ++ ++Point::Point(const Point &point) : m_x(point.m_x), m_y(point.m_y) { ++} ++ ++Point::Point(const int x, const int y) : m_x(x), m_y(y) { ++} ++ ++void Point::setX(const int x) { ++ m_x = x; ++} ++ ++void Point::setY(const int y) { ++ m_y = y; ++} ++ ++Size::Size() : m_w(0), m_h(0) { ++} ++ ++Size::Size(const Size &size) : m_w(size.m_w), m_h(size.m_h) { ++} ++ ++Size::Size(const unsigned int w, const unsigned int h) : m_w(w), m_h(h) { ++} ++ ++void Size::setW(const unsigned int w) { ++ m_w = w; ++} ++ ++void Size::setH(const unsigned int h) { ++ m_h = h; ++} ++ ++Rect::Rect() : m_origin(0, 0), m_size(0, 0) { ++} ++ ++Rect::Rect(const Point &origin, const Size &size) : m_origin(origin), ++ m_size(size) { ++} ++ ++Rect::Rect(const int x, const int y, const unsigned int w, const unsigned int h) ++ : m_origin(x, y), m_size(w, h) { ++} ++ ++void Rect::setSize(const Size &size) { ++ m_size = size; ++} ++ ++void Rect::setSize(const unsigned int w, const unsigned int h) { ++ m_size.setW(w); ++ m_size.setH(h); ++} ++ ++void Rect::setOrigin(const Point &origin) { ++ m_origin = origin; ++} ++ ++void Rect::setOrigin(const int x, const int y) { ++ m_origin.setX(x); ++ m_origin.setY(y); ++} ++ ++void Rect::setLeft(const int x){ ++ m_origin.setX(x); ++} ++ ++void Rect::setX(const int x) { ++ m_origin.setX(x); ++} ++ ++void Rect::setTop(const int y){ ++ m_origin.setY(y); ++} ++ ++void Rect::setY(const int y) { ++ m_origin.setY(y); ++} ++ ++void Rect::setRight(const int right) { ++ m_size.setW(right-m_origin.x()+1); ++} ++ ++void Rect::setW(unsigned int w) { ++ m_size.setW(w); ++} ++ ++void Rect::setBottom(const int bottom) { ++ m_size.setH(bottom-m_origin.y()+1); ++} ++ ++void Rect::setH(unsigned int h) { ++ m_size.setH(h); ++} ++ ++bool Rect::Intersect(const Rect &r) const { ++ return ++ (x() < (r.x()+(signed)r.w()) ) && ++ ( (x()+(signed)w()) > r.x()) && ++ (y() < (r.y()+(signed)r.h()) ) && ++ ( (y()+(signed)h()) > r.y()); ++} ++ ++Rect Rect::Inflate(const unsigned int i) const { ++ return Rect(x(), y(), w()+i, h()+i); ++} ++ ++Rect Rect::Inflate(const unsigned int iw, const unsigned int ih) const { ++ return Rect(x(), y(), w()+iw, h()+ih); ++} ++ ++Rect Rect::Inflate(const Size &i) const { ++ return Rect(x(), y(), w()+i.w(), h()+i.h()); ++} ++ ++Rect Rect::Deflate(const unsigned int d) const { ++ return Rect(x(), y(), w()-d, h()-d); ++} ++ ++Rect Rect::Deflate(const unsigned int dw, const unsigned int dh) const { ++ return Rect(x(), y(), w()-dw, h()-dh); ++} ++ ++Rect Rect::Deflate(const Size &d) const { ++ return Rect(x(), y(), w()-d.w(), h()-d.h()); ++} ++ ++Rect Rect::Translate(const int t) const { ++ return Rect(x()+t, y()+t, w(), h()); ++} ++ ++Rect Rect::Translate(const int tx, const int ty) const { ++ return Rect(x()+tx, y()+ty, w(), h()); ++} ++ ++Rect Rect::Translate(const Point &t) const { ++ return Rect(x()+t.x(), y()+t.y(), w(), h()); ++} diff --cc src/Geometry.h index 00000000,00000000..3f25c504 new file mode 100644 --- /dev/null +++ b/src/Geometry.h @@@ -1,0 -1,0 +1,136 @@@ ++// Geometry.h for Openbox ++// Copyright (c) 2002 - 2002 ben Jansens (ben@orodu.net) ++// ++// Permission is hereby granted, free of charge, to any person obtaining a ++// copy of this software and associated documentation files (the "Software"), ++// to deal in the Software without restriction, including without limitation ++// the rights to use, copy, modify, merge, publish, distribute, sublicense, ++// and/or sell copies of the Software, and to permit persons to whom the ++// Software is furnished to do so, subject to the following conditions: ++// ++// The above copyright notice and this permission notice shall be included in ++// all copies or substantial portions of the Software. ++// ++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++// DEALINGS IN THE SOFTWARE. ++ ++#ifndef __geometry_h ++#define __geometry_h ++ ++class Point{ ++ int m_x, m_y; ++public: ++ Point(); ++ Point(const Point &point); ++ Point(const int x, const int y); ++ ++ void setX(const int x); ++ inline int x() const { ++ return m_x; ++ } ++ ++ void setY(const int y); ++ inline int y() const { ++ return m_y; ++ } ++}; ++ ++class Size{ ++ unsigned int m_w, m_h; ++public: ++ Size(); ++ Size(const Size &size); ++ Size(const unsigned int w, const unsigned int h); ++ ++ void setW(const unsigned int w); ++ inline unsigned int w() const { ++ return m_w; ++ } ++ ++ void setH(const unsigned int h); ++ inline unsigned int h() const { ++ return m_h; ++ } ++}; ++ ++class Rect{ ++ Point m_origin; ++ Size m_size; ++public: ++ Rect(); ++ Rect(const Point &origin, const Size &size); ++ Rect(const int x, const int y, const unsigned int w, const unsigned int h); ++ ++ void setSize(const Size &size); ++ void setSize(const unsigned int w, const unsigned int h); ++ inline const Size &size() const { ++ return const_cast(m_size); ++ } ++ ++ void setOrigin(const Point &origin); ++ void setOrigin(const int x, const int y); ++ inline const Point &origin() const { ++ return const_cast(m_origin); ++ } ++ ++ void setLeft(const int x); ++ inline int left() const { ++ return m_origin.x(); ++ } ++ ++ void setX(const int x); ++ inline int x() const { ++ return m_origin.x(); ++ } ++ ++ void setTop(const int y); ++ inline int top() const { ++ return m_origin.y(); ++ } ++ ++ void setY(const int y); ++ inline int y() const { ++ return m_origin.y(); ++ } ++ ++ void setRight(const int left); ++ inline int right() const { ++ return m_origin.x()+m_size.w()-1; ++ } ++ ++ void setW(const unsigned int w); ++ inline unsigned int w() const { ++ return m_size.w(); ++ } ++ ++ void setBottom(const int bottom); ++ inline int bottom() const { ++ return m_origin.y()+m_size.h()-1; ++ } ++ ++ void setH(const unsigned int h); ++ inline unsigned int h() const { ++ return m_size.h(); ++ } ++ ++ bool Intersect(const Rect &r) const; ++ // returns a rect that is this rect increased in size by the passed in amount ++ Rect Inflate(const unsigned int i) const; ++ Rect Inflate(const unsigned int iw, const unsigned int ih) const; ++ Rect Inflate(const Size &i) const; ++ // returns a rect that is this rect decreased in size by the passed in amount ++ Rect Deflate(const unsigned int d) const; ++ Rect Deflate(const unsigned int dw, const unsigned int dh) const; ++ Rect Deflate(const Size &d) const; ++ // returns a rect that is moved the amount specified ++ Rect Translate(const int t) const; ++ Rect Translate(const int tx, const int ty) const; ++ Rect Translate(const Point &t) const; ++}; ++ ++#endif // __geometry_h diff --cc src/Iconmenu.cc index 32ae67a4,dba587a2..0adc10a7 --- a/src/Iconmenu.cc +++ b/src/Iconmenu.cc @@@ -1,5 -1,6 +1,5 @@@ - // Icon.cc for Openbox -// -*- mode: C++; indent-tabs-mode: nil; -*- -// Icon.cc for Blackbox - an X11 Window manager -// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry ++// Iconmenu.cc for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a @@@ -30,18 -25,16 +30,16 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -#include "i18n.hh" -#include "Iconmenu.hh" -#include "Screen.hh" -#include "Window.hh" +#include "i18n.h" +#include "Iconmenu.h" +#include "Screen.h" +#include "Window.h" --Iconmenu::Iconmenu(BScreen *scrn) : Basemenu(scrn) { ++Iconmenu::Iconmenu(BScreen &scrn) : Basemenu(scrn), screen(scrn) { setInternalMenu(); - screen = scrn; - - setLabel(i18n(IconSet, IconIcons, "Icons")); + setLabel(i18n->getMessage(IconSet, IconIcons, "Icons")); update(); } @@@ -50,8 -43,8 +48,8 @@@ void Iconmenu::itemSelected(int button if (button != 1) return; - if (index >= 0 && index < screen->getIconCount()) { - OpenboxWindow *win = screen->getIcon(index); - if (index < getScreen()->getIconCount()) { - BlackboxWindow *win = getScreen()->getIcon(index); ++ if (index >= 0 && index < screen.getIconCount()) { ++ OpenboxWindow *win = screen.getIcon(index); if (win) { win->deiconify(); @@@ -59,6 -52,6 +57,6 @@@ } } - if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) - if (! (getScreen()->getWorkspacemenu()->isTorn() || isTorn())) ++ if (! (screen.getWorkspacemenu()->isTorn() || isTorn())) hide(); } diff --cc src/Iconmenu.h index ca1b103d,1747e79a..609f03a3 --- a/src/Iconmenu.h +++ b/src/Iconmenu.h @@@ -1,5 -1,6 +1,5 @@@ - // Icon.h for Openbox -// -*- mode: C++; indent-tabs-mode: nil; -*- -// Icon.hh for Blackbox - an X11 Window manager -// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry ++// Iconmenu.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a @@@ -31,13 -32,14 +31,13 @@@ class BScreen class Iconmenu : public Basemenu { private: - BScreen *screen; - Iconmenu(const Iconmenu&); - Iconmenu& operator=(const Iconmenu&); ++ BScreen &screen; protected: - virtual void itemSelected(int button, unsigned int index); + virtual void itemSelected(int, int); public: - Iconmenu(BScreen *); - Iconmenu(BScreen *scrn); ++ Iconmenu(BScreen &); }; diff --cc src/Image.cc index d42d1d12,c20c4f7c..884d235f --- a/src/Image.cc +++ b/src/Image.cc @@@ -30,60 -25,25 +30,62 @@@ # include "../config.h" #endif // HAVE_CONFIG_H +#include "i18n.h" +#include "BaseDisplay.h" +#include "Image.h" + +#ifdef HAVE_SYS_TYPES_H +# include +#endif // HAVE_SYS_TYPES_H + +#ifndef u_int32_t +# ifdef uint_32_t +typedef uint32_t u_int32_t; +# else +# ifdef __uint32_t +typedef __uint32_t u_int32_t; +# else +typedef unsigned int u_int32_t; +# endif +# endif +#endif + - #ifdef STDC_HEADERS ++#ifdef HAVE_STDLIB_H +# include ++#endif // HAVE_STDLIB_H ++ ++#ifdef HAVE_STRING_H +# include - #endif // STDC_HEADERS ++#endif // HAVE_STRING_H + #ifdef HAVE_STDIO_H # include #endif // HAVE_STDIO_H +#ifdef HAVE_CTYPE_H +# include +#endif // HAVE_CTYPE_H + #include - using namespace std; -using std::max; + using std::min; ++using std::max; + +static unsigned long bsqrt(unsigned long x) { + if (x <= 0) return 0; + if (x == 1) return 1; -#include "blackbox.hh" -#include "i18n.hh" -#include "BaseDisplay.hh" -#include "GCCache.hh" -#include "Image.hh" -#include "Texture.hh" + unsigned long r = x >> 1; + unsigned long q; + while (1) { + q = x / r; + if (q >= r) return r; + r = (r + q) >> 1; + } +} -BImage::BImage(BImageControl *c, unsigned int w, unsigned int h) { - control = c; - BImage::BImage(BImageControl *c, unsigned int w, unsigned int h) { - control = c; - ++BImage::BImage(BImageControl &c, unsigned int w, unsigned int h) : control(c) { width = ((signed) w > 0) ? w : 1; height = ((signed) h > 0) ? h : 1; @@@ -93,15 -53,15 +95,15 @@@ xtable = ytable = (unsigned int *) 0; -- cpc = control->getColorsPerChannel(); ++ cpc = control.getColorsPerChannel(); cpccpc = cpc * cpc; -- control->getColorTables(&red_table, &green_table, &blue_table, ++ control.getColorTables(&red_table, &green_table, &blue_table, &red_offset, &green_offset, &blue_offset, &red_bits, &green_bits, &blue_bits); -- if (control->getVisual()->c_class != TrueColor) -- control->getXColorTable(&colors, &ncolors); ++ if (control.getVisual()->c_class != TrueColor) ++ control.getXColorTable(&colors, &ncolors); } @@@ -124,137 -83,111 +126,137 @@@ Pixmap BImage::render(BTexture *texture } -Pixmap BImage::render_solid(const BTexture &texture) { - Pixmap pixmap = XCreatePixmap(control->getBaseDisplay()->getXDisplay(), - control->getDrawable(), width, - height, control->getDepth()); +Pixmap BImage::render_solid(BTexture *texture) { - Pixmap pixmap = XCreatePixmap(control->getBaseDisplay()->getXDisplay(), - control->getDrawable(), width, - height, control->getDepth()); ++ Pixmap pixmap = XCreatePixmap(control.getBaseDisplay().getXDisplay(), ++ control.getDrawable(), width, ++ height, control.getDepth()); if (pixmap == None) { - fprintf(stderr, i18n(ImageSet, ImageErrorCreatingSolidPixmap, - "BImage::render_solid: error creating pixmap\n")); + fprintf(stderr, i18n->getMessage(ImageSet, ImageErrorCreatingSolidPixmap, + "BImage::render_solid: error creating pixmap\n")); return None; } - Display *display = control->getBaseDisplay()->getXDisplay(); + XGCValues gcv; + GC gc, hgc, lgc; + + gcv.foreground = texture->getColor()->getPixel(); + gcv.fill_style = FillSolid; - gc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, ++ gc = XCreateGC(control.getBaseDisplay().getXDisplay(), pixmap, + GCForeground | GCFillStyle, &gcv); + + gcv.foreground = texture->getHiColor()->getPixel(); - hgc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, ++ hgc = XCreateGC(control.getBaseDisplay().getXDisplay(), pixmap, + GCForeground, &gcv); - BPen pen(texture.color()); - BPen penlight(texture.lightColor()); - BPen penshadow(texture.shadowColor()); + gcv.foreground = texture->getLoColor()->getPixel(); - lgc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, ++ lgc = XCreateGC(control.getBaseDisplay().getXDisplay(), pixmap, + GCForeground, &gcv); - XFillRectangle(control->getBaseDisplay()->getXDisplay(), pixmap, gc, 0, 0, - XFillRectangle(display, pixmap, pen.gc(), 0, 0, width, height); ++ XFillRectangle(control.getBaseDisplay().getXDisplay(), pixmap, gc, 0, 0, + width, height); + +#ifdef INTERLACE + if (texture->getTexture() & BImage_Interlaced) { + gcv.foreground = texture->getColorTo()->getPixel(); - GC igc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, ++ GC igc = XCreateGC(control.getBaseDisplay().getXDisplay(), pixmap, + GCForeground, &gcv); - if (texture.texture() & BTexture::Interlaced) { - BPen peninterlace(texture.colorTo()); register unsigned int i = 0; for (; i < height; i += 2) - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, igc, - XDrawLine(display, pixmap, peninterlace.gc(), 0, i, width, i); ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, igc, + 0, i, width, i); + - XFreeGC(control->getBaseDisplay()->getXDisplay(), igc); ++ XFreeGC(control.getBaseDisplay().getXDisplay(), igc); } +#endif // INTERLACE - if (texture.texture() & BTexture::Bevel1) { - if (texture.texture() & BTexture::Raised) { - XDrawLine(display, pixmap, penshadow.gc(), + + if (texture->getTexture() & BImage_Bevel1) { + if (texture->getTexture() & BImage_Raised) { - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, 0, height - 1, width - 1, height - 1); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, - XDrawLine(display, pixmap, penshadow.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, width - 1, height - 1, width - 1, 0); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, - XDrawLine(display, pixmap, penlight.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, 0, 0, width - 1, 0); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, - XDrawLine(display, pixmap, penlight.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, 0, height - 1, 0, 0); - } else if (texture.texture() & BTexture::Sunken) { - XDrawLine(display, pixmap, penlight.gc(), + } else if (texture->getTexture() & BImage_Sunken) { - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, 0, height - 1, width - 1, height - 1); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, - XDrawLine(display, pixmap, penlight.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, width - 1, height - 1, width - 1, 0); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, - XDrawLine(display, pixmap, penshadow.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, 0, 0, width - 1, 0); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, - XDrawLine(display, pixmap, penshadow.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, 0, height - 1, 0, 0); } - } else if (texture.texture() & BTexture::Bevel2) { - if (texture.texture() & BTexture::Raised) { - XDrawLine(display, pixmap, penshadow.gc(), + } else if (texture->getTexture() & BImage_Bevel2) { + if (texture->getTexture() & BImage_Raised) { - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, 1, height - 3, width - 3, height - 3); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, - XDrawLine(display, pixmap, penshadow.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, width - 3, height - 3, width - 3, 1); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, - XDrawLine(display, pixmap, penlight.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, 1, 1, width - 3, 1); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, - XDrawLine(display, pixmap, penlight.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, 1, height - 3, 1, 1); - } else if (texture.texture() & BTexture::Sunken) { - XDrawLine(display, pixmap, penlight.gc(), + } else if (texture->getTexture() & BImage_Sunken) { - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, 1, height - 3, width - 3, height - 3); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, - XDrawLine(display, pixmap, penlight.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, hgc, width - 3, height - 3, width - 3, 1); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, - XDrawLine(display, pixmap, penshadow.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, 1, 1, width - 3, 1); - XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, - XDrawLine(display, pixmap, penshadow.gc(), ++ XDrawLine(control.getBaseDisplay().getXDisplay(), pixmap, lgc, 1, height - 3, 1, 1); } } - XFreeGC(control->getBaseDisplay()->getXDisplay(), gc); - XFreeGC(control->getBaseDisplay()->getXDisplay(), hgc); - XFreeGC(control->getBaseDisplay()->getXDisplay(), lgc); ++ XFreeGC(control.getBaseDisplay().getXDisplay(), gc); ++ XFreeGC(control.getBaseDisplay().getXDisplay(), hgc); ++ XFreeGC(control.getBaseDisplay().getXDisplay(), lgc); + return pixmap; } -Pixmap BImage::render_gradient(const BTexture &texture) { +Pixmap BImage::render_gradient(BTexture *texture) { int inverted = 0; - interlaced = texture.texture() & BTexture::Interlaced; +#ifdef INTERLACE + interlaced = texture->getTexture() & BImage_Interlaced; +#endif // INTERLACE - if (texture.texture() & BTexture::Sunken) { - from = texture.colorTo(); - to = texture.color(); + if (texture->getTexture() & BImage_Sunken) { + from = texture->getColorTo(); + to = texture->getColor(); - if (! (texture.texture() & BTexture::Invert)) inverted = 1; + if (! (texture->getTexture() & BImage_Invert)) inverted = 1; } else { - from = texture.color(); - to = texture.colorTo(); + from = texture->getColor(); + to = texture->getColorTo(); - if (texture.texture() & BTexture::Invert) inverted = 1; + if (texture->getTexture() & BImage_Invert) inverted = 1; } -- control->getGradientBuffers(width, height, &xtable, &ytable); ++ control.getGradientBuffers(width, height, &xtable, &ytable); - if (texture.texture() & BTexture::Diagonal) dgradient(); - else if (texture.texture() & BTexture::Elliptic) egradient(); - else if (texture.texture() & BTexture::Horizontal) hgradient(); - else if (texture.texture() & BTexture::Pyramid) pgradient(); - else if (texture.texture() & BTexture::Rectangle) rgradient(); - else if (texture.texture() & BTexture::Vertical) vgradient(); - else if (texture.texture() & BTexture::CrossDiagonal) cdgradient(); - else if (texture.texture() & BTexture::PipeCross) pcgradient(); + if (texture->getTexture() & BImage_Diagonal) dgradient(); + else if (texture->getTexture() & BImage_Elliptic) egradient(); + else if (texture->getTexture() & BImage_Horizontal) hgradient(); + else if (texture->getTexture() & BImage_Pyramid) pgradient(); + else if (texture->getTexture() & BImage_Rectangle) rgradient(); + else if (texture->getTexture() & BImage_Vertical) vgradient(); + else if (texture->getTexture() & BImage_CrossDiagonal) cdgradient(); + else if (texture->getTexture() & BImage_PipeCross) pcgradient(); - if (texture.texture() & BTexture::Bevel1) bevel1(); - else if (texture.texture() & BTexture::Bevel2) bevel2(); + if (texture->getTexture() & BImage_Bevel1) bevel1(); + else if (texture->getTexture() & BImage_Bevel2) bevel2(); if (inverted) invert(); @@@ -265,183 -198,184 +267,183 @@@ } -static const unsigned char dither4[4][4] = { - {0, 4, 1, 5}, - {6, 2, 7, 3}, - {1, 5, 0, 4}, - {7, 3, 6, 2} -}; - - -/* - * Helper function for TrueColorDither and renderXImage - * - * This handles the proper setting of the image data based on the image depth - * and the machine's byte ordering - */ -static inline -void assignPixelData(unsigned int bit_depth, unsigned char **data, - unsigned long pixel) { - unsigned char *pixel_data = *data; - switch (bit_depth) { - case 8: // 8bpp - *pixel_data++ = pixel; - break; - - case 16: // 16bpp LSB - *pixel_data++ = pixel; - *pixel_data++ = pixel >> 8; - break; - - case 17: // 16bpp MSB - *pixel_data++ = pixel >> 8; - *pixel_data++ = pixel; - break; - - case 24: // 24bpp LSB - *pixel_data++ = pixel; - *pixel_data++ = pixel >> 8; - *pixel_data++ = pixel >> 16; - break; - - case 25: // 24bpp MSB - *pixel_data++ = pixel >> 16; - *pixel_data++ = pixel >> 8; - *pixel_data++ = pixel; - break; - - case 32: // 32bpp LSB - *pixel_data++ = pixel; - *pixel_data++ = pixel >> 8; - *pixel_data++ = pixel >> 16; - *pixel_data++ = pixel >> 24; - break; +XImage *BImage::renderXImage(void) { + XImage *image = - XCreateImage(control->getBaseDisplay()->getXDisplay(), - control->getVisual(), control->getDepth(), ZPixmap, 0, 0, ++ XCreateImage(control.getBaseDisplay().getXDisplay(), ++ control.getVisual(), control.getDepth(), ZPixmap, 0, 0, + width, height, 32, 0); - case 33: // 32bpp MSB - *pixel_data++ = pixel >> 24; - *pixel_data++ = pixel >> 16; - *pixel_data++ = pixel >> 8; - *pixel_data++ = pixel; - break; + if (! image) { + fprintf(stderr, i18n->getMessage(ImageSet, ImageErrorCreatingXImage, + "BImage::renderXImage: error creating XImage\n")); + return (XImage *) 0; } - *data = pixel_data; // assign back so we don't lose our place -} + // insurance policy + image->data = (char *) 0; -// algorithm: ordered dithering... many many thanks to rasterman -// (raster@rasterman.com) for telling me about this... portions of this -// code is based off of his code in Imlib -void BImage::TrueColorDither(unsigned int bit_depth, int bytes_per_line, - unsigned char *pixel_data) { - unsigned int x, y, dithx, dithy, r, g, b, er, eg, eb, offset; - unsigned char *ppixel_data = pixel_data; + unsigned char *d = new unsigned char[image->bytes_per_line * (height + 1)]; + register unsigned int x, y, dithx, dithy, r, g, b, o, er, eg, eb, offset; + + unsigned char *pixel_data = d, *ppixel_data = d; unsigned long pixel; - for (y = 0, offset = 0; y < height; y++) { - dithy = y & 0x3; + o = image->bits_per_pixel + ((image->byte_order == MSBFirst) ? 1 : 0); + - if (control->doDither() && width > 1 && height > 1) { ++ if (control.doDither() && width > 1 && height > 1) { + unsigned char dither4[4][4] = { {0, 4, 1, 5}, + {6, 2, 7, 3}, + {1, 5, 0, 4}, + {7, 3, 6, 2} }; + +#ifdef ORDEREDPSEUDO + unsigned char dither8[8][8] = { { 0, 32, 8, 40, 2, 34, 10, 42 }, + { 48, 16, 56, 24, 50, 18, 58, 26 }, + { 12, 44, 4, 36, 14, 46, 6, 38 }, + { 60, 28, 52, 20, 62, 30, 54, 22 }, + { 3, 35, 11, 43, 1, 33, 9, 41 }, + { 51, 19, 59, 27, 49, 17, 57, 25 }, + { 15, 47, 7, 39, 13, 45, 5, 37 }, + { 63, 31, 55, 23, 61, 29, 53, 21 } }; +#endif // ORDEREDPSEUDO + - switch (control->getVisual()->c_class) { ++ switch (control.getVisual()->c_class) { + case TrueColor: + // algorithm: ordered dithering... many many thanks to rasterman + // (raster@rasterman.com) for telling me about this... portions of this + // code is based off of his code in Imlib + for (y = 0, offset = 0; y < height; y++) { + dithy = y & 0x3; - for (x = 0; x < width; x++, offset++) { - dithx = x & 0x3; - r = red[offset]; - g = green[offset]; - b = blue[offset]; + for (x = 0; x < width; x++, offset++) { + dithx = x & 0x3; + r = red[offset]; + g = green[offset]; + b = blue[offset]; - er = r & (red_bits - 1); - eg = g & (green_bits - 1); - eb = b & (blue_bits - 1); + er = r & (red_bits - 1); + eg = g & (green_bits - 1); + eb = b & (blue_bits - 1); - r = red_table[r]; - g = green_table[g]; - b = blue_table[b]; + r = red_table[r]; + g = green_table[g]; + b = blue_table[b]; - if ((dither4[dithy][dithx] < er) && (r < red_table[255])) r++; - if ((dither4[dithy][dithx] < eg) && (g < green_table[255])) g++; - if ((dither4[dithy][dithx] < eb) && (b < blue_table[255])) b++; + if ((dither4[dithy][dithx] < er) && (r < red_table[255])) r++; + if ((dither4[dithy][dithx] < eg) && (g < green_table[255])) g++; + if ((dither4[dithy][dithx] < eb) && (b < blue_table[255])) b++; - pixel = (r << red_offset) | (g << green_offset) | (b << blue_offset); - assignPixelData(bit_depth, &pixel_data, pixel); - } + pixel = (r << red_offset) | (g << green_offset) | (b << blue_offset); - pixel_data = (ppixel_data += bytes_per_line); - } -} + switch (o) { + case 8: // 8bpp + *pixel_data++ = pixel; + break; + + case 16: // 16bpp LSB + *pixel_data++ = pixel; + *pixel_data++ = pixel >> 8; + break; + + case 17: // 16bpp MSB + *pixel_data++ = pixel >> 8; + *pixel_data++ = pixel; + break; + + case 24: // 24bpp LSB + *pixel_data++ = pixel; + *pixel_data++ = pixel >> 8; + *pixel_data++ = pixel >> 16; + break; + + case 25: // 24bpp MSB + *pixel_data++ = pixel >> 16; + *pixel_data++ = pixel >> 8; + *pixel_data++ = pixel; + break; + + case 32: // 32bpp LSB + *pixel_data++ = pixel; + *pixel_data++ = pixel >> 8; + *pixel_data++ = pixel >> 16; + *pixel_data++ = pixel >> 24; + break; + + case 33: // 32bpp MSB + *pixel_data++ = pixel >> 24; + *pixel_data++ = pixel >> 16; + *pixel_data++ = pixel >> 8; + *pixel_data++ = pixel; + break; + } + } -#ifdef ORDEREDPSEUDO -const static unsigned char dither8[8][8] = { - { 0, 32, 8, 40, 2, 34, 10, 42}, - { 48, 16, 56, 24, 50, 18, 58, 26}, - { 12, 44, 4, 36, 14, 46, 6, 38}, - { 60, 28, 52, 20, 62, 30, 54, 22}, - { 3, 35, 11, 43, 1, 33, 9, 41}, - { 51, 19, 59, 27, 49, 17, 57, 25}, - { 15, 47, 7, 39, 13, 45, 5, 37}, - { 63, 31, 55, 23, 61, 29, 53, 21} -}; - -void BImage::OrderedPseudoColorDither(int bytes_per_line, - unsigned char *pixel_data) { - unsigned int x, y, dithx, dithy, r, g, b, er, eg, eb, offset; - unsigned long pixel; - unsigned char *ppixel_data = pixel_data; + pixel_data = (ppixel_data += image->bytes_per_line); + } - for (y = 0, offset = 0; y < height; y++) { - dithy = y & 7; + break; - for (x = 0; x < width; x++, offset++) { - dithx = x & 7; + case StaticColor: + case PseudoColor: { +#ifndef ORDEREDPSEUDO + short *terr, + *rerr = new short[width + 2], + *gerr = new short[width + 2], + *berr = new short[width + 2], + *nrerr = new short[width + 2], + *ngerr = new short[width + 2], + *nberr = new short[width + 2]; + int rr, gg, bb, rer, ger, ber; - int dd = 255 / control->getColorsPerChannel(); ++ int dd = 255 / control.getColorsPerChannel(); + + for (x = 0; x < width; x++) { + *(rerr + x) = *(red + x); + *(gerr + x) = *(green + x); + *(berr + x) = *(blue + x); + } - r = red[offset]; - g = green[offset]; - b = blue[offset]; + *(rerr + x) = *(gerr + x) = *(berr + x) = 0; +#endif // ORDEREDPSEUDO - er = r & (red_bits - 1); - eg = g & (green_bits - 1); - eb = b & (blue_bits - 1); + for (y = 0, offset = 0; y < height; y++) { +#ifdef ORDEREDPSEUDO + dithy = y & 7; - r = red_table[r]; - g = green_table[g]; - b = blue_table[b]; + for (x = 0; x < width; x++, offset++) { + dithx = x & 7; - if ((dither8[dithy][dithx] < er) && (r < red_table[255])) r++; - if ((dither8[dithy][dithx] < eg) && (g < green_table[255])) g++; - if ((dither8[dithy][dithx] < eb) && (b < blue_table[255])) b++; + r = red[offset]; + g = green[offset]; + b = blue[offset]; - pixel = (r * cpccpc) + (g * cpc) + b; - *(pixel_data++) = colors[pixel].pixel; - } + er = r & (red_bits - 1); + eg = g & (green_bits - 1); + eb = b & (blue_bits - 1); - pixel_data = (ppixel_data += bytes_per_line); - } -} -#endif + r = red_table[r]; + g = green_table[g]; + b = blue_table[b]; -void BImage::PseudoColorDither(int bytes_per_line, unsigned char *pixel_data) { - short *terr, - *rerr = new short[width + 2], - *gerr = new short[width + 2], - *berr = new short[width + 2], - *nrerr = new short[width + 2], - *ngerr = new short[width + 2], - *nberr = new short[width + 2]; - - int rr, gg, bb, rer, ger, ber; - int dd = 255 / control->getColorsPerChannel(); - unsigned int x, y, r, g, b, offset; - unsigned long pixel; - unsigned char *ppixel_data = pixel_data; + if ((dither8[dithy][dithx] < er) && (r < red_table[255])) r++; + if ((dither8[dithy][dithx] < eg) && (g < green_table[255])) g++; + if ((dither8[dithy][dithx] < eb) && (b < blue_table[255])) b++; - for (x = 0; x < width; x++) { - *(rerr + x) = *(red + x); - *(gerr + x) = *(green + x); - *(berr + x) = *(blue + x); - } + pixel = (r * cpccpc) + (g * cpc) + b; + *(pixel_data++) = colors[pixel].pixel; + } - *(rerr + x) = *(gerr + x) = *(berr + x) = 0; + pixel_data = (ppixel_data += image->bytes_per_line); + } +#else // !ORDEREDPSEUDO + if (y < (height - 1)) { + int i = offset + width; + for (x = 0; x < width; x++, i++) { + *(nrerr + x) = *(red + i); + *(ngerr + x) = *(green + i); + *(nberr + x) = *(blue + i); + } - for (y = 0, offset = 0; y < height; y++) { - if (y < (height - 1)) { - int i = offset + width; - for (x = 0; x < width; x++, i++) { - *(nrerr + x) = *(red + i); + *(nrerr + x) = *(red + (--i)); *(ngerr + x) = *(green + i); *(nberr + x) = *(blue + i); } @@@ -512,7 -485,12 +514,7 @@@ return (XImage *) 0; } } else { - register unsigned int x, y, r, g, b, offset; - - unsigned char *pixel_data = d, *ppixel_data = d; - unsigned long pixel; - -- switch (control->getVisual()->c_class) { ++ switch (control.getVisual()->c_class) { case StaticColor: case PseudoColor: for (y = 0, offset = 0; y < height; y++) { @@@ -620,29 -557,29 +622,29 @@@ Pixmap BImage::renderPixmap(void) { Pixmap pixmap = -- XCreatePixmap(control->getBaseDisplay()->getXDisplay(), -- control->getDrawable(), width, height, control->getDepth()); ++ XCreatePixmap(control.getBaseDisplay().getXDisplay(), ++ control.getDrawable(), width, height, control.getDepth()); if (pixmap == None) { - fprintf(stderr, i18n(ImageSet, ImageErrorCreatingPixmap, - "BImage::renderPixmap: error creating pixmap\n")); + fprintf(stderr, i18n->getMessage(ImageSet, ImageErrorCreatingPixmap, + "BImage::renderPixmap: error creating pixmap\n")); return None; } XImage *image = renderXImage(); if (! image) { -- XFreePixmap(control->getBaseDisplay()->getXDisplay(), pixmap); ++ XFreePixmap(control.getBaseDisplay().getXDisplay(), pixmap); return None; } else if (! image->data) { XDestroyImage(image); -- XFreePixmap(control->getBaseDisplay()->getXDisplay(), pixmap); ++ XFreePixmap(control.getBaseDisplay().getXDisplay(), pixmap); return None; } -- XPutImage(control->getBaseDisplay()->getXDisplay(), pixmap, -- DefaultGC(control->getBaseDisplay()->getXDisplay(), -- control->getScreenInfo()->getScreenNumber()), ++ XPutImage(control.getBaseDisplay().getXDisplay(), pixmap, ++ DefaultGC(control.getBaseDisplay().getXDisplay(), ++ control.getScreenInfo().getScreenNumber()), image, 0, 0, 0, 0, width, height); if (image->data) { @@@ -1478,15 -1379,13 +1480,15 @@@ void BImage::egradient(void) for (yt = ytable, y = 0; y < height; y++, yt += 3) { for (xt = xtable, x = 0; x < width; x++) { *(pr++) = (unsigned char) -- (tr - (rsign * control->getSqrt(*(xt++) + *(yt)))); ++ (tr - (rsign * control.getSqrt(*(xt++) + *(yt)))); *(pg++) = (unsigned char) -- (tg - (gsign * control->getSqrt(*(xt++) + *(yt + 1)))); ++ (tg - (gsign * control.getSqrt(*(xt++) + *(yt + 1)))); *(pb++) = (unsigned char) -- (tb - (bsign * control->getSqrt(*(xt++) + *(yt + 2)))); ++ (tb - (bsign * control.getSqrt(*(xt++) + *(yt + 2)))); } } + +#ifdef INTERLACE } else { // faked interlacing effect unsigned char channel, channel2; @@@ -1495,37 -1394,37 +1497,37 @@@ for (xt = xtable, x = 0; x < width; x++) { if (y & 1) { channel = (unsigned char) -- (tr - (rsign * control->getSqrt(*(xt++) + *(yt)))); ++ (tr - (rsign * control.getSqrt(*(xt++) + *(yt)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pr++) = channel2; channel = (unsigned char) -- (tg - (gsign * control->getSqrt(*(xt++) + *(yt + 1)))); ++ (tg - (gsign * control.getSqrt(*(xt++) + *(yt + 1)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pg++) = channel2; channel = (unsigned char) -- (tb - (bsign * control->getSqrt(*(xt++) + *(yt + 2)))); ++ (tb - (bsign * control.getSqrt(*(xt++) + *(yt + 2)))); channel2 = (channel >> 1) + (channel >> 2); if (channel2 > channel) channel2 = 0; *(pb++) = channel2; } else { channel = (unsigned char) -- (tr - (rsign * control->getSqrt(*(xt++) + *(yt)))); ++ (tr - (rsign * control.getSqrt(*(xt++) + *(yt)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pr++) = channel2; channel = (unsigned char) -- (tg - (gsign * control->getSqrt(*(xt++) + *(yt + 1)))); ++ (tg - (gsign * control.getSqrt(*(xt++) + *(yt + 1)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pg++) = channel2; channel = (unsigned char) -- (tb - (bsign * control->getSqrt(*(xt++) + *(yt + 2)))); ++ (tb - (bsign * control.getSqrt(*(xt++) + *(yt + 2)))); channel2 = channel + (channel >> 3); if (channel2 < channel) channel2 = ~0; *(pb++) = channel2; @@@ -1758,687 -1645,4 +1760,686 @@@ void BImage::cdgradient(void) } } } +#endif // INTERLACE +} + + - BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, ++BImageControl::BImageControl(BaseDisplay &dpy, ScreenInfo &scrn, Bool _dither, + int _cpc, unsigned long cache_timeout, - unsigned long cmax) ++ unsigned long cmax) : basedisplay(dpy), ++ screeninfo(scrn) +{ - basedisplay = dpy; - screeninfo = scrn; + setDither(_dither); + setColorsPerChannel(_cpc); + + cache_max = cmax; +#ifdef TIMEDCACHE + if (cache_timeout) { - timer = new BTimer(basedisplay, this); ++ timer = new BTimer(basedisplay, *this); + timer->setTimeout(cache_timeout); + timer->start(); + } else + timer = (BTimer *) 0; +#endif // TIMEDCACHE + + colors = (XColor *) 0; + ncolors = 0; + + grad_xbuffer = grad_ybuffer = (unsigned int *) 0; + grad_buffer_width = grad_buffer_height = 0; + + sqrt_table = (unsigned long *) 0; + - screen_depth = screeninfo->getDepth(); - window = screeninfo->getRootWindow(); - screen_number = screeninfo->getScreenNumber(); ++ screen_depth = screeninfo.getDepth(); ++ window = screeninfo.getRootWindow(); ++ screen_number = screeninfo.getScreenNumber(); + + int count; - XPixmapFormatValues *pmv = XListPixmapFormats(basedisplay->getXDisplay(), ++ XPixmapFormatValues *pmv = XListPixmapFormats(basedisplay.getXDisplay(), + &count); - colormap = screeninfo->getColormap(); ++ colormap = screeninfo.getColormap(); + + if (pmv) { + bits_per_pixel = 0; + for (int i = 0; i < count; i++) + if (pmv[i].depth == screen_depth) { + bits_per_pixel = pmv[i].bits_per_pixel; + break; + } + + XFree(pmv); + } + + if (bits_per_pixel == 0) bits_per_pixel = screen_depth; + if (bits_per_pixel >= 24) setDither(False); + + red_offset = green_offset = blue_offset = 0; + + switch (getVisual()->c_class) { + case TrueColor: + { + int i; + + // compute color tables + unsigned long red_mask = getVisual()->red_mask, + green_mask = getVisual()->green_mask, + blue_mask = getVisual()->blue_mask; + + while (! (red_mask & 1)) { red_offset++; red_mask >>= 1; } + while (! (green_mask & 1)) { green_offset++; green_mask >>= 1; } + while (! (blue_mask & 1)) { blue_offset++; blue_mask >>= 1; } + + red_bits = 255 / red_mask; + green_bits = 255 / green_mask; + blue_bits = 255 / blue_mask; + + for (i = 0; i < 256; i++) { + red_color_table[i] = i / red_bits; + green_color_table[i] = i / green_bits; + blue_color_table[i] = i / blue_bits; + } + } + + break; + + case PseudoColor: + case StaticColor: + { + ncolors = colors_per_channel * colors_per_channel * colors_per_channel; + + if (ncolors > (1 << screen_depth)) { + colors_per_channel = (1 << screen_depth) / 3; + ncolors = colors_per_channel * colors_per_channel * colors_per_channel; + } + + if (colors_per_channel < 2 || ncolors > (1 << screen_depth)) { + fprintf(stderr, i18n->getMessage(ImageSet, ImageInvalidColormapSize, + "BImageControl::BImageControl: invalid colormap size %d " + "(%d/%d/%d) - reducing"), + ncolors, colors_per_channel, colors_per_channel, + colors_per_channel); + + colors_per_channel = (1 << screen_depth) / 3; + } + + colors = new XColor[ncolors]; + if (! colors) { + fprintf(stderr, i18n->getMessage(ImageSet, + ImageErrorAllocatingColormap, + "BImageControl::BImageControl: error allocating " + "colormap\n")); + exit(1); + } + + int i = 0, ii, p, r, g, b, + +#ifdef ORDEREDPSEUDO + bits = 256 / colors_per_channel; +#else // !ORDEREDPSEUDO + bits = 255 / (colors_per_channel - 1); +#endif // ORDEREDPSEUDO + + red_bits = green_bits = blue_bits = bits; + + for (i = 0; i < 256; i++) + red_color_table[i] = green_color_table[i] = blue_color_table[i] = + i / bits; + + for (r = 0, i = 0; r < colors_per_channel; r++) + for (g = 0; g < colors_per_channel; g++) + for (b = 0; b < colors_per_channel; b++, i++) { + colors[i].red = (r * 0xffff) / (colors_per_channel - 1); + colors[i].green = (g * 0xffff) / (colors_per_channel - 1); + colors[i].blue = (b * 0xffff) / (colors_per_channel - 1);; + colors[i].flags = DoRed|DoGreen|DoBlue; + } + - basedisplay->grab(); ++ basedisplay.grab(); + + for (i = 0; i < ncolors; i++) - if (! XAllocColor(basedisplay->getXDisplay(), colormap, &colors[i])) { ++ if (! XAllocColor(basedisplay.getXDisplay(), colormap, &colors[i])) { + fprintf(stderr, i18n->getMessage(ImageSet, ImageColorAllocFail, + "couldn't alloc color %i %i %i\n"), + colors[i].red, colors[i].green, colors[i].blue); + colors[i].flags = 0; + } else + colors[i].flags = DoRed|DoGreen|DoBlue; + - basedisplay->ungrab(); ++ basedisplay.ungrab(); + + XColor icolors[256]; + int incolors = (((1 << screen_depth) > 256) ? 256 : (1 << screen_depth)); + + for (i = 0; i < incolors; i++) + icolors[i].pixel = i; + - XQueryColors(basedisplay->getXDisplay(), colormap, icolors, incolors); ++ XQueryColors(basedisplay.getXDisplay(), colormap, icolors, incolors); + for (i = 0; i < ncolors; i++) { + if (! colors[i].flags) { + unsigned long chk = 0xffffffff, pixel, close = 0; + + p = 2; + while (p--) { + for (ii = 0; ii < incolors; ii++) { + r = (colors[i].red - icolors[i].red) >> 8; + g = (colors[i].green - icolors[i].green) >> 8; + b = (colors[i].blue - icolors[i].blue) >> 8; + pixel = (r * r) + (g * g) + (b * b); + + if (pixel < chk) { + chk = pixel; + close = ii; + } + + colors[i].red = icolors[close].red; + colors[i].green = icolors[close].green; + colors[i].blue = icolors[close].blue; + - if (XAllocColor(basedisplay->getXDisplay(), colormap, ++ if (XAllocColor(basedisplay.getXDisplay(), colormap, + &colors[i])) { + colors[i].flags = DoRed|DoGreen|DoBlue; + break; + } + } + } + } + } + + break; + } + + case GrayScale: + case StaticGray: + { + + if (getVisual()->c_class == StaticGray) { + ncolors = 1 << screen_depth; + } else { + ncolors = colors_per_channel * colors_per_channel * colors_per_channel; + + if (ncolors > (1 << screen_depth)) { + colors_per_channel = (1 << screen_depth) / 3; + ncolors = + colors_per_channel * colors_per_channel * colors_per_channel; + } + } + + if (colors_per_channel < 2 || ncolors > (1 << screen_depth)) { + fprintf(stderr, i18n->getMessage(ImageSet, ImageInvalidColormapSize, + "BImageControl::BImageControl: invalid colormap size %d " + "(%d/%d/%d) - reducing"), + ncolors, colors_per_channel, colors_per_channel, + colors_per_channel); + + colors_per_channel = (1 << screen_depth) / 3; + } + + colors = new XColor[ncolors]; + if (! colors) { + fprintf(stderr, i18n->getMessage(ImageSet, + ImageErrorAllocatingColormap, + "BImageControl::BImageControl: error allocating " + "colormap\n")); + exit(1); + } + + int i = 0, ii, p, bits = 255 / (colors_per_channel - 1); + red_bits = green_bits = blue_bits = bits; + + for (i = 0; i < 256; i++) + red_color_table[i] = green_color_table[i] = blue_color_table[i] = + i / bits; + - basedisplay->grab(); ++ basedisplay.grab(); + for (i = 0; i < ncolors; i++) { + colors[i].red = (i * 0xffff) / (colors_per_channel - 1); + colors[i].green = (i * 0xffff) / (colors_per_channel - 1); + colors[i].blue = (i * 0xffff) / (colors_per_channel - 1);; + colors[i].flags = DoRed|DoGreen|DoBlue; + - if (! XAllocColor(basedisplay->getXDisplay(), colormap, ++ if (! XAllocColor(basedisplay.getXDisplay(), colormap, + &colors[i])) { + fprintf(stderr, i18n->getMessage(ImageSet, ImageColorAllocFail, + "couldn't alloc color %i %i %i\n"), + colors[i].red, colors[i].green, colors[i].blue); + colors[i].flags = 0; + } else + colors[i].flags = DoRed|DoGreen|DoBlue; + } + - basedisplay->ungrab(); ++ basedisplay.ungrab(); + + XColor icolors[256]; + int incolors = (((1 << screen_depth) > 256) ? 256 : + (1 << screen_depth)); + + for (i = 0; i < incolors; i++) + icolors[i].pixel = i; + - XQueryColors(basedisplay->getXDisplay(), colormap, icolors, incolors); ++ XQueryColors(basedisplay.getXDisplay(), colormap, icolors, incolors); + for (i = 0; i < ncolors; i++) { + if (! colors[i].flags) { + unsigned long chk = 0xffffffff, pixel, close = 0; + + p = 2; + while (p--) { + for (ii = 0; ii < incolors; ii++) { + int r = (colors[i].red - icolors[i].red) >> 8; + int g = (colors[i].green - icolors[i].green) >> 8; + int b = (colors[i].blue - icolors[i].blue) >> 8; + pixel = (r * r) + (g * g) + (b * b); + + if (pixel < chk) { + chk = pixel; + close = ii; + } + + colors[i].red = icolors[close].red; + colors[i].green = icolors[close].green; + colors[i].blue = icolors[close].blue; + - if (XAllocColor(basedisplay->getXDisplay(), colormap, ++ if (XAllocColor(basedisplay.getXDisplay(), colormap, + &colors[i])) { + colors[i].flags = DoRed|DoGreen|DoBlue; + break; + } + } + } + } + } + + break; + } + + default: + fprintf(stderr, i18n->getMessage(ImageSet, ImageUnsupVisual, + "BImageControl::BImageControl: unsupported visual %d\n"), + getVisual()->c_class); + exit(1); + } - - cache = new LinkedList; +} + + +BImageControl::~BImageControl(void) { + if (sqrt_table) { + delete [] sqrt_table; + } + + if (grad_xbuffer) { + delete [] grad_xbuffer; + } + + if (grad_ybuffer) { + delete [] grad_ybuffer; + } + + if (colors) { + unsigned long *pixels = new unsigned long [ncolors]; + + int i; + for (i = 0; i < ncolors; i++) + *(pixels + i) = (*(colors + i)).pixel; + - XFreeColors(basedisplay->getXDisplay(), colormap, pixels, ncolors, 0); ++ XFreeColors(basedisplay.getXDisplay(), colormap, pixels, ncolors, 0); + + delete [] colors; + } + - if (cache->count()) { - int i, n = cache->count(); ++ if (!cache.empty()) { ++ int i, n = cache.size(); + fprintf(stderr, i18n->getMessage(ImageSet, ImagePixmapRelease, + "BImageContol::~BImageControl: pixmap cache - " + "releasing %d pixmaps\n"), n); + + for (i = 0; i < n; i++) { - Cache *tmp = cache->first(); - XFreePixmap(basedisplay->getXDisplay(), tmp->pixmap); - cache->remove(tmp); ++ Cache *tmp = cache.front(); ++ XFreePixmap(basedisplay.getXDisplay(), tmp->pixmap); ++ cache.remove(tmp); + delete tmp; + } + +#ifdef TIMEDCACHE + if (timer) { + timer->stop(); + delete timer; + } +#endif // TIMEDCACHE + } - - delete cache; +} + + +Pixmap BImageControl::searchCache(unsigned int width, unsigned int height, + unsigned long texture, + BColor *c1, BColor *c2) { - if (cache->count()) { - LinkedListIterator it(cache); ++ if (!cache.empty()) { + - for (Cache *tmp = it.current(); tmp; it++, tmp = it.current()) { ++ CacheList::iterator it; ++ for (it = cache.begin(); it != cache.end(); ++it) { ++ Cache *tmp = *it; + if ((tmp->width == width) && (tmp->height == height) && + (tmp->texture == texture) && (tmp->pixel1 == c1->getPixel())) - if (texture & BImage_Gradient) { - if (tmp->pixel2 == c2->getPixel()) { - tmp->count++; - return tmp->pixmap; - } - } else { ++ if (texture & BImage_Gradient) { ++ if (tmp->pixel2 == c2->getPixel()) { + tmp->count++; + return tmp->pixmap; + } ++ } else { ++ tmp->count++; ++ return tmp->pixmap; + } ++ } + } + + return None; +} + + +Pixmap BImageControl::renderImage(unsigned int width, unsigned int height, + BTexture *texture) { + if (texture->getTexture() & BImage_ParentRelative) return ParentRelative; + + Pixmap pixmap = searchCache(width, height, texture->getTexture(), + texture->getColor(), texture->getColorTo()); + if (pixmap) return pixmap; + - BImage image(this, width, height); ++ BImage image(*this, width, height); + pixmap = image.render(texture); + + if (pixmap) { + Cache *tmp = new Cache; + + tmp->pixmap = pixmap; + tmp->width = width; + tmp->height = height; + tmp->count = 1; + tmp->texture = texture->getTexture(); + tmp->pixel1 = texture->getColor()->getPixel(); + + if (texture->getTexture() & BImage_Gradient) + tmp->pixel2 = texture->getColorTo()->getPixel(); + else + tmp->pixel2 = 0l; + - cache->insert(tmp); ++ cache.push_back(tmp); + - if ((unsigned) cache->count() > cache_max) { ++ if ((unsigned) cache.size() > cache_max) { +#ifdef DEBUG + fprintf(stderr, i18n->getMessage(ImageSet, ImagePixmapCacheLarge, + "BImageControl::renderImage: cache is large, " + "forcing cleanout\n")); +#endif // DEBUG + + timeout(); + } + + return pixmap; + } + + return None; +} + + +void BImageControl::removeImage(Pixmap pixmap) { + if (pixmap) { - LinkedListIterator it(cache); - for (Cache *tmp = it.current(); tmp; it++, tmp = it.current()) { ++ CacheList::iterator it; ++ for (it = cache.begin(); it != cache.end(); ++it) { ++ Cache *tmp = *it; + if (tmp->pixmap == pixmap) { + if (tmp->count) { + tmp->count--; + +#ifdef TIMEDCACHE + if (! timer) timeout(); +#else // !TIMEDCACHE + if (! tmp->count) timeout(); +#endif // TIMEDCACHE + } + + return; + } + } + } +} + + +unsigned long BImageControl::getColor(const char *colorname, + unsigned char *r, unsigned char *g, + unsigned char *b) +{ + XColor color; + color.pixel = 0; + - if (! XParseColor(basedisplay->getXDisplay(), colormap, colorname, &color)) ++ if (! XParseColor(basedisplay.getXDisplay(), colormap, colorname, &color)) + fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", + colorname); - else if (! XAllocColor(basedisplay->getXDisplay(), colormap, &color)) ++ else if (! XAllocColor(basedisplay.getXDisplay(), colormap, &color)) + fprintf(stderr, "BImageControl::getColor: color alloc error: \"%s\"\n", + colorname); + + if (color.red == 65535) *r = 0xff; + else *r = (unsigned char) (color.red / 0xff); + if (color.green == 65535) *g = 0xff; + else *g = (unsigned char) (color.green / 0xff); + if (color.blue == 65535) *b = 0xff; + else *b = (unsigned char) (color.blue / 0xff); + + return color.pixel; +} + + +unsigned long BImageControl::getColor(const char *colorname) { + XColor color; + color.pixel = 0; + - if (! XParseColor(basedisplay->getXDisplay(), colormap, colorname, &color)) ++ if (! XParseColor(basedisplay.getXDisplay(), colormap, colorname, &color)) + fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", + colorname); - else if (! XAllocColor(basedisplay->getXDisplay(), colormap, &color)) ++ else if (! XAllocColor(basedisplay.getXDisplay(), colormap, &color)) + fprintf(stderr, "BImageControl::getColor: color alloc error: \"%s\"\n", + colorname); + + return color.pixel; +} + + +void BImageControl::getColorTables(unsigned char **rmt, unsigned char **gmt, + unsigned char **bmt, + int *roff, int *goff, int *boff, + int *rbit, int *gbit, int *bbit) { + if (rmt) *rmt = red_color_table; + if (gmt) *gmt = green_color_table; + if (bmt) *bmt = blue_color_table; + + if (roff) *roff = red_offset; + if (goff) *goff = green_offset; + if (boff) *boff = blue_offset; + + if (rbit) *rbit = red_bits; + if (gbit) *gbit = green_bits; + if (bbit) *bbit = blue_bits; +} + + +void BImageControl::getXColorTable(XColor **c, int *n) { + if (c) *c = colors; + if (n) *n = ncolors; +} + + +void BImageControl::getGradientBuffers(unsigned int w, + unsigned int h, + unsigned int **xbuf, + unsigned int **ybuf) +{ + if (w > grad_buffer_width) { + if (grad_xbuffer) { + delete [] grad_xbuffer; + } + + grad_buffer_width = w; + + grad_xbuffer = new unsigned int[grad_buffer_width * 3]; + } + + if (h > grad_buffer_height) { + if (grad_ybuffer) { + delete [] grad_ybuffer; + } + + grad_buffer_height = h; + + grad_ybuffer = new unsigned int[grad_buffer_height * 3]; + } + + *xbuf = grad_xbuffer; + *ybuf = grad_ybuffer; +} + + +void BImageControl::installRootColormap(void) { - basedisplay->grab(); ++ basedisplay.grab(); + + Bool install = True; + int i = 0, ncmap = 0; + Colormap *cmaps = - XListInstalledColormaps(basedisplay->getXDisplay(), window, &ncmap); ++ XListInstalledColormaps(basedisplay.getXDisplay(), window, &ncmap); + + if (cmaps) { + for (i = 0; i < ncmap; i++) + if (*(cmaps + i) == colormap) + install = False; + + if (install) - XInstallColormap(basedisplay->getXDisplay(), colormap); ++ XInstallColormap(basedisplay.getXDisplay(), colormap); + + XFree(cmaps); + } + - basedisplay->ungrab(); ++ basedisplay.ungrab(); +} + + +void BImageControl::setColorsPerChannel(int cpc) { + if (cpc < 2) cpc = 2; + if (cpc > 6) cpc = 6; + + colors_per_channel = cpc; +} + + +unsigned long BImageControl::getSqrt(unsigned int x) { + if (! sqrt_table) { + // build sqrt table for use with elliptic gradient + + sqrt_table = new unsigned long[(256 * 256 * 2) + 1]; + int i = 0; + + for (; i < (256 * 256 * 2); i++) + *(sqrt_table + i) = bsqrt(i); + } + + return (*(sqrt_table + x)); +} + + - void BImageControl::parseTexture(BTexture *texture, char *t) { ++void BImageControl::parseTexture(BTexture *texture, const char *t) { + if ((! texture) || (! t)) return; + + int t_len = strlen(t) + 1, i; + char *ts = new char[t_len]; + if (! ts) return; + + // convert to lower case + for (i = 0; i < t_len; i++) + *(ts + i) = tolower(*(t + i)); + + if (strstr(ts, "parentrelative")) { + texture->setTexture(BImage_ParentRelative); + } else { + texture->setTexture(0); + + if (strstr(ts, "solid")) + texture->addTexture(BImage_Solid); + else if (strstr(ts, "gradient")) { + texture->addTexture(BImage_Gradient); + if (strstr(ts, "crossdiagonal")) + texture->addTexture(BImage_CrossDiagonal); + else if (strstr(ts, "rectangle")) + texture->addTexture(BImage_Rectangle); + else if (strstr(ts, "pyramid")) + texture->addTexture(BImage_Pyramid); + else if (strstr(ts, "pipecross")) + texture->addTexture(BImage_PipeCross); + else if (strstr(ts, "elliptic")) + texture->addTexture(BImage_Elliptic); + else if (strstr(ts, "diagonal")) + texture->addTexture(BImage_Diagonal); + else if (strstr(ts, "horizontal")) + texture->addTexture(BImage_Horizontal); + else if (strstr(ts, "vertical")) + texture->addTexture(BImage_Vertical); + else + texture->addTexture(BImage_Diagonal); + } else + texture->addTexture(BImage_Solid); + + if (strstr(ts, "raised")) + texture->addTexture(BImage_Raised); + else if (strstr(ts, "sunken")) + texture->addTexture(BImage_Sunken); + else if (strstr(ts, "flat")) + texture->addTexture(BImage_Flat); + else + texture->addTexture(BImage_Raised); + + if (! (texture->getTexture() & BImage_Flat)) + if (strstr(ts, "bevel2")) + texture->addTexture(BImage_Bevel2); + else + texture->addTexture(BImage_Bevel1); + +#ifdef INTERLACE + if (strstr(ts, "interlaced")) + texture->addTexture(BImage_Interlaced); +#endif // INTERLACE + } + + delete [] ts; +} + + - void BImageControl::parseColor(BColor *color, char *c) { ++void BImageControl::parseColor(BColor *color, const char *c) { + if (! color) return; + + if (color->isAllocated()) { + unsigned long pixel = color->getPixel(); + - XFreeColors(basedisplay->getXDisplay(), colormap, &pixel, 1, 0); ++ XFreeColors(basedisplay.getXDisplay(), colormap, &pixel, 1, 0); + + color->setPixel(0l); + color->setRGB(0, 0, 0); + color->setAllocated(False); + } + + if (c) { + unsigned char r, g, b; + + color->setPixel(getColor(c, &r, &g, &b)); + color->setRGB(r, g, b); + color->setAllocated(True); + } +} + + +void BImageControl::timeout(void) { - LinkedListIterator it(cache); - for (Cache *tmp = it.current(); tmp; it++, tmp = it.current()) { ++ CacheList::iterator it; ++ for (it = cache.begin(); it != cache.end(); ) { ++ Cache *tmp = *it; ++ ++it; // move on to the next item before this one is removed + if (tmp->count <= 0) { - XFreePixmap(basedisplay->getXDisplay(), tmp->pixmap); - cache->remove(tmp); ++ XFreePixmap(basedisplay.getXDisplay(), tmp->pixmap); ++ cache.remove(tmp); + delete tmp; - } ++ } + } } diff --cc src/Image.h index 249f2672,00000000..e342128b mode 100644,000000..100644 --- a/src/Image.h +++ b/src/Image.h @@@ -1,241 -1,0 +1,242 @@@ +// Image.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Image_hh +#define __Image_hh + +#include +#include + - #include "LinkedList.h" +#include "Timer.h" ++#include + +class ScreenInfo; +class BImage; +class BImageControl; + + +// bevel options +#define BImage_Flat (1l<<1) +#define BImage_Sunken (1l<<2) +#define BImage_Raised (1l<<3) + +// textures +#define BImage_Solid (1l<<4) +#define BImage_Gradient (1l<<5) + +// gradients +#define BImage_Horizontal (1l<<6) +#define BImage_Vertical (1l<<7) +#define BImage_Diagonal (1l<<8) +#define BImage_CrossDiagonal (1l<<9) +#define BImage_Rectangle (1l<<10) +#define BImage_Pyramid (1l<<11) +#define BImage_PipeCross (1l<<12) +#define BImage_Elliptic (1l<<13) + +// bevel types +#define BImage_Bevel1 (1l<<14) +#define BImage_Bevel2 (1l<<15) + +// inverted image +#define BImage_Invert (1l<<16) + +// parent relative image +#define BImage_ParentRelative (1l<<17) + +#ifdef INTERLACE +// fake interlaced image +# define BImage_Interlaced (1l<<18) +#endif // INTERLACE + +class BColor { +private: + int allocated; + unsigned char red, green, blue; + unsigned long pixel; + +public: + BColor(char r = 0, char g = 0, char b = 0) + { red = r; green = g; blue = b; pixel = 0; allocated = 0; } + + inline const int &isAllocated(void) const { return allocated; } + + inline const unsigned char &getRed(void) const { return red; } + inline const unsigned char &getGreen(void) const { return green; } + inline const unsigned char &getBlue(void) const { return blue; } + + inline const unsigned long &getPixel(void) const { return pixel; } + + inline void setAllocated(int a) { allocated = a; } + inline void setRGB(char r, char g, char b) { red = r; green = g; blue = b; } + inline void setPixel(unsigned long p) { pixel = p; } +}; + + +class BTexture { +private: + BColor color, colorTo, hiColor, loColor; + unsigned long texture; + +public: + BTexture(void) { texture = 0; } + + inline BColor *getColor(void) { return &color; } + inline BColor *getColorTo(void) { return &colorTo; } + inline BColor *getHiColor(void) { return &hiColor; } + inline BColor *getLoColor(void) { return &loColor; } + + inline const unsigned long &getTexture(void) const { return texture; } + + inline void setTexture(unsigned long t) { texture = t; } + inline void addTexture(unsigned long t) { texture |= t; } +}; + + +class BImage { +private: - BImageControl *control; ++ BImageControl &control; + +#ifdef INTERLACE + Bool interlaced; +#endif // INTERLACE + + XColor *colors; + + BColor *from, *to; + int red_offset, green_offset, blue_offset, red_bits, green_bits, blue_bits, + ncolors, cpc, cpccpc; + unsigned char *red, *green, *blue, *red_table, *green_table, *blue_table; + unsigned int width, height, *xtable, *ytable; + + +protected: + Pixmap renderPixmap(void); + + XImage *renderXImage(void); + + void invert(void); + void bevel1(void); + void bevel2(void); + void dgradient(void); + void egradient(void); + void hgradient(void); + void pgradient(void); + void rgradient(void); + void vgradient(void); + void cdgradient(void); + void pcgradient(void); + + +public: - BImage(BImageControl *, unsigned int, unsigned int); ++ BImage(BImageControl &, unsigned int, unsigned int); + ~BImage(void); + + Pixmap render(BTexture *); + Pixmap render_solid(BTexture *); + Pixmap render_gradient(BTexture *); +}; + + +class BImageControl : public TimeoutHandler { +private: + Bool dither; - BaseDisplay *basedisplay; - ScreenInfo *screeninfo; ++ BaseDisplay &basedisplay; ++ ScreenInfo &screeninfo; +#ifdef TIMEDCACHE + BTimer *timer; +#endif // TIMEDCACHE + + Colormap colormap; + + Window window; + XColor *colors; + int colors_per_channel, ncolors, screen_number, screen_depth, + bits_per_pixel, red_offset, green_offset, blue_offset, + red_bits, green_bits, blue_bits; + unsigned char red_color_table[256], green_color_table[256], + blue_color_table[256]; + unsigned int *grad_xbuffer, *grad_ybuffer, grad_buffer_width, + grad_buffer_height; + unsigned long *sqrt_table, cache_max; + + typedef struct Cache { + Pixmap pixmap; + + unsigned int count, width, height; + unsigned long pixel1, pixel2, texture; + } Cache; + - LinkedList *cache; ++ typedef std::list CacheList; ++ CacheList cache; + + +protected: + Pixmap searchCache(unsigned int, unsigned int, unsigned long, BColor *, + BColor *); + + +public: - BImageControl(BaseDisplay *, ScreenInfo *, Bool = False, int = 4, ++ BImageControl(BaseDisplay &, ScreenInfo &, Bool = False, int = 4, + unsigned long = 300000l, unsigned long = 200l); + virtual ~BImageControl(void); + - inline BaseDisplay *getBaseDisplay(void) { return basedisplay; } ++ inline BaseDisplay &getBaseDisplay(void) { return basedisplay; } + + inline const Bool &doDither(void) { return dither; } + - inline ScreenInfo *getScreenInfo(void) { return screeninfo; } ++ inline ScreenInfo &getScreenInfo(void) { return screeninfo; } + + inline const Window &getDrawable(void) const { return window; } + - inline Visual *getVisual(void) { return screeninfo->getVisual(); } ++ inline Visual *getVisual(void) const { return screeninfo.getVisual(); } + + inline const int &getBitsPerPixel(void) const { return bits_per_pixel; } + inline const int &getDepth(void) const { return screen_depth; } + inline const int &getColorsPerChannel(void) const + { return colors_per_channel; } + + unsigned long getColor(const char *); + unsigned long getColor(const char *, unsigned char *, unsigned char *, + unsigned char *); + unsigned long getSqrt(unsigned int); + + Pixmap renderImage(unsigned int, unsigned int, BTexture *); + + void installRootColormap(void); + void removeImage(Pixmap); + void getColorTables(unsigned char **, unsigned char **, unsigned char **, + int *, int *, int *, int *, int *, int *); + void getXColorTable(XColor **, int *); + void getGradientBuffers(unsigned int, unsigned int, + unsigned int **, unsigned int **); + void setDither(Bool d) { dither = d; } + void setColorsPerChannel(int); - void parseTexture(BTexture *, char *); - void parseColor(BColor *, char * = 0); ++ void parseTexture(BTexture *, const char *); ++ void parseColor(BColor *, const char * = 0); + + virtual void timeout(void); +}; + + +#endif // __Image_hh + diff --cc src/Makefile.am index f5b0b09e,b17abdc6..980acc6e --- a/src/Makefile.am +++ b/src/Makefile.am @@@ -30,7 -29,7 +30,7 @@@ CPPFLAGS= @CPPFLAGS@ @SHAPE@ @SLIT@ @IN bin_PROGRAMS= openbox - openbox_SOURCES= BaseDisplay.cc Basemenu.cc Clientmenu.cc Configmenu.cc Iconmenu.cc Image.cc LinkedList.cc Netizen.cc Rootmenu.cc Screen.cc Slit.cc Timer.cc Toolbar.cc Window.cc Windowmenu.cc Workspace.cc Workspacemenu.cc openbox.cc bsd-snprintf.c i18n.cc main.cc -openbox_SOURCES= BaseDisplay.cc Basemenu.cc Clientmenu.cc Color.cc Configmenu.cc Configuration.cc GCCache.cc Iconmenu.cc Image.cc ImageControl.cc Netizen.cc Rootmenu.cc Screen.cc Slit.cc Texture.cc Timer.cc Toolbar.cc Util.cc Window.cc Windowmenu.cc Workspace.cc Workspacemenu.cc XAtom.cc blackbox.cc i18n.cc main.cc ++openbox_SOURCES= BaseDisplay.cc Basemenu.cc Clientmenu.cc Configmenu.cc Geometry.cc Iconmenu.cc Image.cc Netizen.cc Resource.cc Rootmenu.cc Screen.cc Slit.cc Timer.cc Toolbar.cc Window.cc Windowmenu.cc Workspace.cc Workspacemenu.cc openbox.cc bsd-snprintf.c i18n.cc main.cc MAINTAINERCLEANFILES= Makefile.in @@@ -39,70 -38,86 +39,73 @@@ distclean-local # local dependencies - BaseDisplay.o: BaseDisplay.cc i18n.h BaseDisplay.h LinkedList.h \ -BaseDisplay.o: BaseDisplay.cc i18n.hh ../nls/blackbox-nls.hh \ - BaseDisplay.hh Timer.hh Util.hh GCCache.hh Color.hh -Basemenu.o: Basemenu.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Basemenu.hh GCCache.hh \ - Color.hh Image.hh Screen.hh Texture.hh Configmenu.hh Iconmenu.hh \ - Netizen.hh Rootmenu.hh Workspace.hh Workspacemenu.hh -Clientmenu.o: Clientmenu.cc blackbox.hh i18n.hh ../nls/blackbox-nls.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Clientmenu.hh \ - Basemenu.hh Screen.hh Color.hh Texture.hh Image.hh Configmenu.hh \ - Iconmenu.hh Netizen.hh Rootmenu.hh Workspace.hh Workspacemenu.hh \ - Window.hh Windowmenu.hh -Color.o: Color.cc Color.hh BaseDisplay.hh Timer.hh Util.hh -Configmenu.o: Configmenu.cc i18n.hh ../nls/blackbox-nls.hh Configmenu.hh \ - Basemenu.hh Image.hh Timer.hh BaseDisplay.hh Util.hh Color.hh \ - Toolbar.hh Screen.hh Texture.hh Iconmenu.hh Netizen.hh Rootmenu.hh \ - Workspace.hh Workspacemenu.hh blackbox.hh Configuration.hh Window.hh \ - Windowmenu.hh -Configuration.o: Configuration.cc ../config.h Configuration.hh Util.hh -GCCache.o: GCCache.cc GCCache.hh BaseDisplay.hh Timer.hh Util.hh Color.hh -Iconmenu.o: Iconmenu.cc i18n.hh ../nls/blackbox-nls.hh Iconmenu.hh \ - Basemenu.hh Screen.hh Color.hh Texture.hh Util.hh Image.hh Timer.hh \ - BaseDisplay.hh Configmenu.hh Netizen.hh Rootmenu.hh Workspace.hh \ - Workspacemenu.hh blackbox.hh Configuration.hh Window.hh Windowmenu.hh -Image.o: Image.cc blackbox.hh i18n.hh ../nls/blackbox-nls.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh GCCache.hh Color.hh \ - Image.hh Texture.hh -ImageControl.o: ImageControl.cc blackbox.hh i18n.hh \ - ../nls/blackbox-nls.hh BaseDisplay.hh Timer.hh Util.hh Configuration.hh \ - Color.hh Image.hh Texture.hh -Netizen.o: Netizen.cc Netizen.hh Screen.hh Color.hh Texture.hh Util.hh \ - Image.hh Timer.hh BaseDisplay.hh Configmenu.hh Basemenu.hh Iconmenu.hh \ - Rootmenu.hh Workspace.hh Workspacemenu.hh blackbox.hh i18n.hh \ - ../nls/blackbox-nls.hh Configuration.hh -Rootmenu.o: Rootmenu.cc blackbox.hh i18n.hh ../nls/blackbox-nls.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Rootmenu.hh \ - Basemenu.hh Screen.hh Color.hh Texture.hh Image.hh Configmenu.hh \ - Iconmenu.hh Netizen.hh Workspace.hh Workspacemenu.hh -Screen.o: Screen.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Clientmenu.hh \ - Basemenu.hh GCCache.hh Color.hh Iconmenu.hh Image.hh Screen.hh \ - Texture.hh Configmenu.hh Netizen.hh Rootmenu.hh Workspace.hh \ - Workspacemenu.hh Slit.hh Toolbar.hh Window.hh Windowmenu.hh -Slit.o: Slit.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh BaseDisplay.hh \ - Timer.hh Util.hh Configuration.hh Image.hh Color.hh Screen.hh \ - Texture.hh Configmenu.hh Basemenu.hh Iconmenu.hh Netizen.hh Rootmenu.hh \ - Workspace.hh Workspacemenu.hh Slit.hh Toolbar.hh -Texture.o: Texture.cc Texture.hh Color.hh Util.hh BaseDisplay.hh Timer.hh \ - Image.hh Screen.hh Configmenu.hh Basemenu.hh Iconmenu.hh Netizen.hh \ - Rootmenu.hh Workspace.hh Workspacemenu.hh blackbox.hh i18n.hh \ - ../nls/blackbox-nls.hh Configuration.hh -Timer.o: Timer.cc BaseDisplay.hh Timer.hh Util.hh -Toolbar.o: Toolbar.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Clientmenu.hh \ - Basemenu.hh GCCache.hh Color.hh Iconmenu.hh Image.hh Rootmenu.hh \ - Screen.hh Texture.hh Configmenu.hh Netizen.hh Workspace.hh \ - Workspacemenu.hh Toolbar.hh Window.hh Windowmenu.hh Slit.hh -Util.o: Util.cc Util.hh -Window.o: Window.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh GCCache.hh Color.hh \ - Iconmenu.hh Basemenu.hh Image.hh Screen.hh Texture.hh Configmenu.hh \ - Netizen.hh Rootmenu.hh Workspace.hh Workspacemenu.hh Toolbar.hh \ - Window.hh Windowmenu.hh Slit.hh -Windowmenu.o: Windowmenu.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Screen.hh Color.hh \ - Texture.hh Image.hh Configmenu.hh Basemenu.hh Iconmenu.hh Netizen.hh \ - Rootmenu.hh Workspace.hh Workspacemenu.hh Window.hh Windowmenu.hh -Workspace.o: Workspace.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Clientmenu.hh \ - Basemenu.hh Netizen.hh Screen.hh Color.hh Texture.hh Image.hh \ - Configmenu.hh Iconmenu.hh Rootmenu.hh Workspace.hh Workspacemenu.hh \ - Toolbar.hh Window.hh Windowmenu.hh -Workspacemenu.o: Workspacemenu.cc i18n.hh ../nls/blackbox-nls.hh \ - blackbox.hh BaseDisplay.hh Timer.hh Util.hh Configuration.hh Screen.hh \ - Color.hh Texture.hh Image.hh Configmenu.hh Basemenu.hh Iconmenu.hh \ - Netizen.hh Rootmenu.hh Workspace.hh Workspacemenu.hh Toolbar.hh -blackbox.o: blackbox.cc i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh Basemenu.hh \ - Clientmenu.hh GCCache.hh Color.hh Image.hh Rootmenu.hh Screen.hh \ - Texture.hh Configmenu.hh Iconmenu.hh Netizen.hh Workspace.hh \ - Workspacemenu.hh Slit.hh Toolbar.hh Window.hh Windowmenu.hh -i18n.o: i18n.cc i18n.hh ../nls/blackbox-nls.hh -main.o: main.cc ../version.h i18n.hh ../nls/blackbox-nls.hh blackbox.hh \ - BaseDisplay.hh Timer.hh Util.hh Configuration.hh ++BaseDisplay.o: BaseDisplay.cc i18n.h BaseDisplay.h \ + Timer.h +Basemenu.o: Basemenu.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \ - Workspace.h Workspacemenu.h - Clientmenu.o: Clientmenu.cc openbox.h BaseDisplay.h LinkedList.h \ ++ Workspace.h Workspacemenu.h Resource.h ++Clientmenu.o: Clientmenu.cc openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Clientmenu.h Workspace.h Screen.h Configmenu.h Netizen.h \ - Rootmenu.h Workspacemenu.h ++ Rootmenu.h Workspacemenu.h Resource.h Geometry.h +Configmenu.o: Configmenu.cc i18n.h Configmenu.h Basemenu.h \ - LinkedList.h Screen.h BaseDisplay.h Timer.h Iconmenu.h Netizen.h \ ++ Screen.h BaseDisplay.h Timer.h Iconmenu.h Netizen.h \ + Rootmenu.h Workspace.h Workspacemenu.h openbox.h Image.h \ - Window.h Windowmenu.h Slit.h Toolbar.h - Icon.o: Iconmenu.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Window.h Windowmenu.h Slit.h Toolbar.h Resource.h Geometry.h ++Geometry.o: Geometry.cc Geometry.h ++Icon.o: Iconmenu.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \ - Workspacemenu.h Toolbar.h - Image.o: Image.cc i18n.h BaseDisplay.h LinkedList.h Timer.h \ ++ Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Image.o: Image.cc i18n.h BaseDisplay.h Timer.h \ + Image.h - LinkedList.o: LinkedList.cc LinkedList.h - Netizen.o: Netizen.cc Netizen.h BaseDisplay.h LinkedList.h Timer.h \ ++Netizen.o: Netizen.cc Netizen.h BaseDisplay.h Timer.h \ + Screen.h Configmenu.h Basemenu.h openbox.h Image.h Window.h \ + Iconmenu.h Windowmenu.h Slit.h Rootmenu.h Workspace.h \ - Workspacemenu.h - Rootmenu.o: Rootmenu.cc openbox.h BaseDisplay.h LinkedList.h \ ++ Workspacemenu.h Resource.h Geometry.h ++Resource.o: Resource.cc Resource.h Util.h ++Rootmenu.o: Rootmenu.cc openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Rootmenu.h Screen.h Configmenu.h Netizen.h Workspace.h \ - Workspacemenu.h ++ Workspacemenu.h Resource.h Geometry.h +Screen.o: Screen.cc i18n.h bsd-snprintf.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Clientmenu.h Workspace.h Screen.h Configmenu.h \ - Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h - Slit.o: Slit.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Slit.o: Slit.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \ - Workspacemenu.h Toolbar.h - Timer.o: Timer.cc BaseDisplay.h LinkedList.h Timer.h - Toolbar.o: Toolbar.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Timer.o: Timer.cc BaseDisplay.h Timer.h ++Toolbar.o: Toolbar.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Clientmenu.h Workspace.h Rootmenu.h Screen.h Configmenu.h \ - Netizen.h Workspacemenu.h Toolbar.h - Window.o: Window.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Netizen.h Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Window.o: Window.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \ - Workspacemenu.h Toolbar.h ++ Workspacemenu.h Toolbar.h Resource.h Geometry.h +Windowmenu.o: Windowmenu.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \ - Workspace.h Workspacemenu.h ++ Workspace.h Workspacemenu.h Resource.h Geometry.h +Workspace.o: Workspace.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Clientmenu.h Workspace.h Screen.h \ - Configmenu.h Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h ++ Configmenu.h Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h Resource.h \ ++ Geometry.h Geometry.h Util.h +Workspacemenu.o: Workspacemenu.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \ - Workspace.h Workspacemenu.h Toolbar.h ++ Workspace.h Workspacemenu.h Toolbar.h Resource.h Geometry.h +openbox.o: openbox.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Clientmenu.h Workspace.h Rootmenu.h \ - Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h ++ Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h Resource.h \ ++ Geometry.h Util.h +bsd-snprintf.o: bsd-snprintf.c bsd-snprintf.h +i18n.o: i18n.cc i18n.h +main.o: main.cc ../version.h i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ - Windowmenu.h Slit.h ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Windowmenu.h Slit.h Resource.h Geometry.h diff --cc src/Makefile.in index 7b8d140b,00000000..c81a7018 mode 100644,000000..100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@@ -1,462 -1,0 +1,403 @@@ - # 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. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# src/Makefile.am for Openbox +# Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +# +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included in +# all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. + + +SHELL = @SHELL@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ +prefix = @prefix@ +exec_prefix = @exec_prefix@ + +bindir = @bindir@ +sbindir = @sbindir@ +libexecdir = @libexecdir@ +datadir = @datadir@ +sysconfdir = @sysconfdir@ +sharedstatedir = @sharedstatedir@ +localstatedir = @localstatedir@ +libdir = @libdir@ +infodir = @infodir@ +mandir = @mandir@ +includedir = @includedir@ +oldincludedir = /usr/include + +DESTDIR = + +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ + +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) +INSTALL_DATA = @INSTALL_DATA@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +transform = @program_transform_name@ + +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +CC = @CC@ +CLOBBER = @CLOBBER@ +CXX = @CXX@ +DEBUG = @DEBUG@ +INTERLACE = @INTERLACE@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +DEFAULT_MENU = $(pkgdatadir)/menu +DEFAULT_STYLE = $(pkgdatadir)/styles/steelblue + +CPPFLAGS = @CPPFLAGS@ @SHAPE@ @SLIT@ @INTERLACE@ @ORDEREDPSEUDO@ @DEBUG@ @NEWWMSPEC@ @NLS@ @TIMEDCACHE@ @CLOBBER@ -DLOCALEPATH=\"$(pkgdatadir)/nls\" -DDEFAULTMENU=\"$(DEFAULT_MENU)\" -DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" + + +bin_PROGRAMS = openbox + - openbox_SOURCES = BaseDisplay.cc Basemenu.cc Clientmenu.cc Configmenu.cc Iconmenu.cc Image.cc LinkedList.cc Netizen.cc Rootmenu.cc Screen.cc Slit.cc Timer.cc Toolbar.cc Window.cc Windowmenu.cc Workspace.cc Workspacemenu.cc openbox.cc bsd-snprintf.c i18n.cc main.cc ++openbox_SOURCES = BaseDisplay.cc Basemenu.cc Clientmenu.cc Configmenu.cc Geometry.cc Iconmenu.cc Image.cc Netizen.cc Resource.cc Rootmenu.cc Screen.cc Slit.cc Timer.cc Toolbar.cc Window.cc Windowmenu.cc Workspace.cc Workspacemenu.cc openbox.cc bsd-snprintf.c i18n.cc main.cc + +MAINTAINERCLEANFILES = Makefile.in +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(bin_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +X_CFLAGS = @X_CFLAGS@ +X_LIBS = @X_LIBS@ +X_EXTRA_LIBS = @X_EXTRA_LIBS@ +X_PRE_LIBS = @X_PRE_LIBS@ +openbox_OBJECTS = BaseDisplay.o Basemenu.o Clientmenu.o Configmenu.o \ - Iconmenu.o Image.o LinkedList.o Netizen.o Rootmenu.o Screen.o Slit.o \ - Timer.o Toolbar.o Window.o Windowmenu.o Workspace.o Workspacemenu.o \ - openbox.o bsd-snprintf.o i18n.o main.o ++Geometry.o Iconmenu.o Image.o Netizen.o Resource.o Rootmenu.o Screen.o \ ++Slit.o Timer.o Toolbar.o Window.o Windowmenu.o Workspace.o \ ++Workspacemenu.o openbox.o bsd-snprintf.o i18n.o main.o +openbox_LDADD = $(LDADD) +openbox_DEPENDENCIES = +openbox_LDFLAGS = +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best - DEP_FILES = .deps/BaseDisplay.P .deps/Basemenu.P .deps/Clientmenu.P \ - .deps/Configmenu.P .deps/Iconmenu.P .deps/Image.P .deps/LinkedList.P \ - .deps/Netizen.P .deps/Rootmenu.P .deps/Screen.P .deps/Slit.P \ - .deps/Timer.P .deps/Toolbar.P .deps/Window.P .deps/Windowmenu.P \ - .deps/Workspace.P .deps/Workspacemenu.P .deps/bsd-snprintf.P \ - .deps/i18n.P .deps/main.P .deps/openbox.P +SOURCES = $(openbox_SOURCES) +OBJECTS = $(openbox_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cc .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) - cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile ++ cd $(top_srcdir) && $(AUTOMAKE) --foreign --include-deps src/Makefile + - Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) ++Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-binPROGRAMS: + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + ++.c.o: ++ $(COMPILE) -c $< ++ +.s.o: + $(COMPILE) -c $< + +.S.o: + $(COMPILE) -c $< + +mostlyclean-compile: + -rm -f *.o core *.core + +clean-compile: + +distclean-compile: + -rm -f *.tab.c + +maintainer-clean-compile: + +openbox: $(openbox_OBJECTS) $(openbox_DEPENDENCIES) + @rm -f openbox + $(CXXLINK) $(openbox_LDFLAGS) $(openbox_OBJECTS) $(openbox_LDADD) $(LIBS) +.cc.o: + $(CXXCOMPILE) -c $< + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags $(ETAGS_ARGS) $$tags $$unique $(LISP) -o $$here/TAGS) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) - here=`cd $(top_builddir) && pwd`; \ - top_distdir=`cd $(top_distdir) && pwd`; \ - distdir=`cd $(distdir) && pwd`; \ - cd $(top_srcdir) \ - && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done - - DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) - - -include $(DEP_FILES) - - mostlyclean-depend: - - clean-depend: - - distclean-depend: - -rm -rf .deps - - maintainer-clean-depend: - - %.o: %.c - @echo '$(COMPILE) -c $<'; \ - $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - - %.lo: %.c - @echo '$(LTCOMPILE) -c $<'; \ - $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp - - %.o: %.cc - @echo '$(CXXCOMPILE) -c $<'; \ - $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-cp .deps/$(*F).pp .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm .deps/$(*F).pp - - %.lo: %.cc - @echo '$(LTCXXCOMPILE) -c $<'; \ - $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< - @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ - < .deps/$(*F).pp > .deps/$(*F).P; \ - tr ' ' '\012' < .deps/$(*F).pp \ - | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ - >> .deps/$(*F).P; \ - rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ - mostlyclean-tags mostlyclean-depend mostlyclean-generic ++ mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-am + - clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \ - clean-generic mostlyclean-am ++clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ ++ mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ - distclean-depend distclean-generic clean-am \ - distclean-local ++ distclean-generic clean-am distclean-local + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ - maintainer-clean-depend maintainer-clean-generic \ - distclean-am ++ maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ - clean-tags maintainer-clean-tags distdir mostlyclean-depend \ - distclean-depend clean-depend maintainer-clean-depend info-am info \ - dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ - install-exec install-data-am install-data install-am install \ - uninstall-am uninstall all-redirect all-am all installdirs \ - mostlyclean-generic distclean-generic clean-generic \ - maintainer-clean-generic clean mostlyclean distclean maintainer-clean ++clean-tags maintainer-clean-tags distdir info-am info dvi-am dvi check \ ++check-am installcheck-am installcheck install-exec-am install-exec \ ++install-data-am install-data install-am install uninstall-am uninstall \ ++all-redirect all-am all installdirs mostlyclean-generic \ ++distclean-generic clean-generic maintainer-clean-generic clean \ ++mostlyclean distclean maintainer-clean + + +distclean-local: + rm -f *\~ *.orig *.rej + +# local dependencies + - BaseDisplay.o: BaseDisplay.cc i18n.h BaseDisplay.h LinkedList.h \ ++BaseDisplay.o: BaseDisplay.cc i18n.h BaseDisplay.h \ + Timer.h +Basemenu.o: Basemenu.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \ - Workspace.h Workspacemenu.h - Clientmenu.o: Clientmenu.cc openbox.h BaseDisplay.h LinkedList.h \ ++ Workspace.h Workspacemenu.h Resource.h ++Clientmenu.o: Clientmenu.cc openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Clientmenu.h Workspace.h Screen.h Configmenu.h Netizen.h \ - Rootmenu.h Workspacemenu.h ++ Rootmenu.h Workspacemenu.h Resource.h Geometry.h +Configmenu.o: Configmenu.cc i18n.h Configmenu.h Basemenu.h \ - LinkedList.h Screen.h BaseDisplay.h Timer.h Iconmenu.h Netizen.h \ ++ Screen.h BaseDisplay.h Timer.h Iconmenu.h Netizen.h \ + Rootmenu.h Workspace.h Workspacemenu.h openbox.h Image.h \ - Window.h Windowmenu.h Slit.h Toolbar.h - Icon.o: Iconmenu.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Window.h Windowmenu.h Slit.h Toolbar.h Resource.h Geometry.h ++Geometry.o: Geometry.cc Geometry.h ++Icon.o: Iconmenu.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \ - Workspacemenu.h Toolbar.h - Image.o: Image.cc i18n.h BaseDisplay.h LinkedList.h Timer.h \ ++ Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Image.o: Image.cc i18n.h BaseDisplay.h Timer.h \ + Image.h - LinkedList.o: LinkedList.cc LinkedList.h - Netizen.o: Netizen.cc Netizen.h BaseDisplay.h LinkedList.h Timer.h \ ++Netizen.o: Netizen.cc Netizen.h BaseDisplay.h Timer.h \ + Screen.h Configmenu.h Basemenu.h openbox.h Image.h Window.h \ + Iconmenu.h Windowmenu.h Slit.h Rootmenu.h Workspace.h \ - Workspacemenu.h - Rootmenu.o: Rootmenu.cc openbox.h BaseDisplay.h LinkedList.h \ ++ Workspacemenu.h Resource.h Geometry.h ++Resource.o: Resource.cc Resource.h Util.h ++Rootmenu.o: Rootmenu.cc openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Rootmenu.h Screen.h Configmenu.h Netizen.h Workspace.h \ - Workspacemenu.h ++ Workspacemenu.h Resource.h Geometry.h +Screen.o: Screen.cc i18n.h bsd-snprintf.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Clientmenu.h Workspace.h Screen.h Configmenu.h \ - Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h - Slit.o: Slit.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Slit.o: Slit.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \ - Workspacemenu.h Toolbar.h - Timer.o: Timer.cc BaseDisplay.h LinkedList.h Timer.h - Toolbar.o: Toolbar.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Timer.o: Timer.cc BaseDisplay.h Timer.h ++Toolbar.o: Toolbar.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Clientmenu.h Workspace.h Rootmenu.h Screen.h Configmenu.h \ - Netizen.h Workspacemenu.h Toolbar.h - Window.o: Window.cc i18n.h openbox.h BaseDisplay.h LinkedList.h \ ++ Netizen.h Workspacemenu.h Toolbar.h Resource.h Geometry.h ++Window.o: Window.cc i18n.h openbox.h BaseDisplay.h \ + Timer.h Image.h Window.h Iconmenu.h Basemenu.h Windowmenu.h Slit.h \ + Screen.h Configmenu.h Netizen.h Rootmenu.h Workspace.h \ - Workspacemenu.h Toolbar.h ++ Workspacemenu.h Toolbar.h Resource.h Geometry.h +Windowmenu.o: Windowmenu.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \ - Workspace.h Workspacemenu.h ++ Workspace.h Workspacemenu.h Resource.h Geometry.h +Workspace.o: Workspace.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Clientmenu.h Workspace.h Screen.h \ - Configmenu.h Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h ++ Configmenu.h Netizen.h Rootmenu.h Workspacemenu.h Toolbar.h Resource.h \ ++ Geometry.h Geometry.h Util.h +Workspacemenu.o: Workspacemenu.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Screen.h Configmenu.h Netizen.h Rootmenu.h \ - Workspace.h Workspacemenu.h Toolbar.h ++ Workspace.h Workspacemenu.h Toolbar.h Resource.h Geometry.h +openbox.o: openbox.cc i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ + Windowmenu.h Slit.h Clientmenu.h Workspace.h Rootmenu.h \ - Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h ++ Screen.h Configmenu.h Netizen.h Workspacemenu.h Toolbar.h Resource.h \ ++ Geometry.h Util.h +bsd-snprintf.o: bsd-snprintf.c bsd-snprintf.h +i18n.o: i18n.cc i18n.h +main.o: main.cc ../version.h i18n.h openbox.h BaseDisplay.h \ - LinkedList.h Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ - Windowmenu.h Slit.h ++ Timer.h Image.h Window.h Iconmenu.h Basemenu.h \ ++ Windowmenu.h Slit.h Resource.h Geometry.h + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --cc src/Netizen.cc index 22d47958,6d73be95..6fbb99ac --- a/src/Netizen.cc +++ b/src/Netizen.cc @@@ -30,87 -25,90 +30,85 @@@ #include "../config.h" #endif // HAVE_CONFIG_H -#include "Netizen.hh" -#include "Screen.hh" - -Netizen::Netizen(BScreen *scr, Window win) { - screen = scr; - blackbox = scr->getBlackbox(); - window = win; +#include "Netizen.h" +#include "Screen.h" - Netizen::Netizen(BScreen *scr, Window win) { - screen = scr; - basedisplay = screen->getBaseDisplay(); - window = win; - ++Netizen::Netizen(BScreen &scr, Window win) :basedisplay(scr.getBaseDisplay()), ++ screen(scr), window(win) ++{ event.type = ClientMessage; - event.xclient.message_type = basedisplay->getOpenboxStructureMessagesAtom(); - event.xclient.display = basedisplay->getXDisplay(); - event.xclient.message_type = - blackbox->getBlackboxStructureMessagesAtom(); - event.xclient.display = blackbox->getXDisplay(); ++ event.xclient.message_type = basedisplay.getOpenboxStructureMessagesAtom(); ++ event.xclient.display = basedisplay.getXDisplay(); event.xclient.window = window; event.xclient.format = 32; - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyStartupAtom(); - event.xclient.data.l[0] = blackbox->getBlackboxNotifyStartupAtom(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyStartupAtom(); event.xclient.data.l[1] = event.xclient.data.l[2] = event.xclient.data.l[3] = event.xclient.data.l[4] = 0l; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWorkspaceCount(void) { - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWorkspaceCountAtom(); - event.xclient.data.l[1] = screen->getCount(); - event.xclient.data.l[0] = - blackbox->getBlackboxNotifyWorkspaceCountAtom(); - event.xclient.data.l[1] = screen->getWorkspaceCount(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWorkspaceCountAtom(); ++ event.xclient.data.l[1] = screen.getWorkspaceCount(); - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendCurrentWorkspace(void) { - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyCurrentWorkspaceAtom(); - event.xclient.data.l[0] = - blackbox->getBlackboxNotifyCurrentWorkspaceAtom(); -- event.xclient.data.l[1] = screen->getCurrentWorkspaceID(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyCurrentWorkspaceAtom(); ++ event.xclient.data.l[1] = screen.getCurrentWorkspaceID(); - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWindowFocus(Window w) { - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowFocusAtom(); - event.xclient.data.l[0] = blackbox->getBlackboxNotifyWindowFocusAtom(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowFocusAtom(); event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWindowAdd(Window w, unsigned long p) { - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowAddAtom(); - event.xclient.data.l[0] = blackbox->getBlackboxNotifyWindowAddAtom(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowAddAtom(); event.xclient.data.l[1] = w; event.xclient.data.l[2] = p; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); event.xclient.data.l[2] = 0l; } void Netizen::sendWindowDel(Window w) { - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowDelAtom(); - event.xclient.data.l[0] = blackbox->getBlackboxNotifyWindowDelAtom(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowDelAtom(); event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWindowRaise(Window w) { - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowRaiseAtom(); - event.xclient.data.l[0] = blackbox->getBlackboxNotifyWindowRaiseAtom(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowRaiseAtom(); event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendWindowLower(Window w) { - event.xclient.data.l[0] = basedisplay->getOpenboxNotifyWindowLowerAtom(); - event.xclient.data.l[0] = blackbox->getBlackboxNotifyWindowLowerAtom(); ++ event.xclient.data.l[0] = basedisplay.getOpenboxNotifyWindowLowerAtom(); event.xclient.data.l[1] = w; - XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); - XSendEvent(blackbox->getXDisplay(), window, False, NoEventMask, &event); ++ XSendEvent(basedisplay.getXDisplay(), window, False, NoEventMask, &event); } void Netizen::sendConfigNotify(XEvent *e) { - XSendEvent(basedisplay->getXDisplay(), window, False, - XSendEvent(blackbox->getXDisplay(), window, False, ++ XSendEvent(basedisplay.getXDisplay(), window, False, StructureNotifyMask, e); } diff --cc src/Netizen.h index 85480f7b,2f7cbda2..9de223d7 --- a/src/Netizen.h +++ b/src/Netizen.h @@@ -32,17 -35,15 +32,17 @@@ class Netizen class Netizen { private: - BaseDisplay *basedisplay; - Blackbox *blackbox; -- BScreen *screen; ++ BaseDisplay &basedisplay; ++ BScreen &screen; Window window; XEvent event; +protected: + public: -- Netizen(BScreen *, Window); ++ Netizen(BScreen &, Window); - inline Window getWindowID(void) const { return window; } + inline const Window &getWindowID(void) const { return window; } void sendWorkspaceCount(void); void sendCurrentWorkspace(void); diff --cc src/Resource.cc index 00000000,be0cd096..2a678f89 mode 000000,100644..100644 --- a/src/Resource.cc +++ b/src/Resource.cc @@@ -1,0 -1,240 +1,192 @@@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// Configuration.hh for Blackbox - an X11 Window manager ++// Resource.cc for Openbox + // Copyright (c) 2002 - 2002 Ben Jansens (ben@orodu.net) + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the "Software"), + // to deal in the Software without restriction, including without limitation + // the rights to use, copy, modify, merge, publish, distribute, sublicense, + // and/or sell copies of the Software, and to permit persons to whom the + // Software is furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + // DEALINGS IN THE SOFTWARE. + -#include "../config.h" ++#include "Resource.h" ++#include "Util.h" + -#include "Configuration.hh" -#include "Util.hh" - -#include ++#ifdef HAVE_CONFIG_H ++# include "../config.h" ++#endif // HAVE_CONFIG_H + + #ifdef HAVE_STDLIB_H + # include + #endif // HAVE_STDLIB_H + -using std::string; ++#ifdef HAVE_STDIO_H ++# include ++#endif // HAVE_STDIO_H + -bool Configuration::m_initialized = false; ++bool Resource::m_initialized = false; + -Configuration::Configuration(const string &file) { ++Resource::Resource(const std::string &file) { + setFile(file); + m_modified = false; + m_database = NULL; + m_autosave = true; - if (! m_initialized) { ++ if (!m_initialized) { + XrmInitialize(); + m_initialized = true; + } + } + -Configuration::Configuration() { ++Resource::Resource() { + m_modified = false; + m_database = NULL; + m_autosave = true; - if (! m_initialized) { ++ if (!m_initialized) { + XrmInitialize(); + m_initialized = true; + } + } + -Configuration::~Configuration() { ++Resource::~Resource() { + if (m_database != NULL) + XrmDestroyDatabase(m_database); + } + -void Configuration::setFile(const string &file) { ++void Resource::setFile(const std::string &file) { + m_file = file; + } + -void Configuration::setAutoSave(bool autosave) { ++void Resource::setAutoSave(bool autosave) { + m_autosave = autosave; + } + -void Configuration::save() { - assert(m_database != NULL); ++void Resource::save() { ++ ASSERT(m_database != NULL); + XrmPutFileDatabase(m_database, m_file.c_str()); + m_modified = false; + } + -bool Configuration::load() { ++bool Resource::load() { + if (m_database != NULL) + XrmDestroyDatabase(m_database); + m_modified = false; + if (NULL == (m_database = XrmGetFileDatabase(m_file.c_str()))) + return false; + return true; + } + -void Configuration::create() { ++void Resource::create() { + if (m_database != NULL) + XrmDestroyDatabase(m_database); + m_modified = false; - assert(NULL != (m_database = XrmGetStringDatabase(""))); ++ ASSERT(NULL != (m_database = XrmGetStringDatabase(""))); + } + -void Configuration::setValue(const string &rname, bool value) { - assert(m_database != NULL); ++void Resource::setValue(const std::string &rname, bool value) { ++ ASSERT(m_database != NULL); + + const char *val = (value ? "True" : "False"); - string rc_string = rname + ": " + val; ++ std::string rc_string = rname + ": " + val; + XrmPutLineResource(&m_database, rc_string.c_str()); + + m_modified = true; + if (m_autosave) + save(); + } + -void Configuration::setValue(const string &rname, unsigned long value) { - assert(m_database != NULL); - - string rc_string = rname + ": " + itostring(value); - XrmPutLineResource(&m_database, rc_string.c_str()); - - m_modified = true; - if (m_autosave) - save(); ++void Resource::setValue(const std::string &rname, int value) { ++ setValue(rname, (long)value); + } + -void Configuration::setValue(const string &rname, long value) { - assert(m_database != NULL); ++void Resource::setValue(const std::string &rname, long value) { ++ ASSERT(m_database != NULL); + - string rc_string = rname + ": " + itostring(value); ++ char val[11]; ++ sprintf(val, "%ld", value); ++ std::string rc_string = rname + ": " + val; + XrmPutLineResource(&m_database, rc_string.c_str()); + + m_modified = true; + if (m_autosave) + save(); + } + -void Configuration::setValue(const string &rname, const char *value) { - assert(m_database != NULL); - assert(value != NULL); ++void Resource::setValue(const std::string &rname, const char *value) { ++ ASSERT(m_database != NULL); ++ ASSERT(value != NULL); + - string rc_string = rname + ": " + value; ++ std::string rc_string = rname + ": " + value; + XrmPutLineResource(&m_database, rc_string.c_str()); + + m_modified = true; + if (m_autosave) + save(); + } + -void Configuration::setValue(const string &rname, const string &value) { - assert(m_database != NULL); ++void Resource::setValue(const std::string &rname, const std::string &value) { ++ ASSERT(m_database != NULL); + - string rc_string = rname + ": " + value; ++ std::string rc_string = rname + ": " + value; + XrmPutLineResource(&m_database, rc_string.c_str()); + + m_modified = true; + if (m_autosave) + save(); + } + -bool Configuration::getValue(const string &rname, bool &value) const { - assert(m_database != NULL); - - string rclass = createClassName(rname); ++bool Resource::getValue(const std::string &rname, const std::string &rclass, ++ bool &value) const { ++ ASSERT(rclass.c_str() != NULL); ++ ASSERT(m_database != NULL); + + char *rettype; + XrmValue retvalue; + if (0 == XrmGetResource(m_database, rname.c_str(), rclass.c_str(), + &rettype, &retvalue) || retvalue.addr == NULL) + return false; - string val = retvalue.addr; - if (val == "true" || val == "True") ++ std::string val = retvalue.addr; ++ if (0 == strncasecmp(val.c_str(), "true", val.length())) + value = true; + else + value = false; + return true; + } + -bool Configuration::getValue(const string &rname, long &value) const { - assert(m_database != NULL); - - string rclass = createClassName(rname); ++bool Resource::getValue(const std::string &rname, const std::string &rclass, ++ long &value) const { ++ ASSERT(m_database != NULL); + + char *rettype; + XrmValue retvalue; + if (0 == XrmGetResource(m_database, rname.c_str(), rclass.c_str(), + &rettype, &retvalue) || retvalue.addr == NULL) + return false; + char *end; + value = strtol(retvalue.addr, &end, 10); + if (end == retvalue.addr) + return false; + return true; + } + -bool Configuration::getValue(const string &rname, unsigned long &value) const { - assert(m_database != NULL); - - string rclass = createClassName(rname); - - char *rettype; - XrmValue retvalue; - if (0 == XrmGetResource(m_database, rname.c_str(), rclass.c_str(), - &rettype, &retvalue) || retvalue.addr == NULL) - return false; - char *end; - value = strtoul(retvalue.addr, &end, 10); - if (end == retvalue.addr) - return false; - return true; -} - -bool Configuration::getValue(const string &rname, - string &value) const { - assert(m_database != NULL); - - string rclass = createClassName(rname); ++bool Resource::getValue(const std::string &rname, const std::string &rclass, ++ std::string &value) const { ++ ASSERT(m_database != NULL); + + char *rettype; + XrmValue retvalue; + if (0 == XrmGetResource(m_database, rname.c_str(), rclass.c_str(), + &rettype, &retvalue) || retvalue.addr == NULL) + return false; + value = retvalue.addr; + return true; + } - - -string Configuration::createClassName(const string &rname) const { - string rclass(rname); - - string::iterator it = rclass.begin(), end = rclass.end(); - while (true) { - *it = toUpper(*it); - ++it; - if (it == end) break; - it = std::find(it, rclass.end(), '.'); - if (it == end) break; - ++it; - if (it == end) break; - } - return rclass; -} - - -char Configuration::toUpper(char c) const { - if (c >= 'a' && c <= 'z') - return c - 'a' + 'A'; - return c; -} diff --cc src/Resource.h index 00000000,6909c799..e75b8718 mode 000000,100644..100644 --- a/src/Resource.h +++ b/src/Resource.h @@@ -1,0 -1,97 +1,76 @@@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// Configuration.hh for Blackbox - an X11 Window manager ++// Resource.h for Openbox + // Copyright (c) 2002 - 2002 Ben Jansens (ben@orodu.net) + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the "Software"), + // to deal in the Software without restriction, including without limitation + // the rights to use, copy, modify, merge, publish, distribute, sublicense, + // and/or sell copies of the Software, and to permit persons to whom the + // Software is furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + // DEALINGS IN THE SOFTWARE. + -#ifndef __Configuration_hh -#define __Configuration_hh ++#ifndef __Resource_hh ++#define __Resource_hh ++ ++#include + + #include + #include -#include + -/* - * The Configuration class is a generic wrapper for configuration settings. - * - * This class is used for the global rc/config file, and for styles. - * - * This implementation of the Configuration class wraps an X resource database - * file. - */ -class Configuration { ++class Resource { + public: - explicit Configuration(const std::string &file); - Configuration(); - virtual ~Configuration(); ++ explicit Resource(const std::string &file); ++ Resource(); ++ virtual ~Resource(); + + inline const std::string &file() const { + return static_cast(m_file); + } + void setFile(const std::string &file); + + // defaults to true! + inline bool autoSave() const { + return m_autosave; + } + void setAutoSave(bool); + + inline bool isModified() const { + return m_modified; + } + + void save(); + bool load(); + void create(); + + void setValue(const std::string &rname, bool value); - inline void setValue(const std::string &rname, int value) { - setValue(rname, (long) value); - } - inline void setValue(const std::string &rname, unsigned int value) { - setValue(rname, (unsigned long) value); - } ++ void setValue(const std::string &rname, int value); + void setValue(const std::string &rname, long value); - void setValue(const std::string &rname, unsigned long value); + void setValue(const std::string &rname, const std::string &value); + void setValue(const std::string &rname, const char *value); + - bool getValue(const std::string &rname, bool &value) const; - inline bool getValue(const std::string &rname, int &value) const { - return getValue(rname, (long) value); - } - inline bool getValue(const std::string &rname, unsigned int &value) const { - return getValue(rname, (unsigned long) value); - } - bool getValue(const std::string &rname, long &value) const; - bool getValue(const std::string &rname, unsigned long &value) const; - bool getValue(const std::string &rname, std::string &value) const; ++ bool getValue(const std::string &rname, const std::string &rclass, ++ bool &value) const; ++ bool getValue(const std::string &rname, const std::string &rclass, ++ long &value) const; ++ bool getValue(const std::string &rname, const std::string &rclass, ++ std::string &value) const; + + private: - std::string createClassName(const std::string &rname) const; - char toUpper(char) const; - + static bool m_initialized; + std::string m_file; + bool m_modified; + bool m_autosave; + XrmDatabase m_database; + }; + -#endif // __Configuration_hh ++#endif // __Resource_hh diff --cc src/Rootmenu.cc index ddb29855,148c1fca..4728f507 --- a/src/Rootmenu.cc +++ b/src/Rootmenu.cc @@@ -38,27 -30,29 +38,30 @@@ # include #endif // HAVE_STDIO_H - #ifdef STDC_HEADERS -#ifdef HAVE_STDLIB_H ++#ifdef HAVE_STDLIB_H # include + #endif // HAVE_STDLIB_H + -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include - #endif // STDC_HEADERS + #endif // HAVE_STRING_H #ifdef HAVE_SYS_PARAM_H # include #endif // HAVE_SYS_PARAM_H -} -#include "blackbox.hh" -#include "Rootmenu.hh" -#include "Screen.hh" -#include "Util.hh" +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif // MAXPATHLEN - Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) { - screen = scrn; - openbox = screen->getOpenbox(); -Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) { } ++Rootmenu::Rootmenu(BScreen &scrn) : Basemenu(scrn), openbox(scrn.getOpenbox()), ++ screen(scrn) ++{ +} -void Rootmenu::itemSelected(int button, unsigned int index) { +void Rootmenu::itemSelected(int button, int index) { if (button != 1) return; @@@ -69,44 -63,33 +72,44 @@@ switch (item->function()) { case BScreen::Execute: - if (item->exec()) - bexec(item->exec(), getScreen()->displayString()); + if (item->exec()) { +#ifndef __EMX__ + char displaystring[MAXPATHLEN]; + sprintf(displaystring, "DISPLAY=%s", - DisplayString(screen->getBaseDisplay()->getXDisplay())); ++ DisplayString(screen.getBaseDisplay().getXDisplay())); + sprintf(displaystring + strlen(displaystring) - 1, "%d", - screen->getScreenNumber()); ++ screen.getScreenNumber()); + + bexec(item->exec(), displaystring); +#else // __EMX__ + spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec(), NULL); +#endif // !__EMX__ + } break; case BScreen::Restart: - openbox->restart(); - getScreen()->getBlackbox()->restart(); ++ openbox.restart(); break; case BScreen::RestartOther: if (item->exec()) - openbox->restart(item->exec()); - getScreen()->getBlackbox()->restart(item->exec()); ++ openbox.restart(item->exec()); break; case BScreen::Exit: - openbox->shutdown(); - getScreen()->getBlackbox()->shutdown(); ++ openbox.shutdown(); break; case BScreen::SetStyle: if (item->exec()) - openbox->saveStyleFilename(item->exec()); - getScreen()->getBlackbox()->saveStyleFilename(item->exec()); ++ openbox.setStyleFilename(item->exec()); case BScreen::Reconfigure: - openbox->reconfigure(); - getScreen()->getBlackbox()->reconfigure(); ++ openbox.reconfigure(); return; } - if (! (screen->getRootmenu()->isTorn() || isTorn()) && - if (! (getScreen()->getRootmenu()->isTorn() || isTorn()) && ++ if (! (screen.getRootmenu()->isTorn() || isTorn()) && item->function() != BScreen::Reconfigure && item->function() != BScreen::SetStyle) hide(); diff --cc src/Rootmenu.h index 076819f1,e436397d..63597d33 --- a/src/Rootmenu.h +++ b/src/Rootmenu.h @@@ -34,16 -32,14 +34,16 @@@ class BScreen class Rootmenu : public Basemenu { private: - Openbox *openbox; - BScreen *screen; - Rootmenu(const Rootmenu&); - Rootmenu& operator=(const Rootmenu&); ++ Openbox &openbox; ++ BScreen &screen; + protected: - virtual void itemSelected(int button, unsigned int index); + virtual void itemSelected(int, int); + public: - Rootmenu(BScreen *); - Rootmenu(BScreen *scrn); ++ Rootmenu(BScreen &); }; diff --cc src/Screen.cc index 13c69bfa,6d204513..69b9f681 --- a/src/Screen.cc +++ b/src/Screen.cc @@@ -20,43 -21,25 +20,49 @@@ // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -#include "../config.h" +// stupid macros needed to access some functions in version 2 of the GNU C +// library +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif // _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif // HAVE_CONFIG_H -extern "C" { #include #include - #include -// for strcasestr() -#ifndef _GNU_SOURCE -# define _GNU_SOURCE -#endif // _GNU_SOURCE - -#ifdef HAVE_STDLIB_H +#include "i18n.h" +#include "openbox.h" +#include "Clientmenu.h" +#include "Iconmenu.h" +#include "Image.h" +#include "Screen.h" + +#ifdef SLIT +#include "Slit.h" +#endif // SLIT + +#include "Rootmenu.h" +#include "Toolbar.h" +#include "Window.h" +#include "Workspace.h" +#include "Workspacemenu.h" ++#include "Util.h" + - #ifdef STDC_HEADERS ++#ifdef HAVE_STDLIB_H # include + #endif // HAVE_STDLIB_H + -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include + #endif // HAVE_STRING_H + ++#ifdef HAVE_SYS_TYPES_H +# include - #endif // STDC_HEADERS ++#endif // HAVE_SYS_TYPES_H + #ifdef HAVE_CTYPE_H # include #endif // HAVE_CTYPE_H @@@ -94,14 -93,13 +100,18 @@@ #define FONT_ELEMENT_SIZE 50 #endif // FONT_ELEMENT_SIZE ++#include ++#include +#include ++#include ++using std::ends; -static bool running = True; +static Bool running = True; static int anotherWMRunning(Display *display, XErrorEvent *) { - fprintf(stderr, i18n(ScreenSet, ScreenAnotherWMRunning, - "BScreen::BScreen: an error occured while querying the X server.\n" - " another window manager already running on display %s.\n"), + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenAnotherWMRunning, + "BScreen::BScreen: an error occured while querying the X server.\n" + " another window manager already running on display %s.\n"), DisplayString(display)); running = False; @@@ -109,86 -107,19 +119,86 @@@ return(-1); } +struct dcmp { + bool operator()(const char *one, const char *two) const { + return (strcmp(one, two) < 0) ? True : False; + } +}; + +#ifndef HAVE_STRCASESTR +static const char * strcasestr(const char *str, const char *ptn) { + const char *s2, *p2; + for( ; *str; str++) { + for(s2=str,p2=ptn; ; s2++,p2++) { + if (!*p2) return str; + if (toupper(*s2) != toupper(*p2)) break; + } + } + return NULL; +} +#endif // HAVE_STRCASESTR + +static const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...) { + const char *p, *v; + char *p2; + va_list va; + + va_start(va, bufsiz); + buf[bufsiz-1] = 0; + buf[bufsiz-2] = '*'; + while((v = va_arg(va, char *)) != NULL) { + p = strcasestr(pattern, v); + if (p) { + strncpy(buf, p+1, bufsiz-2); + p2 = strchr(buf, '-'); + if (p2) *p2=0; + va_end(va); + return p; + } + } + va_end(va); + strncpy(buf, "*", bufsiz); + return NULL; +} + +static const char *getFontSize(const char *pattern, int *size) { + const char *p; + const char *p2=NULL; + int n=0; + + for (p=pattern; 1; p++) { + if (!*p) { + if (p2!=NULL && n>1 && n<72) { + *size = n; return p2+1; + } else { + *size = 16; return NULL; + } + } else if (*p=='-') { + if (n>1 && n<72 && p2!=NULL) { + *size = n; + return p2+1; + } + p2=p; n=0; + } else if (*p>='0' && *p<='9' && p2!=NULL) { + n *= 10; + n += *p-'0'; + } else { + p2=NULL; n=0; + } + } +} -BScreen::BScreen(Blackbox *bb, unsigned int scrn) : ScreenInfo(bb, scrn) { - blackbox = bb; - screenstr = (string)"session.screen" + itostring(scrn) + '.'; - config = blackbox->getConfig(); - xatom = blackbox->getXAtom(); - BScreen::BScreen(Openbox *bb, int scrn) : ScreenInfo(bb, scrn) { - openbox = bb; - ++BScreen::BScreen(Openbox &ob, int scrn, Resource &conf) : ScreenInfo(ob, scrn), ++ openbox(ob), config(conf) ++{ event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask | - SubstructureRedirectMask | ButtonPressMask | ButtonReleaseMask; + SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | + ButtonPressMask | ButtonReleaseMask; XErrorHandler old = XSetErrorHandler((XErrorHandler) anotherWMRunning); -- XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), event_mask); -- XSync(getBaseDisplay()->getXDisplay(), False); ++ XSelectInput(getBaseDisplay().getXDisplay(), getRootWindow(), event_mask); ++ XSync(getBaseDisplay().getXDisplay(), False); XSetErrorHandler((XErrorHandler) old); managed = running; @@@ -201,141 -132,49 +211,136 @@@ getDepth()); rootmenu = 0; - resource.stylerc = 0; resource.mstyle.t_fontset = resource.mstyle.f_fontset = -- resource.tstyle.fontset = resource.wstyle.fontset = (XFontSet) 0; ++ resource.tstyle.fontset = resource.wstyle.fontset = NULL; resource.mstyle.t_font = resource.mstyle.f_font = resource.tstyle.font = -- resource.wstyle.font = (XFontStruct *) 0; ++ resource.wstyle.font = NULL; + resource.root_command = NULL; - +#ifdef HAVE_STRFTIME - resource.strftime_format = 0; ++ resource.strftime_format = NULL; +#endif // HAVE_STRFTIME + ++#ifdef SLIT ++ slit = NULL; ++#endif // SLIT ++ toolbar = NULL; ++ current_workspace = (Workspace *) 0; + - xatom->setSupported(this); // set-up netwm support #ifdef HAVE_GETPID - xatom->setValue(getRootWindow(), XAtom::blackbox_pid, XAtom::cardinal, - (unsigned long) getpid()); -#endif // HAVE_GETPID + pid_t bpid = getpid(); - XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), - openbox->getOpenboxPidAtom(), XA_CARDINAL, - XDefineCursor(blackbox->getXDisplay(), getRootWindow(), - blackbox->getSessionCursor()); ++ XChangeProperty(getBaseDisplay().getXDisplay(), getRootWindow(), ++ openbox.getOpenboxPidAtom(), XA_CARDINAL, + sizeof(pid_t) * 8, PropModeReplace, + (unsigned char *) &bpid, 1); +#endif // HAVE_GETPID - XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(), - openbox->getSessionCursor()); - - workspaceNames = new LinkedList; - workspacesList = new LinkedList; - rootmenuList = new LinkedList; - netizenList = new LinkedList; - iconList = new LinkedList; - // start off full screen, top left. - usableArea.setSize(getWidth(), getHeight()); ++ XDefineCursor(getBaseDisplay().getXDisplay(), getRootWindow(), ++ openbox.getSessionCursor()); image_control = - new BImageControl(openbox, this, True, openbox->getColorsPerChannel(), - openbox->getCacheLife(), openbox->getCacheMax()); - new BImageControl(blackbox, this, True, blackbox->getColorsPerChannel(), - blackbox->getCacheLife(), blackbox->getCacheMax()); ++ new BImageControl(openbox, *this, True, openbox.getColorsPerChannel(), ++ openbox.getCacheLife(), openbox.getCacheMax()); image_control->installRootColormap(); root_colormap_installed = True; - openbox->load_rc(this); - - image_control->setDither(resource.image_dither); - - load_rc(); ++ load(); // load config options from Resources LoadStyle(); XGCValues gcv; unsigned long gc_value_mask = GCForeground; - if (! i18n.multibyte()) gc_value_mask |= GCFont; + if (! i18n->multibyte()) gc_value_mask |= GCFont; - gcv.foreground = WhitePixel(getBaseDisplay()->getXDisplay(), - gcv.foreground = WhitePixel(blackbox->getXDisplay(), getScreenNumber()) - ^ BlackPixel(blackbox->getXDisplay(), getScreenNumber()); ++ gcv.foreground = WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber()) - ^ BlackPixel(getBaseDisplay()->getXDisplay(), ++ ^ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber()); gcv.function = GXxor; gcv.subwindow_mode = IncludeInferiors; - opGC = XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), - opGC = XCreateGC(blackbox->getXDisplay(), getRootWindow(), ++ opGC = XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), GCForeground | GCFunction | GCSubwindowMode, &gcv); - const char *s = i18n(ScreenSet, ScreenPositionLength, - "0: 0000 x 0: 0000"); + gcv.foreground = resource.wstyle.l_text_focus.getPixel(); + if (resource.wstyle.font) + gcv.font = resource.wstyle.font->fid; + resource.wstyle.l_text_focus_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.wstyle.l_text_unfocus.getPixel(); + if (resource.wstyle.font) + gcv.font = resource.wstyle.font->fid; + resource.wstyle.l_text_unfocus_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.wstyle.b_pic_focus.getPixel(); + resource.wstyle.b_pic_focus_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + GCForeground, &gcv); + + gcv.foreground = resource.wstyle.b_pic_unfocus.getPixel(); + resource.wstyle.b_pic_unfocus_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + GCForeground, &gcv); + + gcv.foreground = resource.mstyle.t_text.getPixel(); + if (resource.mstyle.t_font) + gcv.font = resource.mstyle.t_font->fid; + resource.mstyle.t_text_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.f_text.getPixel(); + if (resource.mstyle.f_font) + gcv.font = resource.mstyle.f_font->fid; + resource.mstyle.f_text_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.h_text.getPixel(); + resource.mstyle.h_text_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.d_text.getPixel(); + resource.mstyle.d_text_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.hilite.getColor()->getPixel(); + resource.mstyle.hilite_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.tstyle.l_text.getPixel(); + if (resource.tstyle.font) + gcv.font = resource.tstyle.font->fid; + resource.tstyle.l_text_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.tstyle.w_text.getPixel(); + resource.tstyle.w_text_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.tstyle.c_text.getPixel(); + resource.tstyle.c_text_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + gcv.foreground = resource.tstyle.b_pic.getPixel(); + resource.tstyle.b_pic_gc = - XCreateGC(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateGC(getBaseDisplay().getXDisplay(), getRootWindow(), + gc_value_mask, &gcv); + + const char *s = i18n->getMessage(ScreenSet, ScreenPositionLength, + "0: 0000 x 0: 0000"); int l = strlen(s); - if (i18n.multibyte()) { + if (i18n->multibyte()) { XRectangle ink, logical; XmbTextExtents(resource.wstyle.fontset, s, l, &ink, &logical); geom_w = logical.width; @@@ -357,87 -196,79 +362,89 @@@ attrib.colormap = getColormap(); attrib.save_under = True; - geom_window = XCreateWindow(blackbox->getXDisplay(), getRootWindow(), - 0, 0, geom_w, geom_h, resource.border_width, - getDepth(), InputOutput, getVisual(), - mask, &attrib); + geom_window = - XCreateWindow(getBaseDisplay()->getXDisplay(), getRootWindow(), ++ XCreateWindow(getBaseDisplay().getXDisplay(), getRootWindow(), + 0, 0, geom_w, geom_h, resource.border_width, getDepth(), + InputOutput, getVisual(), mask, &attrib); geom_visible = False; - BTexture* texture = &(resource.wstyle.l_focus); - geom_pixmap = texture->render(geom_w, geom_h, geom_pixmap); - if (geom_pixmap == ParentRelative) { - texture = &(resource.wstyle.t_focus); - geom_pixmap = texture->render(geom_w, geom_h, geom_pixmap); + if (resource.wstyle.l_focus.getTexture() & BImage_ParentRelative) { + if (resource.wstyle.t_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; - XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, ++ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.t_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &resource.wstyle.t_focus); - XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), ++ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(), + geom_window, geom_pixmap); + } + } else { + if (resource.wstyle.l_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; - XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, ++ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.l_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &resource.wstyle.l_focus); - XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), ++ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(), + geom_window, geom_pixmap); + } } - if (! geom_pixmap) - XSetWindowBackground(blackbox->getXDisplay(), geom_window, - texture->color().pixel()); - else - XSetWindowBackgroundPixmap(blackbox->getXDisplay(), - geom_window, geom_pixmap); -- workspacemenu = new Workspacemenu(this); -- iconmenu = new Iconmenu(this); -- configmenu = new Configmenu(this); ++ workspacemenu = new Workspacemenu(*this); ++ iconmenu = new Iconmenu(*this); ++ configmenu = new Configmenu(*this); -- Workspace *wkspc = (Workspace *) 0; ++ Workspace *wkspc = NULL; if (resource.workspaces != 0) { - for (unsigned int i = 0; i < resource.workspaces; ++i) { - wkspc = new Workspace(this, workspacesList.size()); + for (int i = 0; i < resource.workspaces; ++i) { - wkspc = new Workspace(this, workspacesList->count()); - workspacesList->insert(wkspc); ++ wkspc = new Workspace(*this, workspacesList.size()); + workspacesList.push_back(wkspc); workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); } } else { - wkspc = new Workspace(this, workspacesList->count()); - workspacesList->insert(wkspc); - wkspc = new Workspace(this, workspacesList.size()); ++ setWorkspaceCount(1); ++ wkspc = new Workspace(*this, workspacesList.size()); + workspacesList.push_back(wkspc); workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); } + saveWorkspaceNames(); - updateNetizenWorkspaceCount(); - - workspacemenu->insert(i18n(IconSet, IconIcons, "Icons"), iconmenu); + workspacemenu->insert(i18n->getMessage(IconSet, IconIcons, "Icons"), + iconmenu); workspacemenu->update(); - current_workspace = workspacesList->first(); + current_workspace = workspacesList.front(); - - xatom->setValue(getRootWindow(), XAtom::net_current_desktop, - XAtom::cardinal, 0); //first workspace - workspacemenu->setItemSelected(2, True); -- toolbar = new Toolbar(this); ++ toolbar = new Toolbar(*this, config); - slit = new Slit(this); +#ifdef SLIT - slit = new Slit(this); ++ slit = new Slit(*this, config); +#endif // SLIT InitMenu(); raiseWindows(0, 0); rootmenu->update(); - updateAvailableArea(); - changeWorkspaceID(0); - unsigned int i, j, nchild; + int i; + unsigned int nchild; Window r, p, *children; - XQueryTree(getBaseDisplay()->getXDisplay(), getRootWindow(), &r, &p, - XQueryTree(blackbox->getXDisplay(), getRootWindow(), &r, &p, - &children, &nchild); ++ XQueryTree(getBaseDisplay().getXDisplay(), getRootWindow(), &r, &p, + &children, &nchild); // preen the window list of all icon windows... for better dockapp support - for (i = 0; i < nchild; i++) { + for (i = 0; i < (int) nchild; i++) { if (children[i] == None) continue; - XWMHints *wmhints = XGetWMHints(getBaseDisplay()->getXDisplay(), - XWMHints *wmhints = XGetWMHints(blackbox->getXDisplay(), - children[i]); ++ XWMHints *wmhints = XGetWMHints(getBaseDisplay().getXDisplay(), + children[i]); if (wmhints) { if ((wmhints->flags & IconWindowHint) && @@@ -454,35 -286,24 +461,31 @@@ } // manage shown windows - for (i = 0; i < nchild; ++i) { - if (children[i] == None || (! blackbox->validateWindow(children[i]))) + for (i = 0; i < (int) nchild; ++i) { - if (children[i] == None || (! openbox->validateWindow(children[i]))) ++ if (children[i] == None || (! openbox.validateWindow(children[i]))) continue; XWindowAttributes attrib; - if (XGetWindowAttributes(getBaseDisplay()->getXDisplay(), children[i], - if (XGetWindowAttributes(blackbox->getXDisplay(), children[i], &attrib)) { ++ if (XGetWindowAttributes(getBaseDisplay().getXDisplay(), children[i], + &attrib)) { if (attrib.override_redirect) continue; if (attrib.map_state != IsUnmapped) { - manageWindow(children[i]); + new OpenboxWindow(openbox, children[i], this); + - OpenboxWindow *win = openbox->searchWindow(children[i]); ++ OpenboxWindow *win = openbox.searchWindow(children[i]); + if (win) { + XMapRequestEvent mre; + mre.window = children[i]; + win->restoreAttributes(); - win->mapRequestEvent(&mre); ++ win->mapRequestEvent(&mre); + } } } } - if (! resource.sloppy_focus) - XSetInputFocus(getBaseDisplay()->getXDisplay(), toolbar->getWindowID(), - RevertToParent, CurrentTime); - XFree(children); - XFlush(getBaseDisplay()->getXDisplay()); - - // call this again just in case a window we found updates the Strut list - updateAvailableArea(); ++ XFlush(getBaseDisplay().getXDisplay()); } @@@ -493,27 -314,15 +496,20 @@@ BScreen::~BScreen(void) image_control->removeImage(geom_pixmap); if (geom_window != None) - XDestroyWindow(getBaseDisplay()->getXDisplay(), geom_window); - XDestroyWindow(blackbox->getXDisplay(), geom_window); ++ XDestroyWindow(getBaseDisplay().getXDisplay(), geom_window); + + removeWorkspaceNames(); - while (workspacesList->count()) - delete workspacesList->remove(0); - - while (rootmenuList->count()) - rootmenuList->remove(0); - - while (iconList->count()) - delete iconList->remove(0); - - while (netizenList->count()) - delete netizenList->remove(0); + std::for_each(workspacesList.begin(), workspacesList.end(), + PointerAssassin()); - + std::for_each(iconList.begin(), iconList.end(), PointerAssassin()); - + std::for_each(netizenList.begin(), netizenList.end(), PointerAssassin()); +#ifdef HAVE_STRFTIME + if (resource.strftime_format) + delete [] resource.strftime_format; +#endif // HAVE_STRFTIME + delete rootmenu; delete workspacemenu; delete iconmenu; @@@ -526,389 -331,348 +522,999 @@@ delete toolbar; delete image_control; - delete workspacesList; - delete workspaceNames; - delete rootmenuList; - delete iconList; - delete netizenList; - if (resource.wstyle.fontset) - XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.wstyle.fontset); - XFreeFontSet(blackbox->getXDisplay(), resource.wstyle.fontset); ++ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.wstyle.fontset); if (resource.mstyle.t_fontset) - XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.mstyle.t_fontset); - XFreeFontSet(blackbox->getXDisplay(), resource.mstyle.t_fontset); ++ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.mstyle.t_fontset); if (resource.mstyle.f_fontset) - XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.mstyle.f_fontset); - XFreeFontSet(blackbox->getXDisplay(), resource.mstyle.f_fontset); ++ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.mstyle.f_fontset); if (resource.tstyle.fontset) - XFreeFontSet(getBaseDisplay()->getXDisplay(), resource.tstyle.fontset); - XFreeFontSet(blackbox->getXDisplay(), resource.tstyle.fontset); ++ XFreeFontSet(getBaseDisplay().getXDisplay(), resource.tstyle.fontset); if (resource.wstyle.font) - XFreeFont(getBaseDisplay()->getXDisplay(), resource.wstyle.font); - XFreeFont(blackbox->getXDisplay(), resource.wstyle.font); ++ XFreeFont(getBaseDisplay().getXDisplay(), resource.wstyle.font); if (resource.mstyle.t_font) - XFreeFont(getBaseDisplay()->getXDisplay(), resource.mstyle.t_font); - XFreeFont(blackbox->getXDisplay(), resource.mstyle.t_font); ++ XFreeFont(getBaseDisplay().getXDisplay(), resource.mstyle.t_font); if (resource.mstyle.f_font) - XFreeFont(getBaseDisplay()->getXDisplay(), resource.mstyle.f_font); - XFreeFont(blackbox->getXDisplay(), resource.mstyle.f_font); ++ XFreeFont(getBaseDisplay().getXDisplay(), resource.mstyle.f_font); if (resource.tstyle.font) - XFreeFont(getBaseDisplay()->getXDisplay(), resource.tstyle.font); - XFreeFont(blackbox->getXDisplay(), resource.tstyle.font); - - XFreeGC(blackbox->getXDisplay(), opGC); ++ XFreeFont(getBaseDisplay().getXDisplay(), resource.tstyle.font); + if (resource.root_command != NULL) + delete [] resource.root_command; + - XFreeGC(getBaseDisplay()->getXDisplay(), opGC); ++ XFreeGC(getBaseDisplay().getXDisplay(), opGC); + - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.wstyle.l_text_focus_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.wstyle.l_text_unfocus_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.wstyle.b_pic_focus_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.wstyle.b_pic_unfocus_gc); + - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.mstyle.t_text_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.mstyle.f_text_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.mstyle.h_text_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.mstyle.d_text_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.mstyle.hilite_gc); + - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.tstyle.l_text_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.tstyle.w_text_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.tstyle.c_text_gc); - XFreeGC(getBaseDisplay()->getXDisplay(), ++ XFreeGC(getBaseDisplay().getXDisplay(), + resource.tstyle.b_pic_gc); +} + - void BScreen::readDatabaseTexture(char *rname, char *rclass, ++ ++Rect BScreen::availableArea() const { ++ // the following code is temporary and will be taken care of by Screen in the ++ // future (with the NETWM 'strut') ++ Rect space(0, 0, size().w(), size().h()); ++ if (!resource.full_max) { ++#ifdef SLIT ++ int slit_x = slit->autoHide() ? slit->hiddenOrigin().x() : slit->area().x(), ++ slit_y = slit->autoHide() ? slit->hiddenOrigin().y() : slit->area().y(); ++ unsigned int tbarh = resource.hide_toolbar ? 0 : ++ toolbar->getExposedHeight() + resource.border_width * 2; ++ bool tbartop; ++ switch (toolbar->placement()) { ++ case Toolbar::TopLeft: ++ case Toolbar::TopCenter: ++ case Toolbar::TopRight: ++ tbartop = true; ++ break; ++ case Toolbar::BottomLeft: ++ case Toolbar::BottomCenter: ++ case Toolbar::BottomRight: ++ tbartop = false; ++ break; ++ default: ++ ASSERT(false); // unhandled placement ++ } ++ if ((slit->direction() == Slit::Horizontal && ++ (slit->placement() == Slit::TopLeft || ++ slit->placement() == Slit::TopRight)) || ++ slit->placement() == Slit::TopCenter) { ++ // exclude top ++ if (tbartop && slit_y + slit->area().h() < tbarh) { ++ space.setY(space.y() + tbarh); ++ space.setH(space.h() - tbarh); ++ } else { ++ space.setY(space.y() + (slit_y + slit->area().h() + ++ resource.border_width * 2)); ++ space.setH(space.h() - (slit_y + slit->area().h() + ++ resource.border_width * 2)); ++ if (!tbartop) ++ space.setH(space.h() - tbarh); ++ } ++ } else if ((slit->direction() == Slit::Vertical && ++ (slit->placement() == Slit::TopRight || ++ slit->placement() == Slit::BottomRight)) || ++ slit->placement() == Slit::CenterRight) { ++ // exclude right ++ space.setW(space.w() - (size().w() - slit_x)); ++ if (tbartop) ++ space.setY(space.y() + tbarh); ++ space.setH(space.h() - tbarh); ++ } else if ((slit->direction() == Slit::Horizontal && ++ (slit->placement() == Slit::BottomLeft || ++ slit->placement() == Slit::BottomRight)) || ++ slit->placement() == Slit::BottomCenter) { ++ // exclude bottom ++ if (!tbartop && (size().h() - slit_y) < tbarh) { ++ space.setH(space.h() - tbarh); ++ } else { ++ space.setH(space.h() - (size().h() - slit_y)); ++ if (tbartop) { ++ space.setY(space.y() + tbarh); ++ space.setH(space.h() - tbarh); ++ } ++ } ++ } else {// if ((slit->direction() == Slit::Vertical && ++ // (slit->placement() == Slit::TopLeft || ++ // slit->placement() == Slit::BottomLeft)) || ++ // slit->placement() == Slit::CenterLeft) ++ // exclude left ++ space.setX(slit_x + slit->area().w() + ++ resource.border_width * 2); ++ space.setW(space.w() - (slit_x + slit->area().w() + ++ resource.border_width * 2)); ++ if (tbartop) ++ space.setY(space.y() + tbarh); ++ space.setH(space.h() - tbarh); ++ } ++#else // !SLIT ++ int tbarh = resource.hide_toolbar ? 0 : ++ toolbar->getExposedHeight() + resource.border_width * 2; ++ switch (toolbar->placement()) { ++ case Toolbar::TopLeft: ++ case Toolbar::TopCenter: ++ case Toolbar::TopRight: ++ space.setY(toolbar->getExposedHeight()); ++ space.setH(space.h() - toolbar->getExposedHeight()); ++ break; ++ case Toolbar::BottomLeft: ++ case Toolbar::BottomCenter: ++ case Toolbar::BottomRight: ++ space.setH(space.h() - tbarh); ++ break; ++ default: ++ ASSERT(false); // unhandled placement ++ } ++#endif // SLIT ++ } ++ return space; + } + + -void BScreen::removeWorkspaceNames(void) { - workspaceNames.clear(); ++void BScreen::readDatabaseTexture(const char *rname, const char *rclass, + BTexture *texture, + unsigned long default_pixel) +{ - XrmValue value; - char *value_type; - - if (XrmGetResource(resource.stylerc, rname, rclass, &value_type, - &value)) - image_control->parseTexture(texture, value.addr); ++ std::string s; ++ ++ if (resource.styleconfig.getValue(rname, rclass, s)) ++ image_control->parseTexture(texture, s.c_str()); + else + texture->setTexture(BImage_Solid | BImage_Flat); + + if (texture->getTexture() & BImage_Solid) { + int clen = strlen(rclass) + 32, nlen = strlen(rname) + 32; + + char *colorclass = new char[clen], *colorname = new char[nlen]; + + sprintf(colorclass, "%s.Color", rclass); + sprintf(colorname, "%s.color", rname); + + readDatabaseColor(colorname, colorclass, texture->getColor(), + default_pixel); + +#ifdef INTERLACE + sprintf(colorclass, "%s.ColorTo", rclass); + sprintf(colorname, "%s.colorTo", rname); + + readDatabaseColor(colorname, colorclass, texture->getColorTo(), + default_pixel); +#endif // INTERLACE + + delete [] colorclass; + delete [] colorname; + + if ((! texture->getColor()->isAllocated()) || + (texture->getTexture() & BImage_Flat)) + return; + + XColor xcol; + + xcol.red = (unsigned int) (texture->getColor()->getRed() + + (texture->getColor()->getRed() >> 1)); + if (xcol.red >= 0xff) xcol.red = 0xffff; + else xcol.red *= 0xff; + xcol.green = (unsigned int) (texture->getColor()->getGreen() + + (texture->getColor()->getGreen() >> 1)); + if (xcol.green >= 0xff) xcol.green = 0xffff; + else xcol.green *= 0xff; + xcol.blue = (unsigned int) (texture->getColor()->getBlue() + + (texture->getColor()->getBlue() >> 1)); + if (xcol.blue >= 0xff) xcol.blue = 0xffff; + else xcol.blue *= 0xff; + - if (! XAllocColor(getBaseDisplay()->getXDisplay(), ++ if (! XAllocColor(getBaseDisplay().getXDisplay(), + getColormap(), &xcol)) + xcol.pixel = 0; + + texture->getHiColor()->setPixel(xcol.pixel); + + xcol.red = + (unsigned int) ((texture->getColor()->getRed() >> 2) + + (texture->getColor()->getRed() >> 1)) * 0xff; + xcol.green = + (unsigned int) ((texture->getColor()->getGreen() >> 2) + + (texture->getColor()->getGreen() >> 1)) * 0xff; + xcol.blue = + (unsigned int) ((texture->getColor()->getBlue() >> 2) + + (texture->getColor()->getBlue() >> 1)) * 0xff; + - if (! XAllocColor(getBaseDisplay()->getXDisplay(), ++ if (! XAllocColor(getBaseDisplay().getXDisplay(), + getColormap(), &xcol)) + xcol.pixel = 0; + + texture->getLoColor()->setPixel(xcol.pixel); + } else if (texture->getTexture() & BImage_Gradient) { + int clen = strlen(rclass) + 10, nlen = strlen(rname) + 10; + + char *colorclass = new char[clen], *colorname = new char[nlen], + *colortoclass = new char[clen], *colortoname = new char[nlen]; + + sprintf(colorclass, "%s.Color", rclass); + sprintf(colorname, "%s.color", rname); + + sprintf(colortoclass, "%s.ColorTo", rclass); + sprintf(colortoname, "%s.colorTo", rname); + + readDatabaseColor(colorname, colorclass, texture->getColor(), + default_pixel); + readDatabaseColor(colortoname, colortoclass, texture->getColorTo(), + default_pixel); + + delete [] colorclass; + delete [] colorname; + delete [] colortoclass; + delete [] colortoname; + } } + + - void BScreen::readDatabaseColor(char *rname, char *rclass, BColor *color, - unsigned long default_pixel) ++void BScreen::readDatabaseColor(const char *rname, const char *rclass, ++ BColor *color, unsigned long default_pixel) +{ - XrmValue value; - char *value_type; - - if (XrmGetResource(resource.stylerc, rname, rclass, &value_type, - &value)) { - image_control->parseColor(color, value.addr); - } else { - // parsing with no color string just deallocates the color, if it has ++ std::string s; + -void BScreen::saveSloppyFocus(bool s) { - resource.sloppy_focus = s; - - string fmodel; - if (resource.sloppy_focus) { - fmodel = "SloppyFocus"; - if (resource.auto_raise) fmodel += " AutoRaise"; - if (resource.click_raise) fmodel += " ClickRaise"; - } else { - fmodel = "ClickToFocus"; ++ if (resource.styleconfig.getValue(rname, rclass, s)) ++ image_control->parseColor(color, s.c_str()); ++ else { ++ // parsing with no color std::string just deallocates the color, if it has + // been previously allocated + image_control->parseColor(color); + color->setPixel(default_pixel); } - config->setValue(screenstr + "focusModel", fmodel); } - void BScreen::readDatabaseFontSet(char *rname, char *rclass, -void BScreen::saveAutoRaise(bool a) { - resource.auto_raise = a; - saveSloppyFocus(resource.sloppy_focus); ++void BScreen::readDatabaseFontSet(const char *rname, const char *rclass, + XFontSet *fontset) { + if (! fontset) return; + + static char *defaultFont = "fixed"; - - Bool load_default = False; - XrmValue value; - char *value_type; ++ bool load_default = false; ++ std::string s; + + if (*fontset) - XFreeFontSet(getBaseDisplay()->getXDisplay(), *fontset); ++ XFreeFontSet(getBaseDisplay().getXDisplay(), *fontset); + - if (XrmGetResource(resource.stylerc, rname, rclass, &value_type, &value)) { - char *fontname = value.addr; - if (! (*fontset = createFontSet(fontname))) - load_default = True; - } else { - load_default = True; - } ++ if (resource.styleconfig.getValue(rname, rclass, s)) { ++ if (! (*fontset = createFontSet(s.c_str()))) ++ load_default = true; ++ } else ++ load_default = true; + + if (load_default) { + *fontset = createFontSet(defaultFont); + + if (! *fontset) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenDefaultFontLoadFail, + "BScreen::LoadStyle(): couldn't load default font.\n")); + exit(2); + } + } } - void BScreen::readDatabaseFont(char *rname, char *rclass, XFontStruct **font) { -void BScreen::saveClickRaise(bool c) { - resource.click_raise = c; - saveSloppyFocus(resource.sloppy_focus); ++void BScreen::readDatabaseFont(const char *rname, const char *rclass, ++ XFontStruct **font) { + if (! font) return; + + static char *defaultFont = "fixed"; - - Bool load_default = False; - XrmValue value; - char *value_type; ++ bool load_default = false; ++ std::string s; + + if (*font) - XFreeFont(getBaseDisplay()->getXDisplay(), *font); ++ XFreeFont(getBaseDisplay().getXDisplay(), *font); + - if (XrmGetResource(resource.stylerc, rname, rclass, &value_type, &value)) { - if ((*font = XLoadQueryFont(getBaseDisplay()->getXDisplay(), - value.addr)) == NULL) { ++ if (resource.styleconfig.getValue(rname, rclass, s)) { ++ if ((*font = XLoadQueryFont(getBaseDisplay().getXDisplay(), ++ s.c_str())) == NULL) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenFontLoadFail, + "BScreen::LoadStyle(): couldn't load font '%s'\n"), - value.addr); - - load_default = True; ++ s.c_str()); ++ load_default = true; + } - } else { - load_default = True; - } ++ } else ++ load_default = true; + + if (load_default) { - if ((*font = XLoadQueryFont(getBaseDisplay()->getXDisplay(), ++ if ((*font = XLoadQueryFont(getBaseDisplay().getXDisplay(), + defaultFont)) == NULL) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenDefaultFontLoadFail, + "BScreen::LoadStyle(): couldn't load default font.\n")); + exit(2); + } + } } - XFontSet BScreen::createFontSet(char *fontname) { -void BScreen::saveImageDither(bool d) { - image_control->setDither(d); - config->setValue(screenstr + "imageDither", doImageDither()); ++XFontSet BScreen::createFontSet(const char *fontname) { + XFontSet fs; + char **missing, *def = "-"; + int nmissing, pixel_size = 0, buf_size = 0; + char weight[FONT_ELEMENT_SIZE], slant[FONT_ELEMENT_SIZE]; + - fs = XCreateFontSet(getBaseDisplay()->getXDisplay(), ++ fs = XCreateFontSet(getBaseDisplay().getXDisplay(), + fontname, &missing, &nmissing, &def); + if (fs && (! nmissing)) return fs; + +#ifdef HAVE_SETLOCALE + if (! fs) { + if (nmissing) XFreeStringList(missing); + + setlocale(LC_CTYPE, "C"); - fs = XCreateFontSet(getBaseDisplay()->getXDisplay(), fontname, ++ fs = XCreateFontSet(getBaseDisplay().getXDisplay(), fontname, + &missing, &nmissing, &def); + setlocale(LC_CTYPE, ""); + } +#endif // HAVE_SETLOCALE + + if (fs) { + XFontStruct **fontstructs; + char **fontnames; + XFontsOfFontSet(fs, &fontstructs, &fontnames); + fontname = fontnames[0]; + } + + getFontElement(fontname, weight, FONT_ELEMENT_SIZE, + "-medium-", "-bold-", "-demibold-", "-regular-", NULL); + getFontElement(fontname, slant, FONT_ELEMENT_SIZE, + "-r-", "-i-", "-o-", "-ri-", "-ro-", NULL); + getFontSize(fontname, &pixel_size); + + if (! strcmp(weight, "*")) strncpy(weight, "medium", FONT_ELEMENT_SIZE); + if (! strcmp(slant, "*")) strncpy(slant, "r", FONT_ELEMENT_SIZE); + if (pixel_size < 3) pixel_size = 3; + else if (pixel_size > 97) pixel_size = 97; + + buf_size = strlen(fontname) + (FONT_ELEMENT_SIZE * 2) + 64; + char *pattern2 = new char[buf_size]; + snprintf(pattern2, buf_size - 1, + "%s," + "-*-*-%s-%s-*-*-%d-*-*-*-*-*-*-*," + "-*-*-*-*-*-*-%d-*-*-*-*-*-*-*,*", + fontname, weight, slant, pixel_size, pixel_size); + fontname = pattern2; + + if (nmissing) XFreeStringList(missing); - if (fs) XFreeFontSet(getBaseDisplay()->getXDisplay(), fs); ++ if (fs) XFreeFontSet(getBaseDisplay().getXDisplay(), fs); + - fs = XCreateFontSet(getBaseDisplay()->getXDisplay(), fontname, ++ fs = XCreateFontSet(getBaseDisplay().getXDisplay(), fontname, + &missing, &nmissing, &def); + delete [] pattern2; + + return fs; } -void BScreen::saveOpaqueMove(bool o) { - resource.opaque_move = o; - config->setValue(screenstr + "opaqueMove", resource.opaque_move); ++void BScreen::setWindowToWindowSnap(bool sn) { ++ resource.window_to_window_snap = sn; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".windowToWindowSnap" << ends; ++ config.setValue(s.str(), resource.window_to_window_snap); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveFullMax(bool f) { - resource.full_max = f; - config->setValue(screenstr + "fullMaximization", resource.full_max); ++void BScreen::setWindowCornerSnap(bool sn) { ++ resource.window_corner_snap = sn; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".windowCornerSnap" << ends; ++ config.setValue(s.str(), resource.window_corner_snap); ++ s.rdbuf()->freeze(0); + } + ++ ++void BScreen::setSloppyFocus(bool b) { ++ resource.sloppy_focus = b; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".focusModel" << ends; ++ config.setValue(s.str(), ++ (resource.sloppy_focus ? ++ (resource.auto_raise ? "AutoRaiseSloppyFocus" : "SloppyFocus") ++ : "ClickToFocus")); ++ s.rdbuf()->freeze(0); ++} + -void BScreen::saveFocusNew(bool f) { - resource.focus_new = f; - config->setValue(screenstr + "focusNewWindows", resource.focus_new); ++ ++void BScreen::setAutoRaise(bool a) { ++ resource.auto_raise = a; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".focusModel" << ends; ++ config.setValue(s.str(), ++ (resource.sloppy_focus ? ++ (resource.auto_raise ? "AutoRaiseSloppyFocus" : "SloppyFocus") ++ : "ClickToFocus")); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveFocusLast(bool f) { - resource.focus_last = f; - config->setValue(screenstr + "focusLastWindow", resource.focus_last); ++void BScreen::setImageDither(bool d, bool reconfig) { ++ image_control->setDither(d); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".imageDither" << ends; ++ config.setValue(s.str(), imageDither()); ++ if (reconfig) ++ reconfigure(); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveHideToolbar(bool h) { - resource.hide_toolbar = h; - if (resource.hide_toolbar) - toolbar->unmapToolbar(); - else - toolbar->mapToolbar(); - config->setValue(screenstr + "hideToolbar", resource.hide_toolbar); ++void BScreen::setOpaqueMove(bool o) { ++ resource.opaque_move = o; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".opaqueMove" << ends; ++ 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; ++ config.setValue(s.str(), resource.full_max); ++ s.rdbuf()->freeze(0); ++} ++ ++ ++void BScreen::setFocusNew(bool f) { ++ resource.focus_new = f; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".focusNewWindows" << ends; ++ config.setValue(s.str(), resource.focus_new); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveWindowToWindowSnap(bool s) { - resource.window_to_window_snap = s; - config->setValue(screenstr + "windowToWindowSnap", - resource.window_to_window_snap); ++void BScreen::setFocusLast(bool f) { ++ resource.focus_last = f; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".focusLastWindow" << ends; ++ config.setValue(s.str(), resource.focus_last); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveWindowCornerSnap(bool s) { - resource.window_corner_snap = s; - config->setValue(screenstr + "windowCornerSnap", - resource.window_corner_snap); ++void BScreen::setWindowZones(int z) { ++ resource.zones = z; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".windowZones" << ends; ++ config.setValue(s.str(), resource.zones); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveWorkspaces(unsigned int w) { ++void BScreen::setWorkspaceCount(int w) { + resource.workspaces = w; - config->setValue(screenstr + "workspaces", resource.workspaces); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".workspaces" << ends; ++ config.setValue(s.str(), resource.workspaces); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::savePlacementPolicy(int p) { - resource.placement_policy = p; ++void BScreen::setPlacementPolicy(int p) { ++ resource.placement_policy = p; ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".windowPlacement" << ends; + const char *placement; + switch (resource.placement_policy) { + case CascadePlacement: placement = "CascadePlacement"; break; ++ case BestFitPlacement: placement = "BestFitPlacement"; break; + case ColSmartPlacement: placement = "ColSmartPlacement"; break; - case RowSmartPlacement: default: placement = "RowSmartPlacement"; break; ++ case UnderMousePlacement: placement = "UnderMousePlacement"; break; ++ case ClickMousePlacement: placement = "ClickMousePlacement"; break; ++ default: ++ case RowSmartPlacement: placement = "RowSmartPlacement"; break; + } - config->setValue(screenstr + "windowPlacement", placement); ++ config.setValue(s.str(), placement); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveEdgeSnapThreshold(int t) { ++void BScreen::setEdgeSnapThreshold(int t) { + resource.edge_snap_threshold = t; - config->setValue(screenstr + "edgeSnapThreshold", - resource.edge_snap_threshold); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".edgeSnapThreshold" << ends; ++ config.setValue(s.str(), resource.edge_snap_threshold); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveRowPlacementDirection(int d) { ++void BScreen::setRowPlacementDirection(int d) { + resource.row_direction = d; - config->setValue(screenstr + "rowPlacementDirection", - resource.row_direction == LeftRight ? - "LeftToRight" : "RightToLeft"); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".rowPlacementDirection" << ends; ++ config.setValue(s.str(), ++ resource.row_direction == LeftRight ? ++ "LeftToRight" : "RightToLeft"); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveColPlacementDirection(int d) { ++void BScreen::setColPlacementDirection(int d) { + resource.col_direction = d; - config->setValue(screenstr + "colPlacementDirection", - resource.col_direction == TopBottom ? - "TopToBottom" : "BottomToTop"); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".colPlacementDirection" << ends; ++ config.setValue(s.str(), ++ resource.col_direction == TopBottom ? ++ "TopToBottom" : "BottomToTop"); ++ s.rdbuf()->freeze(0); ++} ++ ++ ++void BScreen::setRootCommand(const char *cmd) { ++if (resource.root_command != NULL) ++ delete [] resource.root_command; ++ if (cmd != NULL) ++ resource.root_command = bstrdup(cmd); ++ else ++ resource.root_command = NULL; ++ // this doesn't save to the Resources config because it can't be changed ++ // inside Openbox, and this way we dont add an empty command which would over- ++ // ride the styles command when none has been specified + } + + + #ifdef HAVE_STRFTIME -void BScreen::saveStrftimeFormat(const std::string& format) { - resource.strftime_format = format; - config->setValue(screenstr + "strftimeFormat", resource.strftime_format); ++void BScreen::setStrftimeFormat(const char *f) { ++ if (resource.strftime_format != NULL) ++ delete [] resource.strftime_format; ++ ++ resource.strftime_format = bstrdup(f); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".strftimeFormat" << ends; ++ config.setValue(s.str(), resource.strftime_format); ++ s.rdbuf()->freeze(0); + } + + #else // !HAVE_STRFTIME + -void BScreen::saveDateFormat(int f) { ++void BScreen::setDateFormat(int f) { + resource.date_format = f; - config->setValue(screenstr + "dateFormat", - resource.date_format == B_EuropeanDate ? - "European" : "American"); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".dateFormat" << ends; ++ config.setValue(s.str(), resource.date_format == B_EuropeanDate ? ++ "European" : "American"); ++ s.rdbuf()->freeze(0); + } + + -void BScreen::saveClock24Hour(Bool c) { ++void BScreen::setClock24Hour(Bool c) { + resource.clock24hour = c; - config->setValue(screenstr + "clockFormat", resource.clock24hour ? 24 : 12); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".clockFormat" << ends; ++ config.setValue(s.str(), resource.clock24hour ? 24 : 12); ++ s.rdbuf()->freeze(0); + } + #endif // HAVE_STRFTIME + + ++void BScreen::setHideToolbar(bool b) { ++ resource.hide_toolbar = b; ++ if (resource.hide_toolbar) ++ getToolbar()->unMapToolbar(); ++ else ++ getToolbar()->mapToolbar(); ++ std::ostrstream s; ++ s << "session.screen" << getScreenNumber() << ".hideToolbar" << ends; ++ config.setValue(s.str(), resource.hide_toolbar ? "True" : "False"); ++ s.rdbuf()->freeze(0); ++} ++ ++ + void BScreen::saveWorkspaceNames() { - string names; - WorkspaceList::iterator it; - WorkspaceList::iterator last = workspacesList.end() - 1; ++ std::ostrstream rc, names; ++ ++ wkspList::iterator it; ++ wkspList::iterator last = workspacesList.end() - 1; + for (it = workspacesList.begin(); it != workspacesList.end(); ++it) { - names += (*it)->getName(); ++ names << (*it)->getName(); + if (it != last) - names += ','; ++ names << ","; + } - config->setValue(screenstr + "workspaceNames", names); -} - - -void BScreen::save_rc(void) { - saveSloppyFocus(resource.sloppy_focus); - saveAutoRaise(resource.auto_raise); - saveImageDither(doImageDither()); - saveOpaqueMove(resource.opaque_move); - saveFullMax(resource.full_max); - saveFocusNew(resource.focus_new); - saveFocusLast(resource.focus_last); - saveHideToolbar(resource.hide_toolbar); - saveWindowToWindowSnap(resource.window_to_window_snap); - saveWindowCornerSnap(resource.window_corner_snap); - saveWorkspaces(resource.workspaces); - savePlacementPolicy(resource.placement_policy); - saveEdgeSnapThreshold(resource.edge_snap_threshold); - saveRowPlacementDirection(resource.row_direction); - saveColPlacementDirection(resource.col_direction); ++ names << ends; ++ ++ rc << "session.screen" << getScreenNumber() << ".workspaceNames" << ends; ++ config.setValue(rc.str(), names.str()); ++ rc.rdbuf()->freeze(0); ++ names.rdbuf()->freeze(0); ++} ++ ++void BScreen::save() { ++ setWindowToWindowSnap(resource.window_to_window_snap); ++ setWindowCornerSnap(resource.window_corner_snap); ++ setSloppyFocus(resource.sloppy_focus); ++ setAutoRaise(resource.auto_raise); ++ setImageDither(imageDither(), false); ++ setOpaqueMove(resource.opaque_move); ++ setFullMax(resource.full_max); ++ setFocusNew(resource.focus_new); ++ setFocusLast(resource.focus_last); ++ setWindowZones(resource.zones); ++ setWorkspaceCount(resource.workspaces); ++ setPlacementPolicy(resource.placement_policy); ++ setEdgeSnapThreshold(resource.edge_snap_threshold); ++ setRowPlacementDirection(resource.row_direction); ++ setColPlacementDirection(resource.col_direction); ++ setRootCommand(resource.root_command); + #ifdef HAVE_STRFTIME - saveStrftimeFormat(resource.strftime_format); ++ // it deletes the current value before setting the new one, so we have to ++ // duplicate the current value. ++ std::string s = resource.strftime_format; ++ setStrftimeFormat(s.c_str()); + #else // !HAVE_STRFTIME - saveDateFormat(resource.date_format); - savwClock24Hour(resource.clock24hour); ++ setDateFormat(resource.date_format); ++ setClock24Hour(resource.clock24hour); + #endif // HAVE_STRFTIME - - toolbar->save_rc(); - slit->save_rc(); ++ setHideToolbar(resource.hide_toolbar); ++ ++ toolbar->save(); ++#ifdef SLIT ++ slit->save(); ++#endif // SLIT + } + + -void BScreen::load_rc(void) { ++void BScreen::load() { ++ std::ostrstream rscreen, rname, rclass; + std::string s; + bool b; ++ long l; ++ rscreen << "session.screen" << getScreenNumber() << '.' << ends; + - if (! config->getValue(screenstr + "fullMaximization", resource.full_max)) - resource.full_max = false; - - if (! config->getValue(screenstr + "focusNewWindows", resource.focus_new)) - resource.focus_new = false; - - if (! config->getValue(screenstr + "focusLastWindow", resource.focus_last)) - resource.focus_last = false; - - if (! config->getValue(screenstr + "workspaces", resource.workspaces)) - resource.workspaces = 1; - - if (! config->getValue(screenstr + "opaqueMove", resource.opaque_move)) - resource.opaque_move = false; - - if (! config->getValue(screenstr + "hideToolbar", resource.hide_toolbar)) ++ rname << rscreen.str() << "hideToolbar" << ends; ++ rclass << rscreen.str() << "HideToolbar" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ resource.hide_toolbar = b; ++ else + resource.hide_toolbar = false; ++ Toolbar *t = getToolbar(); ++ if (t != NULL) { ++ if (resource.hide_toolbar) ++ t->unMapToolbar(); ++ else ++ t->mapToolbar(); ++ } ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "fullMaximization" << ends; ++ rclass << rscreen.str() << "FullMaximization" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ resource.full_max = b; ++ else ++ resource.full_max = false; + - if (! config->getValue(screenstr + "windowToWindowSnap", - resource.window_to_window_snap)) ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "windowToWindowSnap" << ends; ++ rclass << rscreen.str() << "windowToWindowSnap" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ resource.window_to_window_snap = b; ++ else + resource.window_to_window_snap = true; + - if (! config->getValue(screenstr + "windowCornerSnap", - resource.window_corner_snap)) ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "windowCornerSnap" << ends; ++ rclass << rscreen.str() << "windowCornerSnap" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ resource.window_corner_snap = b; ++ else + resource.window_corner_snap = true; + - if (! config->getValue(screenstr + "imageDither", b)) - b = true; - image_control->setDither(b); ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "focusNewWindows" << ends; ++ rclass << rscreen.str() << "FocusNewWindows" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ resource.focus_new = b; ++ else ++ resource.focus_new = false; + - if (! config->getValue(screenstr + "edgeSnapThreshold", - resource.edge_snap_threshold)) - resource.edge_snap_threshold = 4; - - if (config->getValue(screenstr + "rowPlacementDirection", s) && - s == "RightToLeft") - resource.row_direction = RightLeft; ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "focusLastWindow" << ends; ++ rclass << rscreen.str() << "FocusLastWindow" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ resource.focus_last = b; + else ++ resource.focus_last = false; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "rowPlacementDirection" << ends; ++ rclass << rscreen.str() << "RowPlacementDirection" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (0 == strncasecmp(s.c_str(), "RightToLeft", s.length())) ++ resource.row_direction = RightLeft; ++ else //if (0 == strncasecmp(s.c_str(), "LeftToRight", s.length())) ++ resource.row_direction = LeftRight; ++ } else + resource.row_direction = LeftRight; + - if (config->getValue(screenstr + "colPlacementDirection", s) && - s == "BottomToTop") - resource.col_direction = BottomTop; - else ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "colPlacementDirection" << ends; ++ rclass << rscreen.str() << "ColPlacementDirection" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (0 == strncasecmp(s.c_str(), "BottomToTop", s.length())) ++ resource.col_direction = BottomTop; ++ else //if (0 == strncasecmp(s.c_str(), "TopToBottom", s.length())) ++ resource.col_direction = TopBottom; ++ } else + resource.col_direction = TopBottom; + ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "workspaces" << ends; ++ rclass << rscreen.str() << "Workspaces" << ends; ++ if (config.getValue(rname.str(), rclass.str(), l)) { ++ resource.workspaces = l; ++ } else ++ resource.workspaces = 1; ++ + removeWorkspaceNames(); - if (config->getValue(screenstr + "workspaceNames", s)) { - string::const_iterator it = s.begin(), end = s.end(); ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "workspaceNames" << ends; ++ rclass << rscreen.str() << "WorkspaceNames" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ std::string::const_iterator it = s.begin(), end = s.end(); + while(1) { - string::const_iterator tmp = it; // current string.begin() ++ std::string::const_iterator tmp = it;// current string.begin() + it = std::find(tmp, end, ','); // look for comma between tmp and end - addWorkspaceName(string(tmp, it)); // s[tmp:it] ++ std::string name(tmp, it); // name = s[tmp:it] ++ addWorkspaceName(name.c_str()); + if (it == end) + break; + ++it; + } + } - - resource.sloppy_focus = true; - resource.auto_raise = false; - resource.click_raise = false; - if (config->getValue(screenstr + "focusModel", s)) { - if (s.find("ClickToFocus") != string::npos) { ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "focusModel" << ends; ++ rclass << rscreen.str() << "FocusModel" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (0 == strncasecmp(s.c_str(), "ClickToFocus", s.length())) { ++ resource.auto_raise = false; + resource.sloppy_focus = false; - } else { - // must be sloppy - if (s.find("AutoRaise") != string::npos) - resource.auto_raise = true; - if (s.find("ClickRaise") != string::npos) - resource.click_raise = true; ++ } else if (0 == strncasecmp(s.c_str(), "AutoRaiseSloppyFocus", ++ s.length())) { ++ resource.sloppy_focus = true; ++ resource.auto_raise = true; ++ } else { //if (0 == strncasecmp(s.c_str(), "SloppyFocus", s.length())) { ++ resource.sloppy_focus = true; ++ resource.auto_raise = false; + } ++ } else { ++ resource.sloppy_focus = true; ++ resource.auto_raise = false; + } + - if (config->getValue(screenstr + "windowPlacement", s)) { - if (s == "CascadePlacement") - resource.placement_policy = CascadePlacement; - else if (s == "ColSmartPlacement") - resource.placement_policy = ColSmartPlacement; - else //if (s == "RowSmartPlacement") ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "windowZones" << ends; ++ rclass << rscreen.str() << "WindowZones" << ends; ++ 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.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "windowPlacement" << ends; ++ rclass << rscreen.str() << "WindowPlacement" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (0 == strncasecmp(s.c_str(), "RowSmartPlacement", s.length())) + resource.placement_policy = RowSmartPlacement; ++ else if (0 == strncasecmp(s.c_str(), "ColSmartPlacement", s.length())) ++ resource.placement_policy = ColSmartPlacement; ++ else if (0 == strncasecmp(s.c_str(), "BestFitPlacement", s.length())) ++ resource.placement_policy = BestFitPlacement; ++ else if (0 == strncasecmp(s.c_str(), "UnderMousePlacement", s.length())) ++ resource.placement_policy = UnderMousePlacement; ++ else if (0 == strncasecmp(s.c_str(), "ClickMousePlacement", s.length())) ++ resource.placement_policy = ClickMousePlacement; ++ else //if (0 == strncasecmp(s.c_str(), "CascadePlacement", s.length())) ++ resource.placement_policy = CascadePlacement; + } else - resource.placement_policy = RowSmartPlacement; ++ resource.placement_policy = CascadePlacement; + + #ifdef HAVE_STRFTIME - if (config->getValue(screenstr + "strftimeFormat", s)) - resource.strftime_format = s; ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "strftimeFormat" << ends; ++ rclass << rscreen.str() << "StrftimeFormat" << ends; ++ ++ if (resource.strftime_format != NULL) ++ delete [] resource.strftime_format; ++ ++ if (config.getValue(rname.str(), rclass.str(), s)) ++ resource.strftime_format = bstrdup(s.c_str()); + else - resource.strftime_format = "%I:%M %p"; ++ resource.strftime_format = bstrdup("%I:%M %p"); + #else // !HAVE_STRFTIME - long l; - - if (config->getValue(screenstr + "dateFormat", s) && s == "European") - resource.date_format = B_EuropeanDate; - else ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "dateFormat" << ends; ++ rclass << rscreen.str() << "DateFormat" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (strncasecmp(s.c_str(), "European", s.length())) ++ resource.date_format = B_EuropeanDate; ++ else //if (strncasecmp(s.c_str(), "American", s.length())) ++ resource.date_format = B_AmericanDate; ++ } else + resource.date_format = B_AmericanDate; + - if (! config->getValue(screenstr + "clockFormat", l)) - l = 12; - resource.clock24hour = l == 24; ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "clockFormat" << ends; ++ rclass << rscreen.str() << "ClockFormat" << ends; ++ if (config.getValue(rname.str(), rclass.str(), l)) { ++ if (clock == 24) ++ resource.clock24hour = true; ++ else if (clock == 12) ++ resource.clock24hour = false; ++ } else ++ resource.clock24hour = false; + #endif // HAVE_STRFTIME -} + ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "edgeSnapThreshold" << ends; ++ rclass << rscreen.str() << "EdgeSnapThreshold" << ends; ++ 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.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "imageDither" << ends; ++ rclass << rscreen.str() << "ImageDither" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ image_control->setDither(b); ++ else ++ image_control->setDither(true); ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "rootCommand" << ends; ++ rclass << rscreen.str() << "RootCommand" << ends; ++ ++ if (resource.root_command != NULL) ++ delete [] resource.root_command; ++ ++ if (config.getValue(rname.str(), rclass.str(), s)) ++ resource.root_command = bstrdup(s.c_str()); ++ else ++ resource.root_command = NULL; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "opaqueMove" << ends; ++ rclass << rscreen.str() << "OpaqueMove" << ends; ++ 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) { - load_rc(); - toolbar->load_rc(); - slit->load_rc(); ++ load(); ++ toolbar->load(); ++#ifdef SLIT ++ slit->load(); ++#endif // SLIT LoadStyle(); XGCValues gcv; unsigned long gc_value_mask = GCForeground; - if (! i18n.multibyte()) gc_value_mask |= GCFont; + if (! i18n->multibyte()) gc_value_mask |= GCFont; - gcv.foreground = WhitePixel(getBaseDisplay()->getXDisplay(), - gcv.foreground = WhitePixel(blackbox->getXDisplay(), - getScreenNumber()); ++ gcv.foreground = WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber()); gcv.function = GXinvert; gcv.subwindow_mode = IncludeInferiors; - XChangeGC(getBaseDisplay()->getXDisplay(), opGC, - XChangeGC(blackbox->getXDisplay(), opGC, - GCForeground | GCFunction | GCSubwindowMode, &gcv); ++ XChangeGC(getBaseDisplay().getXDisplay(), opGC, + GCForeground | GCFunction | GCSubwindowMode, &gcv); + + gcv.foreground = resource.wstyle.l_text_focus.getPixel(); + if (resource.wstyle.font) + gcv.font = resource.wstyle.font->fid; - XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.l_text_focus_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.l_text_focus_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.wstyle.l_text_unfocus.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.l_text_unfocus_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.l_text_unfocus_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.wstyle.b_pic_focus.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.b_pic_focus_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.b_pic_focus_gc, + GCForeground, &gcv); + + gcv.foreground = resource.wstyle.b_pic_unfocus.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.wstyle.b_pic_unfocus_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.wstyle.b_pic_unfocus_gc, + GCForeground, &gcv); + + gcv.foreground = resource.mstyle.t_text.getPixel(); + if (resource.mstyle.t_font) + gcv.font = resource.mstyle.t_font->fid; - XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.t_text_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.t_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.f_text.getPixel(); + if (resource.mstyle.f_font) + gcv.font = resource.mstyle.f_font->fid; - XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.f_text_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.f_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.h_text.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.h_text_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.h_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.d_text.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.d_text_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.d_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.mstyle.hilite.getColor()->getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.mstyle.hilite_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.mstyle.hilite_gc, + gc_value_mask, &gcv); - const char *s = i18n(ScreenSet, ScreenPositionLength, - "0: 0000 x 0: 0000"); + gcv.foreground = resource.tstyle.l_text.getPixel(); + if (resource.tstyle.font) + gcv.font = resource.tstyle.font->fid; - XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.l_text_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.l_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.tstyle.w_text.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.w_text_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.w_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.tstyle.c_text.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.c_text_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.c_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = resource.tstyle.b_pic.getPixel(); - XChangeGC(getBaseDisplay()->getXDisplay(), resource.tstyle.b_pic_gc, ++ XChangeGC(getBaseDisplay().getXDisplay(), resource.tstyle.b_pic_gc, + gc_value_mask, &gcv); + + const char *s = i18n->getMessage(ScreenSet, ScreenPositionLength, + "0: 0000 x 0: 0000"); int l = strlen(s); - if (i18n.multibyte()) { + if (i18n->multibyte()) { XRectangle ink, logical; XmbTextExtents(resource.wstyle.fontset, s, l, &ink, &logical); geom_w = logical.width; @@@ -924,66 -687,68 +1530,84 @@@ geom_w += (resource.bevel_width * 2); geom_h += (resource.bevel_width * 2); - BTexture* texture = &(resource.wstyle.l_focus); - geom_pixmap = texture->render(geom_w, geom_h, geom_pixmap); - if (geom_pixmap == ParentRelative) { - texture = &(resource.wstyle.t_focus); - geom_pixmap = texture->render(geom_w, geom_h, geom_pixmap); + Pixmap tmp = geom_pixmap; + if (resource.wstyle.l_focus.getTexture() & BImage_ParentRelative) { + if (resource.wstyle.t_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; - XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, ++ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.t_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &resource.wstyle.t_focus); - XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), ++ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(), + geom_window, geom_pixmap); + } + } else { + if (resource.wstyle.l_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; - XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, ++ XSetWindowBackground(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.l_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &resource.wstyle.l_focus); - XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), ++ XSetWindowBackgroundPixmap(getBaseDisplay().getXDisplay(), + geom_window, geom_pixmap); + } } - if (! geom_pixmap) - XSetWindowBackground(blackbox->getXDisplay(), geom_window, - texture->color().pixel()); - else - XSetWindowBackgroundPixmap(blackbox->getXDisplay(), - geom_window, geom_pixmap); + if (tmp) image_control->removeImage(tmp); - XSetWindowBorderWidth(getBaseDisplay()->getXDisplay(), geom_window, - XSetWindowBorderWidth(blackbox->getXDisplay(), geom_window, ++ XSetWindowBorderWidth(getBaseDisplay().getXDisplay(), geom_window, resource.border_width); - XSetWindowBorder(getBaseDisplay()->getXDisplay(), geom_window, - XSetWindowBorder(blackbox->getXDisplay(), geom_window, - resource.border_color.pixel()); ++ XSetWindowBorder(getBaseDisplay().getXDisplay(), geom_window, + resource.border_color.getPixel()); workspacemenu->reconfigure(); iconmenu->reconfigure(); - typedef std::vector SubList; - SubList remember_subs; - - // save the current open menus - Basemenu *menu = rootmenu; - int submenu; - while ((submenu = menu->getCurrentSubmenu()) >= 0) { - remember_subs.push_back(submenu); - menu = menu->find(submenu)->submenu(); - assert(menu); - } - - InitMenu(); - raiseWindows(0, 0); - rootmenu->reconfigure(); + { - int remember_sub = rootmenu->getCurrentSubmenu(); ++ typedef std::vector SubList; ++ SubList remember_subs; ++ ++ // save the current open menus ++ Basemenu *menu = rootmenu; ++ int submenu; ++ while ((submenu = menu->getCurrentSubmenu()) >= 0) { ++ remember_subs.push_back(submenu); ++ menu = menu->find(submenu)->submenu(); ++ assert(menu); ++ } + - // reopen the saved menus - menu = rootmenu; - const SubList::iterator subs_end = remember_subs.end(); - for (SubList::iterator it = remember_subs.begin(); it != subs_end; ++it) { - menu->drawSubmenu(*it); - menu = menu->find(*it)->submenu(); - if (! menu) - break; + InitMenu(); + raiseWindows(0, 0); + rootmenu->reconfigure(); - rootmenu->drawSubmenu(remember_sub); ++ ++ // reopen the saved menus ++ menu = rootmenu; ++ const SubList::iterator subs_end = remember_subs.end(); ++ for (SubList::iterator it = remember_subs.begin(); it != subs_end; ++it) { ++ menu->drawSubmenu(*it); ++ menu = menu->find(*it)->submenu(); ++ if (! menu) ++ break; ++ } } configmenu->reconfigure(); toolbar->reconfigure(); +#ifdef SLIT slit->reconfigure(); +#endif // SLIT - LinkedListIterator wit(workspacesList); - for (Workspace *w = wit.current(); w; wit++, w = wit.current()) - w->reconfigure(); + std::for_each(workspacesList.begin(), workspacesList.end(), + std::mem_fun(&Workspace::reconfigure)); - LinkedListIterator iit(iconList); - for (OpenboxWindow *bw = iit.current(); bw; iit++, bw = iit.current()) - BlackboxWindowList::iterator iit = iconList.begin(); - for (; iit != iconList.end(); ++iit) { - BlackboxWindow *bw = *iit; -- if (bw->validateClient()) -- bw->reconfigure(); - } ++ for (winList::iterator it = iconList.begin(); it != iconList.end(); ++it) ++ if ((*it)->validateClient()) ++ (*it)->reconfigure(); image_control->timeout(); } @@@ -997,32 -762,52 +1621,44 @@@ void BScreen::rereadMenu(void) } -void BScreen::LoadStyle(void) { - Configuration style; +void BScreen::removeWorkspaceNames(void) { - while (workspaceNames->count()) - delete [] workspaceNames->remove(0); ++ workspaceNames.clear(); +} + - const char *sfile = blackbox->getStyleFilename(); +void BScreen::LoadStyle(void) { - resource.stylerc = XrmGetFileDatabase(openbox->getStyleFilename()); - if (resource.stylerc == NULL) - resource.stylerc = XrmGetFileDatabase(DEFAULTSTYLE); - assert(resource.stylerc != NULL); - - XrmValue value; - char *value_type; ++ Resource &conf = resource.styleconfig; ++ ++ const char *sfile = openbox.getStyleFilename(); ++ bool loaded = false; + if (sfile != NULL) { - style.setFile(sfile); - if (! style.load()) { - style.setFile(DEFAULTSTYLE); - if (! style.load()) - style.create(); // hardcoded default values will be used. ++ conf.setFile(sfile); ++ loaded = conf.load(); ++ } ++ if (!loaded) { ++ conf.setFile(DEFAULTSTYLE); ++ if (!conf.load()) { ++ fprintf(stderr, i18n->getMessage(ScreenSet, ScreenDefaultStyleLoadFail, ++ "BScreen::LoadStyle(): couldn't load " ++ "default style.\n")); ++ exit(2); + } + } - string s; - ++ std::string s; ++ long l; ++ // load fonts/fontsets - if (resource.wstyle.fontset) - XFreeFontSet(blackbox->getXDisplay(), resource.wstyle.fontset); - if (resource.tstyle.fontset) - XFreeFontSet(blackbox->getXDisplay(), resource.tstyle.fontset); - if (resource.mstyle.f_fontset) - XFreeFontSet(blackbox->getXDisplay(), resource.mstyle.f_fontset); - if (resource.mstyle.t_fontset) - XFreeFontSet(blackbox->getXDisplay(), resource.mstyle.t_fontset); - resource.wstyle.fontset = 0; - resource.tstyle.fontset = 0; - resource.mstyle.f_fontset = 0; - resource.mstyle.t_fontset = 0; - if (resource.wstyle.font) - XFreeFont(blackbox->getXDisplay(), resource.wstyle.font); - if (resource.tstyle.font) - XFreeFont(blackbox->getXDisplay(), resource.tstyle.font); - if (resource.mstyle.f_font) - XFreeFont(blackbox->getXDisplay(), resource.mstyle.f_font); - if (resource.mstyle.t_font) - XFreeFont(blackbox->getXDisplay(), resource.mstyle.t_font); - resource.wstyle.font = 0; - resource.tstyle.font = 0; - resource.mstyle.f_font = 0; - resource.mstyle.t_font = 0; - - if (i18n.multibyte()) { - resource.wstyle.fontset = readDatabaseFontSet("window.font", style); - resource.tstyle.fontset = readDatabaseFontSet("toolbar.font", style); - resource.mstyle.t_fontset = readDatabaseFontSet("menu.title.font", style); - resource.mstyle.f_fontset = readDatabaseFontSet("menu.frame.font", style); + + if (i18n->multibyte()) { + readDatabaseFontSet("window.font", "Window.Font", + &resource.wstyle.fontset); + readDatabaseFontSet("toolbar.font", "Toolbar.Font", + &resource.tstyle.fontset); + readDatabaseFontSet("menu.title.font", "Menu.Title.Font", + &resource.mstyle.t_fontset); + readDatabaseFontSet("menu.frame.font", "Menu.Frame.Font", + &resource.mstyle.f_fontset); resource.mstyle.t_fontset_extents = XExtentsOfFontSet(resource.mstyle.t_fontset); @@@ -1044,325 -825,199 +1680,313 @@@ } // load window config - resource.wstyle.t_focus = - readDatabaseTexture("window.title.focus", "white", style); - resource.wstyle.t_unfocus = - readDatabaseTexture("window.title.unfocus", "black", style); - resource.wstyle.l_focus = - readDatabaseTexture("window.label.focus", "white", style); - resource.wstyle.l_unfocus = - readDatabaseTexture("window.label.unfocus", "black", style); - resource.wstyle.h_focus = - readDatabaseTexture("window.handle.focus", "white", style); - resource.wstyle.h_unfocus = - readDatabaseTexture("window.handle.unfocus", "black", style); - resource.wstyle.g_focus = - readDatabaseTexture("window.grip.focus", "white", style); - resource.wstyle.g_unfocus = - readDatabaseTexture("window.grip.unfocus", "black", style); - resource.wstyle.b_focus = - readDatabaseTexture("window.button.focus", "white", style); - resource.wstyle.b_unfocus = - readDatabaseTexture("window.button.unfocus", "black", style); - resource.wstyle.b_pressed = - readDatabaseTexture("window.button.pressed", "black", style); - resource.wstyle.f_focus = - readDatabaseColor("window.frame.focusColor", "white", style); - resource.wstyle.f_unfocus = - readDatabaseColor("window.frame.unfocusColor", "black", style); - resource.wstyle.l_text_focus = - readDatabaseColor("window.label.focus.textColor", "black", style); - resource.wstyle.l_text_unfocus = - readDatabaseColor("window.label.unfocus.textColor", "white", style); - resource.wstyle.b_pic_focus = - readDatabaseColor("window.button.focus.picColor", "black", style); - resource.wstyle.b_pic_unfocus = - readDatabaseColor("window.button.unfocus.picColor", "white", style); - - resource.wstyle.justify = LeftJustify; - if (style.getValue("window.justify", s)) { - if (s == "right" || s == "Right") - resource.wstyle.justify = RightJustify; - else if (s == "center" || s == "Center") - resource.wstyle.justify = CenterJustify; - } + readDatabaseTexture("window.title.focus", "Window.Title.Focus", + &resource.wstyle.t_focus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.title.unfocus", "Window.Title.Unfocus", + &resource.wstyle.t_unfocus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.label.focus", "Window.Label.Focus", + &resource.wstyle.l_focus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.label.unfocus", "Window.Label.Unfocus", + &resource.wstyle.l_unfocus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.handle.focus", "Window.Handle.Focus", + &resource.wstyle.h_focus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.handle.unfocus", "Window.Handle.Unfocus", + &resource.wstyle.h_unfocus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.grip.focus", "Window.Grip.Focus", + &resource.wstyle.g_focus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.grip.unfocus", "Window.Grip.Unfocus", + &resource.wstyle.g_unfocus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.button.focus", "Window.Button.Focus", + &resource.wstyle.b_focus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.button.unfocus", "Window.Button.Unfocus", + &resource.wstyle.b_unfocus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("window.button.pressed", "Window.Button.Pressed", + &resource.wstyle.b_pressed, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("window.frame.focusColor", + "Window.Frame.FocusColor", + &resource.wstyle.f_focus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("window.frame.unfocusColor", + "Window.Frame.UnfocusColor", + &resource.wstyle.f_unfocus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("window.label.focus.textColor", + "Window.Label.Focus.TextColor", + &resource.wstyle.l_text_focus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("window.label.unfocus.textColor", + "Window.Label.Unfocus.TextColor", + &resource.wstyle.l_text_unfocus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("window.button.focus.picColor", + "Window.Button.Focus.PicColor", + &resource.wstyle.b_pic_focus, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("window.button.unfocus.picColor", + "Window.Button.Unfocus.PicColor", + &resource.wstyle.b_pic_unfocus, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + - if (XrmGetResource(resource.stylerc, "window.justify", "Window.Justify", - &value_type, &value)) { - if (strstr(value.addr, "right") || strstr(value.addr, "Right")) ++ if (conf.getValue("window.justify", "Window.Justify", s)) { ++ if (0 == strncasecmp(s.c_str(), "right", s.length())) + resource.wstyle.justify = BScreen::RightJustify; - else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) ++ else if (0 == strncasecmp(s.c_str(), "center", s.length())) + resource.wstyle.justify = BScreen::CenterJustify; + else + resource.wstyle.justify = BScreen::LeftJustify; - } else { ++ } else + resource.wstyle.justify = BScreen::LeftJustify; - } + // load toolbar config - resource.tstyle.toolbar = - readDatabaseTexture("toolbar", "black", style); - resource.tstyle.label = - readDatabaseTexture("toolbar.label", "black", style); - resource.tstyle.window = - readDatabaseTexture("toolbar.windowLabel", "black", style); - resource.tstyle.button = - readDatabaseTexture("toolbar.button", "white", style); - resource.tstyle.pressed = - readDatabaseTexture("toolbar.button.pressed", "black", style); - resource.tstyle.clock = - readDatabaseTexture("toolbar.clock", "black", style); - resource.tstyle.l_text = - readDatabaseColor("toolbar.label.textColor", "white", style); - resource.tstyle.w_text = - readDatabaseColor("toolbar.windowLabel.textColor", "white", style); - resource.tstyle.c_text = - readDatabaseColor("toolbar.clock.textColor", "white", style); - resource.tstyle.b_pic = - readDatabaseColor("toolbar.button.picColor", "black", style); - - resource.tstyle.justify = LeftJustify; - if (style.getValue("toolbar.justify", s)) { - if (s == "right" || s == "Right") - resource.tstyle.justify = RightJustify; - else if (s == "center" || s == "Center") - resource.tstyle.justify = CenterJustify; - } + readDatabaseTexture("toolbar", "Toolbar", + &resource.tstyle.toolbar, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("toolbar.label", "Toolbar.Label", + &resource.tstyle.label, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("toolbar.windowLabel", "Toolbar.WindowLabel", + &resource.tstyle.window, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("toolbar.button", "Toolbar.Button", + &resource.tstyle.button, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("toolbar.button.pressed", "Toolbar.Button.Pressed", + &resource.tstyle.pressed, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("toolbar.clock", "Toolbar.Clock", + &resource.tstyle.clock, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("toolbar.label.textColor", "Toolbar.Label.TextColor", + &resource.tstyle.l_text, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("toolbar.windowLabel.textColor", + "Toolbar.WindowLabel.TextColor", + &resource.tstyle.w_text, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("toolbar.clock.textColor", "Toolbar.Clock.TextColor", + &resource.tstyle.c_text, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("toolbar.button.picColor", "Toolbar.Button.PicColor", + &resource.tstyle.b_pic, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + - if (XrmGetResource(resource.stylerc, "toolbar.justify", - "Toolbar.Justify", &value_type, &value)) { - if (strstr(value.addr, "right") || strstr(value.addr, "Right")) ++ if (conf.getValue("toolbar.justify", "Toolbar.Justify", s)) { ++ if (0 == strncasecmp(s.c_str(), "right", s.length())) + resource.tstyle.justify = BScreen::RightJustify; - else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) ++ else if (0 == strncasecmp(s.c_str(), "center", s.length())) + resource.tstyle.justify = BScreen::CenterJustify; + else + resource.tstyle.justify = BScreen::LeftJustify; - } else { ++ } else + resource.tstyle.justify = BScreen::LeftJustify; - } + // load menu config - resource.mstyle.title = - readDatabaseTexture("menu.title", "white", style); - resource.mstyle.frame = - readDatabaseTexture("menu.frame", "black", style); - resource.mstyle.hilite = - readDatabaseTexture("menu.hilite", "white", style); - resource.mstyle.t_text = - readDatabaseColor("menu.title.textColor", "black", style); - resource.mstyle.f_text = - readDatabaseColor("menu.frame.textColor", "white", style); - resource.mstyle.d_text = - readDatabaseColor("menu.frame.disableColor", "black", style); - resource.mstyle.h_text = - readDatabaseColor("menu.hilite.textColor", "black", style); - - resource.mstyle.t_justify = LeftJustify; - if (style.getValue("menu.title.justify", s)) { - if (s == "right" || s == "Right") - resource.mstyle.t_justify = RightJustify; - else if (s == "center" || s == "Center") - resource.mstyle.t_justify = CenterJustify; - } + readDatabaseTexture("menu.title", "Menu.Title", + &resource.mstyle.title, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("menu.frame", "Menu.Frame", + &resource.mstyle.frame, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseTexture("menu.hilite", "Menu.Hilite", + &resource.mstyle.hilite, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("menu.title.textColor", "Menu.Title.TextColor", + &resource.mstyle.t_text, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("menu.frame.textColor", "Menu.Frame.TextColor", + &resource.mstyle.f_text, - WhitePixel(getBaseDisplay()->getXDisplay(), ++ WhitePixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("menu.frame.disableColor", "Menu.Frame.DisableColor", + &resource.mstyle.d_text, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + readDatabaseColor("menu.hilite.textColor", "Menu.Hilite.TextColor", + &resource.mstyle.h_text, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); + - if (XrmGetResource(resource.stylerc, "menu.title.justify", - "Menu.Title.Justify", - &value_type, &value)) { - if (strstr(value.addr, "right") || strstr(value.addr, "Right")) ++ if (conf.getValue("menu.title.justify", "Menu.Title.Justify", s)) { ++ if (0 == strncasecmp(s.c_str(), "right", s.length())) + resource.mstyle.t_justify = BScreen::RightJustify; - else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) ++ else if (0 == strncasecmp(s.c_str(), "center", s.length())) + resource.mstyle.t_justify = BScreen::CenterJustify; + else + resource.mstyle.t_justify = BScreen::LeftJustify; - } else { ++ } else + resource.mstyle.t_justify = BScreen::LeftJustify; - } - if (XrmGetResource(resource.stylerc, "menu.frame.justify", - "Menu.Frame.Justify", - &value_type, &value)) { - if (strstr(value.addr, "right") || strstr(value.addr, "Right")) + - resource.mstyle.f_justify = LeftJustify; - if (style.getValue("menu.frame.justify", s)) { - if (s == "right" || s == "Right") - resource.mstyle.f_justify = RightJustify; - else if (s == "center" || s == "Center") - resource.mstyle.f_justify = CenterJustify; - } ++ if (conf.getValue("menu.frame.justify", "Menu.Frame.Justify", s)) { ++ if (0 == strncasecmp(s.c_str(), "right", s.length())) + resource.mstyle.f_justify = BScreen::RightJustify; - else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) ++ else if (0 == strncasecmp(s.c_str(), "center", s.length())) + resource.mstyle.f_justify = BScreen::CenterJustify; + else + resource.mstyle.f_justify = BScreen::LeftJustify; - } else { ++ } else + resource.mstyle.f_justify = BScreen::LeftJustify; - } - if (XrmGetResource(resource.stylerc, "menu.bullet", "Menu.Bullet", - &value_type, &value)) { - if (! strncasecmp(value.addr, "empty", value.size)) + - resource.mstyle.bullet = Basemenu::Triangle; - if (style.getValue("menu.bullet", s)) { - if (s == "empty" || s == "Empty") ++ if (conf.getValue("menu.bullet", "Menu.Bullet", s)) { ++ if (0 == strncasecmp(s.c_str(), "empty", s.length())) resource.mstyle.bullet = Basemenu::Empty; - else if (! strncasecmp(value.addr, "square", value.size)) - else if (s == "square" || s == "Square") ++ else if (0 == strncasecmp(s.c_str(), "square", s.length())) resource.mstyle.bullet = Basemenu::Square; - else if (! strncasecmp(value.addr, "diamond", value.size)) - else if (s == "diamond" || s == "Diamond") ++ else if (0 == strncasecmp(s.c_str(), "diamond", s.length())) resource.mstyle.bullet = Basemenu::Diamond; - } + else + resource.mstyle.bullet = Basemenu::Triangle; - } else { ++ } else + resource.mstyle.bullet = Basemenu::Triangle; - } - if (XrmGetResource(resource.stylerc, "menu.bullet.position", - "Menu.Bullet.Position", &value_type, &value)) { - if (! strncasecmp(value.addr, "right", value.size)) + - resource.mstyle.bullet_pos = Basemenu::Left; - if (style.getValue("menu.bullet.position", s)) { - if (s == "right" || s == "Right") ++ if (conf.getValue("menu.bullet.position", "Menu.Bullet.Position", s)) { ++ if (0 == strncasecmp(s.c_str(), "right", s.length())) resource.mstyle.bullet_pos = Basemenu::Right; - } + else + resource.mstyle.bullet_pos = Basemenu::Left; - } else { ++ } else + resource.mstyle.bullet_pos = Basemenu::Left; - } + - resource.border_color = - readDatabaseColor("borderColor", "black", style); + readDatabaseColor("borderColor", "BorderColor", &resource.border_color, - BlackPixel(getBaseDisplay()->getXDisplay(), ++ BlackPixel(getBaseDisplay().getXDisplay(), + getScreenNumber())); // load bevel, border and handle widths - if (XrmGetResource(resource.stylerc, "handleWidth", "HandleWidth", - &value_type, &value)) { - if (sscanf(value.addr, "%u", &resource.handle_width) != 1 || - resource.handle_width > getWidth() / 2 || resource.handle_width == 0) - if (! style.getValue("handleWidth", resource.handle_width) || - resource.handle_width > (getWidth() / 2) || resource.handle_width == 0) ++ if (conf.getValue("handleWidth", "HandleWidth", l)) { ++ if (l <= (signed)size().w() / 2 && l != 0) ++ resource.handle_width = l; ++ else + resource.handle_width = 6; - } else { ++ } else resource.handle_width = 6; - } - if (XrmGetResource(resource.stylerc, "borderWidth", "BorderWidth", - &value_type, &value)) { - if (sscanf(value.addr, "%u", &resource.border_width) != 1) - resource.border_width = 1; - } else { + - if (! style.getValue("borderWidth", resource.border_width)) ++ if (conf.getValue("borderWidth", "BorderWidth", l)) ++ resource.border_width = l; ++ else resource.border_width = 1; - } - if (XrmGetResource(resource.stylerc, "bevelWidth", "BevelWidth", - &value_type, &value)) { - if (sscanf(value.addr, "%u", &resource.bevel_width) != 1 || - resource.bevel_width > getWidth() / 2 || resource.bevel_width == 0) - if (! style.getValue("bevelWidth", resource.bevel_width) || - resource.bevel_width > (getWidth() / 2) || resource.bevel_width == 0) ++ if (conf.getValue("bevelWidth", "BevelWidth", l)) { ++ if (l <= (signed)size().w() / 2 && l != 0) ++ resource.bevel_width = l; ++ else + resource.bevel_width = 3; - } else { ++ } else resource.bevel_width = 3; - } - if (XrmGetResource(resource.stylerc, "frameWidth", "FrameWidth", - &value_type, &value)) { - if (sscanf(value.addr, "%u", &resource.frame_width) != 1 || - resource.frame_width > getWidth() / 2) + - if (! style.getValue("frameWidth", resource.frame_width) || - resource.frame_width > (getWidth() / 2)) ++ if (conf.getValue("frameWidth", "FrameWidth", l)) { ++ if (l <= (signed)size().w() / 2) ++ resource.frame_width = l; ++ else + resource.frame_width = resource.bevel_width; - } else { ++ } else resource.frame_width = resource.bevel_width; - } + - if (style.getValue("rootCommand", s)) - bexec(s, displayString()); + const char *cmd = resource.root_command; - if (cmd != NULL || XrmGetResource(resource.stylerc, - "rootCommand", - "RootCommand", &value_type, &value)) { ++ if (cmd != NULL || conf.getValue("rootCommand", "RootCommand", s)) { + if (cmd == NULL) - cmd = value.addr; // not specified by the screen, so use the one from the - // style file ++ cmd = s.c_str(); // not specified by the screen, so use the one from the ++ // style file +#ifndef __EMX__ + char displaystring[MAXPATHLEN]; + sprintf(displaystring, "DISPLAY=%s", - DisplayString(getBaseDisplay()->getXDisplay())); ++ DisplayString(getBaseDisplay().getXDisplay())); + sprintf(displaystring + strlen(displaystring) - 1, "%d", + getScreenNumber()); + + bexec(cmd, displaystring); +#else // __EMX__ + spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", cmd, NULL); +#endif // !__EMX__ + } - - XrmDestroyDatabase(resource.stylerc); } -void BScreen::addIcon(BlackboxWindow *w) { +void BScreen::addIcon(OpenboxWindow *w) { if (! w) return; - w->setWorkspace(BSENTINEL); + w->setWorkspace(-1); - w->setWindowNumber(iconList->count()); + w->setWindowNumber(iconList.size()); - iconList->insert(w); + iconList.push_back(w); - const char* title = w->getIconTitle(); - iconmenu->insert(title); + iconmenu->insert((const char **) w->getIconTitle()); iconmenu->update(); } -void BScreen::removeIcon(BlackboxWindow *w) { +void BScreen::removeIcon(OpenboxWindow *w) { if (! w) return; - iconList->remove(w->getWindowNumber()); + iconList.remove(w); iconmenu->remove(w->getWindowNumber()); iconmenu->update(); - LinkedListIterator it(iconList); - OpenboxWindow *bw = it.current(); - for (int i = 0; bw; it++, bw = it.current()) - bw->setWindowNumber(i++); - BlackboxWindowList::iterator it = iconList.begin(), - end = iconList.end(); - for (int i = 0; it != end; ++it) - (*it)->setWindowNumber(i++); ++ winList::iterator it = iconList.begin(); ++ for (int i = 0; it != iconList.end(); ++it, ++i) ++ (*it)->setWindowNumber(i); } -BlackboxWindow *BScreen::getIcon(unsigned int index) { - if (index < iconList.size()) { - BlackboxWindowList::iterator it = iconList.begin(); - for (; index > 0; --index, ++it) ; /* increment to index */ - return *it; - } +OpenboxWindow *BScreen::getIcon(int index) { - if (index >= 0 && index < iconList->count()) - return iconList->find(index); ++ if (index < 0 || index >= (signed)iconList.size()) ++ return (OpenboxWindow *) 0; - return (OpenboxWindow *) 0; - return (BlackboxWindow *) 0; ++ winList::iterator it = iconList.begin(); ++ for (; index > 0; --index, ++it); // increment to index ++ return *it; } -unsigned int BScreen::addWorkspace(void) { - Workspace *wkspc = new Workspace(this, workspacesList.size()); +int BScreen::addWorkspace(void) { - Workspace *wkspc = new Workspace(this, workspacesList->count()); - workspacesList->insert(wkspc); ++ Workspace *wkspc = new Workspace(*this, workspacesList.size()); + workspacesList.push_back(wkspc); - saveWorkspaces(getWorkspaceCount()); ++ setWorkspaceCount(workspaceCount()+1); + saveWorkspaceNames(); workspacemenu->insert(wkspc->getName(), wkspc->getMenu(), - wkspc->getID() + 2); + wkspc->getWorkspaceID() + 2); workspacemenu->update(); toolbar->reconfigure(); @@@ -1373,22 -1028,25 +1997,25 @@@ } -unsigned int BScreen::removeLastWorkspace(void) { +int BScreen::removeLastWorkspace(void) { - if (workspacesList->count() == 1) + if (workspacesList.size() == 1) - return 1; + return 0; - Workspace *wkspc = workspacesList->last(); + Workspace *wkspc = workspacesList.back(); - if (current_workspace->getID() == wkspc->getID()) - changeWorkspaceID(current_workspace->getID() - 1); + if (current_workspace->getWorkspaceID() == wkspc->getWorkspaceID()) + changeWorkspaceID(current_workspace->getWorkspaceID() - 1); wkspc->removeAll(); - workspacemenu->remove(wkspc->getID() + 2); + workspacemenu->remove(wkspc->getWorkspaceID() + 2); workspacemenu->update(); - workspacesList->remove(wkspc); + workspacesList.pop_back(); delete wkspc; - - saveWorkspaces(getWorkspaceCount()); ++ ++ setWorkspaceCount(workspaceCount()-1); + saveWorkspaceNames(); toolbar->reconfigure(); @@@ -1398,21 -1056,24 +2025,18 @@@ } -void BScreen::changeWorkspaceID(unsigned int id) { +void BScreen::changeWorkspaceID(int id) { if (! current_workspace) return; - if (id != current_workspace->getID()) { + if (id != current_workspace->getWorkspaceID()) { current_workspace->hideAll(); - workspacemenu->setItemSelected(current_workspace->getID() + 2, False); + workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, + False); - if (openbox->getFocusedWindow() && - openbox->getFocusedWindow()->getScreen() == this && - (! openbox->getFocusedWindow()->isStuck())) { - current_workspace->setLastFocusedWindow(openbox->getFocusedWindow()); - openbox->setFocusedWindow((OpenboxWindow *) 0); - BlackboxWindow *focused = blackbox->getFocusedWindow(); - if (focused && focused->getScreen() == this && ! focused->isStuck()) { - if (focused->getWorkspaceNumber() != current_workspace->getID()) { - fprintf(stderr, "%s is on the wrong workspace, aborting\n", - focused->getTitle()); - abort(); - } - current_workspace->setLastFocusedWindow(focused); - blackbox->setFocusedWindow((BlackboxWindow *) 0); -- } ++ OpenboxWindow *fw = openbox.focusedWindow(); ++ if (fw && fw->getScreen() == this) ++ openbox.focusWindow(0); current_workspace = getWorkspace(id); @@@ -1422,9 -1086,9 +2046,9 @@@ current_workspace->showAll(); -- if (resource.focus_last && current_workspace->getLastFocusedWindow()) { - XSync(openbox->getXDisplay(), False); - XSync(blackbox->getXDisplay(), False); -- current_workspace->getLastFocusedWindow()->setInputFocus(); ++ if (resource.focus_last && current_workspace->lastFocusedWindow()) { ++ XSync(openbox.getXDisplay(), False); ++ current_workspace->lastFocusedWindow()->setInputFocus(); } } @@@ -1432,108 -1096,151 +2056,107 @@@ } -void BScreen::manageWindow(Window w) { - new BlackboxWindow(blackbox, w, this); - - BlackboxWindow *win = blackbox->searchWindow(w); - if (! win) - return; - - windowList.push_back(win); - - XMapRequestEvent mre; - mre.window = w; - if (blackbox->isStartup()) win->restoreAttributes(); - win->mapRequestEvent(&mre); -} - - -void BScreen::unmanageWindow(BlackboxWindow *w, bool remap) { - w->restore(remap); - - if (w->getWorkspaceNumber() != BSENTINEL && - w->getWindowNumber() != BSENTINEL) - getWorkspace(w->getWorkspaceNumber())->removeWindow(w); - else if (w->isIconic()) - removeIcon(w); - - windowList.remove(w); - - if (blackbox->getFocusedWindow() == w) - blackbox->setFocusedWindow((BlackboxWindow *) 0); - - removeNetizen(w->getClientWindow()); - - /* - some managed windows can also be window group controllers. when - unmanaging such windows, we should also delete the window group. - */ - BWindowGroup *group = blackbox->searchGroup(w->getClientWindow()); - delete group; - - delete w; -} - - void BScreen::addNetizen(Netizen *n) { - netizenList->insert(n); + netizenList.push_back(n); n->sendWorkspaceCount(); n->sendCurrentWorkspace(); - LinkedListIterator it(workspacesList); - for (Workspace *w = it.current(); w; it++, w = it.current()) { - for (int i = 0; i < w->getCount(); i++) - n->sendWindowAdd(w->getWindow(i)->getClientWindow(), - w->getWorkspaceID()); - WorkspaceList::iterator it = workspacesList.begin(); - const WorkspaceList::iterator end = workspacesList.end(); - for (; it != end; ++it) - (*it)->sendWindowList(*n); ++ wkspList::iterator it; ++ for (it = workspacesList.begin(); it != workspacesList.end(); ++it) { ++ for (int i = 0; i < (*it)->getCount(); i++) ++ n->sendWindowAdd((*it)->getWindow(i)->getClientWindow(), ++ (*it)->getWorkspaceID()); + } - Window f = ((openbox->getFocusedWindow()) ? - openbox->getFocusedWindow()->getClientWindow() : None); - Window f = ((blackbox->getFocusedWindow()) ? - blackbox->getFocusedWindow()->getClientWindow() : None); ++ Window f = ((openbox.focusedWindow()) ? ++ openbox.focusedWindow()->getClientWindow() : None); n->sendWindowFocus(f); } void BScreen::removeNetizen(Window w) { - LinkedListIterator it(netizenList); - int i = 0; - NetizenList::iterator it = netizenList.begin(); - for (; it != netizenList.end(); ++it) { ++ netList::iterator it; + - for (Netizen *n = it.current(); n; it++, i++, n = it.current()) - if (n->getWindowID() == w) { - Netizen *tmp = netizenList->remove(i); ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) + if ((*it)->getWindowID() == w) { - delete *it; ++ Netizen *tmp = *it; + netizenList.erase(it); + delete tmp; - break; } - } } void BScreen::updateNetizenCurrentWorkspace(void) { - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendCurrentWorkspace(); - std::for_each(netizenList.begin(), netizenList.end(), - std::mem_fun(&Netizen::sendCurrentWorkspace)); ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) ++ (*it)->sendCurrentWorkspace(); } void BScreen::updateNetizenWorkspaceCount(void) { - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendWorkspaceCount(); - xatom->setValue(getRootWindow(), XAtom::net_number_of_desktops, - XAtom::cardinal, workspacesList.size()); - - std::for_each(netizenList.begin(), netizenList.end(), - std::mem_fun(&Netizen::sendWorkspaceCount)); ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) ++ (*it)->sendWorkspaceCount(); } void BScreen::updateNetizenWindowFocus(void) { - Window f = ((openbox->getFocusedWindow()) ? - openbox->getFocusedWindow()->getClientWindow() : None); - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendWindowFocus(f); - Window f = ((blackbox->getFocusedWindow()) ? - blackbox->getFocusedWindow()->getClientWindow() : None); - NetizenList::iterator it = netizenList.begin(); - for (; it != netizenList.end(); ++it) ++ Window f = ((openbox.focusedWindow()) ? ++ openbox.focusedWindow()->getClientWindow() : None); ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) + (*it)->sendWindowFocus(f); } void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendWindowAdd(w, p); - NetizenList::iterator it = netizenList.begin(); - for (; it != netizenList.end(); ++it) { ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) + (*it)->sendWindowAdd(w, p); - } } void BScreen::updateNetizenWindowDel(Window w) { - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendWindowDel(w); - NetizenList::iterator it = netizenList.begin(); - for (; it != netizenList.end(); ++it) ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) + (*it)->sendWindowDel(w); } void BScreen::updateNetizenWindowRaise(Window w) { - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendWindowRaise(w); - NetizenList::iterator it = netizenList.begin(); - for (; it != netizenList.end(); ++it) ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) + (*it)->sendWindowRaise(w); } void BScreen::updateNetizenWindowLower(Window w) { - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendWindowLower(w); - NetizenList::iterator it = netizenList.begin(); - for (; it != netizenList.end(); ++it) ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) + (*it)->sendWindowLower(w); } void BScreen::updateNetizenConfigNotify(XEvent *e) { - LinkedListIterator it(netizenList); - for (Netizen *n = it.current(); n; it++, n = it.current()) - n->sendConfigNotify(e); - NetizenList::iterator it = netizenList.begin(); - for (; it != netizenList.end(); ++it) ++ netList::iterator it; ++ for (it = netizenList.begin(); it != netizenList.end(); ++it) + (*it)->sendConfigNotify(e); } -void BScreen::raiseWindows(Window *workspace_stack, unsigned int num) { - // XXX: why 13?? +void BScreen::raiseWindows(Window *workspace_stack, int num) { Window *session_stack = new - Window[(num + workspacesList->count() + rootmenuList->count() + 13)]; + Window[(num + workspacesList.size() + rootmenuList.size() + 13)]; - unsigned int i = 0, k = num; + int i = 0, k = num; - XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID()); - XRaiseWindow(blackbox->getXDisplay(), iconmenu->getWindowID()); ++ XRaiseWindow(getBaseDisplay().getXDisplay(), iconmenu->getWindowID()); *(session_stack + i++) = iconmenu->getWindowID(); - LinkedListIterator wit(workspacesList); - for (Workspace *tmp = wit.current(); tmp; wit++, tmp = wit.current()) - *(session_stack + i++) = tmp->getMenu()->getWindowID(); - WorkspaceList::iterator wit = workspacesList.begin(); - const WorkspaceList::iterator w_end = workspacesList.end(); - for (; wit != w_end; ++wit) - *(session_stack + i++) = (*wit)->getMenu()->getWindowID(); ++ wkspList::iterator it; ++ for (it = workspacesList.begin(); it != workspacesList.end(); ++it) ++ *(session_stack + i++) = (*it)->getMenu()->getWindowID(); *(session_stack + i++) = workspacemenu->getWindowID(); @@@ -1551,61 -1256,52 +2174,45 @@@ toolbar->getMenu()->getPlacementmenu()->getWindowID(); *(session_stack + i++) = toolbar->getMenu()->getWindowID(); - LinkedListIterator rit(rootmenuList); - for (Rootmenu *tmp = rit.current(); tmp; rit++, tmp = rit.current()) - *(session_stack + i++) = tmp->getWindowID(); - RootmenuList::iterator rit = rootmenuList.begin(); - for (; rit != rootmenuList.end(); ++rit) ++ menuList::iterator rit; ++ for (rit = rootmenuList.begin(); rit != rootmenuList.end(); ++rit) + *(session_stack + i++) = (*rit)->getWindowID(); *(session_stack + i++) = rootmenu->getWindowID(); -- if (toolbar->isOnTop()) ++ if (toolbar->onTop()) *(session_stack + i++) = toolbar->getWindowID(); - if (slit->isOnTop()) +#ifdef SLIT - if (slit->isOnTop()) ++ if (slit->onTop()) *(session_stack + i++) = slit->getWindowID(); +#endif // SLIT while (k--) *(session_stack + i++) = *(workspace_stack + k); - XRestackWindows(getBaseDisplay()->getXDisplay(), session_stack, i); - XRestackWindows(blackbox->getXDisplay(), session_stack, i); ++ XRestackWindows(getBaseDisplay().getXDisplay(), session_stack, i); delete [] session_stack; } - #ifdef HAVE_STRFTIME - void BScreen::saveStrftimeFormat(char *format) { - if (resource.strftime_format) - delete [] resource.strftime_format; - - resource.strftime_format = bstrdup(format); - } - #endif // HAVE_STRFTIME - - - void BScreen::addWorkspaceName(char *name) { - workspaceNames->insert(bstrdup(name)); -void BScreen::addWorkspaceName(const string& name) { ++void BScreen::addWorkspaceName(const char *name) { + workspaceNames.push_back(name); } - char* BScreen::getNameOfWorkspace(int id) { - char *name = (char *) 0; - - if (id >= 0 && id < workspaceNames->count()) { - char *wkspc_name = workspaceNames->find(id); - - if (wkspc_name) - name = wkspc_name; - } - return name; -/* - * I would love to kill this function and the accompanying workspaceNames - * list. However, we have a chicken and egg situation. The names are read - * in during load_rc() which happens before the workspaces are created. - * The current solution is to read the names into a list, then use the list - * later for constructing the workspaces. It is only used during initial - * BScreen creation. - */ -const string BScreen::getNameOfWorkspace(unsigned int id) { - if (id < workspaceNames.size()) - return workspaceNames[id]; - return string(""); ++const char *BScreen::getNameOfWorkspace(int id) { ++ if (id < 0 || id >= (signed)workspaceNames.size()) ++ return (const char *) 0; ++ return workspaceNames[id].c_str(); } -void BScreen::reassociateWindow(BlackboxWindow *w, unsigned int wkspc_id, - bool ignore_sticky) { - if (! w) return; +void BScreen::reassociateWindow(OpenboxWindow *w, int wkspc_id, Bool ignore_sticky) { - if (! w) return; ++ ASSERT(w != (OpenboxWindow *) 0); - if (wkspc_id == BSENTINEL) - wkspc_id = current_workspace->getID(); + if (wkspc_id == -1) + wkspc_id = current_workspace->getWorkspaceID(); if (w->getWorkspaceNumber() == wkspc_id) return; @@@ -1620,33 -1316,44 +2227,33 @@@ } -void BScreen::propagateWindowName(const BlackboxWindow *bw) { - if (bw->isIconic()) { - iconmenu->changeItemLabel(bw->getWindowNumber(), bw->getIconTitle()); - iconmenu->update(); - } - else { - Clientmenu *clientmenu = getWorkspace(bw->getWorkspaceNumber())->getMenu(); - clientmenu->changeItemLabel(bw->getWindowNumber(), bw->getTitle()); - clientmenu->update(); - - if (blackbox->getFocusedWindow() == bw) - toolbar->redrawWindowLabel(True); - } -} - - void BScreen::nextFocus(void) { - BlackboxWindow *focused = blackbox->getFocusedWindow(), - *next = focused; - - if (focused) { - // if window is not on this screen, ignore it - if (focused->getScreen()->getScreenNumber() != getScreenNumber()) - focused = (BlackboxWindow*) 0; + Bool have_focused = False; + int focused_window_number = -1; + OpenboxWindow *next; + - if (openbox->getFocusedWindow()) { - if (openbox->getFocusedWindow()->getScreen()->getScreenNumber() == ++ if (openbox.focusedWindow()) { ++ if (openbox.focusedWindow()->getScreen()->getScreenNumber() == + getScreenNumber()) { + have_focused = True; - focused_window_number = openbox->getFocusedWindow()->getWindowNumber(); ++ focused_window_number = openbox.focusedWindow()->getWindowNumber(); + } } - if (focused && current_workspace->getCount() > 1) { - // next is the next window to recieve focus, current is a place holder - BlackboxWindow *current; + if ((getCurrentWorkspace()->getCount() > 1) && have_focused) { + int next_window_number = focused_window_number; do { - current = next; - next = current_workspace->getNextWindowInList(current); - } while(! next->setInputFocus() && next != focused); + if ((++next_window_number) >= getCurrentWorkspace()->getCount()) + next_window_number = 0; + + next = getCurrentWorkspace()->getWindow(next_window_number); + } while ((! next->setInputFocus()) && (next_window_number != + focused_window_number)); - if (next != focused) - current_workspace->raiseWindow(next); - } else if (current_workspace->getCount() >= 1) { - next = current_workspace->getTopWindowOnStack(); + if (next_window_number != focused_window_number) + getCurrentWorkspace()->raiseWindow(next); + } else if (getCurrentWorkspace()->getCount() >= 1) { + next = current_workspace->getWindow(0); current_workspace->raiseWindow(next); next->setInputFocus(); @@@ -1655,133 -1362,129 +2262,142 @@@ void BScreen::prevFocus(void) { - BlackboxWindow *focused = blackbox->getFocusedWindow(), - *next = focused; - - if (focused) { - // if window is not on this screen, ignore it - if (focused->getScreen()->getScreenNumber() != getScreenNumber()) - focused = (BlackboxWindow*) 0; + Bool have_focused = False; + int focused_window_number = -1; + OpenboxWindow *prev; + - if (openbox->getFocusedWindow()) { - if (openbox->getFocusedWindow()->getScreen()->getScreenNumber() == ++ if (openbox.focusedWindow()) { ++ if (openbox.focusedWindow()->getScreen()->getScreenNumber() == + getScreenNumber()) { + have_focused = True; - focused_window_number = openbox->getFocusedWindow()->getWindowNumber(); ++ focused_window_number = openbox.focusedWindow()->getWindowNumber(); + } } - if (focused && current_workspace->getCount() > 1) { - // next is the next window to recieve focus, current is a place holder - BlackboxWindow *current; + if ((getCurrentWorkspace()->getCount() > 1) && have_focused) { + int prev_window_number = focused_window_number; do { - current = next; - next = current_workspace->getPrevWindowInList(current); - } while(! next->setInputFocus() && next != focused); + if ((--prev_window_number) < 0) + prev_window_number = getCurrentWorkspace()->getCount() - 1; - if (next != focused) - current_workspace->raiseWindow(next); - } else if (current_workspace->getCount() >= 1) { - next = current_workspace->getTopWindowOnStack(); + prev = getCurrentWorkspace()->getWindow(prev_window_number); + } while ((! prev->setInputFocus()) && (prev_window_number != + focused_window_number)); - current_workspace->raiseWindow(next); - next->setInputFocus(); + if (prev_window_number != focused_window_number) + getCurrentWorkspace()->raiseWindow(prev); + } else if (getCurrentWorkspace()->getCount() >= 1) { + prev = current_workspace->getWindow(0); + + current_workspace->raiseWindow(prev); + prev->setInputFocus(); } } void BScreen::raiseFocus(void) { - BlackboxWindow *focused = blackbox->getFocusedWindow(); - if (! focused) - return; - - // if on this Screen, raise it - if (focused->getScreen()->getScreenNumber() == getScreenNumber()) { - Workspace *workspace = getWorkspace(focused->getWorkspaceNumber()); - workspace->raiseWindow(focused); + Bool have_focused = False; + int focused_window_number = -1; + - if (openbox->getFocusedWindow()) { - if (openbox->getFocusedWindow()->getScreen()->getScreenNumber() == ++ if (openbox.focusedWindow()) { ++ if (openbox.focusedWindow()->getScreen()->getScreenNumber() == + getScreenNumber()) { + have_focused = True; - focused_window_number = openbox->getFocusedWindow()->getWindowNumber(); ++ focused_window_number = openbox.focusedWindow()->getWindowNumber(); + } } + + if ((getCurrentWorkspace()->getCount() > 1) && have_focused) - getWorkspace(openbox->getFocusedWindow()->getWorkspaceNumber())-> - raiseWindow(openbox->getFocusedWindow()); ++ getWorkspace(openbox.focusedWindow()->getWorkspaceNumber())-> ++ raiseWindow(openbox.focusedWindow()); } void BScreen::InitMenu(void) { if (rootmenu) { - while (rootmenuList->count()) - rootmenuList->remove(0); - + rootmenuList.clear(); - while (rootmenu->getCount()) rootmenu->remove(0); } else { -- rootmenu = new Rootmenu(this); ++ rootmenu = new Rootmenu(*this); } - Bool defaultMenu = True; - bool defaultMenu = True; ++ bool defaultMenu = true; - if (openbox->getMenuFilename()) { - FILE *menu_file = fopen(openbox->getMenuFilename(), "r"); - FILE *menu_file = (FILE *) 0; - const char *menu_filename = blackbox->getMenuFilename(); ++ FILE *menu_file; ++ const char *menu_filename = openbox.getMenuFilename(); - if (!menu_file) { - perror(openbox->getMenuFilename()); - if (menu_filename) - if (! (menu_file = fopen(menu_filename, "r"))) - perror(menu_filename); - if (! menu_file) { // opening the menu file failed, try the default menu ++ if (!(menu_file = fopen(menu_filename, "r"))) { ++ perror(menu_filename); ++ menu_filename = (char *) 0; ++ } ++ if (menu_filename == (char *) 0) { ++ // opening the menu file failed, try the DEFAULTMENU + menu_filename = DEFAULTMENU; - if (! (menu_file = fopen(menu_filename, "r"))) ++ if (!(menu_file = fopen(menu_filename, "r"))) { + perror(menu_filename); - } - - if (menu_file) { ++ menu_filename = (char *) 0; ++ } ++ } ++ ++ if (menu_filename) { + if (feof(menu_file)) { - fprintf(stderr, i18n(ScreenSet, ScreenEmptyMenuFile, - "%s: Empty menu file"), - menu_filename); ++ fprintf(stderr, i18n->getMessage(ScreenSet, ScreenEmptyMenuFile, ++ "%s: Empty menu file"), menu_filename); ++ menu_filename = (char *) 0; } else { - if (feof(menu_file)) { - fprintf(stderr, i18n->getMessage(ScreenSet, ScreenEmptyMenuFile, - "%s: Empty menu file"), - openbox->getMenuFilename()); - } else { - char line[1024], label[1024]; - memset(line, 0, 1024); - memset(label, 0, 1024); - - while (fgets(line, 1024, menu_file) && ! feof(menu_file)) { - if (line[0] != '#') { - int i, key = 0, index = -1, len = strlen(line); - - key = 0; - for (i = 0; i < len; i++) { - if (line[i] == '[') index = 0; - else if (line[i] == ']') break; - else if (line[i] != ' ') - if (index++ >= 0) - key += tolower(line[i]); - } ++ // successsfully opened a menu file + char line[1024], label[1024]; + memset(line, 0, 1024); + memset(label, 0, 1024); + + while (fgets(line, 1024, menu_file) && ! feof(menu_file)) { + if (line[0] != '#') { + int i, key = 0, index = -1, len = strlen(line); + ++ key = 0; + for (i = 0; i < len; i++) { + if (line[i] == '[') index = 0; + else if (line[i] == ']') break; + else if (line[i] != ' ') + if (index++ >= 0) + key += tolower(line[i]); + } - if (key == 517) { - index = -1; - for (i = index; i < len; i++) { - if (line[i] == '(') index = 0; - else if (line[i] == ')') break; - else if (index++ >= 0) { - if (line[i] == '\\' && i < len - 1) i++; - label[index - 1] = line[i]; - } - } - if (key == 517) { // [begin] ++ if (key == 517) { + index = -1; + for (i = index; i < len; i++) { + if (line[i] == '(') index = 0; + else if (line[i] == ')') break; + else if (index++ >= 0) { + if (line[i] == '\\' && i < len - 1) i++; + label[index - 1] = line[i]; + } + } - if (index == -1) index = 0; - label[index] = '\0'; + if (index == -1) index = 0; + label[index] = '\0'; - rootmenu->setLabel(label); - defaultMenu = parseMenuFile(menu_file, rootmenu); - break; - } - } - } + rootmenu->setLabel(label); + defaultMenu = parseMenuFile(menu_file, rootmenu); - if (! defaultMenu) - blackbox->addMenuTimestamp(menu_filename); ++ if (!defaultMenu) ++ openbox.addMenuTimestamp(menu_filename); + break; + } + } } - fclose(menu_file); } + fclose(menu_file); } if (defaultMenu) { rootmenu->setInternalMenu(); - rootmenu->insert(i18n(ScreenSet, Screenxterm, "xterm"), - BScreen::Execute, - i18n(ScreenSet, Screenxterm, "xterm")); - rootmenu->insert(i18n(ScreenSet, ScreenRestart, "Restart"), - BScreen::Restart); - rootmenu->insert(i18n(ScreenSet, ScreenExit, "Exit"), - BScreen::Exit); - rootmenu->setLabel(i18n(BasemenuSet, BasemenuBlackboxMenu, - "Openbox Menu")); + rootmenu->insert(i18n->getMessage(ScreenSet, Screenxterm, "xterm"), + BScreen::Execute, + i18n->getMessage(ScreenSet, Screenxterm, "xterm")); + rootmenu->insert(i18n->getMessage(ScreenSet, ScreenRestart, "Restart"), + BScreen::Restart); + rootmenu->insert(i18n->getMessage(ScreenSet, ScreenExit, "Exit"), + BScreen::Exit); - } else { - openbox->saveMenuFilename(openbox->getMenuFilename()); } } @@@ -1861,203 -1557,43 +2477,202 @@@ Bool BScreen::parseMenuFile(FILE *file break; case 333: // nop - if (! *label) - label[0] = '\0'; - menu->insert(label); - - break; - - case 421: // exec - if ((! *label) && (! *command)) { - fprintf(stderr, i18n(ScreenSet, ScreenEXECError, - "BScreen::parseMenuFile: [exec] error, " - "no menu label and/or command defined\n")); - continue; - } - - menu->insert(label, BScreen::Execute, command); - - break; - - case 442: // exit - if (! *label) { - fprintf(stderr, i18n(ScreenSet, ScreenEXITError, - "BScreen::parseMenuFile: [exit] error, " - "no menu label defined\n")); - continue; - } - - menu->insert(label, BScreen::Exit); + menu->insert(label); + + break; + + case 421: // exec + if ((! *label) && (! *command)) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenEXECError, + "BScreen::parseMenuFile: [exec] error, " + "no menu label and/or command defined\n")); + continue; + } + + menu->insert(label, BScreen::Execute, command); + + break; + + case 442: // exit + if (! *label) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenEXITError, + "BScreen::parseMenuFile: [exit] error, " + "no menu label defined\n")); + continue; + } + + menu->insert(label, BScreen::Exit); + + break; + + case 561: // style + { + if ((! *label) || (! *command)) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenSTYLEError, + "BScreen::parseMenuFile: [style] error, " + "no menu label and/or filename defined\n")); + continue; + } + + char style[MAXPATHLEN]; + + // perform shell style ~ home directory expansion + char *homedir = 0; + int homedir_len = 0; + if (*command == '~' && *(command + 1) == '/') { + homedir = getenv("HOME"); + homedir_len = strlen(homedir); + } + + if (homedir && homedir_len != 0) { + strncpy(style, homedir, homedir_len); + + strncpy(style + homedir_len, command + 1, + command_length - 1); + *(style + command_length + homedir_len - 1) = '\0'; + } else { + strncpy(style, command, command_length); + *(style + command_length) = '\0'; + } + + menu->insert(label, BScreen::SetStyle, style); + } + + break; + + case 630: // config + if (! *label) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenCONFIGError, + "BScreen::parseMenufile: [config] error, " + "no label defined")); + continue; + } + + menu->insert(label, configmenu); + + break; + + case 740: // include + { + if (! *label) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenINCLUDEError, + "BScreen::parseMenuFile: [include] error, " + "no filename defined\n")); + continue; + } + + char newfile[MAXPATHLEN]; + + // perform shell style ~ home directory expansion + char *homedir = 0; + int homedir_len = 0; + if (*label == '~' && *(label + 1) == '/') { + homedir = getenv("HOME"); + homedir_len = strlen(homedir); + } + + if (homedir && homedir_len != 0) { + strncpy(newfile, homedir, homedir_len); + + strncpy(newfile + homedir_len, label + 1, + label_length - 1); + *(newfile + label_length + homedir_len - 1) = '\0'; + } else { + strncpy(newfile, label, label_length); + *(newfile + label_length) = '\0'; + } + + if (newfile) { + FILE *submenufile = fopen(newfile, "r"); + + if (submenufile) { + struct stat buf; + if (fstat(fileno(submenufile), &buf) || + (! S_ISREG(buf.st_mode))) { + fprintf(stderr, + i18n->getMessage(ScreenSet, ScreenINCLUDEErrorReg, + "BScreen::parseMenuFile: [include] error: " + "'%s' is not a regular file\n"), newfile); + break; + } - break; + if (! feof(submenufile)) { - if (! parseMenuFile(submenufile, menu)) - openbox->saveMenuFilename(newfile); - - fclose(submenufile); ++ if (!parseMenuFile(submenufile, menu)) ++ openbox.addMenuTimestamp(newfile); ++ fclose(submenufile); + } + } else + perror(newfile); + } + } + + break; + + case 767: // submenu + { + if (! *label) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenSUBMENUError, + "BScreen::parseMenuFile: [submenu] error, " + "no menu label defined\n")); + continue; + } + - Rootmenu *submenu = new Rootmenu(this); ++ Rootmenu *submenu = new Rootmenu(*this); + + if (*command) + submenu->setLabel(command); + else + submenu->setLabel(label); + + parseMenuFile(file, submenu); + submenu->update(); + menu->insert(label, submenu); - rootmenuList->insert(submenu); ++ rootmenuList.push_back(submenu); + } + + break; + + case 773: // restart + { + if (! *label) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenRESTARTError, + "BScreen::parseMenuFile: [restart] error, " + "no menu label defined\n")); + continue; + } + + if (*command) + menu->insert(label, BScreen::RestartOther, command); + else + menu->insert(label, BScreen::Restart); + } + + break; + + case 845: // reconfig + { + if (! *label) { + fprintf(stderr, i18n->getMessage(ScreenSet, ScreenRECONFIGError, + "BScreen::parseMenuFile: [reconfig] error, " + "no menu label defined\n")); + continue; + } + + menu->insert(label, BScreen::Reconfigure); + } + + break; - case 561: // style + case 995: // stylesdir + case 1113: // stylesmenu { - if ((! *label) || (! *command)) { + Bool newmenu = ((key == 1113) ? True : False); + + if ((! *label) || ((! *command) && newmenu)) { fprintf(stderr, - i18n(ScreenSet, ScreenSTYLEError, - "BScreen::parseMenuFile: [style] error, " - "no menu label and/or filename defined\n")); + i18n->getMessage(ScreenSet, ScreenSTYLESDIRError, + "BScreen::parseMenuFile: [stylesdir/stylesmenu]" + " error, no directory defined\n")); continue; } @@@ -2093,61 -1732,53 +2708,60 @@@ Rootmenu *stylesmenu; if (newmenu) -- stylesmenu = new Rootmenu(this); ++ stylesmenu = new Rootmenu(*this); else stylesmenu = menu; - DIR *d = opendir(stylesdir.c_str()); + DIR *d = opendir(stylesdir); + int entries = 0; struct dirent *p; - std::vector ls; - while((p = readdir(d))) - ls.push_back(p->d_name); + // get the total number of directory entries + while ((p = readdir(d))) entries++; + rewinddir(d); - closedir(d); + char **ls = new char* [entries]; + int index = 0; + while ((p = readdir(d))) + ls[index++] = bstrdup(p->d_name); - std::sort(ls.begin(), ls.end()); + closedir(d); - std::sort(ls, ls + entries, dcmp()); - std::vector::iterator it = ls.begin(), - end = ls.end(); - for (; it != end; ++it) { - const string& fname = *it; ++ std::sort(ls, ls + entries, dcmp()); - if (fname[fname.size()-1] == '~') - continue; + int n, slen = strlen(stylesdir); + for (n = 0; n < entries; n++) { + if (ls[n][strlen(ls[n])-1] != '~') { + int nlen = strlen(ls[n]); + char style[MAXPATHLEN + 1]; - string style = stylesdir; - style += '/'; - style += fname; + strncpy(style, stylesdir, slen); + *(style + slen) = '/'; + strncpy(style + slen + 1, ls[n], nlen + 1); - if ((! stat(style.c_str(), &statbuf)) && - S_ISREG(statbuf.st_mode)) - stylesmenu->insert(fname, BScreen::SetStyle, style); + if ((! stat(style, &statbuf)) && S_ISREG(statbuf.st_mode)) + stylesmenu->insert(ls[n], BScreen::SetStyle, style); + } + + delete [] ls[n]; } + delete [] ls; + stylesmenu->update(); if (newmenu) { stylesmenu->setLabel(label); menu->insert(label, stylesmenu); - rootmenuList->insert(stylesmenu); + rootmenuList.push_back(stylesmenu); } -- - openbox->saveMenuFilename(stylesdir); - blackbox->addMenuTimestamp(stylesdir); ++ openbox.addMenuTimestamp(stylesdir); } else { - fprintf(stderr, - i18n(ScreenSet, ScreenSTYLESDIRErrorNotDir, - "BScreen::parseMenuFile:" - " [stylesdir/stylesmenu] error, %s is not a" - " directory\n"), stylesdir.c_str()); + fprintf(stderr, i18n->getMessage(ScreenSet, + ScreenSTYLESDIRErrorNotDir, + "BScreen::parseMenuFile:" + " [stylesdir/stylesmenu] error, %s is not a" + " directory\n"), stylesdir); } } else { fprintf(stderr, @@@ -2183,99 -1813,87 +2797,95 @@@ void BScreen::shutdown(void) { - openbox->grab(); - XSelectInput(blackbox->getXDisplay(), getRootWindow(), NoEventMask); - XSync(blackbox->getXDisplay(), False); ++ openbox.grab(); + - XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), NoEventMask); - XSync(getBaseDisplay()->getXDisplay(), False); ++ XSelectInput(getBaseDisplay().getXDisplay(), getRootWindow(), NoEventMask); ++ XSync(getBaseDisplay().getXDisplay(), False); - LinkedListIterator it(workspacesList); - for (Workspace *w = it.current(); w; it++, w = it.current()) - w->shutdown(); - while(! windowList.empty()) - unmanageWindow(windowList.front(), True); ++ std::for_each(workspacesList.begin(), workspacesList.end(), ++ std::mem_fun(&Workspace::shutdown)); + - while (iconList->count()) { - iconList->first()->restore(); - delete iconList->first(); - } ++ while (!iconList.empty()) ++ iconList.front()->restore(); +#ifdef SLIT slit->shutdown(); +#endif // SLIT + - openbox->ungrab(); ++ openbox.ungrab(); } void BScreen::showPosition(int x, int y) { if (! geom_visible) { - XMoveResizeWindow(getBaseDisplay()->getXDisplay(), geom_window, - XMoveResizeWindow(blackbox->getXDisplay(), geom_window, -- (getWidth() - geom_w) / 2, -- (getHeight() - geom_h) / 2, geom_w, geom_h); - XMapWindow(getBaseDisplay()->getXDisplay(), geom_window); - XRaiseWindow(getBaseDisplay()->getXDisplay(), geom_window); - XMapWindow(blackbox->getXDisplay(), geom_window); - XRaiseWindow(blackbox->getXDisplay(), geom_window); ++ XMoveResizeWindow(getBaseDisplay().getXDisplay(), geom_window, ++ (size().w() - geom_w) / 2, ++ (size().h() - geom_h) / 2, geom_w, geom_h); ++ XMapWindow(getBaseDisplay().getXDisplay(), geom_window); ++ XRaiseWindow(getBaseDisplay().getXDisplay(), geom_window); geom_visible = True; } char label[1024]; - sprintf(label, i18n(ScreenSet, ScreenPositionFormat, - "X: %4d x Y: %4d"), x, y); + sprintf(label, i18n->getMessage(ScreenSet, ScreenPositionFormat, + "X: %4d x Y: %4d"), x, y); - XClearWindow(getBaseDisplay()->getXDisplay(), geom_window); - XClearWindow(blackbox->getXDisplay(), geom_window); ++ XClearWindow(getBaseDisplay().getXDisplay(), geom_window); - BPen pen(resource.wstyle.l_text_focus, resource.wstyle.font); - if (i18n.multibyte()) { - XmbDrawString(blackbox->getXDisplay(), geom_window, - resource.wstyle.fontset, pen.gc(), - resource.bevel_width, resource.bevel_width - - resource.wstyle.fontset_extents->max_ink_extent.y, - label, strlen(label)); + if (i18n->multibyte()) { - XmbDrawString(getBaseDisplay()->getXDisplay(), geom_window, ++ XmbDrawString(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.fontset, resource.wstyle.l_text_focus_gc, + resource.bevel_width, resource.bevel_width - + resource.wstyle.fontset_extents->max_ink_extent.y, + label, strlen(label)); } else { - XDrawString(getBaseDisplay()->getXDisplay(), geom_window, - XDrawString(blackbox->getXDisplay(), geom_window, - pen.gc(), resource.bevel_width, - resource.wstyle.font->ascent + resource.bevel_width, - label, strlen(label)); ++ XDrawString(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.l_text_focus_gc, + resource.bevel_width, + resource.wstyle.font->ascent + + resource.bevel_width, label, strlen(label)); } } void BScreen::showGeometry(unsigned int gx, unsigned int gy) { if (! geom_visible) { - XMoveResizeWindow(getBaseDisplay()->getXDisplay(), geom_window, - XMoveResizeWindow(blackbox->getXDisplay(), geom_window, -- (getWidth() - geom_w) / 2, -- (getHeight() - geom_h) / 2, geom_w, geom_h); - XMapWindow(getBaseDisplay()->getXDisplay(), geom_window); - XRaiseWindow(getBaseDisplay()->getXDisplay(), geom_window); - XMapWindow(blackbox->getXDisplay(), geom_window); - XRaiseWindow(blackbox->getXDisplay(), geom_window); ++ XMoveResizeWindow(getBaseDisplay().getXDisplay(), geom_window, ++ (size().w() - geom_w) / 2, ++ (size().h() - geom_h) / 2, geom_w, geom_h); ++ XMapWindow(getBaseDisplay().getXDisplay(), geom_window); ++ XRaiseWindow(getBaseDisplay().getXDisplay(), geom_window); geom_visible = True; } char label[1024]; - sprintf(label, i18n(ScreenSet, ScreenGeometryFormat, - "W: %4d x H: %4d"), gx, gy); + sprintf(label, i18n->getMessage(ScreenSet, ScreenGeometryFormat, + "W: %4d x H: %4d"), gx, gy); - XClearWindow(getBaseDisplay()->getXDisplay(), geom_window); - XClearWindow(blackbox->getXDisplay(), geom_window); ++ XClearWindow(getBaseDisplay().getXDisplay(), geom_window); - BPen pen(resource.wstyle.l_text_focus, resource.wstyle.font); - if (i18n.multibyte()) { - XmbDrawString(blackbox->getXDisplay(), geom_window, - resource.wstyle.fontset, pen.gc(), - resource.bevel_width, resource.bevel_width - - resource.wstyle.fontset_extents->max_ink_extent.y, - label, strlen(label)); + if (i18n->multibyte()) { - XmbDrawString(getBaseDisplay()->getXDisplay(), geom_window, ++ XmbDrawString(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.fontset, resource.wstyle.l_text_focus_gc, + resource.bevel_width, resource.bevel_width - + resource.wstyle.fontset_extents->max_ink_extent.y, + label, strlen(label)); } else { - XDrawString(getBaseDisplay()->getXDisplay(), geom_window, - XDrawString(blackbox->getXDisplay(), geom_window, - pen.gc(), resource.bevel_width, - resource.wstyle.font->ascent + - resource.bevel_width, label, strlen(label)); ++ XDrawString(getBaseDisplay().getXDisplay(), geom_window, + resource.wstyle.l_text_focus_gc, + resource.bevel_width, + resource.wstyle.font->ascent + + resource.bevel_width, label, strlen(label)); } } -- void BScreen::hideGeometry(void) { if (geom_visible) { - XUnmapWindow(getBaseDisplay()->getXDisplay(), geom_window); - XUnmapWindow(blackbox->getXDisplay(), geom_window); ++ XUnmapWindow(getBaseDisplay().getXDisplay(), geom_window); geom_visible = False; } } diff --cc src/Screen.h index d49668f9,00000000..498e4b15 mode 100644,000000..100644 --- a/src/Screen.h +++ b/src/Screen.h @@@ -1,349 -1,0 +1,345 @@@ +// Screen.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Screen_hh +#define __Screen_hh + +#include +#include + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include +# else // !HAVE_SYS_TIME_H +# include +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +#include "BaseDisplay.h" +#include "Configmenu.h" +#include "Iconmenu.h" - #include "LinkedList.h" +#include "Netizen.h" +#include "Rootmenu.h" +#include "Timer.h" +#include "Workspace.h" +#include "Workspacemenu.h" +#include "openbox.h" +#ifdef SLIT +# include "Slit.h" +#endif // SLIT +#include "Image.h" ++#include "Resource.h" ++#include "Util.h" ++ ++#include ++#include + +// forward declaration +class BScreen; + +struct WindowStyle { + BColor f_focus, f_unfocus, l_text_focus, l_text_unfocus, b_pic_focus, + b_pic_unfocus; + BTexture t_focus, t_unfocus, l_focus, l_unfocus, h_focus, h_unfocus, + b_focus, b_unfocus, b_pressed, g_focus, g_unfocus; + GC l_text_focus_gc, l_text_unfocus_gc, b_pic_focus_gc, b_pic_unfocus_gc; + + XFontSet fontset; + XFontSetExtents *fontset_extents; + XFontStruct *font; + + int justify; +}; + +struct ToolbarStyle { + BColor l_text, w_text, c_text, b_pic; + BTexture toolbar, label, window, button, pressed, clock; + GC l_text_gc, w_text_gc, c_text_gc, b_pic_gc; + + XFontSet fontset; + XFontSetExtents *fontset_extents; + XFontStruct *font; + + int justify; +}; + +struct MenuStyle { + BColor t_text, f_text, h_text, d_text; + BTexture title, frame, hilite; + GC t_text_gc, f_text_gc, h_text_gc, d_text_gc, hilite_gc; + + XFontSet t_fontset, f_fontset; + XFontSetExtents *t_fontset_extents, *f_fontset_extents; + XFontStruct *t_font, *f_font; + + int t_justify, f_justify, bullet, bullet_pos; +}; + + +class BScreen : public ScreenInfo { +private: + Bool root_colormap_installed, managed, geom_visible; + GC opGC; + Pixmap geom_pixmap; + Window geom_window; + - Openbox *openbox; ++ Openbox &openbox; ++ Resource &config; + BImageControl *image_control; + Configmenu *configmenu; + Iconmenu *iconmenu; + Rootmenu *rootmenu; + - LinkedList *rootmenuList; - LinkedList *netizenList; - LinkedList *iconList; ++ typedef std::list menuList; ++ menuList rootmenuList; ++ typedef std::list netList; ++ netList netizenList; ++ typedef std::list winList; ++ winList iconList; + +#ifdef SLIT + Slit *slit; +#endif // SLIT + + Toolbar *toolbar; + Workspace *current_workspace; + Workspacemenu *workspacemenu; + + unsigned int geom_w, geom_h; + unsigned long event_mask; + - LinkedList *workspaceNames; - LinkedList *workspacesList; ++ typedef std::vector wkspNameList; ++ wkspNameList workspaceNames; ++ typedef std::vector wkspList; ++ wkspList workspacesList; + + struct resource { + WindowStyle wstyle; + ToolbarStyle tstyle; + MenuStyle mstyle; + - Bool toolbar_on_top, toolbar_auto_hide, sloppy_focus, auto_raise, - auto_edge_balance, image_dither, ordered_dither, opaque_move, full_max, - focus_new, focus_last; ++ bool sloppy_focus, auto_raise, auto_edge_balance, focus_last, ++ ordered_dither, opaque_move, hide_toolbar, full_max, focus_new, ++ window_to_window_snap, window_corner_snap; + BColor border_color; - XrmDatabase stylerc; - - int workspaces, toolbar_placement, toolbar_width_percent, placement_policy, - edge_snap_threshold, row_direction, col_direction; ++ Resource styleconfig; + - #ifdef SLIT - Bool slit_on_top, slit_auto_hide; - int slit_placement, slit_direction; - #endif // SLIT ++ int workspaces, placement_policy, edge_snap_threshold, row_direction, ++ col_direction; + + unsigned int handle_width, bevel_width, frame_width, border_width; - unsigned int zones; // number of zones to be used when alt-resizing a window ++ int zones; // number of zones to be used when alt-resizing a window + +#ifdef HAVE_STRFTIME + char *strftime_format; +#else // !HAVE_STRFTIME - Bool clock24hour; ++ bool clock24hour; + int date_format; +#endif // HAVE_STRFTIME + + char *root_command; + } resource; + + +protected: + Bool parseMenuFile(FILE *, Rootmenu *); + - void readDatabaseTexture(char *, char *, BTexture *, unsigned long); - void readDatabaseColor(char *, char *, BColor *, unsigned long); ++ void readDatabaseTexture(const char *, const char *, BTexture *, ++ unsigned long); ++ void readDatabaseColor(const char *, const char *, BColor *, unsigned long); + - void readDatabaseFontSet(char *, char *, XFontSet *); - XFontSet createFontSet(char *); - void readDatabaseFont(char *, char *, XFontStruct **); ++ void readDatabaseFontSet(const char *, const char *, XFontSet *); ++ XFontSet createFontSet(const char *); ++ void readDatabaseFont(const char *, const char *, XFontStruct **); + - void InitMenu(void); - void LoadStyle(void); ++ void InitMenu(); ++ void LoadStyle(); + + +public: - BScreen(Openbox *, int); - ~BScreen(void); - - inline const Bool &isToolbarOnTop(void) const - { return resource.toolbar_on_top; } - inline const Bool &doToolbarAutoHide(void) const - { return resource.toolbar_auto_hide; } - inline const Bool &isSloppyFocus(void) const - { return resource.sloppy_focus; } - inline const Bool &isRootColormapInstalled(void) const - { return root_colormap_installed; } - inline const Bool &doAutoRaise(void) const { return resource.auto_raise; } - inline const Bool &isScreenManaged(void) const { return managed; } - inline const Bool &doImageDither(void) const - { return resource.image_dither; } - inline const Bool &doOrderedDither(void) const - { return resource.ordered_dither; } - inline const Bool &doOpaqueMove(void) const { return resource.opaque_move; } - inline const Bool &doFullMax(void) const { return resource.full_max; } - inline const Bool &doFocusNew(void) const { return resource.focus_new; } - inline const Bool &doFocusLast(void) const { return resource.focus_last; } ++ BScreen(Openbox &, int, Resource &); ++ ~BScreen(); + ++ inline const Bool &isScreenManaged() const { return managed; } + inline const GC &getOpGC() const { return opGC; } + - inline Openbox *getOpenbox(void) { return openbox; } - inline BColor *getBorderColor(void) { return &resource.border_color; } - inline BImageControl *getImageControl(void) { return image_control; } - inline Rootmenu *getRootmenu(void) { return rootmenu; } ++ inline Openbox &getOpenbox() { return openbox; } ++ inline BColor *getBorderColor() { return &resource.border_color; } ++ inline BImageControl *getImageControl() { return image_control; } ++ inline Rootmenu *getRootmenu() { return rootmenu; } + +#ifdef SLIT - inline const Bool &isSlitOnTop(void) const { return resource.slit_on_top; } - inline const Bool &doSlitAutoHide(void) const - { return resource.slit_auto_hide; } - inline Slit *getSlit(void) { return slit; } - inline const int &getSlitPlacement(void) const - { return resource.slit_placement; } - inline const int &getSlitDirection(void) const - { return resource.slit_direction; } - inline void saveSlitPlacement(int p) { resource.slit_placement = p; } - inline void saveSlitDirection(int d) { resource.slit_direction = d; } - inline void saveSlitOnTop(Bool t) { resource.slit_on_top = t; } - inline void saveSlitAutoHide(Bool t) { resource.slit_auto_hide = t; } ++ inline Slit *getSlit() { return slit; } +#endif // SLIT + - inline int getWindowZones(void) const - { return resource.zones; } - inline void saveWindowZones(int z) { resource.zones = z; } - - inline Toolbar *getToolbar(void) { return toolbar; } ++ inline Toolbar *getToolbar() { return toolbar; } + - inline Workspace *getWorkspace(int w) { return workspacesList->find(w); } - inline Workspace *getCurrentWorkspace(void) { return current_workspace; } ++ Rect availableArea() const; ++ ++ inline Workspace *getWorkspace(unsigned int w) { ++ ASSERT(w < workspacesList.size()); ++ return workspacesList[w]; ++ } ++ inline Workspace *getCurrentWorkspace() { return current_workspace; } + - inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } ++ inline Workspacemenu *getWorkspacemenu() { return workspacemenu; } ++ ++ inline void iconUpdate() { iconmenu->update(); } + - inline const unsigned int &getHandleWidth(void) const ++ inline const unsigned int &getHandleWidth() const + { return resource.handle_width; } - inline const unsigned int &getBevelWidth(void) const ++ inline const unsigned int &getBevelWidth() const + { return resource.bevel_width; } - inline const unsigned int &getFrameWidth(void) const ++ inline const unsigned int &getFrameWidth() const + { return resource.frame_width; } - inline const unsigned int &getBorderWidth(void) const ++ inline const unsigned int &getBorderWidth() const + { return resource.border_width; } + + inline const int getCurrentWorkspaceID() + { return current_workspace->getWorkspaceID(); } - inline const int getCount(void) { return workspacesList->count(); } - inline const int getIconCount(void) { return iconList->count(); } - inline const int &getNumberOfWorkspaces(void) const - { return resource.workspaces; } - inline const int &getToolbarPlacement(void) const - { return resource.toolbar_placement; } - inline const int &getToolbarWidthPercent(void) const - { return resource.toolbar_width_percent; } - inline const int &getPlacementPolicy(void) const - { return resource.placement_policy; } - inline const int &getEdgeSnapThreshold(void) const - { return resource.edge_snap_threshold; } - inline const int &getRowPlacementDirection(void) const - { return resource.row_direction; } - inline const int &getColPlacementDirection(void) const - { return resource.col_direction; } - - inline void saveRootCommand(const char *cmd) { - if (resource.root_command != NULL) - delete [] resource.root_command; - if (cmd != NULL) - resource.root_command = bstrdup(cmd); - else - resource.root_command = NULL; - } - inline const char *getRootCommand(void) const - { return resource.root_command; } - ++ inline const int getWorkspaceCount() { return workspacesList.size(); } ++ inline const int getIconCount() { return iconList.size(); } ++ ++ inline const Bool &isRootColormapInstalled() const ++ { return root_colormap_installed; } + inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } - inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; } - inline void saveAutoRaise(Bool a) { resource.auto_raise = a; } - inline void saveWorkspaces(int w) { resource.workspaces = w; } - inline void saveToolbarOnTop(Bool r) { resource.toolbar_on_top = r; } - inline void saveToolbarAutoHide(Bool r) { resource.toolbar_auto_hide = r; } - inline void saveToolbarWidthPercent(int w) - { resource.toolbar_width_percent = w; } - inline void saveToolbarPlacement(int p) { resource.toolbar_placement = p; } - inline void savePlacementPolicy(int p) { resource.placement_policy = p; } - inline void saveRowPlacementDirection(int d) { resource.row_direction = d; } - inline void saveColPlacementDirection(int d) { resource.col_direction = d; } - inline void saveEdgeSnapThreshold(int t) - { resource.edge_snap_threshold = t; } - inline void saveImageDither(Bool d) { resource.image_dither = d; } - inline void saveOpaqueMove(Bool o) { resource.opaque_move = o; } - inline void saveFullMax(Bool f) { resource.full_max = f; } - inline void saveFocusNew(Bool f) { resource.focus_new = f; } - inline void saveFocusLast(Bool f) { resource.focus_last = f; } - inline void iconUpdate(void) { iconmenu->update(); } ++ ++ inline bool windowToWindowSnap() const ++ { return resource.window_to_window_snap; } ++ void setWindowToWindowSnap(bool sn); ++ ++ inline bool windowCornerSnap() const ++ { return resource.window_corner_snap; } ++ void setWindowCornerSnap(bool sn); ++ ++ inline bool sloppyFocus() const { return resource.sloppy_focus; } ++ void setSloppyFocus(bool s); ++ ++ inline bool autoRaise() const { return resource.auto_raise; } ++ void setAutoRaise(bool a); ++ ++ inline bool imageDither() const { return image_control->doDither(); } ++ void setImageDither(bool d, bool reconfig = true); ++ ++ inline bool orderedDither() const { return resource.ordered_dither; } ++ ++ inline bool opaqueMove() const { return resource.opaque_move; } ++ void setOpaqueMove(bool o); ++ ++ inline bool fullMax() const { return resource.full_max; } ++ void setFullMax(bool f); ++ ++ inline bool focusNew() const { return resource.focus_new; } ++ void setFocusNew(bool f); ++ ++ inline bool focusLast() const { return resource.focus_last; } ++ void setFocusLast(bool f); ++ ++ inline int getWindowZones() const { return resource.zones; } ++ void setWindowZones(int z); ++ ++ inline int workspaceCount() const { return resource.workspaces; } ++ void setWorkspaceCount(int w); + ++ inline int placementPolicy() const { return resource.placement_policy; } ++ void setPlacementPolicy(int p); ++ ++ inline int edgeSnapThreshold() const { return resource.edge_snap_threshold; } ++ void setEdgeSnapThreshold(int t); ++ ++ inline int rowPlacementDirection() const { return resource.row_direction; } ++ void setRowPlacementDirection(int d); ++ ++ inline int colPlacementDirection() const { return resource.col_direction; } ++ void setColPlacementDirection(int d); ++ ++ inline char *rootCommand() const { return resource.root_command; } ++ inline void setRootCommand(const char *cmd); ++ +#ifdef HAVE_STRFTIME - inline char *getStrftimeFormat(void) { return resource.strftime_format; } - void saveStrftimeFormat(char *); ++ inline char *strftimeFormat() { return resource.strftime_format; } ++ void setStrftimeFormat(const char *); +#else // !HAVE_STRFTIME - inline int getDateFormat(void) { return resource.date_format; } - inline void saveDateFormat(int f) { resource.date_format = f; } - inline Bool isClock24Hour(void) { return resource.clock24hour; } - inline void saveClock24Hour(Bool c) { resource.clock24hour = c; } ++ inline int dateFormat() { return resource.date_format; } ++ void setDateFormat(int f); ++ inline bool clock24Hour() { return resource.clock24hour; } ++ void setClock24Hour(Bool c); +#endif // HAVE_STRFTIME + - inline WindowStyle *getWindowStyle(void) { return &resource.wstyle; } - inline MenuStyle *getMenuStyle(void) { return &resource.mstyle; } - inline ToolbarStyle *getToolbarStyle(void) { return &resource.tstyle; } ++ inline bool hideToolbar() const { return resource.hide_toolbar; } ++ void setHideToolbar(bool); ++ ++ inline WindowStyle *getWindowStyle() { return &resource.wstyle; } ++ inline MenuStyle *getMenuStyle() { return &resource.mstyle; } ++ inline ToolbarStyle *getToolbarStyle() { return &resource.tstyle; } + + OpenboxWindow *getIcon(int); + - int addWorkspace(void); - int removeLastWorkspace(void); ++ int addWorkspace(); ++ int removeLastWorkspace(); + - void removeWorkspaceNames(void); - void addWorkspaceName(char *); ++ void removeWorkspaceNames(); ++ void addWorkspaceName(const char *); ++ void saveWorkspaceNames(); + void addNetizen(Netizen *); + void removeNetizen(Window); + void addIcon(OpenboxWindow *); + void removeIcon(OpenboxWindow *); - char* getNameOfWorkspace(int); ++ const char *getNameOfWorkspace(int); + void changeWorkspaceID(int); + void raiseWindows(Window *, int); + void reassociateWindow(OpenboxWindow *, int, Bool); - void prevFocus(void); - void nextFocus(void); - void raiseFocus(void); - void reconfigure(void); - void rereadMenu(void); - void shutdown(void); ++ void prevFocus(); ++ void nextFocus(); ++ void raiseFocus(); ++ void reconfigure(); ++ void load(); ++ void save(); ++ void rereadMenu(); ++ void shutdown(); + void showPosition(int, int); + void showGeometry(unsigned int, unsigned int); - void hideGeometry(void); - - void updateNetizenCurrentWorkspace(void); - void updateNetizenWorkspaceCount(void); - void updateNetizenWindowFocus(void); ++ void hideGeometry(); ++ void updateNetizenCurrentWorkspace(); ++ void updateNetizenWorkspaceCount(); ++ void updateNetizenWindowFocus(); + void updateNetizenWindowAdd(Window, unsigned long); + void updateNetizenWindowDel(Window); + void updateNetizenConfigNotify(XEvent *); + void updateNetizenWindowRaise(Window); + void updateNetizenWindowLower(Window); + - enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement, LeftRight, - RightLeft, TopBottom, BottomTop }; ++ enum { RowSmartPlacement = 1, ColSmartPlacement, CascadePlacement, ++ BestFitPlacement, UnderMousePlacement, ClickMousePlacement, ++ LeftRight, RightLeft, TopBottom, BottomTop }; + enum { LeftJustify = 1, RightJustify, CenterJustify }; + enum { RoundBullet = 1, TriangleBullet, SquareBullet, NoBullet }; + enum { Restart = 1, RestartOther, Exit, Shutdown, Execute, Reconfigure, + WindowShade, WindowIconify, WindowMaximize, WindowClose, WindowRaise, + WindowLower, WindowStick, WindowKill, SetStyle }; +}; + + +#endif // __Screen_hh diff --cc src/Slit.cc index 2eb940e7,83923dfc..66cdc583 --- a/src/Slit.cc +++ b/src/Slit.cc @@@ -30,159 -25,152 +30,160 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -extern "C" { -#include -} - -#include "i18n.hh" -#include "blackbox.hh" -#include "Image.hh" -#include "Screen.hh" -#include "Slit.hh" -#include "Toolbar.hh" - +#ifdef SLIT -Slit::Slit(BScreen *scr) { - screen = scr; - blackbox = screen->getBlackbox(); - slitstr = (std::string)"session.screen" + itostring(screen->getScreenNumber()) - + ".slit."; - config = blackbox->getConfig(); - - load_rc(); +#include - display = screen->getBaseDisplay()->getXDisplay(); +#include "i18n.h" +#include "openbox.h" +#include "Image.h" +#include "Screen.h" +#include "Slit.h" +#include "Toolbar.h" + - - Slit::Slit(BScreen *scr) { - screen = scr; - openbox = screen->getOpenbox(); - - on_top = screen->isSlitOnTop(); - hidden = do_auto_hide = screen->doSlitAutoHide(); - - display = screen->getBaseDisplay()->getXDisplay(); ++#include ++#include ++using std::ends; ++ ++Slit::Slit(BScreen &scr, Resource &conf) : openbox(scr.getOpenbox()), ++ screen(scr), config(conf) ++{ ++ load(); ++ ++ display = screen.getBaseDisplay().getXDisplay(); frame.window = frame.pixmap = None; - timer = new BTimer(openbox, this); - timer->setTimeout(openbox->getAutoRaiseDelay()); - timer = new BTimer(blackbox, this); - timer->setTimeout(blackbox->getAutoRaiseDelay()); ++ timer = new BTimer(openbox, *this); ++ // the time out is set in ::reconfigure() + timer->fireOnce(True); - clientList = new LinkedList; - -- slitmenu = new Slitmenu(this); ++ slitmenu = new Slitmenu(*this); XSetWindowAttributes attrib; unsigned long create_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | CWColormap | CWOverrideRedirect | CWEventMask; attrib.background_pixmap = None; attrib.background_pixel = attrib.border_pixel = - screen->getBorderColor()->getPixel(); - screen->getBorderColor()->pixel(); -- attrib.colormap = screen->getColormap(); ++ screen.getBorderColor()->getPixel(); ++ attrib.colormap = screen.getColormap(); attrib.override_redirect = True; attrib.event_mask = SubstructureRedirectMask | ButtonPressMask | EnterWindowMask | LeaveWindowMask; - frame.x = frame.y = 0; - frame.width = frame.height = 1; - frame.rect.setSize(1, 1); -- ++ frame.area = Rect(0, 0, 1, 1); ++ frame.window = - XCreateWindow(display, screen->getRootWindow(), frame.x, frame.y, - frame.width, frame.height, screen->getBorderWidth(), - screen->getDepth(), InputOutput, screen->getVisual(), - XCreateWindow(display, screen->getRootWindow(), - frame.rect.x(), frame.rect.y(), - frame.rect.width(), frame.rect.height(), - screen->getBorderWidth(), screen->getDepth(), InputOutput, - screen->getVisual(), create_mask, &attrib); - blackbox->saveSlitSearch(frame.window, this); - - screen->addStrut(&strut); ++ XCreateWindow(display, screen.getRootWindow(), ++ frame.area.x(), frame.area.y(), ++ frame.area.w(), frame.area.h(), screen.getBorderWidth(), ++ screen.getDepth(), InputOutput, screen.getVisual(), + create_mask, &attrib); - openbox->saveSlitSearch(frame.window, this); ++ openbox.saveSlitSearch(frame.window, this); reconfigure(); } -Slit::~Slit(void) { +Slit::~Slit() { - openbox->grab(); ++ openbox.grab(); + + if (timer->isTiming()) timer->stop(); delete timer; - delete clientList; ++ clientList.clear(); ++ delete slitmenu; -- screen->getImageControl()->removeImage(frame.pixmap); ++ screen.getImageControl()->removeImage(frame.pixmap); - openbox->removeSlitSearch(frame.window); - blackbox->removeSlitSearch(frame.window); ++ openbox.removeSlitSearch(frame.window); XDestroyWindow(display, frame.window); + - openbox->ungrab(); ++ openbox.ungrab(); } void Slit::addClient(Window w) { - openbox->grab(); - if (! blackbox->validateWindow(w)) - return; - - SlitClient *client = new SlitClient; - client->client_window = w; - - XWMHints *wmhints = XGetWMHints(display, w); - - if (wmhints) { - if ((wmhints->flags & IconWindowHint) && - (wmhints->icon_window != None)) { - // some dock apps use separate windows, we need to hide these - XMoveWindow(display, client->client_window, screen->getWidth() + 10, - screen->getHeight() + 10); - XMapWindow(display, client->client_window); ++ openbox.grab(); + - if (openbox->validateWindow(w)) { ++ if (openbox.validateWindow(w)) { + SlitClient *client = new SlitClient; + client->client_window = w; + + XWMHints *wmhints = XGetWMHints(display, w); + + if (wmhints) { + if ((wmhints->flags & IconWindowHint) && + (wmhints->icon_window != None)) { - XMoveWindow(display, client->client_window, screen->getWidth() + 10, - screen->getHeight() + 10); ++ XMoveWindow(display, client->client_window, screen.size().w() + 10, ++ screen.size().h() + 10); + XMapWindow(display, client->client_window); + + client->icon_window = wmhints->icon_window; + client->window = client->icon_window; + } else { + client->icon_window = None; + client->window = client->client_window; + } - client->icon_window = wmhints->icon_window; - client->window = client->icon_window; + XFree(wmhints); } else { client->icon_window = None; client->window = client->client_window; } - XFree(wmhints); - } else { - client->icon_window = None; - client->window = client->client_window; - } + XWindowAttributes attrib; + if (XGetWindowAttributes(display, client->window, &attrib)) { + client->width = attrib.width; + client->height = attrib.height; + } else { + client->width = client->height = 64; + } - XWindowAttributes attrib; - if (XGetWindowAttributes(display, client->window, &attrib)) { - client->rect.setSize(attrib.width, attrib.height); - } else { - client->rect.setSize(64, 64); - } + XSetWindowBorderWidth(display, client->window, 0); - XSetWindowBorderWidth(display, client->window, 0); + XSelectInput(display, frame.window, NoEventMask); + XSelectInput(display, client->window, NoEventMask); - XGrabServer(display); - XSelectInput(display, frame.window, NoEventMask); - XSelectInput(display, client->window, NoEventMask); - XReparentWindow(display, client->window, frame.window, 0, 0); - XMapRaised(display, client->window); - XChangeSaveSet(display, client->window, SetModeInsert); - XSelectInput(display, frame.window, SubstructureRedirectMask | - ButtonPressMask | EnterWindowMask | LeaveWindowMask); - XSelectInput(display, client->window, StructureNotifyMask | - SubstructureNotifyMask | EnterWindowMask); + XReparentWindow(display, client->window, frame.window, 0, 0); + XMapRaised(display, client->window); + XChangeSaveSet(display, client->window, SetModeInsert); - XUngrabServer(display); + XSelectInput(display, frame.window, SubstructureRedirectMask | + ButtonPressMask | EnterWindowMask | LeaveWindowMask); + XSelectInput(display, client->window, StructureNotifyMask | + SubstructureNotifyMask | EnterWindowMask); + XFlush(display); - clientList->insert(client); - clientList.push_back(client); ++ clientList.push_back(client); - openbox->saveSlitSearch(client->client_window, this); - openbox->saveSlitSearch(client->icon_window, this); - blackbox->saveSlitSearch(client->client_window, this); - blackbox->saveSlitSearch(client->icon_window, this); - reconfigure(); ++ openbox.saveSlitSearch(client->client_window, this); ++ openbox.saveSlitSearch(client->icon_window, this); + reconfigure(); + } + - openbox->ungrab(); ++ openbox.ungrab(); } -void Slit::removeClient(SlitClient *client, bool remap) { - blackbox->removeSlitSearch(client->client_window); - blackbox->removeSlitSearch(client->icon_window); +void Slit::removeClient(SlitClient *client, Bool remap) { - openbox->removeSlitSearch(client->client_window); - openbox->removeSlitSearch(client->icon_window); - clientList->remove(client); ++ openbox.removeSlitSearch(client->client_window); ++ openbox.removeSlitSearch(client->icon_window); ++ + clientList.remove(client); -- screen->removeNetizen(client->window); ++ screen.removeNetizen(client->window); - if (remap && openbox->validateWindow(client->window)) { - if (remap && blackbox->validateWindow(client->window)) { - XGrabServer(display); ++ if (remap && openbox.validateWindow(client->window)) { XSelectInput(display, frame.window, NoEventMask); XSelectInput(display, client->window, NoEventMask); -- XReparentWindow(display, client->window, screen->getRootWindow(), - client->rect.x(), client->rect.y()); ++ XReparentWindow(display, client->window, screen.getRootWindow(), + client->x, client->y); XChangeSaveSet(display, client->window, SetModeDelete); XSelectInput(display, frame.window, SubstructureRedirectMask | - ButtonPressMask | EnterWindowMask | LeaveWindowMask); - XUngrabServer(display); + ButtonPressMask | EnterWindowMask | LeaveWindowMask); + XFlush(display); } delete client; @@@ -190,175 -178,250 +191,287 @@@ } -struct SlitClientMatch { - Window window; - SlitClientMatch(Window w): window(w) {} - inline bool operator()(const Slit::SlitClient* client) const { - return (client->window == window); - } -}; +void Slit::removeClient(Window w, Bool remap) { - openbox->grab(); ++ openbox.grab(); + Bool reconf = False; - LinkedListIterator it(clientList); - for (SlitClient *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->window == w) { - removeClient(tmp, remap); -void Slit::removeClient(Window w, bool remap) { - SlitClientList::iterator it = clientList.begin(); - const SlitClientList::iterator end = clientList.end(); ++ slitClientList::iterator it; ++ for (it = clientList.begin(); it != clientList.end(); it++) ++ if ((*it)->window == w) { ++ removeClient(*it, remap); + reconf = True; - + break; + } + - it = std::find_if(it, end, SlitClientMatch(w)); - if (it != end) { - removeClient(*it, remap); ++ if (reconf) + reconfigure(); - } -} + - -void Slit::saveOnTop(bool b) { - on_top = b; - config->setValue(slitstr + "onTop", on_top); -} - -void Slit::saveAutoHide(bool b) { - do_auto_hide = b; - config->setValue(slitstr + "autoHide", do_auto_hide); -} - -void Slit::savePlacement(int p) { - placement = p; - const char *pname; - switch (placement) { - case TopLeft: pname = "TopLeft"; break; - case CenterLeft: pname = "CenterLeft"; break; - case BottomLeft: pname = "BottomLeft"; break; - case TopCenter: pname = "TopCenter"; break; - case BottomCenter: pname = "BottomCenter"; break; - case TopRight: pname = "TopRight"; break; - case BottomRight: pname = "BottomRight"; break; - case CenterRight: default: pname = "CenterRight"; break; ++ openbox.ungrab(); ++} ++ ++void Slit::setOnTop(bool b) { ++ m_ontop = b; ++ std::ostrstream s; ++ s << "session.screen" << screen.getScreenNumber() << ".slit.onTop" << ends; ++ 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; ++ 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; ++ const char *placement; ++ switch (m_placement) { ++ case TopLeft: placement = "TopLeft"; break; ++ case CenterLeft: placement = "CenterLeft"; break; ++ case BottomLeft: placement = "BottomLeft"; break; ++ case TopCenter: placement = "TopCenter"; break; ++ case BottomCenter: placement = "BottomCenter"; break; ++ case TopRight: placement = "TopRight"; break; ++ case BottomRight: placement = "BottomRight"; break; ++ case CenterRight: default: placement = "CenterRight"; break; } - config->setValue(slitstr + "placement", pname); ++ config.setValue(s.str(), placement); ++ s.rdbuf()->freeze(0); + } - if (reconf) reconfigure(); -void Slit::saveDirection(int d) { - direction = d; - config->setValue(slitstr + "direction", (direction == Horizontal ? - "Horizontal" : "Vertical")); ++void Slit::setDirection(int d) { ++ m_direction = d; ++ std::ostrstream s; ++ s << "session.screen" << screen.getScreenNumber() << ".slit.direction" ++ << ends; ++ config.setValue(s.str(), ++ m_direction == Horizontal ? "Horizontal" : "Vertical"); ++ s.rdbuf()->freeze(0); + } - openbox->ungrab(); -void Slit::save_rc(void) { - saveOnTop(on_top); - saveAutoHide(do_auto_hide); - savePlacement(placement); - saveDirection(direction); ++void Slit::save() { ++ setOnTop(m_ontop); ++ setAutoHide(m_autohide); ++ setPlacement(m_placement); ++ setDirection(m_direction); } -void Slit::load_rc(void) { ++void Slit::load() { ++ std::ostrstream rscreen, rname, rclass; + std::string s; - - if (! config->getValue(slitstr + "onTop", on_top)) - on_top = false; - - if (! config->getValue(slitstr + "autoHide", do_auto_hide)) - do_auto_hide = false; - hidden = do_auto_hide; - - if (config->getValue(slitstr + "direction", s) && s == "Horizontal") - direction = Horizontal; - else - direction = Vertical; - - if (config->getValue(slitstr + "placement", s)) { - if (s == "TopLeft") - placement = TopLeft; - else if (s == "CenterLeft") - placement = CenterLeft; - else if (s == "BottomLeft") - placement = BottomLeft; - else if (s == "TopCenter") - placement = TopCenter; - else if (s == "BottomCenter") - placement = BottomCenter; - else if (s == "TopRight") - placement = TopRight; - else if (s == "BottomRight") - placement = BottomRight; - else //if (s == "CenterRight") - placement = CenterRight; ++ bool b; ++ rscreen << "session.screen" << screen.getScreenNumber() << '.' << ends; ++ ++ rname << rscreen.str() << "slit.placement" << ends; ++ rclass << rscreen.str() << "Slit.Placement" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (0 == strncasecmp(s.c_str(), "TopLeft", s.length())) ++ m_placement = TopLeft; ++ else if (0 == strncasecmp(s.c_str(), "CenterLeft", s.length())) ++ m_placement = CenterLeft; ++ else if (0 == strncasecmp(s.c_str(), "BottomLeft", s.length())) ++ m_placement = BottomLeft; ++ else if (0 == strncasecmp(s.c_str(), "TopCenter", s.length())) ++ m_placement = TopCenter; ++ else if (0 == strncasecmp(s.c_str(), "BottomCenter", s.length())) ++ m_placement = BottomCenter; ++ else if (0 == strncasecmp(s.c_str(), "TopRight", s.length())) ++ m_placement = TopRight; ++ else if (0 == strncasecmp(s.c_str(), "BottomRight", s.length())) ++ m_placement = BottomRight; ++ else if (0 == strncasecmp(s.c_str(), "CenterRight", s.length())) ++ m_placement = CenterRight; + } else - placement = CenterRight; -} ++ m_placement = CenterRight; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "slit.direction" << ends; ++ rclass << rscreen.str() << "Slit.Direction" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (0 == strncasecmp(s.c_str(), "Horizontal", s.length())) ++ m_direction = Horizontal; ++ else if (0 == strncasecmp(s.c_str(), "Vertical", s.length())) ++ m_direction = Vertical; ++ } else ++ m_direction = Vertical; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "slit.onTop" << ends; ++ rclass << rscreen.str() << "Slit.OnTop" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ m_ontop = b; ++ else ++ m_ontop = false; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "slit.autoHide" << ends; ++ rclass << rscreen.str() << "Slit.AutoHide" << ends; ++ 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) { - frame.width = 0; - frame.height = 0; - LinkedListIterator it(clientList); - SlitClientList::iterator it = clientList.begin(); - const SlitClientList::iterator end = clientList.end(); -- SlitClient *client; ++ timer->setTimeout(openbox.getAutoRaiseDelay()); - switch (screen->getSlitDirection()) { - unsigned int width = 0, height = 0; ++ frame.area.setSize(0, 0); ++ slitClientList::const_iterator it; + - switch (direction) { ++ switch (m_direction) { case Vertical: - for (client = it.current(); client; it++, client = it.current()) { - frame.height += client->height + screen->getBevelWidth(); - for (; it != end; ++it) { - client = *it; - height += client->rect.height() + screen->getBevelWidth(); ++ for (it = clientList.begin(); it != clientList.end(); it++) { ++ frame.area.setH(frame.area.h() + (*it)->height + screen.getBevelWidth()); - if (frame.width < client->width) - frame.width = client->width; - if (width < client->rect.width()) - width = client->rect.width(); ++ if (frame.area.w() < (*it)->width) ++ frame.area.setW((*it)->width); } - if (frame.width < 1) - frame.width = 1; - if (width < 1) - width = 1; ++ if (frame.area.w() < 1) ++ frame.area.setW(1); else - frame.width += (screen->getBevelWidth() * 2); - width += (screen->getBevelWidth() * 2); ++ frame.area.setW(frame.area.w() + (screen.getBevelWidth() * 2)); - if (frame.height < 1) - frame.height = 1; - if (height < 1) - height = 1; ++ if (frame.area.h() < 1) ++ frame.area.setH(1); else - frame.height += screen->getBevelWidth(); - height += screen->getBevelWidth(); ++ frame.area.setH(frame.area.h() + screen.getBevelWidth()); break; case Horizontal: - for (client = it.current(); client; it++, client = it.current()) { - frame.width += client->width + screen->getBevelWidth(); - for (; it != end; ++it) { - client = *it; - width += client->rect.width() + screen->getBevelWidth(); ++ for (it = clientList.begin(); it != clientList.end(); it++) { ++ frame.area.setW(frame.area.w() + (*it)->width + screen.getBevelWidth()); - if (frame.height < client->height) - frame.height = client->height; - if (height < client->rect.height()) - height = client->rect.height(); ++ if (frame.area.h() < (*it)->height) ++ frame.area.setH((*it)->height); } - if (frame.width < 1) - frame.width = 1; - if (width < 1) - width = 1; ++ if (frame.area.w() < 1) ++ frame.area.setW(1); else - frame.width += screen->getBevelWidth(); - width += screen->getBevelWidth(); ++ frame.area.setW(frame.area.w() + screen.getBevelWidth()); - if (frame.height < 1) - frame.height = 1; - if (height < 1) - height = 1; ++ if (frame.area.h() < 1) ++ frame.area.setH(1); else - frame.height += (screen->getBevelWidth() * 2); - height += (screen->getBevelWidth() * 2); ++ frame.area.setH(frame.area.h() + (screen.getBevelWidth() * 2)); break; } reposition(); -- XSetWindowBorderWidth(display ,frame.window, screen->getBorderWidth()); ++ XSetWindowBorderWidth(display ,frame.window, screen.getBorderWidth()); XSetWindowBorder(display, frame.window, - screen->getBorderColor()->getPixel()); - screen->getBorderColor()->pixel()); ++ screen.getBorderColor()->getPixel()); - if (! clientList->count()) - if (clientList.empty()) ++ if (! clientList.size()) XUnmapWindow(display, frame.window); else XMapWindow(display, frame.window); - BTexture *texture = &(screen->getToolbarStyle()->toolbar); - frame.pixmap = texture->render(frame.rect.width(), frame.rect.height(), - frame.pixmap); - if (! frame.pixmap) - XSetWindowBackground(display, frame.window, texture->color().pixel()); - else + Pixmap tmp = frame.pixmap; - BImageControl *image_ctrl = screen->getImageControl(); - BTexture *texture = &(screen->getToolbarStyle()->toolbar); ++ BImageControl *image_ctrl = screen.getImageControl(); ++ BTexture *texture = &(screen.getToolbarStyle()->toolbar); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.pixmap = None; + XSetWindowBackground(display, frame.window, + texture->getColor()->getPixel()); + } else { - frame.pixmap = image_ctrl->renderImage(frame.width, frame.height, ++ frame.pixmap = image_ctrl->renderImage(frame.area.w(), frame.area.h(), + texture); XSetWindowBackgroundPixmap(display, frame.window, frame.pixmap); - + } + if (tmp) image_ctrl->removeImage(tmp); XClearWindow(display, frame.window); - it = clientList.begin(); - int x, y; - it.reset(); - switch (screen->getSlitDirection()) { - switch (direction) { ++ switch (m_direction) { case Vertical: x = 0; -- y = screen->getBevelWidth(); ++ y = screen.getBevelWidth(); - for (client = it.current(); client; it++, client = it.current()) { - x = (frame.width - client->width) / 2; - for (; it != end; ++it) { - client = *it; - x = (frame.rect.width() - client->rect.width()) / 2; ++ for (it = clientList.begin(); it != clientList.end(); it++) { ++ x = (frame.area.w() - (*it)->width) / 2; -- XMoveResizeWindow(display, client->window, x, y, - client->width, client->height); - client->rect.width(), client->rect.height()); -- XMapWindow(display, client->window); ++ XMoveResizeWindow(display, (*it)->window, x, y, ++ (*it)->width, (*it)->height); ++ XMapWindow(display, (*it)->window); // for ICCCM compliance - client->x = x; - client->y = y; - client->rect.setPos(x, y); ++ (*it)->x = x; ++ (*it)->y = y; XEvent event; event.type = ConfigureNotify; event.xconfigure.display = display; -- event.xconfigure.event = client->window; -- event.xconfigure.window = client->window; ++ event.xconfigure.event = (*it)->window; ++ event.xconfigure.window = (*it)->window; event.xconfigure.x = x; event.xconfigure.y = y; - event.xconfigure.width = client->width; - event.xconfigure.height = client->height; - event.xconfigure.width = client->rect.width(); - event.xconfigure.height = client->rect.height(); ++ event.xconfigure.width = (*it)->width; ++ event.xconfigure.height = (*it)->height; event.xconfigure.border_width = 0; event.xconfigure.above = frame.window; event.xconfigure.override_redirect = False; -- XSendEvent(display, client->window, False, StructureNotifyMask, &event); ++ XSendEvent(display, (*it)->window, False, StructureNotifyMask, &event); - y += client->height + screen->getBevelWidth(); - y += client->rect.height() + screen->getBevelWidth(); ++ y += (*it)->height + screen.getBevelWidth(); } break; case Horizontal: -- x = screen->getBevelWidth(); ++ x = screen.getBevelWidth(); y = 0; - for (client = it.current(); client; it++, client = it.current()) { - y = (frame.height - client->height) / 2; - for (; it != end; ++it) { - client = *it; - y = (frame.rect.height() - client->rect.height()) / 2; ++ for (it = clientList.begin(); it != clientList.end(); it++) { ++ y = (frame.area.h() - (*it)->height) / 2; -- XMoveResizeWindow(display, client->window, x, y, - client->width, client->height); - client->rect.width(), client->rect.height()); -- XMapWindow(display, client->window); ++ XMoveResizeWindow(display, (*it)->window, x, y, ++ (*it)->width, (*it)->height); ++ XMapWindow(display, (*it)->window); // for ICCCM compliance - client->x = x; - client->y = y; - client->rect.setPos(x, y); ++ (*it)->x = x; ++ (*it)->y = y; XEvent event; event.type = ConfigureNotify; event.xconfigure.display = display; -- event.xconfigure.event = client->window; -- event.xconfigure.window = client->window; ++ event.xconfigure.event = (*it)->window; ++ event.xconfigure.window = (*it)->window; event.xconfigure.x = x; event.xconfigure.y = y; - event.xconfigure.width = client->width; - event.xconfigure.height = client->height; - event.xconfigure.width = client->rect.width(); - event.xconfigure.height = client->rect.height(); ++ event.xconfigure.width = (*it)->width; ++ event.xconfigure.height = (*it)->height; event.xconfigure.border_width = 0; event.xconfigure.above = frame.window; event.xconfigure.override_redirect = False; -- XSendEvent(display, client->window, False, StructureNotifyMask, &event); ++ XSendEvent(display, (*it)->window, False, StructureNotifyMask, &event); - x += client->width + screen->getBevelWidth(); - x += client->rect.width() + screen->getBevelWidth(); ++ x += (*it)->width + screen.getBevelWidth(); } + break; } @@@ -366,150 -429,206 +479,132 @@@ } -void Slit::updateStrut(void) { - strut.top = strut.bottom = strut.left = strut.right = 0; - - if (! clientList.empty()) { - switch (direction) { - case Vertical: - switch (placement) { - case TopCenter: - strut.top = getY() + getExposedHeight() + - (screen->getBorderWidth() * 2); - break; - case BottomCenter: - strut.bottom = screen->getHeight() - getY(); - break; - case TopLeft: - case CenterLeft: - case BottomLeft: - strut.left = getExposedWidth() + (screen->getBorderWidth() * 2); - break; - case TopRight: - case CenterRight: - case BottomRight: - strut.right = getExposedWidth() + (screen->getBorderWidth() * 2); - break; - } - break; - case Horizontal: - switch (placement) { - case TopCenter: - case TopLeft: - case TopRight: - strut.top = getY() + getExposedHeight() + - (screen->getBorderWidth() * 2); - break; - case BottomCenter: - case BottomLeft: - case BottomRight: - strut.bottom = screen->getHeight() - getY(); - break; - case CenterLeft: - strut.left = getExposedWidth() + (screen->getBorderWidth() * 2); - break; - case CenterRight: - strut.right = getExposedWidth() + (screen->getBorderWidth() * 2); - break; - } - break; - } - } - - // update area with new Strut info - screen->updateAvailableArea(); -} - - void Slit::reposition(void) { // place the slit in the appropriate place - switch (screen->getSlitPlacement()) { - switch (placement) { ++ switch (m_placement) { case TopLeft: - frame.x = 0; - frame.y = 0; - if (screen->getSlitDirection() == Vertical) { - frame.rect.setPos(0, 0); - - if (direction == Vertical) { -- frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() - - frame.width; - - frame.rect.width(); -- frame.y_hidden = 0; ++ frame.area.setOrigin(0, 0); ++ if (m_direction == Vertical) { ++ frame.hidden = Point(screen.getBevelWidth() - screen.getBorderWidth() ++ - frame.area.w(), 0); } else { -- frame.x_hidden = 0; -- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() - - frame.height; - - frame.rect.height(); ++ frame.hidden = Point(0, screen.getBevelWidth() - screen.getBorderWidth() ++ - frame.area.h()); } break; case CenterLeft: - frame.x = 0; - frame.y = (screen->getHeight() - frame.height) / 2; - frame.rect.setPos(0, (screen->getHeight() - frame.rect.height()) / 2); - -- frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() - - frame.width; - frame.y_hidden = frame.y; - - frame.rect.width(); - frame.y_hidden = frame.rect.y(); ++ frame.area.setOrigin(0, (screen.size().h() - frame.area.h()) / 2); ++ frame.hidden = Point(screen.getBevelWidth() - screen.getBorderWidth() ++ - frame.area.w(), frame.area.y()); break; case BottomLeft: - frame.x = 0; - frame.y = screen->getHeight() - frame.height - - (screen->getBorderWidth() * 2); - if (screen->getSlitDirection() == Vertical) { - frame.rect.setPos(0, (screen->getHeight() - frame.rect.height() - - (screen->getBorderWidth() * 2))); - - if (direction == Vertical) { -- frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() - - frame.width; - frame.y_hidden = frame.y; - - frame.rect.width(); - frame.y_hidden = frame.rect.y(); -- } else { -- frame.x_hidden = 0; -- frame.y_hidden = screen->getHeight() - screen->getBevelWidth() - - screen->getBorderWidth(); - - screen->getBorderWidth(); -- } ++ frame.area.setOrigin(0, screen.size().h() - frame.area.h() ++ - (screen.getBorderWidth() * 2)); ++ if (m_direction == Vertical) ++ frame.hidden = Point(screen.getBevelWidth() - screen.getBorderWidth() ++ - frame.area.w(), frame.area.y()); ++ else ++ frame.hidden = Point(0, screen.size().h() - screen.getBevelWidth() ++ - screen.getBorderWidth()); break; case TopCenter: - frame.x = (screen->getWidth() - frame.width) / 2; - frame.y = 0; - frame.x_hidden = frame.x; - frame.rect.setPos((screen->getWidth() - frame.rect.width()) / 2, 0); - - frame.x_hidden = frame.rect.x(); -- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() - - frame.height; - - frame.rect.height(); ++ frame.area.setOrigin((screen.size().w() - frame.area.w()) / 2, 0); ++ frame.hidden = Point(frame.area.x(), screen.getBevelWidth() ++ - screen.getBorderWidth() - frame.area.h()); break; case BottomCenter: - frame.x = (screen->getWidth() - frame.width) / 2; - frame.y = screen->getHeight() - frame.height - - (screen->getBorderWidth() * 2); - frame.x_hidden = frame.x; - frame.rect.setPos((screen->getWidth() - frame.rect.width()) / 2, - (screen->getHeight() - frame.rect.height() - - (screen->getBorderWidth() * 2))); - frame.x_hidden = frame.rect.x(); -- frame.y_hidden = screen->getHeight() - screen->getBevelWidth() -- - screen->getBorderWidth(); ++ frame.area.setOrigin((screen.size().w() - frame.area.w()) / 2, ++ screen.size().h() - frame.area.h() ++ - (screen.getBorderWidth() * 2)); ++ frame.hidden = Point(frame.area.x(), screen.size().h() ++ - screen.getBevelWidth() - screen.getBorderWidth()); break; case TopRight: - frame.x = screen->getWidth() - frame.width - - (screen->getBorderWidth() * 2); - frame.y = 0; - if (screen->getSlitDirection() == Vertical) { - frame.rect.setPos((screen->getWidth() - frame.rect.width() - - (screen->getBorderWidth() * 2)), 0); - - if (direction == Vertical) { -- frame.x_hidden = screen->getWidth() - screen->getBevelWidth() - - screen->getBorderWidth(); - - screen->getBorderWidth(); -- frame.y_hidden = 0; -- } else { - frame.x_hidden = frame.x; - frame.x_hidden = frame.rect.x(); -- frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() - - frame.height; - - frame.rect.height(); -- } ++ frame.area.setOrigin(screen.size().w() - frame.area.w() ++ - (screen.getBorderWidth() * 2), 0); ++ if (m_direction == Vertical) ++ frame.hidden = Point(screen.size().w() - screen.getBevelWidth() ++ - screen.getBorderWidth(), 0); ++ else ++ frame.hidden = Point(frame.area.x(), screen.getBevelWidth() ++ - screen.getBorderWidth() - frame.area.h()); break; case CenterRight: default: - frame.x = screen->getWidth() - frame.width - - (screen->getBorderWidth() * 2); - frame.y = (screen->getHeight() - frame.height) / 2; - frame.rect.setPos((screen->getWidth() - frame.rect.width() - - (screen->getBorderWidth() * 2)), - (screen->getHeight() - frame.rect.height()) / 2); - -- frame.x_hidden = screen->getWidth() - screen->getBevelWidth() -- - screen->getBorderWidth(); - frame.y_hidden = frame.y; - frame.y_hidden = frame.rect.y(); ++ frame.area.setOrigin(screen.size().w() - frame.area.w() ++ - (screen.getBorderWidth() * 2), ++ (screen.size().h() - frame.area.h()) / 2); ++ frame.hidden = Point(screen.size().w() - screen.getBevelWidth() ++ - screen.getBorderWidth(), frame.area.y()); break; case BottomRight: - frame.x = screen->getWidth() - frame.width - - (screen->getBorderWidth() * 2); - frame.y = screen->getHeight() - frame.height - - (screen->getBorderWidth() * 2); - if (screen->getSlitDirection() == Vertical) { - frame.rect.setPos((screen->getWidth() - frame.rect.width() - - (screen->getBorderWidth() * 2)), - (screen->getHeight() - frame.rect.height() - - (screen->getBorderWidth() * 2))); - - if (direction == Vertical) { -- frame.x_hidden = screen->getWidth() - screen->getBevelWidth() - - screen->getBorderWidth(); - frame.y_hidden = frame.y; - - screen->getBorderWidth(); - frame.y_hidden = frame.rect.y(); -- } else { - frame.x_hidden = frame.x; - frame.x_hidden = frame.rect.x(); -- frame.y_hidden = screen->getHeight() - screen->getBevelWidth() -- - screen->getBorderWidth(); -- } ++ frame.area.setOrigin(screen.size().w() - frame.area.w() ++ - (screen.getBorderWidth() * 2), ++ screen.size().h() - frame.area.h() ++ - (screen.getBorderWidth() * 2)); ++ if (m_direction == Vertical) ++ frame.hidden = Point(screen.size().w() - screen.getBevelWidth() ++ - screen.getBorderWidth(), frame.area.y()); ++ else ++ frame.hidden = Point(frame.area.x(), screen.size().h() - ++ screen.getBevelWidth() - screen.getBorderWidth()); break; } - Toolbar *tbar = screen->getToolbar(); - int sw = frame.width + (screen->getBorderWidth() * 2), - sh = frame.height + (screen->getBorderWidth() * 2), - tw = tbar->getWidth() + screen->getBorderWidth(), - th = tbar->getHeight() + screen->getBorderWidth(); - Rect tbar_rect = screen->getToolbar()->getRect(); - tbar_rect.setSize(tbar_rect.width() + (screen->getBorderWidth() * 2), - tbar_rect.height() + (screen->getBorderWidth() * 2)); - Rect slit_rect = frame.rect; - slit_rect.setSize(slit_rect.width() + (screen->getBorderWidth() * 2), - slit_rect.height() + (screen->getBorderWidth() * 2)); -- - if (tbar->getX() < frame.x + sw && tbar->getX() + tw > frame.x && - tbar->getY() < frame.y + sh && tbar->getY() + th > frame.y) { - if (frame.y < th) { - frame.y += tbar->getExposedHeight(); - if (screen->getSlitDirection() == Vertical) - frame.y_hidden += tbar->getExposedHeight(); - if (slit_rect.intersects(tbar_rect)) { - Toolbar *tbar = screen->getToolbar(); - frame.y_hidden = frame.rect.y(); - - int delta = tbar->getExposedHeight() + (screen->getBorderWidth() * 2); - if (frame.rect.bottom() <= tbar_rect.bottom()) { - delta = -delta; ++ Toolbar *tbar = screen.getToolbar(); ++ int sw = frame.area.w() + (screen.getBorderWidth() * 2), ++ sh = frame.area.h() + (screen.getBorderWidth() * 2), ++ tw = tbar->area().w() + screen.getBorderWidth(), ++ th = tbar->area().h() + screen.getBorderWidth(); ++ ++ if (tbar->area().x() < frame.area.x() + sw && ++ tbar->area().x() + tw > frame.area.x() && ++ tbar->area().y() < frame.area.y() + sh && ++ tbar->area().y() + th > frame.area.y()) { ++ if (frame.area.y() < th) { ++ frame.area.setY(frame.area.y() + tbar->getExposedHeight()); ++ if (m_direction == Vertical) ++ frame.hidden.setY(frame.hidden.y() + tbar->getExposedHeight()); + else - frame.y_hidden = frame.y; ++ frame.hidden.setY(frame.area.y()); + } else { - frame.y -= tbar->getExposedHeight(); - if (screen->getSlitDirection() == Vertical) - frame.y_hidden -= tbar->getExposedHeight(); ++ frame.area.setY(frame.area.y() - tbar->getExposedHeight()); ++ if (m_direction == Vertical) ++ frame.hidden.setY(frame.area.y() - tbar->getExposedHeight()); + else - frame.y_hidden = frame.y; ++ frame.hidden.setY(frame.area.y()); } - frame.rect.setY(frame.rect.y() + delta); - if (direction == Vertical) - frame.y_hidden += delta; } - updateStrut(); - -- if (hidden) -- XMoveResizeWindow(display, frame.window, frame.x_hidden, - frame.y_hidden, frame.width, frame.height); - frame.y_hidden, frame.rect.width(), frame.rect.height()); ++ if (m_hidden) ++ XMoveResizeWindow(display, frame.window, frame.hidden.x(), ++ frame.hidden.y(), frame.area.w(), frame.area.h()); else - XMoveResizeWindow(display, frame.window, frame.x, - frame.y, frame.width, frame.height); - XMoveResizeWindow(display, frame.window, frame.rect.x(), frame.rect.y(), - frame.rect.width(), frame.rect.height()); ++ XMoveResizeWindow(display, frame.window, frame.area.x(), ++ frame.area.y(), frame.area.w(), frame.area.h()); } void Slit::shutdown(void) { - while (clientList->count()) - removeClient(clientList->first()); - while (! clientList.empty()) ++ while (clientList.size()) + removeClient(clientList.front()); } void Slit::buttonPressEvent(XButtonEvent *e) { if (e->window != frame.window) return; -- if (e->button == Button1 && (! on_top)) { ++ if (e->button == Button1 && !m_ontop) { Window w[1] = { frame.window }; -- screen->raiseWindows(w, 1); -- } else if (e->button == Button2 && (! on_top)) { ++ screen.raiseWindows(w, 1); ++ } else if (e->button == Button2 && !m_ontop) { XLowerWindow(display, frame.window); } else if (e->button == Button3) { if (! slitmenu->isVisible()) { @@@ -520,13 -639,13 +615,13 @@@ if (x < 0) x = 0; -- else if (x + slitmenu->getWidth() > screen->getWidth()) -- x = screen->getWidth() - slitmenu->getWidth(); ++ else if (x + slitmenu->getWidth() > screen.size().w()) ++ x = screen.size().w() - slitmenu->getWidth(); if (y < 0) y = 0; -- else if (y + slitmenu->getHeight() > screen->getHeight()) -- y = screen->getHeight() - slitmenu->getHeight(); ++ else if (y + slitmenu->getHeight() > screen.size().h()) ++ y = screen.size().h() - slitmenu->getHeight(); slitmenu->move(x, y); slitmenu->show(); @@@ -538,10 -657,10 +633,10 @@@ void Slit::enterNotifyEvent(XCrossingEvent *) { -- if (! do_auto_hide) ++ if (!m_autohide) return; -- if (hidden) { ++ if (m_hidden) { if (! timer->isTiming()) timer->start(); } else { if (timer->isTiming()) timer->stop(); @@@ -550,85 -669,96 +645,85 @@@ void Slit::leaveNotifyEvent(XCrossingEvent *) { -- if (! do_auto_hide) ++ if (!m_autohide) return; -- if (hidden) { ++ if (m_hidden) { if (timer->isTiming()) timer->stop(); } else if (! slitmenu->isVisible()) { -- if (! timer->isTiming()) timer->start(); ++ if (!timer->isTiming()) timer->start(); } } void Slit::configureRequestEvent(XConfigureRequestEvent *e) { - openbox->grab(); - if (! blackbox->validateWindow(e->window)) - return; - - XWindowChanges xwc; - - xwc.x = e->x; - xwc.y = e->y; - xwc.width = e->width; - xwc.height = e->height; - xwc.border_width = 0; - xwc.sibling = e->above; - xwc.stack_mode = e->detail; - - XConfigureWindow(display, e->window, e->value_mask, &xwc); - - SlitClientList::iterator it = clientList.begin(); - const SlitClientList::iterator end = clientList.end(); - for (; it != end; ++it) { - SlitClient *client = *it; - if (client->window == e->window && - (static_cast(client->rect.width()) != e->width || - static_cast(client->rect.height()) != e->height)) { - client->rect.setSize(e->width, e->height); ++ openbox.grab(); + - if (openbox->validateWindow(e->window)) { ++ if (openbox.validateWindow(e->window)) { + Bool reconf = False; + XWindowChanges xwc; + + xwc.x = e->x; + xwc.y = e->y; + xwc.width = e->width; + xwc.height = e->height; + xwc.border_width = 0; + xwc.sibling = e->above; + xwc.stack_mode = e->detail; + + XConfigureWindow(display, e->window, e->value_mask, &xwc); + - LinkedListIterator it(clientList); - SlitClient *client = it.current(); - for (; client; it++, client = it.current()) ++ slitClientList::iterator it = clientList.begin(); ++ for (; it != clientList.end(); it++) { ++ SlitClient *client = *it; + if (client->window == e->window) + if (client->width != ((unsigned) e->width) || + client->height != ((unsigned) e->height)) { + client->width = (unsigned) e->width; + client->height = (unsigned) e->height; - + reconf = True; - + break; + } ++ } - if (reconf) reconfigure(); - ++ if (reconf) + reconfigure(); - return; - } } - - openbox->ungrab(); ++ openbox.ungrab(); } void Slit::timeout(void) { -- hidden = ! hidden; -- if (hidden) -- XMoveWindow(display, frame.window, frame.x_hidden, frame.y_hidden); ++ m_hidden = !m_hidden; ++ if (m_hidden) ++ XMoveWindow(display, frame.window, frame.hidden.x(), frame.hidden.y()); else - XMoveWindow(display, frame.window, frame.x, frame.y); - XMoveWindow(display, frame.window, frame.rect.x(), frame.rect.y()); ++ XMoveWindow(display, frame.window, frame.area.x(), frame.area.y()); } -void Slit::toggleAutoHide(void) { - saveAutoHide(do_auto_hide ? False : True); - - updateStrut(); - - if (do_auto_hide == False && hidden) { - // force the slit to be visible - if (timer->isTiming()) timer->stop(); - timeout(); - } -} - - -void Slit::unmapNotifyEvent(XUnmapEvent *e) { - removeClient(e->window); -} - - --Slitmenu::Slitmenu(Slit *sl) : Basemenu(sl->screen) { -- slit = sl; -- - setLabel(i18n(SlitSet, SlitSlitTitle, "Slit")); ++Slitmenu::Slitmenu(Slit &sl) : Basemenu(sl.screen), slit(sl) { + setLabel(i18n->getMessage(SlitSet, SlitSlitTitle, "Slit")); setInternalMenu(); -- directionmenu = new Directionmenu(this); -- placementmenu = new Placementmenu(this); ++ directionmenu = new Directionmenu(*this); ++ placementmenu = new Placementmenu(*this); - insert(i18n(CommonSet, CommonDirectionTitle, "Direction"), - directionmenu); - insert(i18n(CommonSet, CommonPlacementTitle, "Placement"), - placementmenu); - insert(i18n(CommonSet, CommonAlwaysOnTop, "Always on top"), 1); - insert(i18n(CommonSet, CommonAutoHide, "Auto hide"), 2); + insert(i18n->getMessage(CommonSet, CommonDirectionTitle, "Direction"), + directionmenu); + insert(i18n->getMessage(CommonSet, CommonPlacementTitle, "Placement"), + placementmenu); + insert(i18n->getMessage(CommonSet, CommonAlwaysOnTop, "Always on top"), 1); + insert(i18n->getMessage(CommonSet, CommonAutoHide, "Auto hide"), 2); update(); -- if (slit->isOnTop()) setItemSelected(2, True); -- if (slit->doAutoHide()) setItemSelected(3, True); ++ setValues(); ++} ++ ++void Slitmenu::setValues() { ++ setItemSelected(2, slit.onTop()); ++ setItemSelected(3, slit.autoHide()); } @@@ -647,18 -777,16 +742,18 @@@ void Slitmenu::itemSelected(int button switch (item->function()) { case 1: { // always on top - Bool change = ((slit->isOnTop()) ? False : True); - slit->on_top = change; - slit->saveOnTop(! slit->isOnTop()); - setItemSelected(2, slit->isOnTop()); ++ bool change = ((slit.onTop()) ? false : true); ++ slit.setOnTop(change); + setItemSelected(2, change); -- if (slit->isOnTop()) slit->screen->raiseWindows((Window *) 0, 0); ++ if (slit.onTop()) slit.screen.raiseWindows((Window *) 0, 0); break; } case 2: { // auto hide - Bool change = ((slit->doAutoHide()) ? False : True); - slit->do_auto_hide = change; - slit->toggleAutoHide(); - setItemSelected(3, slit->doAutoHide()); ++ Bool change = ((slit.autoHide()) ? false : true); ++ slit.setAutoHide(change); + setItemSelected(3, change); break; } @@@ -668,12 -796,12 +763,13 @@@ void Slitmenu::internal_hide(void) { Basemenu::internal_hide(); -- if (slit->doAutoHide()) -- slit->timeout(); ++ if (slit.autoHide()) ++ slit.timeout(); } void Slitmenu::reconfigure(void) { ++ setValues(); directionmenu->reconfigure(); placementmenu->reconfigure(); @@@ -681,54 -809,52 +777,61 @@@ } --Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) - : Basemenu(sm->slit->screen) { - slitmenu = sm; - : Basemenu(sm->slit->screen), slit(sm->slit) { -- - setLabel(i18n(SlitSet, SlitSlitDirection, "Slit Direction")); ++Slitmenu::Directionmenu::Directionmenu(Slitmenu &sm) ++ : Basemenu(sm.slit.screen), slitmenu(sm) { + setLabel(i18n->getMessage(SlitSet, SlitSlitDirection, "Slit Direction")); setInternalMenu(); - insert(i18n(CommonSet, CommonDirectionHoriz, "Horizontal"), - Slit::Horizontal); - insert(i18n(CommonSet, CommonDirectionVert, "Vertical"), - Slit::Vertical); + insert(i18n->getMessage(CommonSet, CommonDirectionHoriz, "Horizontal"), + Slit::Horizontal); + insert(i18n->getMessage(CommonSet, CommonDirectionVert, "Vertical"), + Slit::Vertical); update(); + - if (sm->slit->screen->getSlitDirection() == Slit::Horizontal) + setValues(); + } + + -void Slitmenu::Directionmenu::reconfigure(void) { ++void Slitmenu::Directionmenu::setValues() { ++ if (slitmenu.slit.direction() == Slit::Horizontal) + setItemSelected(0, True); + else + setItemSelected(1, True); +} + ++void Slitmenu::Directionmenu::reconfigure() { + setValues(); + Basemenu::reconfigure(); -} - - -void Slitmenu::Directionmenu::setValues(void) { - const bool horiz = slit->getDirection() == Slit::Horizontal; - setItemSelected(0, horiz); - setItemSelected(1, ! horiz); + } + -void Slitmenu::Directionmenu::itemSelected(int button, unsigned int index) { +void Slitmenu::Directionmenu::itemSelected(int button, int index) { if (button != 1) return; BasemenuItem *item = find(index); if (! item) return; - slitmenu->slit->screen->saveSlitDirection(item->function()); - slit->saveDirection(item->function()); ++ slitmenu.slit.setDirection(item->function()); + + if (item->function() == Slit::Horizontal) { + setItemSelected(0, True); + setItemSelected(1, False); + } else { + setItemSelected(0, False); + setItemSelected(1, True); + } + hide(); - slitmenu->slit->reconfigure(); - slit->reconfigure(); ++ slitmenu.slit.reconfigure(); } --Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) - : Basemenu(sm->slit->screen) { - slitmenu = sm; - : Basemenu(sm->slit->screen), slit(sm->slit) { ++Slitmenu::Placementmenu::Placementmenu(Slitmenu &sm) ++ : Basemenu(sm.slit.screen), slitmenu(sm) { - setLabel(i18n(SlitSet, SlitSlitPlacement, "Slit Placement")); + setLabel(i18n->getMessage(SlitSet, SlitSlitPlacement, "Slit Placement")); setMinimumSublevels(3); setInternalMenu(); @@@ -764,10 -926,8 +867,9 @@@ void Slitmenu::Placementmenu::itemSelec BasemenuItem *item = find(index); if (! (item && item->function())) return; - slitmenu->slit->screen->saveSlitPlacement(item->function()); - slit->savePlacement(item->function()); ++ slitmenu.slit.setPlacement(item->function()); hide(); - slitmenu->slit->reconfigure(); - slit->reconfigure(); ++ slitmenu.slit.reconfigure(); } - +#endif // SLIT diff --cc src/Slit.h index 1cb89751,00000000..b07d9c6c mode 100644,000000..100644 --- a/src/Slit.h +++ b/src/Slit.h @@@ -1,159 -1,0 +1,175 @@@ +// Slit.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Slit_hh +#define __Slit_hh + +#include +#include + +#include "Basemenu.h" - #include "LinkedList.h" ++#include "Geometry.h" ++#include + +// forward declaration +class Slit; +class Slitmenu; + +class Slitmenu : public Basemenu { +private: + class Directionmenu : public Basemenu { + private: - Slitmenu *slitmenu; ++ Slitmenu &slitmenu; + + protected: + virtual void itemSelected(int, int); ++ virtual void setValues(); + + public: - Directionmenu(Slitmenu *); ++ Directionmenu(Slitmenu &); ++ void reconfigure(); + }; + + class Placementmenu : public Basemenu { + private: - Slitmenu *slitmenu; ++ Slitmenu &slitmenu; + + protected: + virtual void itemSelected(int, int); + + public: - Placementmenu(Slitmenu *); ++ Placementmenu(Slitmenu &); + }; + + Directionmenu *directionmenu; + Placementmenu *placementmenu; + - Slit *slit; ++ Slit &slit; + + friend class Directionmenu; + friend class Placementmenu; + friend class Slit; + + +protected: + virtual void itemSelected(int, int); - virtual void internal_hide(void); - ++ virtual void internal_hide(); ++ virtual void setValues(); + +public: - Slitmenu(Slit *); - virtual ~Slitmenu(void); ++ Slitmenu(Slit &); ++ virtual ~Slitmenu(); + - inline Basemenu *getDirectionmenu(void) { return directionmenu; } - inline Basemenu *getPlacementmenu(void) { return placementmenu; } ++ inline Basemenu *getDirectionmenu() { return directionmenu; } ++ inline Basemenu *getPlacementmenu() { return placementmenu; } + - void reconfigure(void); ++ void reconfigure(); +}; + + +class Slit : public TimeoutHandler { +private: + class SlitClient { + public: + Window window, client_window, icon_window; + + int x, y; + unsigned int width, height; + }; + - Bool on_top, hidden, do_auto_hide; ++ bool m_ontop, m_autohide, m_hidden; ++ int m_direction, m_placement; + Display *display; + - Openbox *openbox; - BScreen *screen; ++ Openbox &openbox; ++ BScreen &screen; ++ Resource &config; + BTimer *timer; + - LinkedList *clientList; ++ typedef std::list slitClientList; ++ slitClientList clientList; + Slitmenu *slitmenu; + + struct frame { + Pixmap pixmap; + Window window; + - int x, y, x_hidden, y_hidden; - unsigned int width, height; ++ Rect area; ++ Point hidden; + } frame; + ++ + friend class Slitmenu; + friend class Slitmenu::Directionmenu; + friend class Slitmenu::Placementmenu; + + +public: - Slit(BScreen *); ++ Slit(BScreen &, Resource &); + virtual ~Slit(); + - inline const Bool &isOnTop(void) const { return on_top; } - inline const Bool &isHidden(void) const { return hidden; } - inline const Bool &doAutoHide(void) const { return do_auto_hide; } - + inline Slitmenu *getMenu() { return slitmenu; } + + inline const Window &getWindowID() const { return frame.window; } + - inline const int &getX(void) const - { return ((hidden) ? frame.x_hidden : frame.x); } - inline const int &getY(void) const - { return ((hidden) ? frame.y_hidden : frame.y); } - - inline const unsigned int &getWidth(void) const { return frame.width; } - inline const unsigned int &getHeight(void) const { return frame.height; } ++ inline const Point &origin() const { return frame.area.origin(); } ++ inline const Size &size() const { return frame.area.size(); } ++ inline const Rect &area() const { return frame.area; } ++ inline const Point &hiddenOrigin() const { return frame.hidden; } + + void addClient(Window); + void removeClient(SlitClient *, Bool = True); + void removeClient(Window, Bool = True); - void reconfigure(void); - void reposition(void); - void shutdown(void); ++ void reconfigure(); ++ void load(); ++ void save(); ++ void reposition(); ++ void shutdown(); + + void buttonPressEvent(XButtonEvent *); + void enterNotifyEvent(XCrossingEvent *); + void leaveNotifyEvent(XCrossingEvent *); + void configureRequestEvent(XConfigureRequestEvent *); + - virtual void timeout(void); ++ virtual void timeout(); ++ ++ inline bool isHidden() const { return m_hidden; } ++ ++ inline bool onTop() const { return m_ontop; } ++ void setOnTop(bool); ++ ++ inline bool autoHide() const { return m_autohide; } ++ void setAutoHide(bool); ++ ++ inline int placement() const { return m_placement; } ++ void setPlacement(int); ++ ++ inline int direction() const { return m_direction; } ++ void setDirection(int); + + enum { Vertical = 1, Horizontal }; + enum { TopLeft = 1, CenterLeft, BottomLeft, TopCenter, BottomCenter, + TopRight, CenterRight, BottomRight }; +}; + + +#endif // __Slit_hh diff --cc src/Timer.cc index 95985a01,99f05ba9..8cd4714e --- a/src/Timer.cc +++ b/src/Timer.cc @@@ -30,28 -25,31 +30,29 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -#include "BaseDisplay.hh" -#include "Timer.hh" -#include "Util.hh" - -BTimer::BTimer(TimerQueueManager *m, TimeoutHandler *h) { - manager = m; - handler = h; +#include "BaseDisplay.h" +#include "Timer.h" - BTimer::BTimer(BaseDisplay *d, TimeoutHandler *h) { - display = d; - handler = h; - - recur = timing = False; ++BTimer::BTimer(BaseDisplay &d, TimeoutHandler &h) : display(d), handler(h) { + once = timing = False; } - BTimer::~BTimer(void) { if (timing) stop(); } - void BTimer::setTimeout(long t) { _timeout.tv_sec = t / 1000; - _timeout.tv_usec = t % 1000; + _timeout.tv_usec = t; + _timeout.tv_usec -= (_timeout.tv_sec * 1000); _timeout.tv_usec *= 1000; ++ if (timing) { ++ display.removeTimer(this); ++ display.addTimer(this); // reorder the display ++ } } - -void BTimer::setTimeout(const timeval &t) { +void BTimer::setTimeout(timeval t) { _timeout.tv_sec = t.tv_sec; _timeout.tv_usec = t.tv_usec; } @@@ -61,16 -60,52 +62,18 @@@ void BTimer::start(void) if (! timing) { timing = True; - display->addTimer(this); - manager->addTimer(this); ++ display.addTimer(this); } } - void BTimer::stop(void) { -- timing = False; - - manager->removeTimer(this); -} - ++ if (timing) { ++ timing = False; - display->removeTimer(this); -void BTimer::halt(void) { - timing = False; ++ display.removeTimer(this); ++ } } - void BTimer::fireTimeout(void) { - if (handler) handler->timeout(); - if (handler) - handler->timeout(); -} - - -timeval BTimer::timeRemaining(const timeval &tm) const { - timeval ret = endpoint(); - - ret.tv_sec -= tm.tv_sec; - ret.tv_usec -= tm.tv_usec; - - return normalizeTimeval(ret); -} - - -timeval BTimer::endpoint(void) const { - timeval ret; - - ret.tv_sec = _start.tv_sec + _timeout.tv_sec; - ret.tv_usec = _start.tv_usec + _timeout.tv_usec; - - return normalizeTimeval(ret); -} - - -bool BTimer::shouldFire(const timeval &tm) const { - timeval end = endpoint(); - - return ! ((tm.tv_sec < end.tv_sec) || - (tm.tv_sec == end.tv_sec && tm.tv_usec < end.tv_usec)); ++ handler.timeout(); } diff --cc src/Timer.h index 410d658e,00000000..c132b4f2 mode 100644,000000..100644 --- a/src/Timer.h +++ b/src/Timer.h @@@ -1,78 -1,0 +1,78 @@@ +// Timer.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Timer_hh +#define __Timer_hh + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include +# else // !HAVE_SYS_TIME_H +# include +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +// forward declaration +class BTimer; +class TimeoutHandler; +class BaseDisplay; + +class TimeoutHandler { +public: + virtual void timeout(void) = 0; +}; + +class BTimer { + friend class BaseDisplay; +private: - BaseDisplay *display; - TimeoutHandler *handler; ++ BaseDisplay &display; ++ TimeoutHandler &handler; + int timing, once; + + timeval _start, _timeout; + +protected: + void fireTimeout(void); + +public: - BTimer(BaseDisplay *, TimeoutHandler *); ++ BTimer(BaseDisplay &, TimeoutHandler &); + virtual ~BTimer(void); + + inline const int &isTiming(void) const { return timing; } + inline const int &doOnce(void) const { return once; } + + inline const timeval &getTimeout(void) const { return _timeout; } + inline const timeval &getStartTime(void) const { return _start; } + + inline void fireOnce(int o) { once = o; } + + void setTimeout(long); + void setTimeout(timeval); + void start(void); + void stop(void); +}; + +#endif // __Timer_hh + diff --cc src/Toolbar.cc index d2e39c85,447e0d03..8e621bdf --- a/src/Toolbar.cc +++ b/src/Toolbar.cc @@@ -30,23 -25,12 +30,22 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -extern "C" { +#include "i18n.h" +#include "openbox.h" +#include "Clientmenu.h" +#include "Iconmenu.h" +#include "Rootmenu.h" +#include "Screen.h" +#include "Toolbar.h" +#include "Window.h" +#include "Workspace.h" +#include "Workspacemenu.h" + - #include #include - #ifdef STDC_HEADERS -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include - #endif // STDC_HEADERS + #endif // HAVE_STRING_H #ifdef HAVE_STDIO_H # include @@@ -62,375 -46,443 +61,512 @@@ # include # endif // HAVE_SYS_TIME_H #endif // TIME_WITH_SYS_TIME -} ++#include + #include -using std::string; - -#include "i18n.hh" -#include "blackbox.hh" -#include "Clientmenu.hh" -#include "GCCache.hh" -#include "Iconmenu.hh" -#include "Image.hh" -#include "Rootmenu.hh" -#include "Screen.hh" -#include "Toolbar.hh" -#include "Window.hh" -#include "Workspace.hh" -#include "Workspacemenu.hh" -#include "Slit.hh" - - -static long aMinuteFromNow(void) { - timeval now; - gettimeofday(&now, 0); - return ((60 - (now.tv_sec % 60)) * 1000); -} - ++using std::ends; --Toolbar::Toolbar(BScreen *scrn) { -- screen = scrn; - openbox = screen->getOpenbox(); - blackbox = screen->getBlackbox(); - toolbarstr = (string)"session.screen" + itostring(screen->getScreenNumber()) - + ".toolbar."; - config = blackbox->getConfig(); - - load_rc(); ++Toolbar::Toolbar(BScreen &scrn, Resource &conf) : openbox(scrn.getOpenbox()), ++ screen(scrn), config(conf) ++{ ++ load(); // get the clock updating every minute - clock_timer = new BTimer(openbox, this); - clock_timer = new BTimer(blackbox, this); - clock_timer->setTimeout(aMinuteFromNow()); - clock_timer->recurring(True); ++ clock_timer = new BTimer(openbox, *this); + timeval now; + gettimeofday(&now, 0); + clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000); clock_timer->start(); - frame.minute = frame.hour = -1; hide_handler.toolbar = this; - hide_timer = new BTimer(openbox, &hide_handler); - hide_timer->setTimeout(openbox->getAutoRaiseDelay()); - hide_timer = new BTimer(blackbox, &hide_handler); - hide_timer->setTimeout(blackbox->getAutoRaiseDelay()); ++ hide_timer = new BTimer(openbox, hide_handler); ++ // the time out is set in ::reconfigure() + hide_timer->fireOnce(True); - image_ctrl = screen->getImageControl(); - editing = False; ++ image_ctrl = screen.getImageControl(); + - on_top = screen->isToolbarOnTop(); - hidden = do_auto_hide = screen->doToolbarAutoHide(); - - editing = False; ++ m_editing = False; + new_workspace_name = (char *) 0; new_name_pos = 0; frame.grab_x = frame.grab_y = 0; -- toolbarmenu = new Toolbarmenu(this); ++ toolbarmenu = new Toolbarmenu(*this); - display = openbox->getXDisplay(); - display = blackbox->getXDisplay(); ++ display = openbox.getXDisplay(); XSetWindowAttributes attrib; unsigned long create_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | CWColormap | CWOverrideRedirect | CWEventMask; attrib.background_pixmap = None; attrib.background_pixel = attrib.border_pixel = - screen->getBorderColor()->getPixel(); - screen->getBorderColor()->pixel(); -- attrib.colormap = screen->getColormap(); ++ screen.getBorderColor()->getPixel(); ++ attrib.colormap = screen.getColormap(); attrib.override_redirect = True; attrib.event_mask = ButtonPressMask | ButtonReleaseMask | EnterWindowMask | LeaveWindowMask; frame.window = -- XCreateWindow(display, screen->getRootWindow(), 0, 0, 1, 1, 0, - screen->getDepth(), InputOutput, screen->getVisual(), - screen->getDepth(), InputOutput, screen->getVisual(), - create_mask, &attrib); - blackbox->saveToolbarSearch(frame.window, this); ++ XCreateWindow(display, screen.getRootWindow(), 0, 0, 1, 1, 0, ++ screen.getDepth(), InputOutput, screen.getVisual(), + create_mask, &attrib); - openbox->saveToolbarSearch(frame.window, this); ++ openbox.saveToolbarSearch(frame.window, this); attrib.event_mask = ButtonPressMask | ButtonReleaseMask | ExposureMask | KeyPressMask | EnterWindowMask; frame.workspace_label = -- XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen->getDepth(), - InputOutput, screen->getVisual(), create_mask, &attrib); - openbox->saveToolbarSearch(frame.workspace_label, this); - InputOutput, screen->getVisual(), create_mask, &attrib); - blackbox->saveToolbarSearch(frame.workspace_label, this); ++ XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen.getDepth(), ++ InputOutput, screen.getVisual(), create_mask, &attrib); ++ openbox.saveToolbarSearch(frame.workspace_label, this); frame.window_label = -- XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen->getDepth(), - InputOutput, screen->getVisual(), create_mask, &attrib); - openbox->saveToolbarSearch(frame.window_label, this); - InputOutput, screen->getVisual(), create_mask, &attrib); - blackbox->saveToolbarSearch(frame.window_label, this); ++ XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen.getDepth(), ++ InputOutput, screen.getVisual(), create_mask, &attrib); ++ openbox.saveToolbarSearch(frame.window_label, this); frame.clock = -- XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen->getDepth(), - InputOutput, screen->getVisual(), create_mask, &attrib); - openbox->saveToolbarSearch(frame.clock, this); - InputOutput, screen->getVisual(), create_mask, &attrib); - blackbox->saveToolbarSearch(frame.clock, this); ++ XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen.getDepth(), ++ InputOutput, screen.getVisual(), create_mask, &attrib); ++ openbox.saveToolbarSearch(frame.clock, this); frame.psbutton = -- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), -- InputOutput, screen->getVisual(), create_mask, &attrib); - openbox->saveToolbarSearch(frame.psbutton, this); - blackbox->saveToolbarSearch(frame.psbutton, this); ++ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(), ++ InputOutput, screen.getVisual(), create_mask, &attrib); ++ openbox.saveToolbarSearch(frame.psbutton, this); frame.nsbutton = -- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), -- InputOutput, screen->getVisual(), create_mask, &attrib); - openbox->saveToolbarSearch(frame.nsbutton, this); - blackbox->saveToolbarSearch(frame.nsbutton, this); ++ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(), ++ InputOutput, screen.getVisual(), create_mask, &attrib); ++ openbox.saveToolbarSearch(frame.nsbutton, this); frame.pwbutton = -- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), -- InputOutput, screen->getVisual(), create_mask, &attrib); - openbox->saveToolbarSearch(frame.pwbutton, this); - blackbox->saveToolbarSearch(frame.pwbutton, this); ++ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(), ++ InputOutput, screen.getVisual(), create_mask, &attrib); ++ openbox.saveToolbarSearch(frame.pwbutton, this); frame.nwbutton = -- XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), -- InputOutput, screen->getVisual(), create_mask, &attrib); - openbox->saveToolbarSearch(frame.nwbutton, this); - blackbox->saveToolbarSearch(frame.nwbutton, this); ++ XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen.getDepth(), ++ InputOutput, screen.getVisual(), create_mask, &attrib); ++ openbox.saveToolbarSearch(frame.nwbutton, this); frame.base = frame.label = frame.wlabel = frame.clk = frame.button = frame.pbutton = None; - screen->addStrut(&strut); - reconfigure(); + mapToolbar(); + } + - -Toolbar::~Toolbar(void) { - unmapToolbar(); - - if (frame.base) screen->getImageControl()->removeImage(frame.base); - if (frame.label) screen->getImageControl()->removeImage(frame.label); - if (frame.wlabel) screen->getImageControl()->removeImage(frame.wlabel); - if (frame.clk) screen->getImageControl()->removeImage(frame.clk); - if (frame.button) screen->getImageControl()->removeImage(frame.button); - if (frame.pbutton) screen->getImageControl()->removeImage(frame.pbutton); - - blackbox->removeToolbarSearch(frame.window); - blackbox->removeToolbarSearch(frame.workspace_label); - blackbox->removeToolbarSearch(frame.window_label); - blackbox->removeToolbarSearch(frame.clock); - blackbox->removeToolbarSearch(frame.psbutton); - blackbox->removeToolbarSearch(frame.nsbutton); - blackbox->removeToolbarSearch(frame.pwbutton); - blackbox->removeToolbarSearch(frame.nwbutton); - - XDestroyWindow(display, frame.workspace_label); - XDestroyWindow(display, frame.window_label); - XDestroyWindow(display, frame.clock); - - XDestroyWindow(display, frame.window); - - delete hide_timer; - delete clock_timer; - delete toolbarmenu; ++Rect Toolbar::area() const { ++ int x = ((m_hidden) ? frame.x_hidden : frame.x); ++ int y; ++ if (screen.hideToolbar()) y = screen.size().h(); ++ else if (m_hidden) y = frame.y_hidden; ++ else y = frame.y; ++ return Rect(x, y, frame.width, frame.height); + } - XMapSubwindows(display, frame.window); - XMapWindow(display, frame.window); ++unsigned int Toolbar::getExposedHeight() const { ++ if (screen.hideToolbar()) return 0; ++ else if (m_autohide) return frame.bevel_w; ++ else return frame.height; +} -void Toolbar::mapToolbar() { - if (!screen->doHideToolbar()) { ++void Toolbar::mapToolbar(){ ++ if (!screen.hideToolbar()) { + //not hidden, so windows should not maximize over the toolbar + XMapSubwindows(display, frame.window); + XMapWindow(display, frame.window); + } - updateStrut(); + } - Toolbar::~Toolbar(void) { - -void Toolbar::unmapToolbar() { - if (toolbarmenu->isVisible()) - toolbarmenu->hide(); ++void Toolbar::unMapToolbar(){ + //hidden so we can maximize over the toolbar XUnmapWindow(display, frame.window); - updateStrut(); + } ++Toolbar::~Toolbar() { ++ unMapToolbar(); + if (frame.base) image_ctrl->removeImage(frame.base); + if (frame.label) image_ctrl->removeImage(frame.label); + if (frame.wlabel) image_ctrl->removeImage(frame.wlabel); + if (frame.clk) image_ctrl->removeImage(frame.clk); + if (frame.button) image_ctrl->removeImage(frame.button); + if (frame.pbutton) image_ctrl->removeImage(frame.pbutton); + - openbox->removeToolbarSearch(frame.window); - openbox->removeToolbarSearch(frame.workspace_label); - openbox->removeToolbarSearch(frame.window_label); - openbox->removeToolbarSearch(frame.clock); - openbox->removeToolbarSearch(frame.psbutton); - openbox->removeToolbarSearch(frame.nsbutton); - openbox->removeToolbarSearch(frame.pwbutton); - openbox->removeToolbarSearch(frame.nwbutton); ++ openbox.removeToolbarSearch(frame.window); ++ openbox.removeToolbarSearch(frame.workspace_label); ++ openbox.removeToolbarSearch(frame.window_label); ++ openbox.removeToolbarSearch(frame.clock); ++ openbox.removeToolbarSearch(frame.psbutton); ++ openbox.removeToolbarSearch(frame.nsbutton); ++ openbox.removeToolbarSearch(frame.pwbutton); ++ openbox.removeToolbarSearch(frame.nwbutton); -void Toolbar::saveOnTop(bool b) { - on_top = b; - config->setValue(toolbarstr + "onTop", on_top); -} + XDestroyWindow(display, frame.workspace_label); + XDestroyWindow(display, frame.window_label); + XDestroyWindow(display, frame.clock); + XDestroyWindow(display, frame.window); -void Toolbar::saveAutoHide(bool b) { - do_auto_hide = b; - config->setValue(toolbarstr + "autoHide", do_auto_hide); + delete hide_timer; + delete clock_timer; + delete toolbarmenu; } - void Toolbar::reconfigure(void) { - frame.bevel_w = screen->getBevelWidth(); - frame.width = screen->getWidth() * screen->getToolbarWidthPercent() / 100; -void Toolbar::saveWidthPercent(unsigned int w) { - width_percent = w; - config->setValue(toolbarstr + "widthPercent", width_percent); ++void Toolbar::setOnTop(bool b) { ++ m_ontop = b; ++ std::ostrstream s; ++ s << "session.screen" << screen.getScreenNumber() << ".toolbar.onTop" << ends; ++ config.setValue(s.str(), m_ontop ? "True" : "False"); ++ s.rdbuf()->freeze(0); + } + - -void Toolbar::savePlacement(int p) { - placement = p; - const char *pname; - switch (placement) { - case TopLeft: pname = "TopLeft"; break; - case BottomLeft: pname = "BottomLeft"; break; - case TopCenter: pname = "TopCenter"; break; - case TopRight: pname = "TopRight"; break; - case BottomRight: pname = "BottomRight"; break; - case BottomCenter: default: pname = "BottomCenter"; break; - } - config->setValue(toolbarstr + "placement", pname); ++void Toolbar::setAutoHide(bool b) { ++ m_autohide = b; ++ std::ostrstream s; ++ s << "session.screen" << screen.getScreenNumber() << ".toolbar.autoHide" ++ << ends; ++ config.setValue(s.str(), m_autohide ? "True" : "False"); ++ s.rdbuf()->freeze(0); + } + - -void Toolbar::save_rc(void) { - saveOnTop(on_top); - saveAutoHide(do_auto_hide); - saveWidthPercent(width_percent); - savePlacement(placement); ++void Toolbar::setWidthPercent(int w) { ++ m_width_percent = w; ++ std::ostrstream s; ++ s << "session.screen" << screen.getScreenNumber() << ".toolbar.widthPercent" ++ << ends; ++ config.setValue(s.str(), m_width_percent); ++ s.rdbuf()->freeze(0); + } + - -void Toolbar::load_rc(void) { - string s; - - if (! config->getValue(toolbarstr + "onTop", on_top)) - on_top = false; - - if (! config->getValue(toolbarstr + "autoHide", do_auto_hide)) - do_auto_hide = false; - hidden = do_auto_hide; - - if (! config->getValue(toolbarstr + "widthPercent", width_percent) || - width_percent == 0 || width_percent > 100) - width_percent = 66; - - if (config->getValue(toolbarstr + "placement", s)) { - if (s == "TopLeft") - placement = TopLeft; - else if (s == "BottomLeft") - placement = BottomLeft; - else if (s == "TopCenter") - placement = TopCenter; - else if (s == "TopRight") - placement = TopRight; - else if (s == "BottomRight") - placement = BottomRight; - else //if (s == "BottomCenter") - placement = BottomCenter; - } else - placement = BottomCenter; ++void Toolbar::setPlacement(int p) { ++ m_placement = p; ++ std::ostrstream s; ++ s << "session.screen" << screen.getScreenNumber() << ".toolbar.placement" ++ << ends; ++ const char *placement; ++ switch (m_placement) { ++ case TopLeft: placement = "TopLeft"; break; ++ case BottomLeft: placement = "BottomLeft"; break; ++ case TopCenter: placement = "TopCenter"; break; ++ case TopRight: placement = "TopRight"; break; ++ case BottomRight: placement = "BottomRight"; break; ++ case BottomCenter: default: placement = "BottomCenter"; break; ++ } ++ config.setValue(s.str(), placement); ++ s.rdbuf()->freeze(0); + } + ++void Toolbar::save() { ++ setOnTop(m_ontop); ++ setAutoHide(m_autohide); ++ setWidthPercent(m_width_percent); ++ setPlacement(m_placement); ++} + -void Toolbar::reconfigure(void) { - unsigned int height = 0, - width = (screen->getWidth() * width_percent) / 100; - - if (i18n.multibyte()) - height = screen->getToolbarStyle()->fontset_extents->max_ink_extent.height; ++void Toolbar::load() { ++ std::ostrstream rscreen, rname, rclass; ++ std::string s; ++ bool b; ++ long l; ++ rscreen << "session.screen" << screen.getScreenNumber() << '.' << ends; ++ ++ rname << rscreen.str() << "toolbar.widthPercent" << ends; ++ rclass << rscreen.str() << "Toolbar.WidthPercent" << ends; ++ if (config.getValue(rname.str(), rclass.str(), l) && (l > 0 && l <= 100)) ++ m_width_percent = l; + else - height = screen->getToolbarStyle()->font->ascent + - screen->getToolbarStyle()->font->descent; ++ m_width_percent =66; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "toolbar.placement" << ends; ++ rclass << rscreen.str() << "Toolbar.Placement" << ends; ++ if (config.getValue(rname.str(), rclass.str(), s)) { ++ if (0 == strncasecmp(s.c_str(), "TopLeft", s.length())) ++ m_placement = TopLeft; ++ else if (0 == strncasecmp(s.c_str(), "BottomLeft", s.length())) ++ m_placement = BottomLeft; ++ else if (0 == strncasecmp(s.c_str(), "TopCenter", s.length())) ++ m_placement = TopCenter; ++ else if (0 == strncasecmp(s.c_str(), "TopRight", s.length())) ++ m_placement = TopRight; ++ else if ( 0 == strncasecmp(s.c_str(), "BottomRight", s.length())) ++ m_placement = BottomRight; ++ else if ( 0 == strncasecmp(s.c_str(), "BottomCenter", s.length())) ++ m_placement = BottomCenter; ++ } else ++ m_placement = BottomCenter; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "toolbar.onTop" << ends; ++ rclass << rscreen.str() << "Toolbar.OnTop" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ m_ontop = b; ++ else ++ m_ontop = false; ++ ++ rname.seekp(0); rclass.seekp(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++ rname << rscreen.str() << "toolbar.autoHide" << ends; ++ rclass << rscreen.str() << "Toolbar.AutoHide" << ends; ++ if (config.getValue(rname.str(), rclass.str(), b)) ++ m_hidden = m_autohide = b; ++ else ++ m_hidden = m_autohide = false; + - frame.bevel_w = screen->getBevelWidth(); - frame.button_w = height; - height += 2; - frame.label_h = height; - height += (frame.bevel_w * 2); ++ rscreen.rdbuf()->freeze(0); ++ rname.rdbuf()->freeze(0); rclass.rdbuf()->freeze(0); ++} + - frame.rect.setSize(width, height); ++void Toolbar::reconfigure() { ++ hide_timer->setTimeout(openbox.getAutoRaiseDelay()); + - int x, y; - switch (placement) { ++ frame.bevel_w = screen.getBevelWidth(); ++ frame.width = screen.size().w() * m_width_percent / 100; + + if (i18n->multibyte()) + frame.height = - screen->getToolbarStyle()->fontset_extents->max_ink_extent.height; ++ screen.getToolbarStyle()->fontset_extents->max_ink_extent.height; + else - frame.height = screen->getToolbarStyle()->font->ascent + - screen->getToolbarStyle()->font->descent; ++ frame.height = screen.getToolbarStyle()->font->ascent + ++ screen.getToolbarStyle()->font->descent; + frame.button_w = frame.height; + frame.height += 2; + frame.label_h = frame.height; + frame.height += (frame.bevel_w * 2); + - switch (screen->getToolbarPlacement()) { ++ switch (m_placement) { case TopLeft: - case TopRight: - case TopCenter: - if (placement == TopLeft) - x = 0; - else if (placement == TopRight) - x = screen->getWidth() - frame.rect.width() - - (screen->getBorderWidth() * 2); - else - x = (screen->getWidth() - frame.rect.width()) / 2; + frame.x = 0; + frame.y = 0; + frame.x_hidden = 0; - frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() ++ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth() + - frame.height; + break; - y = 0; + case BottomLeft: + frame.x = 0; - frame.y = screen->getHeight() - frame.height - - (screen->getBorderWidth() * 2); ++ frame.y = screen.size().h() - frame.height ++ - (screen.getBorderWidth() * 2); + frame.x_hidden = 0; - frame.y_hidden = screen->getHeight() - screen->getBevelWidth() - - screen->getBorderWidth(); ++ frame.y_hidden = screen.size().h() - screen.getBevelWidth() ++ - screen.getBorderWidth(); + break; - frame.x_hidden = x; - frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() - - frame.rect.height(); + case TopCenter: - frame.x = (screen->getWidth() - frame.width) / 2; ++ frame.x = (screen.size().w() - frame.width) / 2; + frame.y = 0; + frame.x_hidden = frame.x; - frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() ++ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth() + - frame.height; break; - case BottomLeft: - case BottomRight: case BottomCenter: default: - frame.x = (screen->getWidth() - frame.width) / 2; - frame.y = screen->getHeight() - frame.height - - (screen->getBorderWidth() * 2); - if (placement == BottomLeft) - x = 0; - else if (placement == BottomRight) - x = screen->getWidth() - frame.rect.width() - - (screen->getBorderWidth() * 2); - else - x = (screen->getWidth() - frame.rect.width()) / 2; ++ frame.x = (screen.size().w() - frame.width) / 2; ++ frame.y = screen.size().h() - frame.height ++ - (screen.getBorderWidth() * 2); + frame.x_hidden = frame.x; - frame.y_hidden = screen->getHeight() - screen->getBevelWidth() - - screen->getBorderWidth(); ++ frame.y_hidden = screen.size().h() - screen.getBevelWidth() ++ - screen.getBorderWidth(); + break; - y = screen->getHeight() - frame.rect.height() - - (screen->getBorderWidth() * 2); + case TopRight: - frame.x = screen->getWidth() - frame.width - - (screen->getBorderWidth() * 2); ++ frame.x = screen.size().w() - frame.width ++ - (screen.getBorderWidth() * 2); + frame.y = 0; + frame.x_hidden = frame.x; - frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() ++ frame.y_hidden = screen.getBevelWidth() - screen.getBorderWidth() + - frame.height; + break; - frame.x_hidden = x; - frame.y_hidden = screen->getHeight() - screen->getBevelWidth() - - screen->getBorderWidth(); + case BottomRight: - frame.x = screen->getWidth() - frame.width - - (screen->getBorderWidth() * 2); - frame.y = screen->getHeight() - frame.height - - (screen->getBorderWidth() * 2); ++ frame.x = screen.size().w() - frame.width ++ - (screen.getBorderWidth() * 2); ++ frame.y = screen.size().h() - frame.height ++ - (screen.getBorderWidth() * 2); + frame.x_hidden = frame.x; - frame.y_hidden = screen->getHeight() - screen->getBevelWidth() - - screen->getBorderWidth(); ++ frame.y_hidden = screen.size().h() - screen.getBevelWidth() ++ - screen.getBorderWidth(); break; } - frame.rect.setPos(x, y); - - updateStrut(); - #ifdef HAVE_STRFTIME time_t ttmp = time(NULL); + struct tm *tt = 0; - frame.clock_w = 0; if (ttmp != -1) { - struct tm *tt = localtime(&ttmp); + tt = localtime(&ttmp); if (tt) { - char t[1024], *time_string = (char *) 0; - char t[1024]; -- int len = strftime(t, 1024, screen->getStrftimeFormat(), tt); - if (len == 0) { // invalid time format found - screen->saveStrftimeFormat("%I:%M %p"); // so use the default - len = strftime(t, 1024, screen->getStrftimeFormat(), tt); - } - // find the length of the rendered string and add room for two extra - // characters to it. This allows for variable width output of the fonts - if (i18n.multibyte()) { ++ char t[1025], *time_string = (char *) 0; ++ int len = strftime(t, 1024, screen.strftimeFormat(), tt); ++ t[len++] = 'A'; // add size to the string for padding ++ t[len++] = 'A'; // add size to the string for padding ++ t[len] = '\0'; + + if (i18n->multibyte()) { XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, t, len, &ink, - XmbTextExtents(screen->getToolbarStyle()->fontset, t, len, - &ink, &logical); - XFontSetExtents* extents = screen->getToolbarStyle()->fontset_extents; - frame.clock_w = logical.width + - (extents->max_logical_extent.width * 2); ++ XmbTextExtents(screen.getToolbarStyle()->fontset, t, len, &ink, + &logical); + frame.clock_w = logical.width; + + // ben's additional solution to pad some space beside the numbers - frame.clock_w += - screen->getToolbarStyle()->fontset_extents->max_logical_extent.width * - 4; ++ //frame.clock_w += ++ // screen.getToolbarStyle()->fontset_extents->max_logical_extent.width * ++ // 4; + + // brad's solution, which is currently buggy, too big + //frame.clock_w = - // screen->getToolbarStyle()->fontset_extents->max_logical_extent.width ++ // screen.getToolbarStyle()->fontset_extents->max_logical_extent.width + // * len; } else { - frame.clock_w = XTextWidth(screen->getToolbarStyle()->font, t, len); - XFontStruct* font = screen->getToolbarStyle()->font; - frame.clock_w = XTextWidth(font, t, len) + - ((font->max_bounds.rbearing - font->min_bounds.lbearing) * 2); ++ frame.clock_w = XTextWidth(screen.getToolbarStyle()->font, t, len); + // ben's additional solution to pad some space beside the numbers - frame.clock_w += screen->getToolbarStyle()->font->max_bounds.width * 4; ++ //frame.clock_w += screen.getToolbarStyle()->font->max_bounds.width * 4; + // brad's solution again, too big - //frame.clock_w = screen->getToolbarStyle()->font->max_bounds.width * len; ++ //frame.clock_w = screen.getToolbarStyle()->font->max_bounds.width * len; } + frame.clock_w += (frame.bevel_w * 4); + + delete [] time_string; + } else { + frame.clock_w = 0; } + } else { + frame.clock_w = 0; } #else // !HAVE_STRFTIME frame.clock_w = -- XTextWidth(screen->getToolbarStyle()->font, - i18n(ToolbarSet, ToolbarNoStrftimeLength, "00:00000"), - strlen(i18n(ToolbarSet, ToolbarNoStrftimeLength, - "00:00000"))); ++ XTextWidth(screen.getToolbarStyle()->font, + i18n->getMessage(ToolbarSet, ToolbarNoStrftimeLength, + "00:00000"), + strlen(i18n->getMessage(ToolbarSet, ToolbarNoStrftimeLength, + "00:00000"))) + (frame.bevel_w * 4); #endif // HAVE_STRFTIME + int i; + unsigned int w = 0; frame.workspace_label_w = 0; - for (i = 0; i < screen->getCount(); i++) { - for (unsigned int i = 0; i < screen->getWorkspaceCount(); i++) { - const string& workspace_name = screen->getWorkspace(i)->getName(); - if (i18n.multibyte()) { ++ for (i = 0; i < screen.getWorkspaceCount(); i++) { + if (i18n->multibyte()) { XRectangle ink, logical; -- XmbTextExtents(screen->getToolbarStyle()->fontset, - screen->getWorkspace(i)->getName(), - strlen(screen->getWorkspace(i)->getName()), - workspace_name.c_str(), workspace_name.length(), - &ink, &logical); - width = logical.width; ++ XmbTextExtents(screen.getToolbarStyle()->fontset, ++ screen.getWorkspace(i)->getName(), ++ strlen(screen.getWorkspace(i)->getName()), + &ink, &logical); + w = logical.width; } else { - w = XTextWidth(screen->getToolbarStyle()->font, - screen->getWorkspace(i)->getName(), - strlen(screen->getWorkspace(i)->getName())); - width = XTextWidth(screen->getToolbarStyle()->font, - workspace_name.c_str(), workspace_name.length()); ++ w = XTextWidth(screen.getToolbarStyle()->font, ++ screen.getWorkspace(i)->getName(), ++ strlen(screen.getWorkspace(i)->getName())); } + w += (frame.bevel_w * 4); - if (width > frame.workspace_label_w) frame.workspace_label_w = width; + if (w > frame.workspace_label_w) frame.workspace_label_w = w; } - frame.workspace_label_w = frame.clock_w = - std::max(frame.workspace_label_w, frame.clock_w) + (frame.bevel_w * 4); + if (frame.workspace_label_w < frame.clock_w) + frame.workspace_label_w = frame.clock_w; + else if (frame.workspace_label_w > frame.clock_w) + frame.clock_w = frame.workspace_label_w; - // XXX: where'd the +6 come from? frame.window_label_w = - (frame.rect.width() - (frame.clock_w + (frame.button_w * 4) + - frame.workspace_label_w + (frame.bevel_w * 8) + 6)); + (frame.width - (frame.clock_w + (frame.button_w * 4) + + frame.workspace_label_w + (frame.bevel_w * 8) + 6)); -- if (hidden) { ++ if (m_hidden) { XMoveResizeWindow(display, frame.window, frame.x_hidden, frame.y_hidden, - frame.rect.width(), frame.rect.height()); + frame.width, frame.height); } else { - XMoveResizeWindow(display, frame.window, frame.rect.x(), frame.rect.y(), - frame.rect.width(), frame.rect.height()); + XMoveResizeWindow(display, frame.window, frame.x, frame.y, + frame.width, frame.height); } XMoveResizeWindow(display, frame.workspace_label, frame.bevel_w, - frame.bevel_w, frame.workspace_label_w, + frame.bevel_w, frame.workspace_label_w, frame.label_h); - XMoveResizeWindow(display, frame.psbutton, - ((frame.bevel_w * 2) + frame.workspace_label_w + 1), - frame.bevel_w + 1, frame.button_w, frame.button_w); - XMoveResizeWindow(display, frame.nsbutton, - ((frame.bevel_w * 3) + frame.workspace_label_w + - frame.button_w + 2), frame.bevel_w + 1, frame.button_w, - frame.button_w); - XMoveResizeWindow(display, frame.window_label, - ((frame.bevel_w * 4) + (frame.button_w * 2) + - frame.workspace_label_w + 3), frame.bevel_w, - frame.window_label_w, frame.label_h); - XMoveResizeWindow(display, frame.pwbutton, - ((frame.bevel_w * 5) + (frame.button_w * 2) + - frame.workspace_label_w + frame.window_label_w + 4), - frame.bevel_w + 1, frame.button_w, frame.button_w); - XMoveResizeWindow(display, frame.nwbutton, - ((frame.bevel_w * 6) + (frame.button_w * 3) + - frame.workspace_label_w + frame.window_label_w + 5), + XMoveResizeWindow(display, frame.psbutton, (frame.bevel_w * 2) + + frame.workspace_label_w + 1, frame.bevel_w + 1, + frame.button_w, frame.button_w); + XMoveResizeWindow(display ,frame.nsbutton, (frame.bevel_w * 3) + + frame.workspace_label_w + frame.button_w + 2, frame.bevel_w + 1, frame.button_w, frame.button_w); - XMoveResizeWindow(display, frame.clock, - frame.rect.width() - frame.clock_w - (frame.bevel_w * 2), - frame.bevel_w, frame.clock_w, frame.label_h); - - ToolbarStyle *style = screen->getToolbarStyle(); - frame.base = style->toolbar.render(frame.rect.width(), frame.rect.height(), - frame.base); - if (! frame.base) + XMoveResizeWindow(display, frame.window_label, (frame.bevel_w * 4) + + (frame.button_w * 2) + frame.workspace_label_w + 3, + frame.bevel_w, frame.window_label_w, frame.label_h); + XMoveResizeWindow(display, frame.pwbutton, (frame.bevel_w * 5) + + (frame.button_w * 2) + frame.workspace_label_w + + frame.window_label_w + 4, frame.bevel_w + 1, + frame.button_w, frame.button_w); + XMoveResizeWindow(display, frame.nwbutton, (frame.bevel_w * 6) + + (frame.button_w * 3) + frame.workspace_label_w + + frame.window_label_w + 5, frame.bevel_w + 1, + frame.button_w, frame.button_w); + XMoveResizeWindow(display, frame.clock, frame.width - frame.clock_w - + frame.bevel_w, frame.bevel_w, frame.clock_w, + frame.label_h); + + Pixmap tmp = frame.base; - BTexture *texture = &(screen->getToolbarStyle()->toolbar); ++ BTexture *texture = &(screen.getToolbarStyle()->toolbar); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.base = None; XSetWindowBackground(display, frame.window, - style->toolbar.color().pixel()); - else + texture->getColor()->getPixel()); + } else { + frame.base = + image_ctrl->renderImage(frame.width, frame.height, texture); XSetWindowBackgroundPixmap(display, frame.window, frame.base); + } + if (tmp) image_ctrl->removeImage(tmp); - frame.label = style->window.render(frame.window_label_w, frame.label_h, - frame.label); - if (! frame.label) + tmp = frame.label; - texture = &(screen->getToolbarStyle()->window); ++ texture = &(screen.getToolbarStyle()->window); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.label = None; XSetWindowBackground(display, frame.window_label, - style->window.color().pixel()); - else + texture->getColor()->getPixel()); + } else { + frame.label = + image_ctrl->renderImage(frame.window_label_w, frame.label_h, texture); XSetWindowBackgroundPixmap(display, frame.window_label, frame.label); + } + if (tmp) image_ctrl->removeImage(tmp); - frame.wlabel = style->label.render(frame.workspace_label_w, frame.label_h, - frame.wlabel); - if (! frame.wlabel) + tmp = frame.wlabel; - texture = &(screen->getToolbarStyle()->label); ++ texture = &(screen.getToolbarStyle()->label); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.wlabel = None; XSetWindowBackground(display, frame.workspace_label, - style->label.color().pixel()); - else + texture->getColor()->getPixel()); + } else { + frame.wlabel = + image_ctrl->renderImage(frame.workspace_label_w, frame.label_h, texture); XSetWindowBackgroundPixmap(display, frame.workspace_label, frame.wlabel); - - frame.clk = style->clock.render(frame.clock_w, frame.label_h, frame.clk); - if (! frame.clk) - XSetWindowBackground(display, frame.clock, style->clock.color().pixel()); - else + } + if (tmp) image_ctrl->removeImage(tmp); + + tmp = frame.clk; - texture = &(screen->getToolbarStyle()->clock); ++ texture = &(screen.getToolbarStyle()->clock); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.clk = None; + XSetWindowBackground(display, frame.clock, + texture->getColor()->getPixel()); + } else { + frame.clk = + image_ctrl->renderImage(frame.clock_w, frame.label_h, texture); XSetWindowBackgroundPixmap(display, frame.clock, frame.clk); + } + if (tmp) image_ctrl->removeImage(tmp); - frame.button = style->button.render(frame.button_w, frame.button_w, - frame.button); - if (! frame.button) { - frame.button_pixel = style->button.color().pixel(); + tmp = frame.button; - texture = &(screen->getToolbarStyle()->button); ++ texture = &(screen.getToolbarStyle()->button); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.button = None; + + frame.button_pixel = texture->getColor()->getPixel(); XSetWindowBackground(display, frame.psbutton, frame.button_pixel); XSetWindowBackground(display, frame.nsbutton, frame.button_pixel); XSetWindowBackground(display, frame.pwbutton, frame.button_pixel); @@@ -444,22 -493,15 +580,22 @@@ XSetWindowBackgroundPixmap(display, frame.pwbutton, frame.button); XSetWindowBackgroundPixmap(display, frame.nwbutton, frame.button); } + if (tmp) image_ctrl->removeImage(tmp); - frame.pbutton = style->pressed.render(frame.button_w, frame.button_w, - frame.pbutton); - if (! frame.pbutton) - frame.pbutton_pixel = style->pressed.color().pixel(); + tmp = frame.pbutton; - texture = &(screen->getToolbarStyle()->pressed); ++ texture = &(screen.getToolbarStyle()->pressed); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.pbutton = None; + frame.pbutton_pixel = texture->getColor()->getPixel(); + } else { + frame.pbutton = + image_ctrl->renderImage(frame.button_w, frame.button_w, texture); + } + if (tmp) image_ctrl->removeImage(tmp); XSetWindowBorder(display, frame.window, - screen->getBorderColor()->getPixel()); - screen->getBorderColor()->pixel()); -- XSetWindowBorderWidth(display, frame.window, screen->getBorderWidth()); ++ screen.getBorderColor()->getPixel()); ++ XSetWindowBorderWidth(display, frame.window, screen.getBorderWidth()); XClearWindow(display, frame.window); XClearWindow(display, frame.workspace_label); @@@ -469,7 -511,7 +605,7 @@@ XClearWindow(display, frame.nsbutton); XClearWindow(display, frame.pwbutton); XClearWindow(display, frame.nwbutton); -- ++ redrawWindowLabel(); redrawWorkspaceLabel(); redrawPrevWorkspaceButton(); @@@ -477,7 -519,7 +613,7 @@@ redrawPrevWindowButton(); redrawNextWindowButton(); checkClock(True); -- ++ toolbarmenu->reconfigure(); } @@@ -503,215 -565,104 +639,215 @@@ void Toolbar::checkClock(Bool redraw, B if (redraw) { #ifdef HAVE_STRFTIME char t[1024]; -- if (! strftime(t, 1024, screen->getStrftimeFormat(), tt)) ++ if (! strftime(t, 1024, screen.strftimeFormat(), tt)) return; #else // !HAVE_STRFTIME char t[9]; if (date) { // format the date... with special consideration for y2k ;) - if (screen->getDateFormat() == Openbox::B_EuropeanDate) - if (screen->getDateFormat() == Blackbox::B_EuropeanDate) - sprintf(t, 18n(ToolbarSet, ToolbarNoStrftimeDateFormatEu, - "%02d.%02d.%02d"), - tt->tm_mday, tt->tm_mon + 1, ++ if (screen.getDateFormat() == Openbox::B_EuropeanDate) + sprintf(t, 18n->getMessage(ToolbarSet, ToolbarNoStrftimeDateFormatEu, + "%02d.%02d.%02d"), + tt->tm_mday, tt->tm_mon + 1, (tt->tm_year >= 100) ? tt->tm_year - 100 : tt->tm_year); else - sprintf(t, i18n(ToolbarSet, ToolbarNoStrftimeDateFormat, - "%02d/%02d/%02d"), - tt->tm_mon + 1, tt->tm_mday, + sprintf(t, i18n->getMessage(ToolbarSet, ToolbarNoStrftimeDateFormat, + "%02d/%02d/%02d"), + tt->tm_mon + 1, tt->tm_mday, (tt->tm_year >= 100) ? tt->tm_year - 100 : tt->tm_year); } else { -- if (screen->isClock24Hour()) - sprintf(t, i18n(ToolbarSet, ToolbarNoStrftimeTimeFormat24, - " %02d:%02d "), - frame.hour, frame.minute); ++ if (screen.isClock24Hour()) + sprintf(t, i18n->getMessage(ToolbarSet, ToolbarNoStrftimeTimeFormat24, + " %02d:%02d "), + frame.hour, frame.minute); else - sprintf(t, i18n(ToolbarSet, ToolbarNoStrftimeTimeFormat12, - "%02d:%02d %sm"), - ((frame.hour > 12) ? frame.hour - 12 : - ((frame.hour == 0) ? 12 : frame.hour)), frame.minute, - ((frame.hour >= 12) ? - i18n(ToolbarSet, ToolbarNoStrftimeTimeFormatP, "p") : - i18n(ToolbarSet, ToolbarNoStrftimeTimeFormatA, "a"))); + sprintf(t, i18n->getMessage(ToolbarSet, ToolbarNoStrftimeTimeFormat12, + "%02d:%02d %sm"), + ((frame.hour > 12) ? frame.hour - 12 : + ((frame.hour == 0) ? 12 : frame.hour)), frame.minute, + ((frame.hour >= 12) ? + i18n->getMessage(ToolbarSet, + ToolbarNoStrftimeTimeFormatP, "p") : + i18n->getMessage(ToolbarSet, + ToolbarNoStrftimeTimeFormatA, "a"))); } #endif // HAVE_STRFTIME - ToolbarStyle *style = screen->getToolbarStyle(); + int dx = (frame.bevel_w * 2), dlen = strlen(t); + unsigned int l; - int pos = frame.bevel_w * 2, // this is modified by doJustify() - dlen = style->doJustify(t, pos, frame.clock_w, - frame.bevel_w * 4, i18n.multibyte()); - BPen pen(style->c_text, style->font); - if (i18n.multibyte()) - XmbDrawString(display, frame.clock, style->fontset, pen.gc(), - pos, (1 - style->fontset_extents->max_ink_extent.y), - t, dlen); + if (i18n->multibyte()) { + XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, ++ XmbTextExtents(screen.getToolbarStyle()->fontset, + t, dlen, &ink, &logical); + l = logical.width; + } else { - l = XTextWidth(screen->getToolbarStyle()->font, t, dlen); ++ l = XTextWidth(screen.getToolbarStyle()->font, t, dlen); + } + + l += (frame.bevel_w * 4); + + if (l > frame.clock_w) { + for (; dlen >= 0; dlen--) { + if (i18n->multibyte()) { + XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, ++ XmbTextExtents(screen.getToolbarStyle()->fontset, + t, dlen, &ink, &logical); + l = logical.width; + } else { - l = XTextWidth(screen->getToolbarStyle()->font, t, dlen); ++ l = XTextWidth(screen.getToolbarStyle()->font, t, dlen); + } + l+= (frame.bevel_w * 4); + + if (l < frame.clock_w) + break; + } + } - switch (screen->getToolbarStyle()->justify) { ++ switch (screen.getToolbarStyle()->justify) { + case BScreen::RightJustify: + dx += frame.clock_w - l; + break; + + case BScreen::CenterJustify: + dx += (frame.clock_w - l) / 2; + break; + } + - ToolbarStyle *style = screen->getToolbarStyle(); ++ ToolbarStyle *style = screen.getToolbarStyle(); + if (i18n->multibyte()) + XmbDrawString(display, frame.clock, style->fontset, style->c_text_gc, + dx, (1 - style->fontset_extents->max_ink_extent.y), + t, dlen); else - XDrawString(display, frame.clock, pen.gc(), pos, - (style->font->ascent + 1), t, dlen); + XDrawString(display, frame.clock, style->c_text_gc, dx, + (style->font->ascent + 1), t, dlen); } } -void Toolbar::redrawWindowLabel(bool redraw) { - BlackboxWindow *foc = screen->getBlackbox()->getFocusedWindow(); - if (! foc) { - XClearWindow(display, frame.window_label); - return; - } - - if (redraw) +void Toolbar::redrawWindowLabel(Bool redraw) { - if (screen->getOpenbox()->getFocusedWindow()) { ++ OpenboxWindow *foc = screen.getOpenbox().focusedWindow(); ++ if (foc == (OpenboxWindow *) 0) { + XClearWindow(display, frame.window_label); ++ } else { + if (redraw) + XClearWindow(display, frame.window_label); - OpenboxWindow *foc = screen->getOpenbox()->getFocusedWindow(); - if (foc->getScreen() != screen) return; - if (foc->getScreen() != screen) return; - - const char *title = foc->getTitle(); - ToolbarStyle *style = screen->getToolbarStyle(); ++ if (foc->getScreen() != &screen) return; - int pos = frame.bevel_w * 2, // modified by doJustify() - dlen = style->doJustify(title, pos, frame.window_label_w, - frame.bevel_w * 4, i18n.multibyte()); - BPen pen(style->w_text, style->font); - if (i18n.multibyte()) - XmbDrawString(display, frame.window_label, style->fontset, pen.gc(), pos, - (1 - style->fontset_extents->max_ink_extent.y), - title, dlen); - else - XDrawString(display, frame.window_label, pen.gc(), pos, - (style->font->ascent + 1), title, dlen); -} + int dx = (frame.bevel_w * 2), dlen = strlen(*foc->getTitle()); + unsigned int l; + if (i18n->multibyte()) { + XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, *foc->getTitle(), ++ XmbTextExtents(screen.getToolbarStyle()->fontset, *foc->getTitle(), + dlen, &ink, &logical); + l = logical.width; + } else { - l = XTextWidth(screen->getToolbarStyle()->font, *foc->getTitle(), dlen); ++ l = XTextWidth(screen.getToolbarStyle()->font, *foc->getTitle(), dlen); + } + l += (frame.bevel_w * 4); + + if (l > frame.window_label_w) { + for (; dlen >= 0; dlen--) { + if (i18n->multibyte()) { + XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, ++ XmbTextExtents(screen.getToolbarStyle()->fontset, + *foc->getTitle(), dlen, &ink, &logical); + l = logical.width; + } else { - l = XTextWidth(screen->getToolbarStyle()->font, ++ l = XTextWidth(screen.getToolbarStyle()->font, + *foc->getTitle(), dlen); + } + l += (frame.bevel_w * 4); + + if (l < frame.window_label_w) + break; + } + } - switch (screen->getToolbarStyle()->justify) { ++ switch (screen.getToolbarStyle()->justify) { + case BScreen::RightJustify: + dx += frame.window_label_w - l; + break; -void Toolbar::redrawWorkspaceLabel(bool redraw) { - const string& name = screen->getCurrentWorkspace()->getName(); + case BScreen::CenterJustify: + dx += (frame.window_label_w - l) / 2; + break; + } - ToolbarStyle *style = screen->getToolbarStyle(); - if (redraw) - XClearWindow(display, frame.workspace_label); ++ ToolbarStyle *style = screen.getToolbarStyle(); + if (i18n->multibyte()) + XmbDrawString(display, frame.window_label, style->fontset, + style->w_text_gc, dx, + (1 - style->fontset_extents->max_ink_extent.y), + *foc->getTitle(), dlen); + else + XDrawString(display, frame.window_label, style->w_text_gc, dx, + (style->font->ascent + 1), *foc->getTitle(), dlen); - } else { - XClearWindow(display, frame.window_label); + } +} + + +void Toolbar::redrawWorkspaceLabel(Bool redraw) { - if (screen->getCurrentWorkspace()->getName()) { ++ if (screen.getCurrentWorkspace()->getName()) { + if (redraw) + XClearWindow(display, frame.workspace_label); + + int dx = (frame.bevel_w * 2), dlen = - strlen(screen->getCurrentWorkspace()->getName()); ++ strlen(screen.getCurrentWorkspace()->getName()); + unsigned int l; + + if (i18n->multibyte()) { + XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, - screen->getCurrentWorkspace()->getName(), dlen, ++ XmbTextExtents(screen.getToolbarStyle()->fontset, ++ screen.getCurrentWorkspace()->getName(), dlen, + &ink, &logical); + l = logical.width; + } else { - l = XTextWidth(screen->getToolbarStyle()->font, - screen->getCurrentWorkspace()->getName(), dlen); ++ l = XTextWidth(screen.getToolbarStyle()->font, ++ screen.getCurrentWorkspace()->getName(), dlen); + } + l += (frame.bevel_w * 4); + + if (l > frame.workspace_label_w) { + for (; dlen >= 0; dlen--) { + if (i18n->multibyte()) { + XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, - screen->getCurrentWorkspace()->getName(), dlen, ++ XmbTextExtents(screen.getToolbarStyle()->fontset, ++ screen.getCurrentWorkspace()->getName(), dlen, + &ink, &logical); + l = logical.width; + } else { - l = XTextWidth(screen->getWindowStyle()->font, - screen->getCurrentWorkspace()->getName(), dlen); ++ l = XTextWidth(screen.getWindowStyle()->font, ++ screen.getCurrentWorkspace()->getName(), dlen); + } + l += (frame.bevel_w * 4); + + if (l < frame.workspace_label_w) + break; + } + } - switch (screen->getToolbarStyle()->justify) { ++ switch (screen.getToolbarStyle()->justify) { + case BScreen::RightJustify: + dx += frame.workspace_label_w - l; + break; - ToolbarStyle *style = screen->getToolbarStyle(); + case BScreen::CenterJustify: + dx += (frame.workspace_label_w - l) / 2; + break; + } - ToolbarStyle *style = screen->getToolbarStyle(); - int pos = frame.bevel_w * 2, - dlen = style->doJustify(name.c_str(), pos, frame.workspace_label_w, - frame.bevel_w * 4, i18n.multibyte()); - BPen pen(style->l_text, style->font); - if (i18n.multibyte()) - XmbDrawString(display, frame.workspace_label, style->fontset, pen.gc(), - pos, (1 - style->fontset_extents->max_ink_extent.y), - name.c_str(), dlen); - else - XDrawString(display, frame.workspace_label, pen.gc(), pos, - (style->font->ascent + 1), - name.c_str(), dlen); ++ ToolbarStyle *style = screen.getToolbarStyle(); + if (i18n->multibyte()) + XmbDrawString(display, frame.workspace_label, style->fontset, + style->l_text_gc, dx, + (1 - style->fontset_extents->max_ink_extent.y), - (char *) screen->getCurrentWorkspace()->getName(), dlen); ++ (char *) screen.getCurrentWorkspace()->getName(), dlen); + else + XDrawString(display, frame.workspace_label, style->l_text_gc, dx, + (style->font->ascent + 1), - (char *) screen->getCurrentWorkspace()->getName(), dlen); ++ (char *) screen.getCurrentWorkspace()->getName(), dlen); + } } @@@ -738,7 -689,9 +874,7 @@@ void Toolbar::redrawPrevWorkspaceButton pts[1].x = 4; pts[1].y = 2; pts[2].x = 0; pts[2].y = -4; - XFillPolygon(display, frame.psbutton, screen->getToolbarStyle()->b_pic_gc, - ToolbarStyle *style = screen->getToolbarStyle(); - BPen pen(style->b_pic, style->font); - XFillPolygon(display, frame.psbutton, pen.gc(), ++ XFillPolygon(display, frame.psbutton, screen.getToolbarStyle()->b_pic_gc, pts, 3, Convex, CoordModePrevious); } @@@ -766,7 -719,9 +902,7 @@@ void Toolbar::redrawNextWorkspaceButton pts[1].x = 4; pts[1].y = 2; pts[2].x = -4; pts[2].y = 2; - XFillPolygon(display, frame.nsbutton, screen->getToolbarStyle()->b_pic_gc, - ToolbarStyle *style = screen->getToolbarStyle(); - BPen pen(style->b_pic, style->font); - XFillPolygon(display, frame.nsbutton, pen.gc(), ++ XFillPolygon(display, frame.nsbutton, screen.getToolbarStyle()->b_pic_gc, pts, 3, Convex, CoordModePrevious); } @@@ -794,7 -749,9 +930,7 @@@ void Toolbar::redrawPrevWindowButton(Bo pts[1].x = 4; pts[1].y = 2; pts[2].x = 0; pts[2].y = -4; - XFillPolygon(display, frame.pwbutton, screen->getToolbarStyle()->b_pic_gc, - ToolbarStyle *style = screen->getToolbarStyle(); - BPen pen(style->b_pic, style->font); - XFillPolygon(display, frame.pwbutton, pen.gc(), ++ XFillPolygon(display, frame.pwbutton, screen.getToolbarStyle()->b_pic_gc, pts, 3, Convex, CoordModePrevious); } @@@ -822,48 -779,44 +958,46 @@@ void Toolbar::redrawNextWindowButton(Bo pts[1].x = 4; pts[1].y = 2; pts[2].x = -4; pts[2].y = 2; - XFillPolygon(display, frame.nwbutton, screen->getToolbarStyle()->b_pic_gc, - ToolbarStyle *style = screen->getToolbarStyle(); - BPen pen(style->b_pic, style->font); - XFillPolygon(display, frame.nwbutton, pen.gc(), pts, 3, Convex, - CoordModePrevious); ++ XFillPolygon(display, frame.nwbutton, screen.getToolbarStyle()->b_pic_gc, + pts, 3, Convex, CoordModePrevious); } --void Toolbar::edit(void) { ++void Toolbar::edit() { Window window; int foo; -- editing = True; - XGetInputFocus(display, &window, &foo); - if (window == frame.workspace_label) ++ m_editing = True; + if (XGetInputFocus(display, &window, &foo) && + window == frame.workspace_label) return; XSetInputFocus(display, frame.workspace_label, - ((screen->isSloppyFocus()) ? RevertToPointerRoot : - RevertToParent), - CurrentTime); + RevertToPointerRoot, CurrentTime); XClearWindow(display, frame.workspace_label); - openbox->setNoFocus(True); - if (openbox->getFocusedWindow()) - openbox->getFocusedWindow()->setFocusFlag(False); - blackbox->setNoFocus(True); - if (blackbox->getFocusedWindow()) - blackbox->getFocusedWindow()->setFocusFlag(False); ++ openbox.setNoFocus(True); ++ if (openbox.focusedWindow()) ++ openbox.focusedWindow()->setFocusFlag(False); - ToolbarStyle *style = screen->getToolbarStyle(); - BPen pen(style->l_text, style->font); - XDrawRectangle(display, frame.workspace_label, pen.gc(), + XDrawRectangle(display, frame.workspace_label, - screen->getWindowStyle()->l_text_focus_gc, ++ screen.getWindowStyle()->l_text_focus_gc, frame.workspace_label_w / 2, 0, 1, frame.label_h - 1); + // change the background of the window to that of an active window label - BTexture *texture = &(screen->getWindowStyle()->l_focus); - frame.wlabel = texture->render(frame.workspace_label_w, frame.label_h, - frame.wlabel); - if (! frame.wlabel) + Pixmap tmp = frame.wlabel; - BTexture *texture = &(screen->getWindowStyle()->l_focus); ++ BTexture *texture = &(screen.getWindowStyle()->l_focus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.wlabel = None; XSetWindowBackground(display, frame.workspace_label, - texture->color().pixel()); - else + texture->getColor()->getPixel()); + } else { + frame.wlabel = + image_ctrl->renderImage(frame.workspace_label_w, frame.label_h, texture); XSetWindowBackgroundPixmap(display, frame.workspace_label, frame.wlabel); + } + if (tmp) image_ctrl->removeImage(tmp); } @@@ -883,14 -836,16 +1017,14 @@@ void Toolbar::buttonPressEvent(XButtonE checkClock(True, True); } #endif // HAVE_STRFTIME -- else if (! on_top) { ++ else if (! m_ontop) { Window w[1] = { frame.window }; -- screen->raiseWindows(w, 1); ++ screen.raiseWindows(w, 1); } -- } else if (be->button == 2 && (! on_top)) { ++ } else if (be->button == 2 && (! m_ontop)) { XLowerWindow(display, frame.window); } else if (be->button == 3) { - if (toolbarmenu->isVisible()) { - toolbarmenu->hide(); - } else { + if (! toolbarmenu->isVisible()) { int x, y; x = be->x_root - (toolbarmenu->getWidth() / 2); @@@ -898,13 -853,13 +1032,13 @@@ if (x < 0) x = 0; -- else if (x + toolbarmenu->getWidth() > screen->getWidth()) -- x = screen->getWidth() - toolbarmenu->getWidth(); ++ else if (x + toolbarmenu->getWidth() > screen.size().w()) ++ x = screen.size().w() - toolbarmenu->getWidth(); if (y < 0) y = 0; -- else if (y + toolbarmenu->getHeight() > screen->getHeight()) -- y = screen->getHeight() - toolbarmenu->getHeight(); ++ else if (y + toolbarmenu->getHeight() > screen.size().h()) ++ y = screen.size().h() - toolbarmenu->getHeight(); toolbarmenu->move(x, y); toolbarmenu->show(); @@@ -920,38 -874,38 +1054,38 @@@ void Toolbar::buttonReleaseEvent(XButto if (re->window == frame.psbutton) { redrawPrevWorkspaceButton(False, True); - if (re->x >= 0 && re->x < static_cast(frame.button_w) && - re->y >= 0 && re->y < static_cast(frame.button_w)) - if (screen->getCurrentWorkspace()->getID() > 0) - screen->changeWorkspaceID(screen->getCurrentWorkspace()-> - getID() - 1); + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) - if (screen->getCurrentWorkspace()->getWorkspaceID() > 0) - screen->changeWorkspaceID(screen->getCurrentWorkspace()-> ++ if (screen.getCurrentWorkspace()->getWorkspaceID() > 0) ++ screen.changeWorkspaceID(screen.getCurrentWorkspace()-> + getWorkspaceID() - 1); else - screen->changeWorkspaceID(screen->getCount() - 1); - screen->changeWorkspaceID(screen->getWorkspaceCount() - 1); ++ screen.changeWorkspaceID(screen.getWorkspaceCount() - 1); } else if (re->window == frame.nsbutton) { redrawNextWorkspaceButton(False, True); - if (re->x >= 0 && re->x < static_cast(frame.button_w) && - re->y >= 0 && re->y < static_cast(frame.button_w)) - if (screen->getCurrentWorkspace()->getID() < - (screen->getWorkspaceCount() - 1)) - screen->changeWorkspaceID(screen->getCurrentWorkspace()-> - getID() + 1); + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) - if (screen->getCurrentWorkspace()->getWorkspaceID() < - screen->getCount() - 1) - screen->changeWorkspaceID(screen->getCurrentWorkspace()-> ++ if (screen.getCurrentWorkspace()->getWorkspaceID() < ++ screen.getWorkspaceCount() - 1) ++ screen.changeWorkspaceID(screen.getCurrentWorkspace()-> + getWorkspaceID() + 1); else -- screen->changeWorkspaceID(0); ++ screen.changeWorkspaceID(0); } else if (re->window == frame.pwbutton) { redrawPrevWindowButton(False, True); - if (re->x >= 0 && re->x < static_cast(frame.button_w) && - re->y >= 0 && re->y < static_cast(frame.button_w)) - screen->prevFocus(); + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) - screen->prevFocus(); ++ screen.prevFocus(); } else if (re->window == frame.nwbutton) { redrawNextWindowButton(False, True); - if (re->x >= 0 && re->x < static_cast(frame.button_w) && - re->y >= 0 && re->y < static_cast(frame.button_w)) - screen->nextFocus(); + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) - screen->nextFocus(); ++ screen.nextFocus(); } else if (re->window == frame.window_label) -- screen->raiseFocus(); ++ screen.raiseFocus(); #ifndef HAVE_STRFTIME else if (re->window == frame.clock) { XClearWindow(display, frame.clock); @@@ -963,10 -917,10 +1097,10 @@@ void Toolbar::enterNotifyEvent(XCrossingEvent *) { -- if (! do_auto_hide) ++ if (! m_autohide) return; -- if (hidden) { ++ if (m_hidden) { if (! hide_timer->isTiming()) hide_timer->start(); } else { if (hide_timer->isTiming()) hide_timer->stop(); @@@ -974,10 -928,10 +1108,10 @@@ } void Toolbar::leaveNotifyEvent(XCrossingEvent *) { -- if (! do_auto_hide) ++ if (! m_autohide) return; -- if (hidden) { ++ if (m_hidden) { if (hide_timer->isTiming()) hide_timer->stop(); } else if (! toolbarmenu->isVisible()) { if (! hide_timer->isTiming()) hide_timer->start(); @@@ -987,7 -941,7 +1121,7 @@@ void Toolbar::exposeEvent(XExposeEvent *ee) { if (ee->window == frame.clock) checkClock(True); -- else if (ee->window == frame.workspace_label && (! editing)) ++ else if (ee->window == frame.workspace_label && (! m_editing)) redrawWorkspaceLabel(); else if (ee->window == frame.window_label) redrawWindowLabel(); else if (ee->window == frame.psbutton) redrawPrevWorkspaceButton(); @@@ -998,168 -952,161 +1132,170 @@@ void Toolbar::keyPressEvent(XKeyEvent *ke) { -- if (ke->window == frame.workspace_label && editing) { - openbox->grab(); - if (new_workspace_name.empty()) { ++ if (ke->window == frame.workspace_label && m_editing) { ++ openbox.grab(); + + if (! new_workspace_name) { + new_workspace_name = new char[128]; new_name_pos = 0; + + if (! new_workspace_name) return; } KeySym ks; char keychar[1]; XLookupString(ke, keychar, 1, &ks, 0); - // either we are told to end with a return or we hit 127 chars + // either we are told to end with a return or we hit the end of the buffer if (ks == XK_Return || new_name_pos == 127) { - editing = False; - - blackbox->setNoFocus(False); - if (blackbox->getFocusedWindow()) { - blackbox->getFocusedWindow()->setInputFocus(); - } else { - blackbox->setFocusedWindow(0); + *(new_workspace_name + new_name_pos) = 0; + - editing = False; ++ m_editing = False; ++ ++ openbox.setNoFocus(False); ++ if (openbox.focusedWindow()) { ++ openbox.focusedWindow()->setInputFocus(); ++ openbox.focusedWindow()->setFocusFlag(True); ++ } else ++ openbox.focusWindow((OpenboxWindow *) 0); + - openbox->setNoFocus(False); - if (openbox->getFocusedWindow()) { - openbox->getFocusedWindow()->setInputFocus(); - openbox->getFocusedWindow()->setFocusFlag(True); - } else { - XSetInputFocus(display, PointerRoot, None, CurrentTime); - } + // check to make sure that new_name[0] != 0... otherwise we have a null + // workspace name which causes serious problems, especially for the + // Openbox::LoadRC() method. + if (*new_workspace_name) { - screen->getCurrentWorkspace()->setName(new_workspace_name); - screen->getCurrentWorkspace()->getMenu()->hide(); - screen->getWorkspacemenu()-> - remove(screen->getCurrentWorkspace()->getWorkspaceID() + 2); - screen->getWorkspacemenu()-> - insert(screen->getCurrentWorkspace()->getName(), - screen->getCurrentWorkspace()->getMenu(), - screen->getCurrentWorkspace()->getWorkspaceID() + 2); - screen->getWorkspacemenu()->update(); ++ screen.getCurrentWorkspace()->setName(new_workspace_name); ++ screen.getCurrentWorkspace()->getMenu()->hide(); ++ screen.getWorkspacemenu()-> ++ remove(screen.getCurrentWorkspace()->getWorkspaceID() + 2); ++ screen.getWorkspacemenu()-> ++ insert(screen.getCurrentWorkspace()->getName(), ++ screen.getCurrentWorkspace()->getMenu(), ++ screen.getCurrentWorkspace()->getWorkspaceID() + 2); ++ screen.getWorkspacemenu()->update(); } - Workspace *wkspc = screen->getCurrentWorkspace(); - wkspc->setName(new_workspace_name); - wkspc->getMenu()->hide(); - - screen->getWorkspacemenu()->changeItemLabel(wkspc->getID() + 2, - wkspc->getName()); - screen->getWorkspacemenu()->update(); - - new_workspace_name.erase(); + delete [] new_workspace_name; + new_workspace_name = (char *) 0; new_name_pos = 0; // reset the background to that of the workspace label (its normal // setting) - BTexture *texture = &(screen->getToolbarStyle()->label); - frame.wlabel = texture->render(frame.workspace_label_w, frame.label_h, - frame.wlabel); - if (! frame.wlabel) + Pixmap tmp = frame.wlabel; - BTexture *texture = &(screen->getToolbarStyle()->label); ++ BTexture *texture = &(screen.getToolbarStyle()->label); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.wlabel = None; XSetWindowBackground(display, frame.workspace_label, - texture->color().pixel()); - else - XSetWindowBackgroundPixmap(display, frame.workspace_label, - frame.wlabel); + texture->getColor()->getPixel()); + } else { + frame.wlabel = + image_ctrl->renderImage(frame.workspace_label_w, frame.label_h, texture); + XSetWindowBackgroundPixmap(display, frame.workspace_label, frame.wlabel); + } + if (tmp) image_ctrl->removeImage(tmp); + reconfigure(); } else if (! (ks == XK_Shift_L || ks == XK_Shift_R || - ks == XK_Control_L || ks == XK_Control_R || - ks == XK_Caps_Lock || ks == XK_Shift_Lock || - ks == XK_Meta_L || ks == XK_Meta_R || - ks == XK_Alt_L || ks == XK_Alt_R || - ks == XK_Super_L || ks == XK_Super_R || - ks == XK_Hyper_L || ks == XK_Hyper_R)) { + ks == XK_Control_L || ks == XK_Control_R || + ks == XK_Caps_Lock || ks == XK_Shift_Lock || + ks == XK_Meta_L || ks == XK_Meta_R || + ks == XK_Alt_L || ks == XK_Alt_R || + ks == XK_Super_L || ks == XK_Super_R || + ks == XK_Hyper_L || ks == XK_Hyper_R)) { if (ks == XK_BackSpace) { - if (new_name_pos > 0) { - --new_name_pos; - new_workspace_name.erase(new_name_pos); - } else { - new_workspace_name.resize(0); - } + if (new_name_pos > 0) { + --new_name_pos; + *(new_workspace_name + new_name_pos) = '\0'; + } else { + *new_workspace_name = '\0'; + } } else { - new_workspace_name += (*keychar); - ++new_name_pos; + *(new_workspace_name + new_name_pos) = *keychar; + ++new_name_pos; + *(new_workspace_name + new_name_pos) = '\0'; } XClearWindow(display, frame.workspace_label); - unsigned int l = new_workspace_name.length(), tw, x; + int l = strlen(new_workspace_name), tw, x; - if (i18n.multibyte()) { - XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, - new_workspace_name.c_str(), l, &ink, &logical); - tw = logical.width; + if (i18n->multibyte()) { + XRectangle ink, logical; - XmbTextExtents(screen->getToolbarStyle()->fontset, ++ XmbTextExtents(screen.getToolbarStyle()->fontset, + new_workspace_name, l, &ink, &logical); + tw = logical.width; } else { - tw = XTextWidth(screen->getToolbarStyle()->font, - tw = XTextWidth(screen->getToolbarStyle()->font, - new_workspace_name.c_str(), l); ++ tw = XTextWidth(screen.getToolbarStyle()->font, + new_workspace_name, l); } x = (frame.workspace_label_w - tw) / 2; - if (x < frame.bevel_w) x = frame.bevel_w; + if (x < (signed) frame.bevel_w) x = frame.bevel_w; - WindowStyle *style = screen->getWindowStyle(); - ToolbarStyle *style = screen->getToolbarStyle(); - BPen pen(style->l_text, style->font); - if (i18n.multibyte()) - XmbDrawString(display, frame.workspace_label, style->fontset, - pen.gc(), x, - (1 - style->fontset_extents->max_ink_extent.y), - new_workspace_name.c_str(), l); ++ WindowStyle *style = screen.getWindowStyle(); + if (i18n->multibyte()) + XmbDrawString(display, frame.workspace_label, style->fontset, + style->l_text_focus_gc, x, + (1 - style->fontset_extents->max_ink_extent.y), + new_workspace_name, l); else - XDrawString(display, frame.workspace_label, pen.gc(), x, - (style->font->ascent + 1), - new_workspace_name.c_str(), l); - XDrawRectangle(display, frame.workspace_label, pen.gc(), x + tw, 0, 1, - frame.label_h - 1); + XDrawString(display, frame.workspace_label, style->l_text_focus_gc, x, + (style->font->ascent + 1), + new_workspace_name, l); + + XDrawRectangle(display, frame.workspace_label, - screen->getWindowStyle()->l_text_focus_gc, x + tw, 0, 1, ++ screen.getWindowStyle()->l_text_focus_gc, x + tw, 0, 1, + frame.label_h - 1); } + - openbox->ungrab(); ++ openbox.ungrab(); } } --void Toolbar::timeout(void) { ++void Toolbar::timeout() { checkClock(True); - clock_timer->setTimeout(aMinuteFromNow()); + timeval now; + gettimeofday(&now, 0); + clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000); } --void Toolbar::HideHandler::timeout(void) { -- toolbar->hidden = ! toolbar->hidden; -- if (toolbar->hidden) ++void Toolbar::HideHandler::timeout() { ++ toolbar->m_hidden = !toolbar->m_hidden; ++ if (toolbar->m_hidden) XMoveWindow(toolbar->display, toolbar->frame.window, - toolbar->frame.x_hidden, toolbar->frame.y_hidden); + toolbar->frame.x_hidden, toolbar->frame.y_hidden); else XMoveWindow(toolbar->display, toolbar->frame.window, - toolbar->frame.rect.x(), toolbar->frame.rect.y()); + toolbar->frame.x, toolbar->frame.y); } -void Toolbar::toggleAutoHide(void) { - saveAutoHide(! doAutoHide()); - - updateStrut(); - screen->getSlit()->reposition(); - - if (do_auto_hide == False && hidden) { - // force the slit to be visible - if (hide_timer->isTiming()) hide_timer->stop(); - hide_handler.timeout(); - } -} - - --Toolbarmenu::Toolbarmenu(Toolbar *tb) : Basemenu(tb->screen) { -- toolbar = tb; -- - setLabel(i18n(ToolbarSet, ToolbarToolbarTitle, "Toolbar")); ++Toolbarmenu::Toolbarmenu(Toolbar &tb) : Basemenu(tb.screen), toolbar(tb) { + setLabel(i18n->getMessage(ToolbarSet, ToolbarToolbarTitle, "Toolbar")); setInternalMenu(); -- placementmenu = new Placementmenu(this); ++ placementmenu = new Placementmenu(*this); - insert(i18n(CommonSet, CommonPlacementTitle, "Placement"), - placementmenu); - insert(i18n(CommonSet, CommonAlwaysOnTop, "Always on top"), 1); - insert(i18n(CommonSet, CommonAutoHide, "Auto hide"), 2); - insert(i18n(ToolbarSet, ToolbarEditWkspcName, - "Edit current workspace name"), 3); + insert(i18n->getMessage(CommonSet, CommonPlacementTitle, "Placement"), + placementmenu); + insert(i18n->getMessage(CommonSet, CommonAlwaysOnTop, "Always on top"), 1); + insert(i18n->getMessage(CommonSet, CommonAutoHide, "Auto hide"), 2); + insert(i18n->getMessage(ToolbarSet, ToolbarEditWkspcName, + "Edit current workspace name"), 3); update(); ++ + setValues(); + } - if (toolbar->isOnTop()) setItemSelected(1, True); - if (toolbar->doAutoHide()) setItemSelected(2, True); - + void Toolbarmenu::setValues() { - setItemSelected(1, toolbar->isOnTop()); - setItemSelected(2, toolbar->doAutoHide()); ++ setItemSelected(1, toolbar.onTop()); ++ setItemSelected(2, toolbar.autoHide()); } --Toolbarmenu::~Toolbarmenu(void) { ++Toolbarmenu::~Toolbarmenu() { delete placementmenu; } @@@ -1173,27 -1120,22 +1309,27 @@@ void Toolbarmenu::itemSelected(int butt switch (item->function()) { case 1: { // always on top - Bool change = ((toolbar->isOnTop()) ? False : True); - toolbar->on_top = change; - toolbar->saveOnTop(! toolbar->isOnTop()); - setItemSelected(1, toolbar->isOnTop()); ++ Bool change = ((toolbar.onTop()) ? False : True); ++ toolbar.setOnTop(change); + setItemSelected(1, change); - if (toolbar->isOnTop()) toolbar->screen->raiseWindows((Window *) 0, 0); - if (toolbar->isOnTop()) getScreen()->raiseWindows((Window *) 0, 0); ++ if (toolbar.onTop()) toolbar.screen.raiseWindows((Window *) 0, 0); break; } case 2: { // auto hide - Bool change = ((toolbar->doAutoHide()) ? False : True); - toolbar->do_auto_hide = change; - toolbar->toggleAutoHide(); - setItemSelected(2, toolbar->doAutoHide()); ++ Bool change = ((toolbar.autoHide()) ? False : True); ++ toolbar.setAutoHide(change); + setItemSelected(2, change); +#ifdef SLIT - toolbar->screen->getSlit()->reposition(); ++ toolbar.screen.getSlit()->reposition(); +#endif // SLIT break; } case 3: { // edit current workspace name -- toolbar->edit(); ++ toolbar.edit(); hide(); break; @@@ -1202,59 -1144,122 +1338,57 @@@ } --void Toolbarmenu::internal_hide(void) { ++void Toolbarmenu::internal_hide() { Basemenu::internal_hide(); -- if (toolbar->doAutoHide() && ! toolbar->isEditing()) -- toolbar->hide_handler.timeout(); ++ if (toolbar.autoHide() && ! toolbar.isEditing()) ++ toolbar.hide_handler.timeout(); } --void Toolbarmenu::reconfigure(void) { ++void Toolbarmenu::reconfigure() { + setValues(); placementmenu->reconfigure(); Basemenu::reconfigure(); } --Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) - : Basemenu(tm->toolbar->screen) { - toolbarmenu = tm; - - : Basemenu(tm->toolbar->screen), toolbar(tm->toolbar) { - setLabel(i18n(ToolbarSet, ToolbarToolbarPlacement, "Toolbar Placement")); ++Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu &tm) ++ : Basemenu(tm.toolbar.screen), toolbarmenu(tm) { + setLabel(i18n->getMessage(ToolbarSet, ToolbarToolbarPlacement, + "Toolbar Placement")); setInternalMenu(); setMinimumSublevels(3); - insert(i18n(CommonSet, CommonPlacementTopLeft, "Top Left"), - Toolbar::TopLeft); - insert(i18n(CommonSet, CommonPlacementBottomLeft, "Bottom Left"), - Toolbar::BottomLeft); - insert(i18n(CommonSet, CommonPlacementTopCenter, "Top Center"), - Toolbar::TopCenter); - insert(i18n(CommonSet, CommonPlacementBottomCenter, "Bottom Center"), - Toolbar::BottomCenter); - insert(i18n(CommonSet, CommonPlacementTopRight, "Top Right"), - Toolbar::TopRight); - insert(i18n(CommonSet, CommonPlacementBottomRight, "Bottom Right"), - Toolbar::BottomRight); + insert(i18n->getMessage(CommonSet, CommonPlacementTopLeft, + "Top Left"), Toolbar::TopLeft); + insert(i18n->getMessage(CommonSet, CommonPlacementBottomLeft, + "Bottom Left"), Toolbar::BottomLeft); + insert(i18n->getMessage(CommonSet, CommonPlacementTopCenter, + "Top Center"), Toolbar::TopCenter); + insert(i18n->getMessage(CommonSet, CommonPlacementBottomCenter, + "Bottom Center"), Toolbar::BottomCenter); + insert(i18n->getMessage(CommonSet, CommonPlacementTopRight, + "Top Right"), Toolbar::TopRight); + insert(i18n->getMessage(CommonSet, CommonPlacementBottomRight, + "Bottom Right"), Toolbar::BottomRight); update(); - setValues(); } - -void Toolbarmenu::Placementmenu::setValues(void) { - int place = 0; - switch (toolbar->getPlacement()) { - case Toolbar::BottomRight: - place++; - case Toolbar::TopRight: - place++; - case Toolbar::BottomCenter: - place++; - case Toolbar::TopCenter: - place++; - case Toolbar::BottomLeft: - place++; - case Toolbar::TopLeft: - break; - } - setItemSelected(0, 0 == place); - setItemSelected(1, 1 == place); - setItemSelected(2, 2 == place); - setItemSelected(3, 3 == place); - setItemSelected(4, 4 == place); - setItemSelected(5, 5 == place); -} - - -void Toolbarmenu::Placementmenu::reconfigure(void) { - setValues(); - Basemenu::reconfigure(); -} - -- -void Toolbarmenu::Placementmenu::itemSelected(int button, unsigned int index) { +void Toolbarmenu::Placementmenu::itemSelected(int button, int index) { if (button != 1) return; BasemenuItem *item = find(index); if (! item) return; - toolbarmenu->toolbar->screen->saveToolbarPlacement(item->function()); - toolbar->savePlacement(item->function()); ++ toolbarmenu.toolbar.setPlacement(item->function()); hide(); - toolbarmenu->toolbar->reconfigure(); - toolbar->reconfigure(); ++ toolbarmenu.toolbar.reconfigure(); +#ifdef SLIT // reposition the slit as well to make sure it doesn't intersect the // toolbar - toolbarmenu->toolbar->screen->getSlit()->reposition(); - getScreen()->getSlit()->reposition(); -} - - -int ToolbarStyle::doJustify(const char *text, int &start_pos, - unsigned int max_length, unsigned int modifier, - bool multibyte) const { - size_t text_len = strlen(text); - unsigned int length; - - do { - if (multibyte) { - XRectangle ink, logical; - XmbTextExtents(fontset, text, text_len, &ink, &logical); - length = logical.width; - } else { - length = XTextWidth(font, text, text_len); - } - length += modifier; - } while (length > max_length && text_len-- > 0); - - switch (justify) { - case RightJustify: - start_pos += max_length - length; - break; - - case CenterJustify: - start_pos += (max_length - length) / 2; - break; - - case LeftJustify: - default: - break; - } - - return text_len; ++ toolbarmenu.toolbar.screen.getSlit()->reposition(); +#endif // SLIT } diff --cc src/Toolbar.h index 17c46984,00000000..93d92055 mode 100644,000000..100644 --- a/src/Toolbar.h +++ b/src/Toolbar.h @@@ -1,156 -1,0 +1,176 @@@ +// Toolbar.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Toolbar_hh +#define __Toolbar_hh + +#include + +#include "Basemenu.h" +#include "Timer.h" ++#include "Resource.h" ++#include "Screen.h" ++#include "Geometry.h" + +// forward declaration +class Toolbar; + +class Toolbarmenu : public Basemenu { +private: + class Placementmenu : public Basemenu { + private: - Toolbarmenu *toolbarmenu; ++ Toolbarmenu &toolbarmenu; + + protected: + virtual void itemSelected(int, int); + + public: - Placementmenu(Toolbarmenu *); ++ Placementmenu(Toolbarmenu &); + }; + - Toolbar *toolbar; ++ Toolbar &toolbar; + Placementmenu *placementmenu; + + friend class Placementmenu; + friend class Toolbar; + + +protected: + virtual void itemSelected(int, int); - virtual void internal_hide(void); ++ virtual void internal_hide(); ++ virtual void setValues(); + +public: - Toolbarmenu(Toolbar *); - ~Toolbarmenu(void); ++ Toolbarmenu(Toolbar &); ++ ~Toolbarmenu(); + - inline Basemenu *getPlacementmenu(void) { return placementmenu; } ++ inline Basemenu *getPlacementmenu() { return placementmenu; } + - void reconfigure(void); ++ void reconfigure(); +}; + + +class Toolbar : public TimeoutHandler { +private: - Bool on_top, editing, hidden, do_auto_hide; ++ bool m_ontop, m_editing, m_hidden, m_autohide; ++ int m_width_percent, m_placement; + Display *display; + + struct frame { + unsigned long button_pixel, pbutton_pixel; + Pixmap base, label, wlabel, clk, button, pbutton; + Window window, workspace_label, window_label, clock, psbutton, nsbutton, + pwbutton, nwbutton; + + int x, y, x_hidden, y_hidden, hour, minute, grab_x, grab_y; + unsigned int width, height, window_label_w, workspace_label_w, clock_w, + button_w, bevel_w, label_h; + } frame; + + class HideHandler : public TimeoutHandler { + public: + Toolbar *toolbar; - - virtual void timeout(void); ++ virtual void timeout(); + } hide_handler; + - Openbox *openbox; ++ Openbox &openbox; ++ BScreen &screen; ++ Resource &config; + BImageControl *image_ctrl; - BScreen *screen; + BTimer *clock_timer, *hide_timer; + Toolbarmenu *toolbarmenu; + + char *new_workspace_name; + size_t new_name_pos; + + friend class HideHandler; + friend class Toolbarmenu; + friend class Toolbarmenu::Placementmenu; + + +public: - Toolbar(BScreen *); - virtual ~Toolbar(void); - - inline Toolbarmenu *getMenu(void) { return toolbarmenu; } ++ Toolbar(BScreen &, Resource &); ++ virtual ~Toolbar(); + - inline const Bool &isEditing(void) const { return editing; } - inline const Bool &isOnTop(void) const { return on_top; } - inline const Bool &isHidden(void) const { return hidden; } - inline const Bool &doAutoHide(void) const { return do_auto_hide; } ++ inline Toolbarmenu *getMenu() { return toolbarmenu; } + - inline const Window &getWindowID(void) const { return frame.window; } ++ inline const Window &getWindowID() const { return frame.window; } + - inline const unsigned int &getWidth(void) const { return frame.width; } - inline const unsigned int &getHeight(void) const { return frame.height; } - inline const unsigned int &getExposedHeight(void) const - { return ((do_auto_hide) ? frame.bevel_w : frame.height); } - inline const int &getX(void) const - { return ((hidden) ? frame.x_hidden : frame.x); } - inline const int &getY(void) const - { return ((hidden) ? frame.y_hidden : frame.y); } ++ //inline unsigned int getWidth() const { return frame.width; } ++ //inline unsigned int getHeight() const { return frame.height; } ++ unsigned int getExposedHeight() const; ++ ++ //int getX() const; ++ //int getY() const; + ++ Rect area() const; ++ //Size size() const { return area().size(); } ++ //Point origin() const { return area().origin(); } ++ + void buttonPressEvent(XButtonEvent *); + void buttonReleaseEvent(XButtonEvent *); + void enterNotifyEvent(XCrossingEvent *); + void leaveNotifyEvent(XCrossingEvent *); + void exposeEvent(XExposeEvent *); + void keyPressEvent(XKeyEvent *); + + void redrawWindowLabel(Bool = False); + void redrawWorkspaceLabel(Bool = False); + void redrawPrevWorkspaceButton(Bool = False, Bool = False); + void redrawNextWorkspaceButton(Bool = False, Bool = False); + void redrawPrevWindowButton(Bool = False, Bool = False); + void redrawNextWindowButton(Bool = False, Bool = False); - void edit(void); - void reconfigure(void); - ++ void edit(); ++ void reconfigure(); ++ void load(); ++ void save(); ++ void mapToolbar(); ++ void unMapToolbar(); +#ifdef HAVE_STRFTIME + void checkClock(Bool = False); +#else // HAVE_STRFTIME + void checkClock(Bool = False, Bool = False); +#endif // HAVE_STRFTIME + - virtual void timeout(void); ++ virtual void timeout(); ++ ++ inline bool onTop() const { return m_ontop; } ++ void setOnTop(bool); ++ ++ inline bool autoHide() const { return m_autohide; } ++ void setAutoHide(bool); ++ ++ inline int widthPercent() const { return m_width_percent; } ++ void setWidthPercent(int); ++ ++ inline int placement() const { return m_placement; } ++ void setPlacement(int); + ++ inline bool isEditing() const { return m_editing; } ++ inline bool isHidden() const { return m_hidden; } ++ + enum { TopLeft = 1, BottomLeft, TopCenter, + BottomCenter, TopRight, BottomRight }; +}; + + +#endif // __Toolbar_hh diff --cc src/Util.h index 00000000,00000000..ad45c403 new file mode 100644 --- /dev/null +++ b/src/Util.h @@@ -1,0 -1,0 +1,39 @@@ ++// Util.h for Openbox ++// Copyright (c) 2002 - 2002 Ben Jansens (ben@orodu.net) ++// ++// Permission is hereby granted, free of charge, to any person obtaining a ++// copy of this software and associated documentation files (the "Software"), ++// to deal in the Software without restriction, including without limitation ++// the rights to use, copy, modify, merge, publish, distribute, sublicense, ++// and/or sell copies of the Software, and to permit persons to whom the ++// Software is furnished to do so, subject to the following conditions: ++// ++// The above copyright notice and this permission notice shall be included in ++// all copies or substantial portions of the Software. ++// ++// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR ++// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, ++// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ++// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER ++// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING ++// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER ++// DEALINGS IN THE SOFTWARE. ++ ++#ifndef __Util_hh ++#define __Util_hh ++ ++#ifdef DEBUG ++# include ++# define ASSERT(x) assert(x) ++#else // !DEBUG ++# define ASSERT(x) ++#endif // DEBUG ++ ++struct PointerAssassin { ++ template ++ inline void operator()(const T ptr) const { ++ delete ptr; ++ } ++}; ++ ++#endif // __Util_hh diff --cc src/Window.cc index 4133ac00,417e15ac..56875851 --- a/src/Window.cc +++ b/src/Window.cc @@@ -1,6 -1,7 +1,7 @@@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// Window.cc for Blackbox - an X11 Window manager -// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry -// Copyright (c) 1997 - 2000, 2002 Brad Hughes +// Window.cc for Openbox - // Copyright (c) 2001 Sean 'Shaleh' Perry - // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) ++// Copyright (c) 2002 - 2002 Ben Jansens (ben at orodu.net) ++// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry (shaleh at debian.org) ++// Copyright (c) 1997 - 2000 Brad Hughes (bhughes at tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a // copy of this software and associated documentation files (the "Software"), @@@ -33,44 -28,69 +34,44 @@@ #include #include - #ifdef STDC_HEADERS -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include - #endif // STDC_HEADERS + #endif // HAVE_STRING_H #ifdef DEBUG # ifdef HAVE_STDIO_H # include # endif // HAVE_STDIO_H #endif // DEBUG -} - -#include - -#include "i18n.hh" -#include "blackbox.hh" -#include "GCCache.hh" -#include "Iconmenu.hh" -#include "Image.hh" -#include "Screen.hh" -#include "Toolbar.hh" -#include "Util.hh" -#include "Window.hh" -#include "Windowmenu.hh" -#include "Workspace.hh" -#include "Slit.hh" -using std::string; +#include "i18n.h" +#include "openbox.h" +#include "Iconmenu.h" +#include "Screen.h" +#include "Toolbar.h" +#include "Window.h" +#include "Windowmenu.h" +#include "Workspace.h" +#ifdef SLIT +# include "Slit.h" +#endif // SLIT ++#include "Util.h" /* * Initializes the class with default values/the window's set initial values. */ - OpenboxWindow::OpenboxWindow(Openbox *b, Window w, BScreen *s) { -BlackboxWindow::BlackboxWindow(Blackbox *b, Window w, BScreen *s) { - // fprintf(stderr, "BlackboxWindow size: %d bytes\n", - // sizeof(BlackboxWindow)); - ++OpenboxWindow::OpenboxWindow(Openbox &o, Window w, BScreen *s) : openbox(o) { #ifdef DEBUG - fprintf(stderr, "BlackboxWindow::BlackboxWindow(): creating 0x%lx\n", w); + fprintf(stderr, i18n->getMessage(WindowSet, WindowCreating, + "OpenboxWindow::OpenboxWindow(): creating 0x%lx\n"), + w); #endif // DEBUG - // set timer to zero... it is initialized properly later, so we check - // if timer is zero in the destructor, and assume that the window is not - // fully constructed if timer is zero... - timer = 0; - blackbox = b; client.window = w; - openbox = b; - display = openbox->getXDisplay(); - screen = s; - xatom = blackbox->getXAtom(); - - if (! validateClient()) { - delete this; - return; - } ++ display = openbox.getXDisplay(); - openbox->grab(); - // set the eventmask early in the game so that we make sure we get - // all the events we are interested in - XSetWindowAttributes attrib_set; - attrib_set.event_mask = PropertyChangeMask | FocusChangeMask | - StructureNotifyMask; - attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | - ButtonMotionMask; - XChangeWindowAttributes(blackbox->getXDisplay(), client.window, - CWEventMask|CWDontPropagate, &attrib_set); ++ openbox.grab(); + if (! validateClient()) return; // fetch client size and placement XWindowAttributes wattrib; @@@ -78,45 -99,26 +79,47 @@@ (! wattrib.screen) || wattrib.override_redirect) { #ifdef DEBUG fprintf(stderr, - "BlackboxWindow::BlackboxWindow(): XGetWindowAttributes failed\n"); + i18n->getMessage(WindowSet, WindowXGetWindowAttributesFail, + "OpenboxWindow::OpenboxWindow(): XGetWindowAttributes " + "failed\n")); #endif // DEBUG - b->ungrab(); - delete this; ++ openbox.ungrab(); return; } + if (s) { + screen = s; + } else { - screen = openbox->searchScreen(RootWindowOfScreen(wattrib.screen)); ++ screen = openbox.searchScreen(RootWindowOfScreen(wattrib.screen)); + if (! screen) { +#ifdef DEBUG + fprintf(stderr, i18n->getMessage(WindowSet, WindowCannotFindScreen, + "OpenboxWindow::OpenboxWindow(): can't find screen\n" + "\tfor root window 0x%lx\n"), + RootWindowOfScreen(wattrib.screen)); +#endif // DEBUG + - b->ungrab(); ++ openbox.ungrab(); + return; + } + } + ++ mapped = false; ++ flags.moving = flags.resizing = flags.shaded = flags.visible = - flags.iconic = flags.focused = flags.stuck = flags.modal = - flags.send_focus_message = flags.shaped = False; + flags.iconic = flags.transient = flags.focused = + flags.stuck = flags.modal = flags.send_focus_message = + flags.shaped = flags.managed = False; flags.maximized = 0; - blackbox_attrib.workspace = window_number = BSENTINEL; + openbox_attrib.workspace = workspace_number = window_number = -1; - blackbox_attrib.flags = blackbox_attrib.attrib = blackbox_attrib.stack - = blackbox_attrib.decoration = 0l; - blackbox_attrib.premax_x = blackbox_attrib.premax_y = 0; - blackbox_attrib.premax_w = blackbox_attrib.premax_h = 0; + openbox_attrib.flags = openbox_attrib.attrib = openbox_attrib.stack + = openbox_attrib.decoration = 0l; + openbox_attrib.premax_x = openbox_attrib.premax_y = 0; + openbox_attrib.premax_w = openbox_attrib.premax_h = 0; - frame.border_w = 1; frame.window = frame.plate = frame.title = frame.handle = None; frame.close_button = frame.iconify_button = frame.maximize_button = None; frame.right_grip = frame.left_grip = None; @@@ -150,14 -147,11 +153,16 @@@ windowmenu = 0; lastButtonPressTime = 0; + image_ctrl = screen->getImageControl(); - timer = new BTimer(openbox, this); - timer->setTimeout(openbox->getAutoRaiseDelay()); - timer = new BTimer(blackbox, this); - timer->setTimeout(blackbox->getAutoRaiseDelay()); ++ current_state = WithdrawnState; + - if (! getBlackboxHints()) ++ timer = new BTimer(openbox, *this); ++ timer->setTimeout(openbox.getAutoRaiseDelay()); + timer->fireOnce(True); + + getOpenboxHints(); + if (! client.openbox_hint) getMWMHints(); // get size, aspect, minimum/maximum size and other hints set by the @@@ -166,264 -160,169 +171,273 @@@ getWMHints(); getWMNormalHints(); +#ifdef SLIT if (client.initial_state == WithdrawnState) { screen->getSlit()->addClient(client.window); ++ openbox.ungrab(); delete this; - - b->ungrab(); return; } +#endif // SLIT - frame.window = createToplevelWindow(); - frame.plate = createChildWindow(frame.window); - associateClientWindow(); - - blackbox->saveWindowSearch(frame.window, this); - blackbox->saveWindowSearch(frame.plate, this); - blackbox->saveWindowSearch(client.window, this); + flags.managed = True; - openbox->saveWindowSearch(client.window, this); ++ openbox.saveWindowSearch(client.window, this); // determine if this is a transient window - getTransientInfo(); + Window win; + if (XGetTransientForHint(display, client.window, &win)) { + if (win && (win != client.window)) { + OpenboxWindow *tr; - if ((tr = openbox->searchWindow(win))) { ++ if ((tr = openbox.searchWindow(win))) { + while (tr->client.transient) tr = tr->client.transient; + client.transient_for = tr; + tr->client.transient = this; + flags.stuck = client.transient_for->flags.stuck; + flags.transient = True; + } else if (win == client.window_group) { - if ((tr = openbox->searchGroup(win, this))) { ++ if ((tr = openbox.searchGroup(win, this))) { + while (tr->client.transient) tr = tr->client.transient; + client.transient_for = tr; + tr->client.transient = this; + flags.stuck = client.transient_for->flags.stuck; + flags.transient = True; + } + } + } - // adjust the window decorations based on transience and window sizes - if (isTransient()) { - decorations &= ~(Decor_Maximize | Decor_Handle); - functions &= ~Func_Maximize; + if (win == screen->getRootWindow()) flags.modal = True; } + // adjust the window decorations based on transience and window sizes + if (flags.transient) + decorations.maximize = decorations.handle = functions.maximize = False; + if ((client.normal_hint_flags & PMinSize) && (client.normal_hint_flags & PMaxSize) && - client.max_width <= client.min_width && + client.max_width <= client.min_width && client.max_height <= client.min_height) { - decorations &= ~(Decor_Maximize | Decor_Handle); - functions &= ~(Func_Resize | Func_Maximize); + decorations.maximize = decorations.handle = + functions.resize = functions.maximize = False; } upsize(); - Bool place_window = True; - if (openbox->isStartup() || flags.transient || - bool place_window = True; - if (blackbox->isStartup() || isTransient() || ++ place_window = true; ++ if (openbox.isStartup() || flags.transient || client.normal_hint_flags & (PPosition|USPosition)) { setGravityOffsets(); - if ((openbox->isStartup()) || - - if (blackbox->isStartup() || - client.rect.intersects(screen->availableArea())) - place_window = False; ++ if ((openbox.isStartup()) || + (frame.x >= 0 && + (signed) (frame.y + frame.y_border) >= 0 && - frame.x <= (signed) screen->getWidth() && - frame.y <= (signed) screen->getHeight())) - place_window = False; ++ frame.x <= (signed) screen->size().w() && ++ frame.y <= (signed) screen->size().h())) ++ place_window = false; } - if (decorations & Decor_Titlebar) - createTitlebar(); + frame.window = createToplevelWindow(frame.x, frame.y, frame.width, + frame.height, + frame.border_w); - openbox->saveWindowSearch(frame.window, this); ++ openbox.saveWindowSearch(frame.window, this); - if (decorations & Decor_Handle) - createHandle(); + frame.plate = createChildWindow(frame.window); - openbox->saveWindowSearch(frame.plate, this); ++ openbox.saveWindowSearch(frame.plate, this); -#ifdef SHAPE - if (blackbox->hasShapeExtensions() && flags.shaped) { - configureShape(); + if (decorations.titlebar) { + frame.title = createChildWindow(frame.window); + frame.label = createChildWindow(frame.title); - openbox->saveWindowSearch(frame.title, this); - openbox->saveWindowSearch(frame.label, this); ++ openbox.saveWindowSearch(frame.title, this); ++ openbox.saveWindowSearch(frame.label, this); } -#endif // SHAPE - if ((! screen->isSloppyFocus()) || screen->doClickRaise()) { - // grab button 1 for changing focus/raising - blackbox->grabButton(Button1, 0, frame.plate, True, ButtonPressMask, - GrabModeSync, GrabModeSync, frame.plate, None); + if (decorations.handle) { + frame.handle = createChildWindow(frame.window); - openbox->saveWindowSearch(frame.handle, this); ++ openbox.saveWindowSearch(frame.handle, this); + + frame.left_grip = - createChildWindow(frame.handle, openbox->getLowerLeftAngleCursor()); - openbox->saveWindowSearch(frame.left_grip, this); ++ createChildWindow(frame.handle, openbox.getLowerLeftAngleCursor()); ++ openbox.saveWindowSearch(frame.left_grip, this); + + frame.right_grip = - createChildWindow(frame.handle, openbox->getLowerRightAngleCursor()); - openbox->saveWindowSearch(frame.right_grip, this); ++ createChildWindow(frame.handle, openbox.getLowerRightAngleCursor()); ++ openbox.saveWindowSearch(frame.right_grip, this); } - blackbox->grabButton(Button1, Mod1Mask, frame.window, True, - ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, - GrabModeAsync, frame.window, blackbox->getMoveCursor()); - blackbox->grabButton(Button2, Mod1Mask, frame.window, True, - ButtonReleaseMask, GrabModeAsync, GrabModeAsync, - frame.window, None); - blackbox->grabButton(Button3, Mod1Mask, frame.window, True, - ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, - GrabModeAsync, frame.window, - blackbox->getLowerRightAngleCursor()); + associateClientWindow(); + - if (! screen->isSloppyFocus()) - openbox->grabButton(Button1, 0, frame.plate, True, ButtonPressMask, - GrabModeSync, GrabModeSync, None, None); ++ if (! screen->sloppyFocus()) ++ openbox.grabButton(Button1, 0, frame.plate, True, ButtonPressMask, ++ GrabModeSync, GrabModeSync, frame.plate, None); + - openbox->grabButton(Button1, Mod1Mask, frame.window, True, ++ openbox.grabButton(Button1, Mod1Mask, frame.window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, - GrabModeAsync, None, openbox->getMoveCursor()); - openbox->grabButton(Button2, Mod1Mask, frame.window, True, - ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); - openbox->grabButton(Button3, Mod1Mask, frame.window, True, ++ GrabModeAsync, frame.window, openbox.getMoveCursor()); ++ openbox.grabButton(Button2, Mod1Mask, frame.window, True, ++ ButtonReleaseMask, GrabModeAsync, GrabModeAsync, frame.window, None); ++ openbox.grabButton(Button3, Mod1Mask, frame.window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, - GrabModeAsync, None, None); ++ GrabModeAsync, frame.window, None); positionWindows(); - decorate(); + XRaiseWindow(display, frame.plate); + XMapSubwindows(display, frame.plate); + if (decorations.titlebar) XMapSubwindows(display, frame.title); + XMapSubwindows(display, frame.window); - if (decorations & Decor_Titlebar) - XMapSubwindows(blackbox->getXDisplay(), frame.title); - XMapSubwindows(blackbox->getXDisplay(), frame.window); + if (decorations.menu) - windowmenu = new Windowmenu(this); ++ windowmenu = new Windowmenu(*this); - windowmenu = new Windowmenu(this); + decorate(); - if (workspace_number < 0 || workspace_number >= screen->getCount()) - if (blackbox_attrib.workspace >= screen->getWorkspaceCount()) ++ if (workspace_number < 0 || workspace_number >= screen->getWorkspaceCount()) screen->getCurrentWorkspace()->addWindow(this, place_window); else - screen->getWorkspace(blackbox_attrib.workspace)-> - addWindow(this, place_window); + screen->getWorkspace(workspace_number)->addWindow(this, place_window); - if (! place_window) { - // don't need to call configure if we are letting the workspace - // place the window - configure(frame.rect.x(), frame.rect.y(), - frame.rect.width(), frame.rect.height()); - } + configure(frame.x, frame.y, frame.width, frame.height); if (flags.shaded) { flags.shaded = False; shade(); } - if (flags.maximized && (functions & Func_Maximize)) { - remaximize(); ++ if (flags.stuck) { ++ flags.stuck = False; ++ stick(); + } + - setFocusFlag(False); -} + if (flags.maximized && functions.maximize) { + unsigned int button = flags.maximized; + flags.maximized = 0; + maximize(button); + } + setFocusFlag(False); - openbox->ungrab(); -BlackboxWindow::~BlackboxWindow(void) { -#ifdef DEBUG - fprintf(stderr, "BlackboxWindow::~BlackboxWindow: destroying 0x%lx\n", - client.window); -#endif // DEBUG ++ openbox.ungrab(); +} - if (! timer) // window not managed... - return; +OpenboxWindow::~OpenboxWindow(void) { if (flags.moving || flags.resizing) { screen->hideGeometry(); - XUngrabPointer(blackbox->getXDisplay(), CurrentTime); + XUngrabPointer(display, CurrentTime); + } + - if (workspace_number != -1 && window_number != -1) - screen->getWorkspace(workspace_number)->removeWindow(this); - else if (flags.iconic) ++ if (workspace_number != -1 && window_number != -1) { ++ if (flags.stuck) { ++ // make sure no other workspaces think that we're focused ++ for (int i=0; i < screen->getWorkspaceCount(); i++) ++ screen->getWorkspace(i)->removeWindow(this); ++ } else ++ screen->getWorkspace(workspace_number)->removeWindow(this); ++ } else if (flags.iconic) + screen->removeIcon(this); + + if (timer) { + if (timer->isTiming()) timer->stop(); + delete timer; } - delete timer; + if (windowmenu) delete windowmenu; + + if (client.title) + delete [] client.title; + + if (client.icon_title) + delete [] client.icon_title; - delete windowmenu; + if (client.mwm_hint) + XFree(client.mwm_hint); - if (client.window_group) { - BWindowGroup *group = blackbox->searchGroup(client.window_group); - if (group) group->removeWindow(this); + if (client.openbox_hint) + XFree(client.openbox_hint); + + if (client.window_group) - openbox->removeGroupSearch(client.window_group); ++ openbox.removeGroupSearch(client.window_group); + + if (flags.transient && client.transient_for) + client.transient_for->client.transient = client.transient; + if (client.transient) + client.transient->client.transient_for = client.transient_for; + + if (frame.close_button) { - openbox->removeWindowSearch(frame.close_button); ++ openbox.removeWindowSearch(frame.close_button); + XDestroyWindow(display, frame.close_button); } - // remove ourselves from our transient_for - if (isTransient()) { - if (client.transient_for != (BlackboxWindow *) ~0ul) { - client.transient_for->client.transientList.remove(this); - } - client.transient_for = (BlackboxWindow*) 0; + if (frame.iconify_button) { - openbox->removeWindowSearch(frame.iconify_button); ++ openbox.removeWindowSearch(frame.iconify_button); + XDestroyWindow(display, frame.iconify_button); } - if (client.transientList.size() > 0) { - // reset transient_for for all transients - BlackboxWindowList::iterator it, end = client.transientList.end(); - for (it = client.transientList.begin(); it != end; ++it) { - (*it)->client.transient_for = (BlackboxWindow*) 0; - } + if (frame.maximize_button) { - openbox->removeWindowSearch(frame.maximize_button); ++ openbox.removeWindowSearch(frame.maximize_button); + XDestroyWindow(display, frame.maximize_button); + } + + if (frame.title) { + if (frame.ftitle) + image_ctrl->removeImage(frame.ftitle); + + if (frame.utitle) + image_ctrl->removeImage(frame.utitle); + + if (frame.flabel) + image_ctrl->removeImage(frame.flabel); + + if( frame.ulabel) + image_ctrl->removeImage(frame.ulabel); + - openbox->removeWindowSearch(frame.label); - openbox->removeWindowSearch(frame.title); ++ openbox.removeWindowSearch(frame.label); ++ openbox.removeWindowSearch(frame.title); + XDestroyWindow(display, frame.label); + XDestroyWindow(display, frame.title); } - if (frame.title) - destroyTitlebar(); + if (frame.handle) { + if (frame.fhandle) + image_ctrl->removeImage(frame.fhandle); + + if (frame.uhandle) + image_ctrl->removeImage(frame.uhandle); + + if (frame.fgrip) + image_ctrl->removeImage(frame.fgrip); + + if (frame.ugrip) + image_ctrl->removeImage(frame.ugrip); + - openbox->removeWindowSearch(frame.handle); - openbox->removeWindowSearch(frame.right_grip); - openbox->removeWindowSearch(frame.left_grip); ++ openbox.removeWindowSearch(frame.handle); ++ openbox.removeWindowSearch(frame.right_grip); ++ openbox.removeWindowSearch(frame.left_grip); + XDestroyWindow(display, frame.right_grip); + XDestroyWindow(display, frame.left_grip); + XDestroyWindow(display, frame.handle); + } + + if (frame.fbutton) + image_ctrl->removeImage(frame.fbutton); + + if (frame.ubutton) + image_ctrl->removeImage(frame.ubutton); - if (frame.handle) - destroyHandle(); + if (frame.pbutton) + image_ctrl->removeImage(frame.pbutton); if (frame.plate) { - openbox->removeWindowSearch(frame.plate); - blackbox->removeWindowSearch(frame.plate); - XDestroyWindow(blackbox->getXDisplay(), frame.plate); ++ openbox.removeWindowSearch(frame.plate); + XDestroyWindow(display, frame.plate); } if (frame.window) { - openbox->removeWindowSearch(frame.window); - blackbox->removeWindowSearch(frame.window); - XDestroyWindow(blackbox->getXDisplay(), frame.window); ++ openbox.removeWindowSearch(frame.window); + XDestroyWindow(display, frame.window); } - blackbox->removeWindowSearch(client.window); + if (flags.managed) { - openbox->removeWindowSearch(client.window); ++ openbox.removeWindowSearch(client.window); + screen->removeNetizen(client.window); + } } @@@ -483,142 -378,75 +497,124 @@@ void OpenboxWindow::associateClientWind getWMName(); getWMIconName(); - XChangeSaveSet(blackbox->getXDisplay(), client.window, SetModeInsert); + XChangeSaveSet(display, client.window, SetModeInsert); + XSetWindowAttributes attrib_set; - XSelectInput(blackbox->getXDisplay(), frame.plate, SubstructureRedirectMask); + XSelectInput(display, frame.plate, NoEventMask); + XReparentWindow(display, client.window, frame.plate, 0, 0); + XSelectInput(display, frame.plate, SubstructureRedirectMask); - XGrabServer(blackbox->getXDisplay()); - XSelectInput(blackbox->getXDisplay(), client.window, NoEventMask); - XReparentWindow(blackbox->getXDisplay(), client.window, frame.plate, 0, 0); - XSelectInput(blackbox->getXDisplay(), client.window, - PropertyChangeMask | FocusChangeMask | StructureNotifyMask); - XUngrabServer(blackbox->getXDisplay()); + XFlush(display); - XRaiseWindow(blackbox->getXDisplay(), frame.plate); - XMapSubwindows(blackbox->getXDisplay(), frame.plate); + attrib_set.event_mask = PropertyChangeMask | StructureNotifyMask | + FocusChangeMask; + attrib_set.do_not_propagate_mask = ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask; + XChangeWindowAttributes(display, client.window, CWEventMask|CWDontPropagate, + &attrib_set); #ifdef SHAPE - if (openbox->hasShapeExtensions()) { - if (blackbox->hasShapeExtensions()) { - XShapeSelectInput(blackbox->getXDisplay(), client.window, - ShapeNotifyMask); ++ if (openbox.hasShapeExtensions()) { + XShapeSelectInput(display, client.window, ShapeNotifyMask); - Bool shaped = False; int foo; unsigned int ufoo; - XShapeQueryExtents(blackbox->getXDisplay(), client.window, &shaped, - &foo, &foo, &ufoo, &ufoo, &foo, &foo, &foo, - &ufoo, &ufoo); - flags.shaped = shaped; + XShapeQueryExtents(display, client.window, &flags.shaped, &foo, &foo, + &ufoo, &ufoo, &foo, &foo, &foo, &ufoo, &ufoo); + + if (flags.shaped) { + XShapeCombineShape(display, frame.window, ShapeBounding, + frame.mwm_border_w, frame.y_border + + frame.mwm_border_w, client.window, + ShapeBounding, ShapeSet); + + int num = 1; + XRectangle xrect[2]; + xrect[0].x = xrect[0].y = 0; + xrect[0].width = frame.width; + xrect[0].height = frame.y_border; + + if (decorations.handle) { + xrect[1].x = 0; + xrect[1].y = frame.y_handle; + xrect[1].width = frame.width; + xrect[1].height = frame.handle_h + frame.border_w; + num++; + } + + XShapeCombineRectangles(display, frame.window, ShapeBounding, 0, 0, + xrect, num, ShapeUnion, Unsorted); + } } #endif // SHAPE -} + if (decorations.iconify) createIconifyButton(); + if (decorations.maximize) createMaximizeButton(); + if (decorations.close) createCloseButton(); - - if (frame.ubutton) { - if (frame.close_button) - XSetWindowBackgroundPixmap(display, frame.close_button, frame.ubutton); - if (frame.maximize_button) - XSetWindowBackgroundPixmap(display, frame.maximize_button, - frame.ubutton); - if (frame.iconify_button) - XSetWindowBackgroundPixmap(display, frame.iconify_button, frame.ubutton); - } else { - if (frame.close_button) - XSetWindowBackground(display, frame.close_button, frame.ubutton_pixel); - if (frame.maximize_button) - XSetWindowBackground(display, frame.maximize_button, - frame.ubutton_pixel); - if (frame.iconify_button) - XSetWindowBackground(display, frame.iconify_button, frame.ubutton_pixel); - } +} -void BlackboxWindow::decorate(void) { - BTexture* texture; - texture = &(screen->getWindowStyle()->b_focus); - frame.fbutton = texture->render(frame.button_w, frame.button_w, - frame.fbutton); - if (! frame.fbutton) - frame.fbutton_pixel = texture->color().pixel(); +void OpenboxWindow::decorate(void) { + Pixmap tmp = frame.fbutton; + BTexture *texture = &(screen->getWindowStyle()->b_focus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.fbutton = None; + frame.fbutton_pixel = texture->getColor()->getPixel(); + } else { + frame.fbutton = + image_ctrl->renderImage(frame.button_w, frame.button_h, texture); + } + if (tmp) image_ctrl->removeImage(tmp); + tmp = frame.ubutton; texture = &(screen->getWindowStyle()->b_unfocus); - frame.ubutton = texture->render(frame.button_w, frame.button_w, - frame.ubutton); - if (! frame.ubutton) - frame.ubutton_pixel = texture->color().pixel(); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.ubutton = None; + frame.ubutton_pixel = texture->getColor()->getPixel(); + } else { + frame.ubutton = + image_ctrl->renderImage(frame.button_w, frame.button_h, texture); + } + if (tmp) image_ctrl->removeImage(tmp); + tmp = frame.pbutton; texture = &(screen->getWindowStyle()->b_pressed); - frame.pbutton = texture->render(frame.button_w, frame.button_w, - frame.pbutton); - if (! frame.pbutton) - frame.pbutton_pixel = texture->color().pixel(); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.pbutton = None; + frame.pbutton_pixel = texture->getColor()->getPixel(); + } else { + frame.pbutton = + image_ctrl->renderImage(frame.button_w, frame.button_h, texture); + } + if (tmp) image_ctrl->removeImage(tmp); - if (decorations & Decor_Titlebar) { + if (decorations.titlebar) { + tmp = frame.ftitle; texture = &(screen->getWindowStyle()->t_focus); - frame.ftitle = texture->render(frame.inside_w, frame.title_h, - frame.ftitle); - if (! frame.ftitle) - frame.ftitle_pixel = texture->color().pixel(); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.ftitle = None; + frame.ftitle_pixel = texture->getColor()->getPixel(); + } else { + frame.ftitle = + image_ctrl->renderImage(frame.width, frame.title_h, texture); + } + if (tmp) image_ctrl->removeImage(tmp); + tmp = frame.utitle; texture = &(screen->getWindowStyle()->t_unfocus); - frame.utitle = texture->render(frame.inside_w, frame.title_h, - frame.utitle); - if (! frame.utitle) - frame.utitle_pixel = texture->color().pixel(); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.utitle = None; + frame.utitle_pixel = texture->getColor()->getPixel(); + } else { + frame.utitle = + image_ctrl->renderImage(frame.width, frame.title_h, texture); + } + if (tmp) image_ctrl->removeImage(tmp); - XSetWindowBorder(blackbox->getXDisplay(), frame.title, - screen->getBorderColor()->pixel()); + XSetWindowBorder(display, frame.title, + screen->getBorderColor()->getPixel()); decorateLabel(); } @@@ -716,105 -604,132 +712,110 @@@ void OpenboxWindow::decorateLabel(void } -void BlackboxWindow::createCloseButton(void) { - if (frame.title != None) { +void OpenboxWindow::createCloseButton(void) { + if (decorations.close && frame.title != None) { frame.close_button = createChildWindow(frame.title); - openbox->saveWindowSearch(frame.close_button, this); - blackbox->saveWindowSearch(frame.close_button, this); ++ openbox.saveWindowSearch(frame.close_button, this); } } -void BlackboxWindow::destroyCloseButton(void) { - blackbox->removeWindowSearch(frame.close_button); - XDestroyWindow(blackbox->getXDisplay(), frame.close_button); - frame.close_button = None; -} - - -void BlackboxWindow::createIconifyButton(void) { - if (frame.title != None) { +void OpenboxWindow::createIconifyButton(void) { + if (decorations.iconify && frame.title != None) { frame.iconify_button = createChildWindow(frame.title); - openbox->saveWindowSearch(frame.iconify_button, this); - blackbox->saveWindowSearch(frame.iconify_button, this); ++ openbox.saveWindowSearch(frame.iconify_button, this); } } -void BlackboxWindow::destroyIconifyButton(void) { - blackbox->removeWindowSearch(frame.iconify_button); - XDestroyWindow(blackbox->getXDisplay(), frame.iconify_button); - frame.iconify_button = None; -} - - -void BlackboxWindow::createMaximizeButton(void) { - if (frame.title != None) { +void OpenboxWindow::createMaximizeButton(void) { + if (decorations.maximize && frame.title != None) { frame.maximize_button = createChildWindow(frame.title); - openbox->saveWindowSearch(frame.maximize_button, this); - blackbox->saveWindowSearch(frame.maximize_button, this); ++ openbox.saveWindowSearch(frame.maximize_button, this); } } - void OpenboxWindow::positionButtons(Bool redecorate_label) { - const char *format = openbox->getTitleBarLayout(); -void BlackboxWindow::destroyMaximizeButton(void) { - blackbox->removeWindowSearch(frame.maximize_button); - XDestroyWindow(blackbox->getXDisplay(), frame.maximize_button); - frame.maximize_button = None; -} - - -void BlackboxWindow::positionButtons(bool redecorate_label) { - string layout = blackbox->getTitlebarLayout(); - string parsed; - - bool hasclose, hasiconify, hasmaximize, haslabel; - hasclose = hasiconify = hasmaximize = haslabel = false; - - string::const_iterator it, end; - for (it = layout.begin(), end = layout.end(); it != end; ++it) { - switch(*it) { ++void OpenboxWindow::positionButtons() { ++ const char *format = openbox.getTitleBarLayout(); + const unsigned int bw = frame.bevel_w + 1; + const unsigned int by = frame.bevel_w + 1; + unsigned int bx = frame.bevel_w + 1; + unsigned int bcount = strlen(format) - 1; + + if (!decorations.close) + bcount--; + if (!decorations.maximize) + bcount--; + if (!decorations.iconify) + bcount--; + frame.label_w = frame.width - bx * 2 - (frame.button_w + bw) * bcount; + + bool hasclose, hasiconify, hasmaximize; + hasclose = hasiconify = hasmaximize = false; + + for (int i = 0; format[i] != '\0' && i < 4; i++) { + switch(format[i]) { case 'C': - if (decorations.close && frame.close_button != None) { - if (! hasclose && (decorations & Decor_Close)) { ++ if (decorations.close) { ++ if (frame.close_button == None) ++ createCloseButton(); + XMoveResizeWindow(display, frame.close_button, bx, by, + frame.button_w, frame.button_h); + XMapWindow(display, frame.close_button); + XClearWindow(display, frame.close_button); + bx += frame.button_w + bw; hasclose = true; - } else if (frame.close_button) - XUnmapWindow(display, frame.close_button); - parsed += *it; + } break; case 'I': - if (decorations.iconify && frame.iconify_button != None) { - if (! hasiconify && (decorations & Decor_Iconify)) { ++ if (decorations.iconify) { ++ if (frame.iconify_button == None) ++ createIconifyButton(); + XMoveResizeWindow(display, frame.iconify_button, bx, by, + frame.button_w, frame.button_h); + XMapWindow(display, frame.iconify_button); + XClearWindow(display, frame.iconify_button); + bx += frame.button_w + bw; hasiconify = true; - } else if (frame.close_button) - XUnmapWindow(display, frame.close_button); - parsed += *it; + } break; case 'M': - if (decorations.maximize && frame.maximize_button != None) { - if (! hasmaximize && (decorations & Decor_Maximize)) { ++ if (decorations.maximize) { ++ if (frame.maximize_button == None) ++ createMaximizeButton(); + XMoveResizeWindow(display, frame.maximize_button, bx, by, + frame.button_w, frame.button_h); + XMapWindow(display, frame.maximize_button); + XClearWindow(display, frame.maximize_button); + bx += frame.button_w + bw; hasmaximize = true; - } else if (frame.close_button) - XUnmapWindow(display, frame.close_button); - parsed += *it; - } - break; - case 'L': - if (! haslabel) { - haslabel = true; - parsed += *it; + } - } - } - if (! hasclose && frame.close_button) - destroyCloseButton(); - if (! hasiconify && frame.iconify_button) - destroyIconifyButton(); - if (! hasmaximize && frame.maximize_button) - destroyMaximizeButton(); - if (! haslabel) - parsed += 'L'; // require that the label be in the layout - - const unsigned int bsep = frame.bevel_w + 1; // separation between elements - const unsigned int by = frame.bevel_w + 1; - const unsigned int ty = frame.bevel_w; - - frame.label_w = frame.inside_w - bsep * 2 - - (frame.button_w + bsep) * (parsed.size() - 1); - - unsigned int x = bsep; - for (it = parsed.begin(), end = parsed.end(); it != end; ++it) { - switch(*it) { - case 'C': - if (!frame.close_button) createCloseButton(); - XMoveResizeWindow(blackbox->getXDisplay(), frame.close_button, x, by, - frame.button_w, frame.button_w); - x += frame.button_w + bsep; - break; - case 'I': - if (!frame.iconify_button) createIconifyButton(); - XMoveResizeWindow(blackbox->getXDisplay(), frame.iconify_button, x, by, - frame.button_w, frame.button_w); - x += frame.button_w + bsep; - break; - case 'M': - if (!frame.maximize_button) createMaximizeButton(); - XMoveResizeWindow(blackbox->getXDisplay(), frame.maximize_button, x, by, - frame.button_w, frame.button_w); - x += frame.button_w + bsep; break; case 'L': - XMoveResizeWindow(blackbox->getXDisplay(), frame.label, x, ty, + XMoveResizeWindow(display, frame.label, bx, by - 1, frame.label_w, frame.label_h); - x += frame.label_w + bsep; + bx += frame.label_w + bw; break; } } - if (!hasclose) { - openbox->removeWindowSearch(frame.close_button); - XDestroyWindow(display, frame.close_button); - if (redecorate_label) decorateLabel(); ++ if (!hasclose && frame.close_button) { ++ openbox.removeWindowSearch(frame.close_button); ++ XDestroyWindow(display, frame.close_button); ++ frame.close_button = None; + } - if (!hasiconify) { - openbox->removeWindowSearch(frame.iconify_button); - XDestroyWindow(display, frame.iconify_button); ++ if (!hasiconify && frame.iconify_button) { ++ openbox.removeWindowSearch(frame.iconify_button); ++ XDestroyWindow(display, frame.iconify_button); ++ frame.iconify_button = None; + } - if (!hasmaximize) { - openbox->removeWindowSearch(frame.maximize_button); - XDestroyWindow(display, frame.maximize_button); ++ if (!hasmaximize && frame.iconify_button) { ++ openbox.removeWindowSearch(frame.maximize_button); ++ XDestroyWindow(display, frame.maximize_button); ++ frame.maximize_button = None; + } - if (redecorate_label) - decorateLabel(); ++ redrawLabel(); redrawAllButtons(); } @@@ -843,21 -744,16 +844,24 @@@ void OpenboxWindow::reconfigure(void) positionWindows(); decorate(); - XClearWindow(blackbox->getXDisplay(), frame.window); + XClearWindow(display, frame.window); setFocusFlag(flags.focused); - configure(frame.rect.x(), frame.rect.y(), - frame.rect.width(), frame.rect.height()); + configure(frame.x, frame.y, frame.width, frame.height); + - if (! screen->isSloppyFocus()) - openbox->grabButton(Button1, 0, frame.plate, True, ButtonPressMask, ++ if (! screen->sloppyFocus()) ++ openbox.grabButton(Button1, 0, frame.plate, True, ButtonPressMask, + GrabModeSync, GrabModeSync, None, None); + else - openbox->ungrabButton(Button1, 0, frame.plate); ++ openbox.ungrabButton(Button1, 0, frame.plate); if (windowmenu) { - windowmenu->move(windowmenu->getX(), frame.rect.y() + frame.title_h); + windowmenu->move(windowmenu->getX(), frame.y + frame.title_h); windowmenu->reconfigure(); } ++ ++ // re-get the timeout delay ++ timer->setTimeout(openbox.getAutoRaiseDelay()); } @@@ -998,14 -866,16 +1002,14 @@@ void OpenboxWindow::getWMProtocols(void Atom *proto; int num_return = 0; - if (XGetWMProtocols(blackbox->getXDisplay(), client.window, - &proto, &num_return)) { + if (XGetWMProtocols(display, client.window, &proto, &num_return)) { for (int i = 0; i < num_return; ++i) { - if (proto[i] == openbox->getWMDeleteAtom()) - if (proto[i] == blackbox->getWMDeleteAtom()) { - decorations |= Decor_Close; - functions |= Func_Close; - } else if (proto[i] == blackbox->getWMTakeFocusAtom()) ++ if (proto[i] == openbox.getWMDeleteAtom()) + functions.close = decorations.close = True; - else if (proto[i] == openbox->getWMTakeFocusAtom()) ++ else if (proto[i] == openbox.getWMTakeFocusAtom()) flags.send_focus_message = True; - else if (proto[i] == openbox->getOpenboxStructureMessagesAtom()) - else if (proto[i] == blackbox->getBlackboxStructureMessagesAtom()) -- screen->addNetizen(new Netizen(screen, client.window)); ++ else if (proto[i] == openbox.getOpenboxStructureMessagesAtom()) ++ screen->addNetizen(new Netizen(*screen, client.window)); } XFree(proto); @@@ -1046,17 -917,18 +1050,17 @@@ void OpenboxWindow::getWMHints(void) if (wmhint->flags & StateHint) client.initial_state = wmhint->initial_state; + else + client.initial_state = NormalState; if (wmhint->flags & WindowGroupHint) { - client.window_group = wmhint->window_group; - - // add window to the appropriate group - BWindowGroup *group = blackbox->searchGroup(client.window_group); - if (! group) // no group found, create it! - group = new BWindowGroup(blackbox, client.window_group); - group->addWindow(this); + if (! client.window_group) { + client.window_group = wmhint->window_group; - openbox->saveGroupSearch(client.window_group, this); ++ openbox.saveGroupSearch(client.window_group, this); + } + } else { + client.window_group = None; } - - client.wm_hint_flags = wmhint->flags; XFree(wmhint); } @@@ -1070,10 -942,18 +1074,10 @@@ void OpenboxWindow::getWMNormalHints(vo XSizeHints sizehint; client.min_width = client.min_height = + client.base_width = client.base_height = client.width_inc = client.height_inc = 1; - client.max_width = screen->getWidth(); - client.max_height = screen->getHeight(); - client.base_width = client.base_height = 0; - - /* - use the full screen, not the strut modified size. otherwise when the - availableArea changes max_width/height will be incorrect and lead to odd - rendering bugs. - */ - const Rect& screen_area = screen->getRect(); - client.max_width = screen_area.width(); - - client.max_height = screen_area.height(); ++ client.max_width = screen->size().w(); ++ client.max_height = screen->size().h(); client.min_aspect_x = client.min_aspect_y = client.max_aspect_x = client.max_aspect_y = 1; client.win_gravity = NorthWestGravity; @@@ -1126,39 -1007,35 +1130,39 @@@ void OpenboxWindow::getMWMHints(void) int format; Atom atom_return; unsigned long num, len; - MwmHints *mwm_hint = 0; - int ret = XGetWindowProperty(blackbox->getXDisplay(), client.window, - blackbox->getMotifWMHintsAtom(), 0, - PropMwmHintsElements, False, - blackbox->getMotifWMHintsAtom(), &atom_return, - &format, &num, &len, - (unsigned char **) &mwm_hint); + int ret = XGetWindowProperty(display, client.window, - openbox->getMotifWMHintsAtom(), 0, ++ openbox.getMotifWMHintsAtom(), 0, + PropMwmHintsElements, False, - openbox->getMotifWMHintsAtom(), &atom_return, ++ openbox.getMotifWMHintsAtom(), &atom_return, + &format, &num, &len, + (unsigned char **) &client.mwm_hint); - if (ret != Success || ! mwm_hint || num != PropMwmHintsElements) + if (ret != Success || !client.mwm_hint || num != PropMwmHintsElements) return; - if (mwm_hint->flags & MwmHintsDecorations) { - if (mwm_hint->decorations & MwmDecorAll) { - decorations = Decor_Titlebar | Decor_Handle | Decor_Border | - Decor_Iconify | Decor_Maximize | Decor_Close; + if (client.mwm_hint->flags & MwmHintsDecorations) { + if (client.mwm_hint->decorations & MwmDecorAll) { + decorations.titlebar = decorations.handle = decorations.border = + decorations.iconify = decorations.maximize = + decorations.close = decorations.menu = True; } else { - decorations = 0; - - if (mwm_hint->decorations & MwmDecorBorder) - decorations |= Decor_Border; - if (mwm_hint->decorations & MwmDecorHandle) - decorations |= Decor_Handle; - if (mwm_hint->decorations & MwmDecorTitle) - decorations |= Decor_Titlebar; - if (mwm_hint->decorations & MwmDecorIconify) - decorations |= Decor_Iconify; - if (mwm_hint->decorations & MwmDecorMaximize) - decorations |= Decor_Maximize; + decorations.titlebar = decorations.handle = decorations.border = + decorations.iconify = decorations.maximize = + decorations.close = decorations.menu = False; + + if (client.mwm_hint->decorations & MwmDecorBorder) + decorations.border = True; + if (client.mwm_hint->decorations & MwmDecorHandle) + decorations.handle = True; + if (client.mwm_hint->decorations & MwmDecorTitle) + decorations.titlebar = True; + if (client.mwm_hint->decorations & MwmDecorMenu) + decorations.menu = True; + if (client.mwm_hint->decorations & MwmDecorIconify) + decorations.iconify = True; + if (client.mwm_hint->decorations & MwmDecorMaximize) + decorations.maximize = True; } } @@@ -1196,47 -1073,46 +1200,47 @@@ void OpenboxWindow::getOpenboxHints(voi int format; Atom atom_return; unsigned long num, len; - BlackboxHints *blackbox_hint = 0; - - int ret = XGetWindowProperty(blackbox->getXDisplay(), client.window, - blackbox->getBlackboxHintsAtom(), 0, - PropBlackboxHintsElements, False, - blackbox->getBlackboxHintsAtom(), &atom_return, - &format, &num, &len, - (unsigned char **) &blackbox_hint); - if (ret != Success || ! blackbox_hint || num != PropBlackboxHintsElements) - return False; - if (blackbox_hint->flags & AttribShaded) - flags.shaded = (blackbox_hint->attrib & AttribShaded); + int ret = XGetWindowProperty(display, client.window, - openbox->getOpenboxHintsAtom(), 0, ++ openbox.getOpenboxHintsAtom(), 0, + PropOpenboxHintsElements, False, - openbox->getOpenboxHintsAtom(), &atom_return, ++ openbox.getOpenboxHintsAtom(), &atom_return, + &format, &num, &len, + (unsigned char **) &client.openbox_hint); + if (ret != Success || !client.openbox_hint || + num != PropOpenboxHintsElements) + return; + + if (client.openbox_hint->flags & AttribShaded) + flags.shaded = (client.openbox_hint->attrib & AttribShaded); - if ((blackbox_hint->flags & AttribMaxHoriz) && - (blackbox_hint->flags & AttribMaxVert)) - flags.maximized = (blackbox_hint->attrib & - (AttribMaxHoriz | AttribMaxVert)) ? 1 : 0; - else if (blackbox_hint->flags & AttribMaxVert) - flags.maximized = (blackbox_hint->attrib & AttribMaxVert) ? 2 : 0; - else if (blackbox_hint->flags & AttribMaxHoriz) - flags.maximized = (blackbox_hint->attrib & AttribMaxHoriz) ? 3 : 0; + if ((client.openbox_hint->flags & AttribMaxHoriz) && + (client.openbox_hint->flags & AttribMaxVert)) + flags.maximized = (client.openbox_hint->attrib & + (AttribMaxHoriz | AttribMaxVert)) ? 1 : 0; + else if (client.openbox_hint->flags & AttribMaxVert) + flags.maximized = (client.openbox_hint->attrib & AttribMaxVert) ? 2 : 0; + else if (client.openbox_hint->flags & AttribMaxHoriz) + flags.maximized = (client.openbox_hint->attrib & AttribMaxHoriz) ? 3 : 0; - if (blackbox_hint->flags & AttribOmnipresent) - flags.stuck = (blackbox_hint->attrib & AttribOmnipresent); + if (client.openbox_hint->flags & AttribOmnipresent) + flags.stuck = (client.openbox_hint->attrib & AttribOmnipresent); - if (blackbox_hint->flags & AttribWorkspace) - blackbox_attrib.workspace = blackbox_hint->workspace; + if (client.openbox_hint->flags & AttribWorkspace) + workspace_number = client.openbox_hint->workspace; - // if (blackbox_hint->flags & AttribStack) - // don't yet have always on top/bottom for blackbox yet... working + // if (client.openbox_hint->flags & AttribStack) + // don't yet have always on top/bottom for openbox yet... working // on that - if (blackbox_hint->flags & AttribDecoration) { - switch (blackbox_hint->decoration) { + if (client.openbox_hint->flags & AttribDecoration) { + switch (client.openbox_hint->decoration) { case DecorNone: - // clear all decorations except close - decorations &= Decor_Close; - // clear all functions except close - functions &= Func_Close; + decorations.titlebar = decorations.border = decorations.handle = + decorations.iconify = decorations.maximize = + decorations.menu = False; + functions.resize = functions.move = functions.iconify = + functions.maximize = False; break; @@@ -1272,77 -1146,121 +1276,76 @@@ } -void BlackboxWindow::getTransientInfo(void) { - if (client.transient_for && - client.transient_for != (BlackboxWindow *) ~0ul) { - // the transient for hint was removed, so we need to tell our - // previous transient_for that we are going away - client.transient_for->client.transientList.remove(this); - } +void OpenboxWindow::configure(int dx, int dy, + unsigned int dw, unsigned int dh) { + Bool send_event = (frame.x != dx || frame.y != dy); - // we have no transient_for until we find a new one - client.transient_for = 0; + if ((dw != frame.width) || (dh != frame.height)) { + if ((((signed) frame.width) + dx) < 0) dx = 0; + if ((((signed) frame.height) + dy) < 0) dy = 0; - Window trans_for; - if (! XGetTransientForHint(blackbox->getXDisplay(), client.window, - &trans_for)) { - // transient_for hint not set - return; - } + frame.x = dx; + frame.y = dy; + frame.width = dw; + frame.height = dh; - if (trans_for == client.window) { - // wierd client... treat this window as a normal window - return; - } + downsize(); - if (trans_for == None || trans_for == screen->getRootWindow()) { - // this is an undocumented interpretation of the ICCCM. a transient - // associated with None/Root/itself is assumed to be a modal root - // transient. we don't support the concept of a global transient, - // so we just associate this transient with nothing, and perhaps - // we will add support later for global modality. - client.transient_for = (BlackboxWindow *) ~0ul; - flags.modal = True; - return; - } +#ifdef SHAPE - if (openbox->hasShapeExtensions() && flags.shaped) { ++ if (openbox.hasShapeExtensions() && flags.shaped) { + XShapeCombineShape(display, frame.window, ShapeBounding, + frame.mwm_border_w, frame.y_border + + frame.mwm_border_w, client.window, + ShapeBounding, ShapeSet); + + int num = 1; + XRectangle xrect[2]; + xrect[0].x = xrect[0].y = 0; + xrect[0].width = frame.width; + xrect[0].height = frame.y_border; + + if (decorations.handle) { + xrect[1].x = 0; + xrect[1].y = frame.y_handle; + xrect[1].width = frame.width; + xrect[1].height = frame.handle_h + frame.border_w; + num++; + } - client.transient_for = blackbox->searchWindow(trans_for); - if (! client.transient_for && - client.window_group && trans_for == client.window_group) { - // no direct transient_for, perhaps this is a group transient? - BWindowGroup *group = blackbox->searchGroup(client.window_group); - if (group) client.transient_for = group->find(screen); - } + XShapeCombineRectangles(display, frame.window, ShapeBounding, 0, 0, + xrect, num, ShapeUnion, Unsorted); + } +#endif // SHAPE - if (! client.transient_for || client.transient_for == this) { - // no transient_for found, or we have a wierd client that wants to be - // a transient for itself, so we treat this window as a normal window - client.transient_for = (BlackboxWindow*) 0; - return; - } + XMoveWindow(display, frame.window, frame.x, frame.y); - // register ourselves with our new transient_for - client.transient_for->client.transientList.push_back(this); - flags.stuck = client.transient_for->flags.stuck; -} ++ setFocusFlag(flags.focused); + positionWindows(); + decorate(); - setFocusFlag(flags.focused); - redrawAllButtons(); + } else { + frame.x = dx; + frame.y = dy; + XMoveWindow(display, frame.window, frame.x, frame.y); -BlackboxWindow *BlackboxWindow::getTransientFor(void) const { - if (client.transient_for && - client.transient_for != (BlackboxWindow*) ~0ul) - return client.transient_for; - return 0; -} + if (! flags.moving) send_event = True; + } + if (send_event && ! flags.moving) { + client.x = dx + frame.mwm_border_w + frame.border_w; + client.y = dy + frame.y_border + frame.mwm_border_w + + frame.border_w; -void BlackboxWindow::configure(int dx, int dy, - unsigned int dw, unsigned int dh) { - bool send_event = (frame.rect.x() != dx || frame.rect.y() != dy); + XEvent event; + event.type = ConfigureNotify; - if ((dw != frame.rect.width()) || (dh != frame.rect.height())) { - frame.rect.setRect(dx, dy, dw, dh); - frame.inside_w = frame.rect.width() - (frame.border_w * 2); - frame.inside_h = frame.rect.height() - (frame.border_w * 2); - - if (frame.rect.right() <= 0 || frame.rect.bottom() <= 0) - frame.rect.setPos(0, 0); - - client.rect.setCoords(frame.rect.left() + frame.margin.left, - frame.rect.top() + frame.margin.top, - frame.rect.right() - frame.margin.right, - frame.rect.bottom() - frame.margin.bottom); - -#ifdef SHAPE - if (blackbox->hasShapeExtensions() && flags.shaped) { - configureShape(); - } -#endif // SHAPE - - positionWindows(); - decorate(); - setFocusFlag(flags.focused); - redrawAllButtons(); - } else { - frame.rect.setPos(dx, dy); - - XMoveWindow(blackbox->getXDisplay(), frame.window, - frame.rect.x(), frame.rect.y()); - - if (! flags.moving) send_event = True; - } - - if (send_event && ! flags.moving) { - client.rect.setPos(frame.rect.left() + frame.margin.left, - frame.rect.top() + frame.margin.top); - - XEvent event; - event.type = ConfigureNotify; - - event.xconfigure.display = blackbox->getXDisplay(); + event.xconfigure.display = display; event.xconfigure.event = client.window; event.xconfigure.window = client.window; - event.xconfigure.x = client.rect.x(); - event.xconfigure.y = client.rect.y(); - event.xconfigure.width = client.rect.width(); - event.xconfigure.height = client.rect.height(); + event.xconfigure.x = client.x; + event.xconfigure.y = client.y; + event.xconfigure.width = client.width; + event.xconfigure.height = client.height; event.xconfigure.border_width = client.old_bw; event.xconfigure.above = frame.window; event.xconfigure.override_redirect = False; @@@ -1354,75 -1273,94 +1357,75 @@@ } - Bool OpenboxWindow::setInputFocus(void) { -#ifdef SHAPE -void BlackboxWindow::configureShape(void) { - XShapeCombineShape(blackbox->getXDisplay(), frame.window, ShapeBounding, - frame.margin.left - frame.border_w, - frame.margin.top - frame.border_w, - client.window, ShapeBounding, ShapeSet); - - int num = 0; - XRectangle xrect[2]; - - if (decorations & Decor_Titlebar) { - xrect[0].x = xrect[0].y = -frame.border_w; - xrect[0].width = frame.rect.width(); - xrect[0].height = frame.title_h + (frame.border_w * 2); - ++num; - } - - if (decorations & Decor_Handle) { - xrect[1].x = -frame.border_w; - xrect[1].y = frame.rect.height() - frame.margin.bottom + - frame.mwm_border_w - frame.border_w; - xrect[1].width = frame.rect.width(); - xrect[1].height = frame.handle_h + (frame.border_w * 2); - ++num; - } - - XShapeCombineRectangles(blackbox->getXDisplay(), frame.window, - ShapeBounding, 0, 0, xrect, num, - ShapeUnion, Unsorted); -} -#endif // SHAPE - - -bool BlackboxWindow::setInputFocus(void) { - if (flags.focused) return True; ++bool OpenboxWindow::setInputFocus(void) { + if (((signed) (frame.x + frame.width)) < 0) { + if (((signed) (frame.y + frame.y_border)) < 0) + configure(frame.border_w, frame.border_w, frame.width, frame.height); - else if (frame.y > (signed) screen->getHeight()) - configure(frame.border_w, screen->getHeight() - frame.height, ++ else if (frame.y > (signed) screen->size().h()) ++ configure(frame.border_w, screen->size().h() - frame.height, + frame.width, frame.height); + else + configure(frame.border_w, frame.y + frame.border_w, + frame.width, frame.height); - } else if (frame.x > (signed) screen->getWidth()) { ++ } else if (frame.x > (signed) screen->size().w()) { + if (((signed) (frame.y + frame.y_border)) < 0) - configure(screen->getWidth() - frame.width, frame.border_w, ++ configure(screen->size().w() - frame.width, frame.border_w, + frame.width, frame.height); - else if (frame.y > (signed) screen->getHeight()) - configure(screen->getWidth() - frame.width, - screen->getHeight() - frame.height, frame.width, frame.height); ++ else if (frame.y > (signed) screen->size().h()) ++ configure(screen->size().w() - frame.width, ++ screen->size().h() - frame.height, frame.width, frame.height); + else - configure(screen->getWidth() - frame.width, ++ configure(screen->size().w() - frame.width, + frame.y + frame.border_w, frame.width, frame.height); + } + - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) return False; + - Bool ret = False; ++ bool ret = false; + + if (client.transient && flags.modal) { + ret = client.transient->setInputFocus(); + } else if (! flags.focused) { - if (focus_mode == F_LocallyActive || focus_mode == F_Passive) ++ if (focus_mode == F_LocallyActive || focus_mode == F_Passive) { + XSetInputFocus(display, client.window, - RevertToPointerRoot, CurrentTime); - else - XSetInputFocus(display, screen->getRootWindow(), - RevertToNone, CurrentTime); - - openbox->setFocusedWindow(this); - - if (flags.send_focus_message) { - XEvent ce; - ce.xclient.type = ClientMessage; - ce.xclient.message_type = openbox->getWMProtocolsAtom(); - ce.xclient.display = display; - ce.xclient.window = client.window; - ce.xclient.format = 32; - ce.xclient.data.l[0] = openbox->getWMTakeFocusAtom(); - ce.xclient.data.l[1] = openbox->getLastTime(); - ce.xclient.data.l[2] = 0l; - ce.xclient.data.l[3] = 0l; - ce.xclient.data.l[4] = 0l; - XSendEvent(display, client.window, False, NoEventMask, &ce); - } ++ RevertToPointerRoot, CurrentTime); ++ openbox.focusWindow(this); ++ ++ if (flags.send_focus_message) { ++ XEvent ce; ++ ce.xclient.type = ClientMessage; ++ ce.xclient.message_type = openbox.getWMProtocolsAtom(); ++ ce.xclient.display = display; ++ ce.xclient.window = client.window; ++ ce.xclient.format = 32; ++ ce.xclient.data.l[0] = openbox.getWMTakeFocusAtom(); ++ ce.xclient.data.l[1] = openbox.getLastTime(); ++ ce.xclient.data.l[2] = 0l; ++ ce.xclient.data.l[3] = 0l; ++ ce.xclient.data.l[4] = 0l; ++ XSendEvent(display, client.window, False, NoEventMask, &ce); ++ } - if (screen->isSloppyFocus() && screen->doAutoRaise()) - timer->start(); - if (! client.rect.intersects(screen->getRect())) { - // client is outside the screen, move it to the center - configure((screen->getWidth() - frame.rect.width()) / 2, - (screen->getHeight() - frame.rect.height()) / 2, - frame.rect.width(), frame.rect.height()); - } ++ if (screen->sloppyFocus() && screen->autoRaise()) ++ timer->start(); - ret = True; - if (client.transientList.size() > 0) { - // transfer focus to any modal transients - BlackboxWindowList::iterator it, end = client.transientList.end(); - for (it = client.transientList.begin(); it != end; ++it) { - if ((*it)->flags.modal) return (*it)->setInputFocus(); ++ ret = true; + } } - openbox->ungrab(); - bool ret = True; - if (focus_mode == F_LocallyActive || focus_mode == F_Passive) { - XSetInputFocus(blackbox->getXDisplay(), client.window, - RevertToPointerRoot, CurrentTime); - - blackbox->setFocusedWindow(this); - } else { - /* we could set the focus to none, since the window doesn't accept focus, - * but we shouldn't set focus to nothing since this would surely make - * someone angry - */ - ret = False; - } - - if (flags.send_focus_message) { - XEvent ce; - ce.xclient.type = ClientMessage; - ce.xclient.message_type = blackbox->getWMProtocolsAtom(); - ce.xclient.display = blackbox->getXDisplay(); - ce.xclient.window = client.window; - ce.xclient.format = 32; - ce.xclient.data.l[0] = blackbox->getWMTakeFocusAtom(); - ce.xclient.data.l[1] = blackbox->getLastTime(); - ce.xclient.data.l[2] = 0l; - ce.xclient.data.l[3] = 0l; - ce.xclient.data.l[4] = 0l; - XSendEvent(blackbox->getXDisplay(), client.window, False, - NoEventMask, &ce); - } ++ openbox.ungrab(); return ret; } -void BlackboxWindow::iconify(void) { +void OpenboxWindow::iconify(void) { if (flags.iconic) return; ++ if (flags.moving) ++ endMove(); ++ if (windowmenu) windowmenu->hide(); setState(IconicState); @@@ -1450,23 -1405,12 +1453,35 @@@ } - void OpenboxWindow::deiconify(Bool reassoc, Bool raise) { -void BlackboxWindow::show(void) { ++void OpenboxWindow::deiconify(bool reassoc, bool raise, bool initial) { + if (flags.iconic || reassoc) + screen->reassociateWindow(this, -1, False); + else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID()) + return; + setState(NormalState); - XMapWindow(blackbox->getXDisplay(), client.window); - XMapSubwindows(blackbox->getXDisplay(), frame.window); - XMapWindow(blackbox->getXDisplay(), frame.window); + XSelectInput(display, client.window, NoEventMask); + XMapWindow(display, client.window); + XSelectInput(display, client.window, + PropertyChangeMask | StructureNotifyMask | FocusChangeMask); + + XMapSubwindows(display, frame.window); + XMapWindow(display, frame.window); + - if (flags.iconic && screen->doFocusNew()) setInputFocus(); ++ // if we're using the click to place placement type, then immediately ++ // after the window is mapped, we need to start interactively moving it ++ if (initial && place_window && ++ screen->placementPolicy() == BScreen::ClickMousePlacement) { ++ int x, y, rx, ry; ++ Window c, r; ++ unsigned int m; ++ XQueryPointer(openbox.getXDisplay(), screen->getRootWindow(), ++ &r, &c, &rx, &ry, &x, &y, &m); ++ startMove(rx, ry); ++ } ++ ++ if (flags.iconic && screen->focusNew()) setInputFocus(); flags.visible = True; flags.iconic = False; @@@ -1478,14 -1438,14 +1493,14 @@@ } -void BlackboxWindow::close(void) { +void OpenboxWindow::close(void) { XEvent ce; ce.xclient.type = ClientMessage; - ce.xclient.message_type = openbox->getWMProtocolsAtom(); - ce.xclient.message_type = blackbox->getWMProtocolsAtom(); - ce.xclient.display = blackbox->getXDisplay(); ++ ce.xclient.message_type = openbox.getWMProtocolsAtom(); + ce.xclient.display = display; ce.xclient.window = client.window; ce.xclient.format = 32; - ce.xclient.data.l[0] = openbox->getWMDeleteAtom(); - ce.xclient.data.l[0] = blackbox->getWMDeleteAtom(); ++ ce.xclient.data.l[0] = openbox.getWMDeleteAtom(); ce.xclient.data.l[1] = CurrentTime; ce.xclient.data.l[2] = 0l; ce.xclient.data.l[3] = 0l; @@@ -1494,7 -1454,9 +1509,10 @@@ } -void BlackboxWindow::withdraw(void) { - setState(current_state); +void OpenboxWindow::withdraw(void) { ++ if (flags.moving) ++ endMove(); + flags.visible = False; flags.iconic = False; @@@ -1509,86 -1473,43 +1527,69 @@@ } -void BlackboxWindow::maximize(unsigned int button) { +void OpenboxWindow::maximize(unsigned int button) { ++ if (flags.moving) ++ endMove(); ++ // handle case where menu is open then the max button is used instead if (windowmenu && windowmenu->isVisible()) windowmenu->hide(); if (flags.maximized) { flags.maximized = 0; - blackbox_attrib.flags &= ! (AttribMaxHoriz | AttribMaxVert); - blackbox_attrib.attrib &= ! (AttribMaxHoriz | AttribMaxVert); + openbox_attrib.flags &= ! (AttribMaxHoriz | AttribMaxVert); + openbox_attrib.attrib &= ! (AttribMaxHoriz | AttribMaxVert); - /* - when a resize is begun, maximize(0) is called to clear any maximization - flags currently set. Otherwise it still thinks it is maximized. - so we do not need to call configure() because resizing will handle it - */ - if (! flags.resizing) - configure(blackbox_attrib.premax_x, blackbox_attrib.premax_y, - blackbox_attrib.premax_w, blackbox_attrib.premax_h); + // when a resize is begun, maximize(0) is called to clear any maximization + // flags currently set. Otherwise it still thinks it is maximized. + // so we do not need to call configure() because resizing will handle it + if (!flags.resizing) + configure(openbox_attrib.premax_x, openbox_attrib.premax_y, + openbox_attrib.premax_w, openbox_attrib.premax_h); - blackbox_attrib.premax_x = blackbox_attrib.premax_y = 0; - blackbox_attrib.premax_w = blackbox_attrib.premax_h = 0; + openbox_attrib.premax_x = openbox_attrib.premax_y = 0; + openbox_attrib.premax_w = openbox_attrib.premax_h = 0; -- redrawAllButtons(); ++ redrawMaximizeButton(flags.maximized); setState(current_state); return; } - int dx = 0, dy = 0; - unsigned int dw, dh; - - blackbox_attrib.premax_x = frame.rect.x(); - blackbox_attrib.premax_y = frame.rect.y(); - blackbox_attrib.premax_w = frame.rect.width(); - // use client.rect so that clients can be restored even if shaded - blackbox_attrib.premax_h = - client.rect.height() + frame.margin.top + frame.margin.bottom; + openbox_attrib.premax_x = frame.x; + openbox_attrib.premax_y = frame.y; + openbox_attrib.premax_w = frame.width; + openbox_attrib.premax_h = frame.height; + - dw = screen->getWidth(); ++ Rect space = screen->availableArea(); ++ unsigned int dw = space.w(), ++ dh = space.h(); + dw -= frame.border_w * 2; + dw -= frame.mwm_border_w * 2; + dw -= client.base_width; + - dh = screen->getHeight(); + dh -= frame.border_w * 2; + dh -= frame.mwm_border_w * 2; + dh -= ((frame.handle_h + frame.border_w) * decorations.handle); + dh -= client.base_height; + dh -= frame.y_border; + - if (! screen->doFullMax()) - dh -= screen->getToolbar()->getExposedHeight() + frame.border_w; - + if (dw < client.min_width) dw = client.min_width; + if (dh < client.min_height) dh = client.min_height; + if (dw > client.max_width) dw = client.max_width; + if (dh > client.max_height) dh = client.max_height; - const Rect &screen_area = screen->availableArea(); - frame.changing = screen_area; - constrain(TopLeft); + dw -= (dw % client.width_inc); + dw += client.base_width; + dw += frame.mwm_border_w * 2; + + dh -= (dh % client.height_inc); + dh += client.base_height; + dh += frame.y_border; + dh += ((frame.handle_h + frame.border_w) * decorations.handle); + dh += frame.mwm_border_w * 2; + - dx += ((screen->getWidth() - dw) / 2) - frame.border_w; - - if (screen->doFullMax()) { - dy += ((screen->getHeight() - dh) / 2) - frame.border_w; - } else { - dy += (((screen->getHeight() - screen->getToolbar()->getExposedHeight()) - - dh) / 2) - frame.border_w; - - switch (screen->getToolbarPlacement()) { - case Toolbar::TopLeft: - case Toolbar::TopCenter: - case Toolbar::TopRight: - dy += screen->getToolbar()->getExposedHeight() + - frame.border_w; - break; - } - } ++ int dx = space.x() + ((space.w() - dw) / 2) - frame.border_w, ++ dy = space.y() + ((space.h() - dh) / 2) - frame.border_w; switch(button) { case 1: @@@ -1621,18 -1542,32 +1622,19 @@@ flags.maximized = button; - configure(frame.changing.x(), frame.changing.y(), - frame.changing.width(), frame.changing.height()); - if (flags.focused) - screen->getWorkspace(blackbox_attrib.workspace)->raiseWindow(this); - redrawAllButtons(); + configure(dx, dy, dw, dh); + screen->getWorkspace(workspace_number)->raiseWindow(this); - redrawAllButtons(); ++ redrawMaximizeButton(flags.maximized); setState(current_state); } -// re-maximizes the window to take into account availableArea changes -void BlackboxWindow::remaximize(void) { - // save the original dimensions because maximize will wipe them out - int premax_x = blackbox_attrib.premax_x, - premax_y = blackbox_attrib.premax_y, - premax_w = blackbox_attrib.premax_w, - premax_h = blackbox_attrib.premax_h; +void OpenboxWindow::setWorkspace(int n) { ++ ASSERT(n < screen->getWorkspaceCount()); + workspace_number = n; - unsigned int button = flags.maximized; - flags.maximized = 0; // trick maximize() into working - maximize(button); - - // restore saved values - blackbox_attrib.premax_x = premax_x; - blackbox_attrib.premax_y = premax_y; - blackbox_attrib.premax_w = premax_w; - blackbox_attrib.premax_h = premax_h; + openbox_attrib.flags |= AttribWorkspace; + openbox_attrib.workspace = workspace_number; } @@@ -1717,86 -1677,92 +1719,89 @@@ void OpenboxWindow::setFocusFlag(Bool f } } else { if (frame.uhandle) - XSetWindowBackgroundPixmap(blackbox->getXDisplay(), - frame.handle, frame.uhandle); + XSetWindowBackgroundPixmap(display, frame.handle, frame.uhandle); else - XSetWindowBackground(blackbox->getXDisplay(), - frame.handle, frame.uhandle_pixel); + XSetWindowBackground(display, frame.handle, frame.uhandle_pixel); if (frame.ugrip) { - XSetWindowBackgroundPixmap(blackbox->getXDisplay(), - frame.left_grip, frame.ugrip); - XSetWindowBackgroundPixmap(blackbox->getXDisplay(), - frame.right_grip, frame.ugrip); + XSetWindowBackgroundPixmap(display, frame.right_grip, frame.ugrip); + XSetWindowBackgroundPixmap(display, frame.left_grip, frame.ugrip); } else { - XSetWindowBackground(blackbox->getXDisplay(), - frame.left_grip, frame.ugrip_pixel); - XSetWindowBackground(blackbox->getXDisplay(), - frame.right_grip, frame.ugrip_pixel); + XSetWindowBackground(display, frame.right_grip, frame.ugrip_pixel); + XSetWindowBackground(display, frame.left_grip, frame.ugrip_pixel); } } - XClearWindow(blackbox->getXDisplay(), frame.handle); - XClearWindow(blackbox->getXDisplay(), frame.left_grip); - XClearWindow(blackbox->getXDisplay(), frame.right_grip); + XClearWindow(display, frame.handle); + XClearWindow(display, frame.right_grip); + XClearWindow(display, frame.left_grip); } - if (decorations & Decor_Border) { + if (decorations.border) { if (flags.focused) - XSetWindowBorder(blackbox->getXDisplay(), - frame.plate, frame.fborder_pixel); + XSetWindowBorder(display, frame.plate, frame.fborder_pixel); else - XSetWindowBorder(blackbox->getXDisplay(), - frame.plate, frame.uborder_pixel); + XSetWindowBorder(display, frame.plate, frame.uborder_pixel); } - if (screen->isSloppyFocus() && screen->doAutoRaise() && timer->isTiming()) - if (screen->isSloppyFocus() && screen->doAutoRaise()) { - if (isFocused()) timer->start(); - else timer->stop(); - } ++ if (screen->sloppyFocus() && screen->autoRaise() && timer->isTiming()) + timer->stop(); + - if (isFocused()) - blackbox->setFocusedWindow(this); } -void BlackboxWindow::installColormap(bool install) { +void OpenboxWindow::installColormap(Bool install) { - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) return; + int i = 0, ncmap = 0; - Colormap *cmaps = XListInstalledColormaps(blackbox->getXDisplay(), - client.window, &ncmap); + Colormap *cmaps = XListInstalledColormaps(display, client.window, &ncmap); XWindowAttributes wattrib; if (cmaps) { - if (XGetWindowAttributes(blackbox->getXDisplay(), - client.window, &wattrib)) { + if (XGetWindowAttributes(display, client.window, &wattrib)) { if (install) { - // install the window's colormap - for (i = 0; i < ncmap; i++) { - if (*(cmaps + i) == wattrib.colormap) - // this window is using an installed color map... do not install - install = False; - } - // otherwise, install the window's colormap - if (install) - XInstallColormap(blackbox->getXDisplay(), wattrib.colormap); + // install the window's colormap + for (i = 0; i < ncmap; i++) { + if (*(cmaps + i) == wattrib.colormap) + // this window is using an installed color map... do not install + install = False; + } + // otherwise, install the window's colormap + if (install) + XInstallColormap(display, wattrib.colormap); } else { - // uninstall the window's colormap - for (i = 0; i < ncmap; i++) { - if (*(cmaps + i) == wattrib.colormap) - // we found the colormap to uninstall - XUninstallColormap(blackbox->getXDisplay(), wattrib.colormap); - } + // uninstall the window's colormap + for (i = 0; i < ncmap; i++) { + if (*(cmaps + i) == wattrib.colormap) + // we found the colormap to uninstall + XUninstallColormap(display, wattrib.colormap); + } } } XFree(cmaps); } + - openbox->ungrab(); ++ openbox.ungrab(); } -void BlackboxWindow::setState(unsigned long new_state) { +void OpenboxWindow::setState(unsigned long new_state) { ++ if (! mapped) return; ++ current_state = new_state; unsigned long state[2]; - state[0] = current_state; - state[1] = None; - xatom->setValue(client.window, XAtom::wm_state, XAtom::wm_state, state, 2); - - xatom->setValue(client.window, XAtom::blackbox_attributes, - XAtom::blackbox_attributes, (unsigned long *)&blackbox_attrib, - PropBlackboxAttributesElements); + state[0] = (unsigned long) current_state; + state[1] = (unsigned long) None; - XChangeProperty(display, client.window, openbox->getWMStateAtom(), - openbox->getWMStateAtom(), 32, PropModeReplace, ++ XChangeProperty(display, client.window, openbox.getWMStateAtom(), ++ openbox.getWMStateAtom(), 32, PropModeReplace, + (unsigned char *) state, 2); + + XChangeProperty(display, client.window, - openbox->getOpenboxAttributesAtom(), - openbox->getOpenboxAttributesAtom(), 32, PropModeReplace, ++ openbox.getOpenboxAttributesAtom(), ++ openbox.getOpenboxAttributesAtom(), 32, PropModeReplace, + (unsigned char *) &openbox_attrib, + PropOpenboxAttributesElements); } @@@ -1804,85 -1770,17 +1809,85 @@@ Bool OpenboxWindow::getState(void) current_state = 0; Atom atom_return; - bool ret = False; - unsigned long *state, nitems; - - if (! xatom->getValue(client.window, XAtom::wm_state, XAtom::wm_state, nitems, - &state)) + Bool ret = False; + int foo; + unsigned long *state, ulfoo, nitems; + - if ((XGetWindowProperty(display, client.window, openbox->getWMStateAtom(), - 0l, 2l, False, openbox->getWMStateAtom(), ++ if ((XGetWindowProperty(display, client.window, openbox.getWMStateAtom(), ++ 0l, 2l, False, openbox.getWMStateAtom(), + &atom_return, &foo, &nitems, &ulfoo, + (unsigned char **) &state) != Success) || + (! state)) { - openbox->ungrab(); ++ openbox.ungrab(); return False; + } + + if (nitems >= 1) { + current_state = (unsigned long) state[0]; + + ret = True; + } - current_state = static_cast(state[0]); - delete state; + XFree((void *) state); - return True; + return ret; +} + + +void OpenboxWindow::setGravityOffsets(void) { + // x coordinates for each gravity type + const int x_west = client.x; + const int x_east = client.x + client.width - frame.width; + const int x_center = client.x + client.width - frame.width/2; + // y coordinates for each gravity type + const int y_north = client.y; + const int y_south = client.y + client.height - frame.height; + const int y_center = client.y + client.height - frame.height/2; + + switch (client.win_gravity) { + case NorthWestGravity: + default: + frame.x = x_west; + frame.y = y_north; + break; + case NorthGravity: + frame.x = x_center; + frame.y = y_north; + break; + case NorthEastGravity: + frame.x = x_east; + frame.y = y_north; + break; + case SouthWestGravity: + frame.x = x_west; + frame.y = y_south; + break; + case SouthGravity: + frame.x = x_center; + frame.y = y_south; + break; + case SouthEastGravity: + frame.x = x_east; + frame.y = y_south; + break; + case WestGravity: + frame.x = x_west; + frame.y = y_center; + break; + case EastGravity: + frame.x = x_east; + frame.y = y_center; + break; + case CenterGravity: + frame.x = x_center; + frame.y = y_center; + break; + case ForgetGravity: + case StaticGravity: + frame.x = client.x - frame.mwm_border_w + frame.border_w; + frame.y = client.y - frame.y_border - frame.mwm_border_w - frame.border_w; + break; + } } @@@ -1893,30 -1791,18 +1898,30 @@@ void OpenboxWindow::restoreAttributes(v int foo; unsigned long ulfoo, nitems; - BlackboxAttributes *net; - int ret = XGetWindowProperty(blackbox->getXDisplay(), client.window, - blackbox->getBlackboxAttributesAtom(), 0l, - PropBlackboxAttributesElements, False, - blackbox->getBlackboxAttributesAtom(), - &atom_return, &foo, &nitems, &ulfoo, - (unsigned char **) &net); - if (ret != Success || ! net || nitems != PropBlackboxAttributesElements) + OpenboxAttributes *net; + int ret = XGetWindowProperty(display, client.window, - openbox->getOpenboxAttributesAtom(), 0l, ++ openbox.getOpenboxAttributesAtom(), 0l, + PropOpenboxAttributesElements, False, - openbox->getOpenboxAttributesAtom(), ++ openbox.getOpenboxAttributesAtom(), + &atom_return, &foo, &nitems, &ulfoo, + (unsigned char **) &net); + if (ret != Success || !net || nitems != PropOpenboxAttributesElements) return; - if (net->flags & AttribShaded && - net->attrib & AttribShaded) { + openbox_attrib.flags = net->flags; + openbox_attrib.attrib = net->attrib; + openbox_attrib.decoration = net->decoration; + openbox_attrib.workspace = net->workspace; + openbox_attrib.stack = net->stack; + openbox_attrib.premax_x = net->premax_x; + openbox_attrib.premax_y = net->premax_y; + openbox_attrib.premax_w = net->premax_w; + openbox_attrib.premax_h = net->premax_h; + + XFree((void *) net); + + if (openbox_attrib.flags & AttribShaded && + openbox_attrib.attrib & AttribShaded) { int save_state = ((current_state == IconicState) ? NormalState : current_state); @@@ -1926,9 -1812,9 +1931,9 @@@ current_state = save_state; } - if ((net->workspace != screen->getCurrentWorkspaceID()) && - (net->workspace < screen->getWorkspaceCount())) { - screen->reassociateWindow(this, net->workspace, True); + if (((int) openbox_attrib.workspace != screen->getCurrentWorkspaceID()) && - ((int) openbox_attrib.workspace < screen->getCount())) { ++ ((int) openbox_attrib.workspace < screen->getWorkspaceCount())) { + screen->reassociateWindow(this, openbox_attrib.workspace, True); if (current_state == NormalState) current_state = WithdrawnState; } else if (current_state == WithdrawnState) { @@@ -2203,166 -2082,111 +2208,170 @@@ void OpenboxWindow::redrawCloseButton(B } -void BlackboxWindow::mapRequestEvent(XMapRequestEvent *re) { - if (re->window != client.window) - return; - +void OpenboxWindow::mapRequestEvent(XMapRequestEvent *re) { + if (re->window == client.window) { #ifdef DEBUG - fprintf(stderr, "BlackboxWindow::mapRequestEvent() for 0x%lx\n", - client.window); + fprintf(stderr, i18n->getMessage(WindowSet, WindowMapRequest, + "OpenboxWindow::mapRequestEvent() for 0x%lx\n"), + client.window); #endif // DEBUG - openbox->grab(); - bool get_state_ret = getState(); - if (! (get_state_ret && blackbox->isStartup())) { - if ((client.wm_hint_flags & StateHint) && - (! (current_state == NormalState || current_state == IconicState))) - current_state = client.initial_state; - else ++ openbox.grab(); + if (! validateClient()) return; + + Bool get_state_ret = getState(); - if (! (get_state_ret && openbox->isStartup())) { ++ if (! (get_state_ret && openbox.isStartup())) { + if ((client.wm_hint_flags & StateHint) && + (! (current_state == NormalState || current_state == IconicState))) + current_state = client.initial_state; + else + current_state = NormalState; + } else if (flags.iconic) { current_state = NormalState; - } else if (flags.iconic) { - current_state = NormalState; - } + } - switch (current_state) { - case IconicState: - iconify(); - break; ++ mapped = true; + - case WithdrawnState: - withdraw(); - break; + switch (current_state) { + case IconicState: + iconify(); + break; - case NormalState: - case InactiveState: - case ZoomState: - default: - show(); - screen->getWorkspace(blackbox_attrib.workspace)->raiseWindow(this); - if (! blackbox->isStartup() && (isTransient() || screen->doFocusNew())) { - XSync(blackbox->getXDisplay(), False); // make sure the frame is mapped.. - setInputFocus(); + case WithdrawnState: + withdraw(); + break; + + case NormalState: + case InactiveState: + case ZoomState: + default: - deiconify(False); ++ deiconify(False, True, True); // specify that we're initializing the ++ // window + break; } - break; + - openbox->ungrab(); ++ openbox.ungrab(); } } -void BlackboxWindow::unmapNotifyEvent(XUnmapEvent *ue) { - if (ue->window != client.window) - return; +void OpenboxWindow::mapNotifyEvent(XMapEvent *ne) { + if ((ne->window == client.window) && (! ne->override_redirect) + && (flags.visible)) { - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) return; - if (decorations.titlebar) positionButtons(); - -#ifdef DEBUG - fprintf(stderr, "BlackboxWindow::unmapNotifyEvent() for 0x%lx\n", - client.window); -#endif // DEBUG + setState(NormalState); - redrawAllButtons(); - - if (flags.transient || screen->doFocusNew()) - screen->unmanageWindow(this, False); -} ++ if (flags.transient || screen->focusNew()) + setInputFocus(); + else + setFocusFlag(False); + flags.visible = True; + flags.iconic = False; + - openbox->ungrab(); ++ openbox.ungrab(); + } +} -void BlackboxWindow::destroyNotifyEvent(XDestroyWindowEvent *de) { - if (de->window != client.window) - return; +void OpenboxWindow::unmapNotifyEvent(XUnmapEvent *ue) { + if (ue->window == client.window) { #ifdef DEBUG - fprintf(stderr, "BlackboxWindow::destroyNotifyEvent() for 0x%lx\n", - client.window); + fprintf(stderr, i18n->getMessage(WindowSet, WindowUnmapNotify, + "OpenboxWindow::unmapNotifyEvent() for 0x%lx\n"), + client.window); #endif // DEBUG - openbox->grab(); - screen->unmanageWindow(this, False); -} ++ openbox.grab(); + if (! validateClient()) return; ++ if (flags.moving) ++ endMove(); ++ + XChangeSaveSet(display, client.window, SetModeDelete); + XSelectInput(display, client.window, NoEventMask); - XDeleteProperty(display, client.window, openbox->getWMStateAtom()); -void BlackboxWindow::reparentNotifyEvent(XReparentEvent *re) { - if (re->window != client.window || re->parent == frame.plate) - return; ++ XDeleteProperty(display, client.window, openbox.getWMStateAtom()); + XDeleteProperty(display, client.window, - openbox->getOpenboxAttributesAtom()); ++ openbox.getOpenboxAttributesAtom()); + + XUnmapWindow(display, frame.window); + XUnmapWindow(display, client.window); + XEvent dummy; + if (! XCheckTypedWindowEvent(display, client.window, ReparentNotify, + &dummy)) { #ifdef DEBUG - fprintf(stderr, "BlackboxWindow::reparentNotifyEvent(): reparent 0x%lx to " - "0x%lx.\n", client.window, re->parent); + fprintf(stderr, i18n->getMessage(WindowSet, WindowUnmapNotifyReparent, + "OpenboxWindow::unmapNotifyEvent(): reparent 0x%lx to " + "root.\n"), client.window); #endif // DEBUG - XEvent ev; - ev.xreparent = *re; - XPutBackEvent(blackbox->getXDisplay(), &ev); - screen->unmanageWindow(this, True); + restoreGravity(); + XReparentWindow(display, client.window, screen->getRootWindow(), + client.x, client.y); + } + + XFlush(display); + - openbox->ungrab(); ++ openbox.ungrab(); + + delete this; + } +} + + +void OpenboxWindow::destroyNotifyEvent(XDestroyWindowEvent *de) { + if (de->window == client.window) { ++ if (flags.moving) ++ endMove(); + XUnmapWindow(display, frame.window); + + delete this; + } } -void BlackboxWindow::propertyNotifyEvent(Atom atom) { +void OpenboxWindow::propertyNotifyEvent(Atom atom) { - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) return; + switch(atom) { case XA_WM_CLASS: case XA_WM_CLIENT_MACHINE: case XA_WM_COMMAND: break; - case XA_WM_TRANSIENT_FOR: { + case XA_WM_TRANSIENT_FOR: // determine if this is a transient window - getTransientInfo(); + Window win; + if (XGetTransientForHint(display, client.window, &win)) { + if (win && (win != client.window)) { - if ((client.transient_for = openbox->searchWindow(win))) { ++ if ((client.transient_for = openbox.searchWindow(win))) { + client.transient_for->client.transient = this; + flags.stuck = client.transient_for->flags.stuck; + flags.transient = True; + } else if (win == client.window_group) { + //jr This doesn't look quite right... - if ((client.transient_for = openbox->searchGroup(win, this))) { ++ if ((client.transient_for = openbox.searchGroup(win, this))) { + client.transient_for->client.transient = this; + flags.stuck = client.transient_for->flags.stuck; + flags.transient = True; + } + } + } - // adjust the window decorations based on transience - if (isTransient()) { - decorations &= ~(Decor_Maximize | Decor_Handle); - functions &= ~Func_Maximize; + if (win == screen->getRootWindow()) flags.modal = True; } + // adjust the window decorations based on transience + if (flags.transient) + decorations.maximize = decorations.handle = functions.maximize = False; + reconfigure(); - } + break; case XA_WM_HINTS: @@@ -2412,20 -2233,21 +2421,23 @@@ } default: - if (atom == openbox->getWMProtocolsAtom()) { - if (atom == blackbox->getWMProtocolsAtom()) { ++ if (atom == openbox.getWMProtocolsAtom()) { getWMProtocols(); - if ((decorations & Decor_Close) && (! frame.close_button)) { + if (decorations.close && (! frame.close_button)) { createCloseButton(); - if (decorations.titlebar) positionButtons(True); - if (decorations & Decor_Titlebar) { - positionButtons(True); - XMapSubwindows(blackbox->getXDisplay(), frame.title); ++ if (decorations.titlebar) { ++ positionButtons(); ++ decorateLabel(); + } if (windowmenu) windowmenu->reconfigure(); } } break; } + - openbox->ungrab(); ++ openbox.ungrab(); } @@@ -2441,191 -2263,134 +2453,189 @@@ void OpenboxWindow::exposeEvent(XExpose } -void BlackboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) { - if (cr->window != client.window || flags.iconic) - return; +void OpenboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) { + if (cr->window == client.window) { - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) return; - int cx = frame.rect.x(), cy = frame.rect.y(); - unsigned int cw = frame.rect.width(), ch = frame.rect.height(); + int cx = frame.x, cy = frame.y; + unsigned int cw = frame.width, ch = frame.height; - if (cr->value_mask & CWBorderWidth) - client.old_bw = cr->border_width; + if (cr->value_mask & CWBorderWidth) + client.old_bw = cr->border_width; - if (cr->value_mask & CWX) - cx = cr->x - frame.margin.left; + if (cr->value_mask & CWX) + cx = cr->x - frame.mwm_border_w - frame.border_w; - if (cr->value_mask & CWY) - cy = cr->y - frame.margin.top; + if (cr->value_mask & CWY) + cy = cr->y - frame.y_border - frame.mwm_border_w - + frame.border_w; - if (cr->value_mask & CWWidth) - cw = cr->width + frame.margin.left + frame.margin.right; + if (cr->value_mask & CWWidth) + cw = cr->width + (frame.mwm_border_w * 2); - if (cr->value_mask & CWHeight) - ch = cr->height + frame.margin.top + frame.margin.bottom; + if (cr->value_mask & CWHeight) + ch = cr->height + frame.y_border + (frame.mwm_border_w * 2) + + (frame.border_w * decorations.handle) + frame.handle_h; - if (frame.rect != Rect(cx, cy, cw, ch)) - configure(cx, cy, cw, ch); + if (frame.x != cx || frame.y != cy || + frame.width != cw || frame.height != ch) + configure(cx, cy, cw, ch); - if (cr->value_mask & CWStackMode) { - switch (cr->detail) { - case Below: - case BottomIf: - screen->getWorkspace(blackbox_attrib.workspace)->lowerWindow(this); - break; + if (cr->value_mask & CWStackMode) { + switch (cr->detail) { + case Above: + case TopIf: + default: + if (flags.iconic) deiconify(); + screen->getWorkspace(workspace_number)->raiseWindow(this); + break; - case Above: - case TopIf: - default: - screen->getWorkspace(blackbox_attrib.workspace)->raiseWindow(this); - break; + case Below: + case BottomIf: + if (flags.iconic) deiconify(); + screen->getWorkspace(workspace_number)->lowerWindow(this); + break; + } } + - openbox->ungrab(); ++ openbox.ungrab(); } } -void BlackboxWindow::buttonPressEvent(XButtonEvent *be) { - if (frame.maximize_button == be->window) { - redrawMaximizeButton(True); - } else if (be->button == 1 || (be->button == 3 && be->state == Mod1Mask)) { - if (! flags.focused) - setInputFocus(); +void OpenboxWindow::buttonPressEvent(XButtonEvent *be) { - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) + return; - if (frame.iconify_button == be->window) { + int stack_change = 1; // < 0 means to lower the window + // > 0 means to raise the window + // 0 means to leave it where it is + + // alt + left/right click begins interactively moving/resizing the window + // when the mouse is moved + if (be->state == Mod1Mask && (be->button == 1 || be->button == 3)) { - frame.grab_x = be->x_root - frame.x - frame.border_w; - frame.grab_y = be->y_root - frame.y - frame.border_w; + if (be->button == 3) { + if (screen->getWindowZones() == 4 && + be->y < (signed) frame.height / 2) { + resize_zone = ZoneTop; + } else { + resize_zone = ZoneBottom; + } + if (screen->getWindowZones() >= 2 && + be->x < (signed) frame.width / 2) { + resize_zone |= ZoneLeft; + } else { + resize_zone |= ZoneRight; + } + } + // control + left click on the titlebar shades the window + } else if (be->state == ControlMask && be->button == 1) { + if (be->window == frame.title || + be->window == frame.label) + shade(); + // left click + } else if (be->state == 0 && be->button == 1) { + if (windowmenu && windowmenu->isVisible()) + windowmenu->hide(); + + if (be->window == frame.maximize_button) { + redrawMaximizeButton(True); + } else if (be->window == frame.iconify_button) { redrawIconifyButton(True); - } else if (frame.close_button == be->window) { + } else if (be->window == frame.close_button) { redrawCloseButton(True); - } else if (frame.plate == be->window) { - if (windowmenu && windowmenu->isVisible()) windowmenu->hide(); - - screen->getWorkspace(blackbox_attrib.workspace)->raiseWindow(this); - - XAllowEvents(blackbox->getXDisplay(), ReplayPointer, be->time); - } else { - if (frame.title == be->window || frame.label == be->window) { - if (((be->time - lastButtonPressTime) <= - blackbox->getDoubleClickInterval()) || - (be->state & ControlMask)) { - lastButtonPressTime = 0; - shade(); - } else { - lastButtonPressTime = be->time; - } + } else if (be->window == frame.plate) { + XAllowEvents(display, ReplayPointer, be->time); + } else if (be->window == frame.title || + be->window == frame.label) { + // shade the window when the titlebar is double clicked + if ( (be->time - lastButtonPressTime) <= - openbox->getDoubleClickInterval()) { ++ openbox.getDoubleClickInterval()) { + lastButtonPressTime = 0; + shade(); + } else { + lastButtonPressTime = be->time; } - - frame.grab_x = be->x_root - frame.rect.x() - frame.border_w; - frame.grab_y = be->y_root - frame.rect.y() - frame.border_w; - - if (windowmenu && windowmenu->isVisible()) windowmenu->hide(); - - screen->getWorkspace(blackbox_attrib.workspace)->raiseWindow(this); + // clicking and dragging on the titlebar moves the window, so on a click + // we need to save the coords of the click in case the user drags + frame.grab_x = be->x_root - frame.x - frame.border_w; + frame.grab_y = be->y_root - frame.y - frame.border_w; + } else if (be->window == frame.handle || + be->window == frame.left_grip || + be->window == frame.right_grip || + be->window == frame.window) { + // clicking and dragging on the window's frame moves the window, so on a + // click we need to save the coords of the click in case the user drags + frame.grab_x = be->x_root - frame.x - frame.border_w; + frame.grab_y = be->y_root - frame.y - frame.border_w; + if (be->window == frame.left_grip) + resize_zone = ZoneBottom | ZoneLeft; + else if (be->window == frame.right_grip) + resize_zone = ZoneBottom | ZoneRight; } - } else if (be->button == 2 && (be->window != frame.iconify_button) && - (be->window != frame.close_button)) { - screen->getWorkspace(blackbox_attrib.workspace)->lowerWindow(this); - } else if (windowmenu && be->button == 3 && - (frame.title == be->window || frame.label == be->window || - frame.handle == be->window || frame.window == be->window)) { - int mx = 0, my = 0; - - if (frame.title == be->window || frame.label == be->window) { - mx = be->x_root - (windowmenu->getWidth() / 2); - my = frame.rect.y() + frame.title_h + frame.border_w; - } else if (frame.handle == be->window) { - mx = be->x_root - (windowmenu->getWidth() / 2); - my = frame.rect.bottom() - frame.handle_h - (frame.border_w * 3) - - windowmenu->getHeight(); - } else { - mx = be->x_root - (windowmenu->getWidth() / 2); - - if (be->y <= static_cast(frame.bevel_w)) - my = frame.rect.y() + frame.title_h; - else - my = be->y_root - (windowmenu->getHeight() / 2); + // middle click + } else if (be->state == 0 && be->button == 2) { + if (be->window == frame.maximize_button) { + redrawMaximizeButton(True); + // a middle click anywhere on the window's frame except for on the buttons + // will lower the window + } else if (! (be->window == frame.iconify_button || + be->window == frame.close_button) ) { + stack_change = -1; } + // right click + } else if (be->state == 0 && be->button == 3) { + if (be->window == frame.maximize_button) { + redrawMaximizeButton(True); + // a right click on the window's frame will show or hide the window's + // windowmenu + } else if (be->window == frame.title || + be->window == frame.label || + be->window == frame.handle || + be->window == frame.window) { + int mx, my; + if (windowmenu) { + if (windowmenu->isVisible()) { + windowmenu->hide(); + } else { + // get the coords for the menu + mx = be->x_root - windowmenu->getWidth() / 2; + if (be->window == frame.title || be->window == frame.label) { + my = frame.y + frame.title_h; - } else if (be->window = frame.handle) { ++ } else if (be->window == frame.handle) { + my = frame.y + frame.y_handle - windowmenu->getHeight(); + } else { // (be->window == frame.window) + if (be->y <= (signed) frame.bevel_w) { + my = frame.y + frame.y_border; + } else { + my = be->y_root - (windowmenu->getHeight() / 2); + } + } - // snap the window menu into a corner if necessary - we check the - // position of the menu with the coordinates of the client to - // make the comparisions easier. - // XXX: this needs some work! - if (mx > client.rect.right() - - static_cast(windowmenu->getWidth())) - mx = frame.rect.right() - windowmenu->getWidth() - frame.border_w + 1; - if (mx < client.rect.left()) - mx = frame.rect.x(); - - if (my > client.rect.bottom() - - static_cast(windowmenu->getHeight())) - my = frame.rect.bottom() - windowmenu->getHeight() - frame.border_w + 1; - if (my < client.rect.top()) - my = frame.rect.y() + ((decorations & Decor_Titlebar) ? - frame.title_h : 0); - - if (windowmenu) { - if (! windowmenu->isVisible()) { - windowmenu->move(mx, my); - windowmenu->show(); - XRaiseWindow(blackbox->getXDisplay(), windowmenu->getWindowID()); - XRaiseWindow(blackbox->getXDisplay(), - windowmenu->getSendToMenu()->getWindowID()); - } else { - windowmenu->hide(); + if (mx > (signed) (frame.x + frame.width - + windowmenu->getWidth())) { + mx = frame.x + frame.width - windowmenu->getWidth(); + } else if (mx < frame.x) { + mx = frame.x; + } + + if (my > (signed) (frame.y + frame.y_handle - + windowmenu->getHeight())) { + my = frame.y + frame.y_handle - windowmenu->getHeight(); + } else if (my < (signed) (frame.y + + ((decorations.titlebar) ? frame.title_h : frame.y_border))) { + my = frame.y + + ((decorations.titlebar) ? frame.title_h : frame.y_border); + } + + windowmenu->move(mx, my); + windowmenu->show(); + XRaiseWindow(display, windowmenu->getWindowID()); + XRaiseWindow(display, windowmenu->getSendToMenu()->getWindowID()); + stack_change = 0; // dont raise the window overtop of the menu + } } } // mouse wheel up @@@ -2641,354 -2406,359 +2651,496 @@@ flags.shaded) shade(); } + - if (! (flags.focused || screen->isSloppyFocus()) ) { ++ if (! (flags.focused || screen->sloppyFocus()) ) { + setInputFocus(); // any click focus' the window in 'click to focus' + } + if (stack_change < 0) { + screen->getWorkspace(workspace_number)->lowerWindow(this); + } else if (stack_change > 0) { + screen->getWorkspace(workspace_number)->raiseWindow(this); + } + - openbox->ungrab(); ++ openbox.ungrab(); } -void BlackboxWindow::buttonReleaseEvent(XButtonEvent *re) { - if (re->window == frame.maximize_button) { - if ((re->x >= 0 && re->x <= static_cast(frame.button_w)) && - (re->y >= 0 && re->y <= static_cast(frame.button_w))) { - maximize(re->button); - } else { - redrawMaximizeButton(flags.maximized); +void OpenboxWindow::buttonReleaseEvent(XButtonEvent *re) { - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) + return; + + // alt + middle button released + if (re->state == (Mod1Mask & Button2Mask) && re->button == 2) { + if (re->window == frame.window) { + XUngrabPointer(display, CurrentTime); // why? i dont know } - } else if (re->window == frame.iconify_button) { - if ((re->x >= 0 && re->x <= static_cast(frame.button_w)) && - (re->y >= 0 && re->y <= static_cast(frame.button_w))) { - iconify(); - } else { - redrawIconifyButton(False); + // left button released + } else if (re->button == 1) { + if (re->window == frame.maximize_button) { + if (re->state == Button1Mask && // only the left button was depressed + (re->x >= 0) && ((unsigned) re->x <= frame.button_w) && + (re->y >= 0) && ((unsigned) re->y <= frame.button_h)) { + maximize(re->button); + } else { + redrawMaximizeButton(False); + } + } else if (re->window == frame.iconify_button) { + if (re->state == Button1Mask && // only the left button was depressed + (re->x >= 0) && ((unsigned) re->x <= frame.button_w) && + (re->y >= 0) && ((unsigned) re->y <= frame.button_h)) { + iconify(); + } else { + redrawIconifyButton(False); + } + } else if (re->window == frame.close_button) { + if (re->state == Button1Mask && // only the left button was depressed + (re->x >= 0) && ((unsigned) re->x <= frame.button_w) && + (re->y >= 0) && ((unsigned) re->y <= frame.button_h)) { + close(); - } else { - redrawCloseButton(False); + } ++ //we should always redraw the close button. some applications ++ //eg. acroread don't honour the close. ++ redrawCloseButton(False); } - } else if (re->window == frame.close_button) { - if ((re->x >= 0 && re->x <= static_cast(frame.button_w)) && - (re->y >= 0 && re->y <= static_cast(frame.button_w))) - close(); - redrawCloseButton(False); - } else if (flags.moving) { - flags.moving = False; - - if (! screen->doOpaqueMove()) { - /* when drawing the rubber band, we need to make sure we only draw inside - * the frame... frame.changing_* contain the new coords for the window, - * so we need to subtract 1 from changing_w/changing_h every where we - * draw the rubber band (for both moving and resizing) - */ - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), frame.changing.x(), frame.changing.y(), - frame.changing.width() - 1, frame.changing.height() - 1); - XUngrabServer(blackbox->getXDisplay()); - - configure(frame.changing.x(), frame.changing.y(), - frame.changing.width(), frame.changing.height()); - } else { - configure(frame.rect.x(), frame.rect.y(), - frame.rect.width(), frame.rect.height()); + // middle button released + } else if (re->button == 2) { + if (re->window == frame.maximize_button) { + if (re->state == Button2Mask && // only the middle button was depressed + (re->x >= 0) && ((unsigned) re->x <= frame.button_w) && + (re->y >= 0) && ((unsigned) re->y <= frame.button_h)) { + maximize(re->button); + } else { + redrawMaximizeButton(False); + } } - screen->hideGeometry(); - XUngrabPointer(blackbox->getXDisplay(), CurrentTime); + // right button released + } else if (re->button == 3) { + if (re->window == frame.maximize_button) { + if (re->state == Button3Mask && // only the right button was depressed + (re->x >= 0) && ((unsigned) re->x <= frame.button_w) && + (re->y >= 0) && ((unsigned) re->y <= frame.button_h)) { + maximize(re->button); + } else { + redrawMaximizeButton(False); + } + } + } + + // when the window is being interactively moved, a button release stops the + // move where it is + if (flags.moving) { - flags.moving = False; - - openbox->maskWindowEvents(0, (OpenboxWindow *) 0); - if (!screen->doOpaqueMove()) { - XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), - frame.move_x, frame.move_y, frame.resize_w - 1, - frame.resize_h - 1); - - configure(frame.move_x, frame.move_y, frame.width, frame.height); - openbox->ungrab(); - } else { - configure(frame.x, frame.y, frame.width, frame.height); - } - screen->hideGeometry(); - XUngrabPointer(display, CurrentTime); ++ endMove(); + // when the window is being interactively resized, a button release stops the + // resizing } else if (flags.resizing) { - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), frame.changing.x(), frame.changing.y(), - frame.changing.width() - 1, frame.changing.height() - 1); - XUngrabServer(blackbox->getXDisplay()); - + flags.resizing = False; + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w - 1, frame.resize_h - 1); screen->hideGeometry(); + if (resize_zone & ZoneLeft) { + left_fixsize(); + } else { // when resizing with "Alt+Button3", the resize is the same as if + // done with the right grip (the right side of the window is what + // moves) + right_fixsize(); + } + // unset maximized state when resized after fully maximized + if (flags.maximized == 1) { + maximize(0); + } + configure(frame.resize_x, frame.resize_y, + frame.resize_w - (frame.border_w * 2), + frame.resize_h - (frame.border_w * 2)); - openbox->ungrab(); ++ openbox.ungrab(); + XUngrabPointer(display, CurrentTime); + resize_zone = 0; + } - openbox->ungrab(); - constrain((re->window == frame.left_grip) ? TopRight : TopLeft); ++ openbox.ungrab(); +} - // unset maximized state when resized after fully maximized - if (flags.maximized == 1) - maximize(0); - flags.resizing = False; - configure(frame.changing.x(), frame.changing.y(), - frame.changing.width(), frame.changing.height()); - void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { - if (!flags.resizing && (me->state & Button1Mask) && functions.move && - (frame.title == me->window || frame.label == me->window || - frame.handle == me->window || frame.window == me->window)) { - if (! flags.moving) { - XGrabPointer(display, me->window, False, Button1MotionMask | - ButtonReleaseMask, GrabModeAsync, GrabModeAsync, - None, openbox->getMoveCursor(), CurrentTime); - XUngrabPointer(blackbox->getXDisplay(), CurrentTime); - } else if (re->window == frame.window) { - if (re->button == 2 && re->state == Mod1Mask) - XUngrabPointer(blackbox->getXDisplay(), CurrentTime); ++void OpenboxWindow::startMove(int x, int y) { ++ ASSERT(!flags.moving); + - if (windowmenu && windowmenu->isVisible()) - windowmenu->hide(); ++ // make sure only one window is moving at a time ++ OpenboxWindow *w = openbox.getMaskedWindow(); ++ if (w != (OpenboxWindow *) 0 && w->flags.moving) ++ w->endMove(); ++ ++ XGrabPointer(display, frame.window, False, PointerMotionMask | ++ ButtonReleaseMask, GrabModeAsync, GrabModeAsync, ++ None, openbox.getMoveCursor(), CurrentTime); + - flags.moving = True; ++ if (windowmenu && windowmenu->isVisible()) ++ windowmenu->hide(); + - openbox->maskWindowEvents(client.window, this); ++ flags.moving = True; + - if (! screen->doOpaqueMove()) { - openbox->grab(); ++ openbox.maskWindowEvents(client.window, this); + - frame.move_x = frame.x; - frame.move_y = frame.y; - frame.resize_w = frame.width + (frame.border_w * 2); - frame.resize_h = ((flags.shaded) ? frame.title_h : frame.height) + - (frame.border_w * 2); ++ if (! screen->opaqueMove()) { ++ openbox.grab(); + - screen->showPosition(frame.x, frame.y); ++ frame.move_x = frame.x; ++ frame.move_y = frame.y; ++ frame.resize_w = frame.width + (frame.border_w * 2); ++ frame.resize_h = ((flags.shaded) ? frame.title_h : frame.height) + ++ (frame.border_w * 2); + - XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), - frame.move_x, frame.move_y, - frame.resize_w - 1, frame.resize_h - 1); - } - } else { - int dx = me->x_root - frame.grab_x, dy = me->y_root - frame.grab_y; - - dx -= frame.border_w; - dy -= frame.border_w; - - int snap_distance = screen->getEdgeSnapThreshold(); - if (snap_distance) { - int drx = screen->getWidth() - (dx + frame.snap_w); - - if (dx < drx && (dx > 0 && dx < snap_distance) || - (dx < 0 && dx > -snap_distance) ) - dx = 0; - else if ( (drx > 0 && drx < snap_distance) || - (drx < 0 && drx > -snap_distance) ) - dx = screen->getWidth() - frame.snap_w; - - int dtty, dbby, dty, dby; - switch (screen->getToolbarPlacement()) { - case Toolbar::TopLeft: - case Toolbar::TopCenter: - case Toolbar::TopRight: - dtty = screen->getToolbar()->getExposedHeight() + - frame.border_w; - dbby = screen->getHeight(); - break; - - default: - dtty = 0; - dbby = screen->getToolbar()->getY(); - break; - } ++ screen->showPosition(frame.x, frame.y); + - dty = dy - dtty; - dby = dbby - (dy + frame.snap_h); ++ XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), ++ frame.move_x, frame.move_y, ++ frame.resize_w - 1, frame.resize_h - 1); + } ++ frame.grab_x = x - frame.x - frame.border_w; ++ frame.grab_y = y - frame.y - frame.border_w; + } - if ( (dy > 0 && dty < snap_distance) || - (dy < 0 && dty > -snap_distance) ) - dy = dtty; - else if ( (dby > 0 && dby < snap_distance) || - (dby < 0 && dby > -snap_distance) ) - dy = dbby - frame.snap_h; - } - if (screen->doOpaqueMove()) { - configure(dx, dy, frame.width, frame.height); - } else { - XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), - frame.move_x, frame.move_y, frame.resize_w - 1, - frame.resize_h - 1); -void BlackboxWindow::motionNotifyEvent(XMotionEvent *me) { - if (! flags.resizing && (me->state & Button1Mask) && - (functions & Func_Move) && - (frame.title == me->window || frame.label == me->window || - frame.handle == me->window || frame.window == me->window)) { - if (! flags.moving) { - XGrabPointer(blackbox->getXDisplay(), me->window, False, - Button1MotionMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, - None, blackbox->getMoveCursor(), CurrentTime); - - if (windowmenu && windowmenu->isVisible()) - windowmenu->hide(); ++void OpenboxWindow::doMove(int x, int y) { ++ ASSERT(flags.moving); + - flags.moving = True; ++ int dx = x - frame.grab_x, dy = y - frame.grab_y; + - if (! screen->doOpaqueMove()) { - XGrabServer(blackbox->getXDisplay()); ++ dx -= frame.border_w; ++ dy -= frame.border_w; + - frame.changing = frame.rect; - screen->showPosition(frame.changing.x(), frame.changing.y()); ++ const int snap_distance = screen->edgeSnapThreshold(); + - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), - frame.changing.x(), - frame.changing.y(), - frame.changing.width() - 1, - frame.changing.height() - 1); - } - } else { - int dx = me->x_root - frame.grab_x, dy = me->y_root - frame.grab_y; - dx -= frame.border_w; - dy -= frame.border_w; - - const int snap_distance = screen->getEdgeSnapThreshold(); - - if (snap_distance) { - // window corners - const int wleft = dx, - wright = dx + frame.rect.width() - 1, - wtop = dy, - wbottom = dy + frame.rect.height() - 1; - - // Maybe this should be saved in the class, and set in the setWorkspace - // function!! - Workspace *w = screen->getWorkspace(getWorkspaceNumber()); - assert(w); - - if (screen->getWindowToWindowSnap()) { - // try snap to another window - for (unsigned int i = 0, c = w->getCount(); i < c; ++i) { - BlackboxWindow *snapwin = w->getWindow(i); - if (snapwin == this) - continue; // don't snap to self - - const Rect &winrect = snapwin->frameRect(); - int dleft = std::abs(wright - winrect.left()), - dright = std::abs(wleft - winrect.right()), - dtop = std::abs(wbottom - winrect.top()), - dbottom = std::abs(wtop - winrect.bottom()); - - // snap top of other window? - if (dtop < snap_distance && dtop <= dbottom) { - dy = winrect.top() - frame.rect.height(); - - if (screen->getWindowCornerSnap()) { - // try corner-snap to its other sides - dleft = std::abs(wleft - winrect.left()); - dright = std::abs(wright - winrect.right()); - if (dleft < snap_distance && dleft <= dright) - dx = winrect.left(); - else if (dright < snap_distance) - dx = winrect.right() - frame.rect.width() + 1; - } - - continue; ++ if (snap_distance) { ++ // window corners ++ const int wleft = dx, ++ wright = dx + area().w() + (frame.border_w * 2) - 1, ++ wtop = dy, ++ wbottom = dy + area().h() + (frame.border_w * 2) - 1; ++ ++ Workspace *w = screen->getWorkspace(getWorkspaceNumber()); ++ assert(w); ++ ++ if (screen->windowToWindowSnap()) { ++ // try snap to another window ++ for (unsigned int i = 0, c = w->getCount(); i < c; ++i) { ++ OpenboxWindow *snapwin = w->getWindow(i); ++ if (snapwin == this) ++ continue; // don't snap to self ++ ++ const Rect &winrect = snapwin->area(); ++ int dleft = std::abs(wright - winrect.left()), ++ dright = std::abs(wleft - winrect.right()), ++ dtop = std::abs(wbottom - winrect.top()), ++ dbottom = std::abs(wtop - winrect.bottom()); ++ ++ if (wtop >= (signed)(winrect.y() - area().h() - frame.border_w * 3) && ++ wtop < (signed)(winrect.y() + winrect.h() + frame.border_w * 3)) { ++ ++ // snap left of other window? ++ if (dleft < snap_distance && dleft <= dright) { ++ dx = winrect.left() - area().w() - (frame.border_w * 2); ++ ++ if (screen->windowCornerSnap()) { ++ // try corner-snap to its other sides ++ dtop = std::abs(wtop - winrect.top()); ++ dbottom = std::abs(wbottom - winrect.bottom()); ++ if (dtop < snap_distance && dtop <= dbottom) ++ dy = winrect.top(); ++ else if (dbottom < snap_distance) ++ dy = winrect.bottom() - area().h() + frame.border_w; + } - // snap bottom of other window? - else if (dbottom < snap_distance) { - dy = winrect.bottom() + 1; - - if (screen->getWindowCornerSnap()) { - // try corner-snap to its other sides - dleft = std::abs(wleft - winrect.left()); - dright = std::abs(wright - winrect.right()); - if (dleft < snap_distance && dleft <= dright) - dx = winrect.left(); - else if (dright < snap_distance) - dx = winrect.right() - frame.rect.width() + 1; - } - - continue; + - frame.move_x = dx; - frame.move_y = dy; ++ continue; ++ } ++ // snap right of other window? ++ else if (dright < snap_distance) { ++ dx = winrect.right() + (frame.border_w * 2) + 1; ++ ++ if (screen->windowCornerSnap()) { ++ // try corner-snap to its other sides ++ dtop = std::abs(wtop - winrect.top()); ++ dbottom = std::abs(wbottom - winrect.bottom()); ++ if (dtop < snap_distance && dtop <= dbottom) ++ dy = winrect.top(); ++ else if (dbottom < snap_distance) ++ dy = winrect.bottom() - area().h() + frame.border_w; + } - XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), - frame.move_x, frame.move_y, frame.resize_w - 1, - frame.resize_h - 1); - // snap left of other window? - if (dleft < snap_distance && dleft <= dright) { - dx = winrect.left() - frame.rect.width(); - - if (screen->getWindowCornerSnap()) { - // try corner-snap to its other sides - dtop = std::abs(wtop - winrect.top()); - dbottom = std::abs(wbottom - winrect.bottom()); - if (dtop < snap_distance && dtop <= dbottom) - dy = winrect.top(); - else if (dbottom < snap_distance) - dy = winrect.bottom() - frame.rect.height() + 1; - } - - continue; ++ continue; ++ } ++ } ++ ++ if (wleft >= (signed)(winrect.x() - area().w() - frame.border_w * 3) && ++ wleft < (signed)(winrect.x() + winrect.w() + frame.border_w * 3)) { ++ ++ // snap top of other window? ++ if (dtop < snap_distance && dtop <= dbottom) { ++ dy = winrect.top() - area().h() - (frame.border_w * 2); ++ ++ if (screen->windowCornerSnap()) { ++ // try corner-snap to its other sides ++ dleft = std::abs(wleft - winrect.left()); ++ dright = std::abs(wright - winrect.right()); ++ if (dleft < snap_distance && dleft <= dright) ++ dx = winrect.left(); ++ else if (dright < snap_distance) ++ dx = winrect.right() - area().w() + frame.border_w; + } - // snap right of other window? - else if (dright < snap_distance) { - dx = winrect.right() + 1; - - if (screen->getWindowCornerSnap()) { - // try corner-snap to its other sides - dtop = std::abs(wtop - winrect.top()); - dbottom = std::abs(wbottom - winrect.bottom()); - if (dtop < snap_distance && dtop <= dbottom) - dy = winrect.top(); - else if (dbottom < snap_distance) - dy = winrect.bottom() - frame.rect.height() + 1; - } - - continue; ++ ++ continue; ++ } ++ // snap bottom of other window? ++ else if (dbottom < snap_distance) { ++ dy = winrect.bottom() + (frame.border_w * 2) + 1; ++ ++ if (screen->windowCornerSnap()) { ++ // try corner-snap to its other sides ++ dleft = std::abs(wleft - winrect.left()); ++ dright = std::abs(wright - winrect.right()); ++ if (dleft < snap_distance && dleft <= dright) ++ dx = winrect.left(); ++ else if (dright < snap_distance) ++ dx = winrect.right() - area().w() + frame.border_w; + } ++ ++ continue; + } + } - - // try snap to the screen's available area - Rect srect = screen->availableArea(); - - int dleft = std::abs(wleft - srect.left()), - dright = std::abs(wright - srect.right()), - dtop = std::abs(wtop - srect.top()), - dbottom = std::abs(wbottom - srect.bottom()); - - // snap left? - if (dleft < snap_distance && dleft <= dright) - dx = srect.left(); - // snap right? - else if (dright < snap_distance) - dx = srect.right() - frame.rect.width() + 1; - - // snap top? - if (dtop < snap_distance && dtop <= dbottom) - dy = srect.top(); - // snap bottom? - else if (dbottom < snap_distance) - dy = srect.bottom() - frame.rect.height() + 1; - - if (! screen->doFullMax()) { - srect = screen->getRect(); // now get the full screen - - dleft = std::abs(wleft - srect.left()), - dright = std::abs(wright - srect.right()), - dtop = std::abs(wtop - srect.top()), - dbottom = std::abs(wbottom - srect.bottom()); - - // snap left? - if (dleft < snap_distance && dleft <= dright) - dx = srect.left(); - // snap right? - else if (dright < snap_distance) - dx = srect.right() - frame.rect.width() + 1; - - // snap top? - if (dtop < snap_distance && dtop <= dbottom) - dy = srect.top(); - // snap bottom? - else if (dbottom < snap_distance) - dy = srect.bottom() - frame.rect.height() + 1; - } - } - - if (screen->doOpaqueMove()) { - configure(dx, dy, frame.rect.width(), frame.rect.height()); - } else { - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), - frame.changing.x(), - frame.changing.y(), - frame.changing.width() - 1, - frame.changing.height() - 1); - - frame.changing.setPos(dx, dy); - - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), - frame.changing.x(), - frame.changing.y(), - frame.changing.width() - 1, - frame.changing.height() - 1); } ++ } -- screen->showPosition(dx, dy); ++ // try snap to the screen's available area ++ Rect srect = screen->availableArea(); ++ ++ int dleft = std::abs(wleft - srect.left()), ++ dright = std::abs(wright - srect.right()), ++ dtop = std::abs(wtop - srect.top()), ++ dbottom = std::abs(wbottom - srect.bottom()); ++ ++ // snap left? ++ if (dleft < snap_distance && dleft <= dright) ++ dx = srect.left(); ++ // snap right? ++ else if (dright < snap_distance) ++ dx = srect.right() - area().w() - (frame.border_w * 2) + 1; ++ ++ // snap top? ++ if (dtop < snap_distance && dtop <= dbottom) ++ dy = srect.top(); ++ // snap bottom? ++ else if (dbottom < snap_distance) ++ dy = srect.bottom() - area().h() - (frame.border_w * 2) + 1; ++ ++ if (! screen->fullMax()) { ++ srect = Rect(Point(0,0), screen->size()); // now get the full screen ++ ++ dleft = std::abs(wleft - srect.left()); ++ dright = std::abs(wright - srect.right()); ++ dtop = std::abs(wtop - srect.top()); ++ dbottom = std::abs(wbottom - srect.bottom()); ++ ++ // snap left? ++ if (dleft < snap_distance && dleft <= dright) ++ dx = srect.left(); ++ // snap right? ++ else if (dright < snap_distance) ++ dx = srect.right() - area().w() - (frame.border_w * 2) + 1; ++ ++ // snap top? ++ if (dtop < snap_distance && dtop <= dbottom) ++ dy = srect.top(); ++ // snap bottom? ++ else if (dbottom < snap_distance) ++ dy = srect.bottom() - area().h() - (frame.border_w * 2) + 1; } - } else if (functions.resize && - } else if ((functions & Func_Resize) && - (((me->state & Button1Mask) && - (me->window == frame.right_grip || - me->window == frame.left_grip)) || - (me->state & (Mod1Mask | Button3Mask) && - me->window == frame.window))) { - bool left = (me->window == frame.left_grip); ++ } ++ ++ ++ ++ if (screen->opaqueMove()) { ++ configure(dx, dy, frame.width, frame.height); ++ } else { ++ XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), ++ frame.move_x, frame.move_y, frame.resize_w - 1, ++ frame.resize_h - 1); ++ ++ frame.move_x = dx; ++ frame.move_y = dy; ++ ++ XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), ++ frame.move_x, frame.move_y, frame.resize_w - 1, ++ frame.resize_h - 1); ++ } ++ ++ screen->showPosition(dx, dy); ++} ++ ++ ++void OpenboxWindow::endMove() { ++ ASSERT(flags.moving); ++ ++ flags.moving = False; ++ ++ openbox.maskWindowEvents(0, (OpenboxWindow *) 0); ++ if (!screen->opaqueMove()) { ++ XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), ++ frame.move_x, frame.move_y, frame.resize_w - 1, ++ frame.resize_h - 1); ++ ++ configure(frame.move_x, frame.move_y, frame.width, frame.height); ++ openbox.ungrab(); ++ } else { ++ configure(frame.x, frame.y, frame.width, frame.height); ++ } ++ screen->hideGeometry(); ++ XUngrabPointer(display, CurrentTime); ++ // if there are any left over motions from the move, drop them now cuz they ++ // cause problems ++ XEvent e; ++ while (XCheckTypedWindowEvent(display, frame.window, MotionNotify, &e)); ++} ++ ++ ++void OpenboxWindow::motionNotifyEvent(XMotionEvent *me) { ++ if (flags.moving) ++ doMove(me->x_root, me->y_root); ++ else if (!flags.resizing && (me->state & Button1Mask) && functions.move && ++ (frame.title == me->window || frame.label == me->window || ++ frame.handle == me->window || frame.window == me->window)) ++ startMove(me->x_root, me->y_root); ++ else if (functions.resize && + (((me->state & Button1Mask) && (me->window == frame.right_grip || + me->window == frame.left_grip)) || - (me->state & (Mod1Mask | Button3Mask) && ++ (me->state == (Mod1Mask | Button3Mask) && + me->window == frame.window))) { + Bool left = resize_zone & ZoneLeft; if (! flags.resizing) { - XGrabServer(blackbox->getXDisplay()); - XGrabPointer(blackbox->getXDisplay(), me->window, False, - ButtonMotionMask | ButtonReleaseMask, - GrabModeAsync, GrabModeAsync, None, - ((left) ? blackbox->getLowerLeftAngleCursor() : - blackbox->getLowerRightAngleCursor()), - CurrentTime); + Cursor cursor; + if (resize_zone & ZoneTop) + cursor = (resize_zone & ZoneLeft) ? - openbox->getUpperLeftAngleCursor() : - openbox->getUpperRightAngleCursor(); ++ openbox.getUpperLeftAngleCursor() : ++ openbox.getUpperRightAngleCursor(); + else + cursor = (resize_zone & ZoneLeft) ? - openbox->getLowerLeftAngleCursor() : - openbox->getLowerRightAngleCursor(); ++ openbox.getLowerLeftAngleCursor() : ++ openbox.getLowerRightAngleCursor(); + XGrabPointer(display, me->window, False, ButtonMotionMask | + ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, + cursor, CurrentTime); flags.resizing = True; - openbox->grab(); - int gw, gh; - frame.grab_x = me->x; - frame.grab_y = me->y; - frame.changing = frame.rect; ++ openbox.grab(); - constrain((left) ? TopRight : TopLeft, &gw, &gh); + int gx, gy; + if (resize_zone & ZoneRight) + frame.grab_x = me->x - screen->getBorderWidth(); + else + frame.grab_x = me->x + screen->getBorderWidth(); + if (resize_zone & ZoneTop) + frame.grab_y = me->y + screen->getBorderWidth() * 2; + else + frame.grab_y = me->y - screen->getBorderWidth() * 2; + frame.resize_x = frame.x; + frame.resize_y = frame.y; + frame.resize_w = frame.width + (frame.border_w * 2); + frame.resize_h = frame.height + (frame.border_w * 2); + + if (left) + left_fixsize(&gx, &gy); + else + right_fixsize(&gx, &gy); - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), frame.changing.x(), frame.changing.y(), - frame.changing.width() - 1, frame.changing.height() - 1); + screen->showGeometry(gx, gy); - screen->showGeometry(gw, gh); + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w - 1, frame.resize_h - 1); } else { - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), frame.changing.x(), frame.changing.y(), - frame.changing.width() - 1, frame.changing.height() - 1); + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w - 1, frame.resize_h - 1); - int gw, gh; + int gx, gy; - Corner anchor; + if (resize_zone & ZoneTop) + frame.resize_h = frame.height - (me->y - frame.grab_y); + else + frame.resize_h = frame.height + (me->y - frame.grab_y); + if (frame.resize_h < 1) frame.resize_h = 1; if (left) { - anchor = TopRight; - frame.changing.setCoords(me->x_root - frame.grab_x, frame.rect.top(), - frame.rect.right(), frame.rect.bottom()); - frame.changing.setHeight(frame.rect.height() + (me->y - frame.grab_y)); + frame.resize_x = me->x_root - frame.grab_x; + if (frame.resize_x > (signed) (frame.x + frame.width)) + frame.resize_x = frame.resize_x + frame.width - 1; + + left_fixsize(&gx, &gy); } else { - anchor = TopLeft; - frame.changing.setSize(frame.rect.width() + (me->x - frame.grab_x), - frame.rect.height() + (me->y - frame.grab_y)); - } + frame.resize_w = frame.width + (me->x - frame.grab_x); + if (frame.resize_w < 1) frame.resize_w = 1; - constrain(anchor, &gw, &gh); + right_fixsize(&gx, &gy); + } - XDrawRectangle(blackbox->getXDisplay(), screen->getRootWindow(), - screen->getOpGC(), frame.changing.x(), frame.changing.y(), - frame.changing.width() - 1, frame.changing.height() - 1); + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w - 1, frame.resize_h - 1); - screen->showGeometry(gw, gh); + screen->showGeometry(gx, gy); } } } #ifdef SHAPE -void BlackboxWindow::shapeEvent(XShapeEvent *) { - if (blackbox->hasShapeExtensions() && flags.shaped) { - configureShape(); +void OpenboxWindow::shapeEvent(XShapeEvent *) { - if (openbox->hasShapeExtensions()) { ++ if (openbox.hasShapeExtensions()) { + if (flags.shaped) { - openbox->grab(); ++ openbox.grab(); + if (! validateClient()) return; + XShapeCombineShape(display, frame.window, ShapeBounding, + frame.mwm_border_w, frame.y_border + + frame.mwm_border_w, client.window, + ShapeBounding, ShapeSet); + + int num = 1; + XRectangle xrect[2]; + xrect[0].x = xrect[0].y = 0; + xrect[0].width = frame.width; + xrect[0].height = frame.y_border; + + if (decorations.handle) { + xrect[1].x = 0; + xrect[1].y = frame.y_handle; + xrect[1].width = frame.width; + xrect[1].height = frame.handle_h + frame.border_w; + num++; + } + + XShapeCombineRectangles(display, frame.window, ShapeBounding, 0, 0, + xrect, num, ShapeUnion, Unsorted); - openbox->ungrab(); ++ openbox.ungrab(); + } } } #endif // SHAPE - Bool OpenboxWindow::validateClient(void) { -bool BlackboxWindow::validateClient(void) const { - XSync(blackbox->getXDisplay(), False); ++bool OpenboxWindow::validateClient(void) { + XSync(display, False); XEvent e; - if (XCheckTypedWindowEvent(blackbox->getXDisplay(), client.window, - DestroyNotify, &e) || - XCheckTypedWindowEvent(blackbox->getXDisplay(), client.window, - UnmapNotify, &e)) { - XPutBackEvent(blackbox->getXDisplay(), &e); + if (XCheckTypedWindowEvent(display, client.window, DestroyNotify, &e) || + XCheckTypedWindowEvent(display, client.window, UnmapNotify, &e)) { + XPutBackEvent(display, &e); - openbox->ungrab(); ++ openbox.ungrab(); -- return False; ++ return false; } -- return True; ++ return true; } @@@ -2998,15 -2769,24 +3150,17 @@@ void OpenboxWindow::restore(void) restoreGravity(); - XUnmapWindow(blackbox->getXDisplay(), frame.window); - XUnmapWindow(blackbox->getXDisplay(), client.window); + XUnmapWindow(display, frame.window); + XUnmapWindow(display, client.window); - XSetWindowBorderWidth(blackbox->getXDisplay(), client.window, client.old_bw); + XSetWindowBorderWidth(display, client.window, client.old_bw); + XReparentWindow(display, client.window, screen->getRootWindow(), + client.x, client.y); + XMapWindow(display, client.window); - XEvent ev; - if (XCheckTypedWindowEvent(blackbox->getXDisplay(), client.window, - ReparentNotify, &ev)) { - remap = True; - } else { - // according to the ICCCM - if the client doesn't reparent to - // root, then we have to do it for them - XReparentWindow(blackbox->getXDisplay(), client.window, - screen->getRootWindow(), - client.rect.x(), client.rect.y()); - } + XFlush(display); + - if (remap) XMapWindow(blackbox->getXDisplay(), client.window); ++ delete this; } @@@ -3064,21 -2849,37 +3218,25 @@@ void OpenboxWindow::changeOpenboxHints( default: case DecorNormal: - decorations.titlebar = decorations.border = decorations.handle = - decorations.iconify = decorations.maximize = decorations.menu = True; - decorations |= Decor_Titlebar | Decor_Border | Decor_Iconify; - - decorations = ((functions & Func_Resize) && !isTransient() ? - decorations | Decor_Handle : - decorations &= ~Decor_Handle); - decorations = (functions & Func_Maximize ? - decorations | Decor_Maximize : - decorations &= ~Decor_Maximize); ++ decorations.titlebar = decorations.iconify = decorations.menu = ++ decorations.border = True; ++ decorations.handle = (functions.resize && !flags.transient); ++ decorations.maximize = functions.maximize; break; case DecorTiny: - decorations |= Decor_Titlebar | Decor_Iconify; - decorations &= ~(Decor_Border | Decor_Handle); - - decorations = (functions & Func_Maximize ? - decorations | Decor_Maximize : - decorations &= ~Decor_Maximize); + decorations.titlebar = decorations.iconify = decorations.menu = True; - decorations.border = decorations.handle = decorations.maximize = False; - ++ decorations.border = decorations.border = decorations.handle = False; ++ decorations.maximize = functions.maximize; + break; case DecorTool: - decorations.titlebar = decorations.menu = functions.move = True; - decorations.iconify = decorations.border = decorations.handle = - decorations.maximize = False; - decorations |= Decor_Titlebar; - decorations &= ~(Decor_Iconify | Decor_Border); - - decorations = ((functions & Func_Resize) && !isTransient() ? - decorations | Decor_Handle : - decorations &= ~Decor_Handle); - decorations = (functions & Func_Maximize ? - decorations | Decor_Maximize : - decorations &= ~Decor_Maximize); ++ decorations.titlebar = decorations.menu = True; ++ decorations.iconify = decorations.border = False; ++ decorations.handle = (functions.resize && !flags.transient); ++ decorations.maximize = functions.maximize; break; } @@@ -3129,116 -2938,204 +3287,110 @@@ void OpenboxWindow::upsize(void) } else { frame.title_h = 0; frame.label_h = 0; - frame.button_w = 0; - - // set the top frame margin - frame.margin.top = frame.border_w + frame.mwm_border_w; + frame.button_w = frame.button_h = 0; + frame.y_border = 0; } - // set the left/right frame margin - frame.margin.left = frame.margin.right = frame.border_w + frame.mwm_border_w; + frame.border_h = client.height + frame.mwm_border_w * 2; - if (decorations & Decor_Handle) { + if (decorations.handle) { + frame.y_handle = frame.y_border + frame.border_h + frame.border_w; frame.grip_w = frame.button_w * 2; - frame.handle_h = screen->getHandleWidth(); - - // set the bottom frame margin - frame.margin.bottom = frame.border_w + frame.handle_h + - frame.border_w + frame.mwm_border_w; + frame.grip_h = frame.handle_h = screen->getHandleWidth(); } else { + frame.y_handle = frame.y_border + frame.border_h; frame.handle_h = 0; - frame.grip_w = 0; - - // set the bottom frame margin - frame.margin.bottom = frame.border_w + frame.mwm_border_w; + frame.grip_w = frame.grip_h = 0; } - - /* - We first get the normal dimensions and use this to define the inside_w/h - then we modify the height if shading is in effect. - If the shade state is not considered then frame.rect gets reset to the - normal window size on a reconfigure() call resulting in improper - dimensions appearing in move/resize and other events. - */ - unsigned int - height = client.rect.height() + frame.margin.top + frame.margin.bottom, - width = client.rect.width() + frame.margin.left + frame.margin.right; - - frame.inside_w = width - (frame.border_w * 2); - frame.inside_h = height - (frame.border_w * 2); - - if (flags.shaded) - height = frame.title_h + (frame.border_w * 2); - frame.rect.setSize(width, height); + + frame.width = client.width + (frame.mwm_border_w * 2); + frame.height = frame.y_handle + frame.handle_h; - - frame.snap_w = frame.width + (frame.border_w * 2); - frame.snap_h = frame.height + (frame.border_w * 2); } /* - * Calculate the size of the client window and constrain it to the - * size specified by the size hints of the client window. - * - * The logical width and height are placed into pw and ph, if they - * are non-zero. Logical size refers to the users perception of - * the window size (for example an xterm resizes in cells, not in pixels). - * - * The physical geometry is placed into frame.changing_{x,y,width,height}. - * Physical geometry refers to the geometry of the window in pixels. + * Set the size and position of the client window. + * These values are based upon the current style settings and the frame + * window's dimensions. */ -void BlackboxWindow::constrain(Corner anchor, int *pw, int *ph) { - // frame.changing represents the requested frame size, we need to - // strip the frame margin off and constrain the client size - frame.changing.setCoords(frame.changing.left() + frame.margin.left, - frame.changing.top() + frame.margin.top, - frame.changing.right() - frame.margin.right, - frame.changing.bottom() - frame.margin.bottom); - - int dw = frame.changing.width(), dh = frame.changing.height(), - base_width = (client.base_width) ? client.base_width : client.min_width, - base_height = (client.base_height) ? client.base_height : - client.min_height; - - // constrain - if (dw < static_cast(client.min_width)) dw = client.min_width; - if (dh < static_cast(client.min_height)) dh = client.min_height; - if (dw > static_cast(client.max_width)) dw = client.max_width; - if (dh > static_cast(client.max_height)) dh = client.max_height; - - dw -= base_width; - dw /= client.width_inc; - dh -= base_height; - dh /= client.height_inc; - - if (pw) *pw = dw; - if (ph) *ph = dh; - - dw *= client.width_inc; - dw += base_width; - dh *= client.height_inc; - dh += base_height; - - frame.changing.setSize(dw, dh); - - // add the frame margin back onto frame.changing - frame.changing.setCoords(frame.changing.left() - frame.margin.left, - frame.changing.top() - frame.margin.top, - frame.changing.right() + frame.margin.right, - frame.changing.bottom() + frame.margin.bottom); - - // move frame.changing to the specified anchor - switch (anchor) { - case TopLeft: - // nothing to do - break; - - case TopRight: - int dx = frame.rect.right() - frame.changing.right(); - frame.changing.setPos(frame.changing.x() + dx, frame.changing.y()); - break; - } -} +void OpenboxWindow::downsize(void) { + frame.y_handle = frame.height - frame.handle_h; + frame.border_h = frame.y_handle - frame.y_border - + (decorations.handle ? frame.border_w : 0); + client.x = frame.x + frame.mwm_border_w + frame.border_w; + client.y = frame.y + frame.y_border + frame.mwm_border_w + frame.border_w; -int WindowStyle::doJustify(const char *text, int &start_pos, - unsigned int max_length, unsigned int modifier, - bool multibyte) const { - size_t text_len = strlen(text); - unsigned int length; + client.width = frame.width - (frame.mwm_border_w * 2); + client.height = frame.height - frame.y_border - (frame.mwm_border_w * 2) + - frame.handle_h - (decorations.handle ? frame.border_w : 0); - do { - if (multibyte) { - XRectangle ink, logical; - XmbTextExtents(fontset, text, text_len, &ink, &logical); - length = logical.width; - } else { - length = XTextWidth(font, text, text_len); - } - length += modifier; - } while (length > max_length && text_len-- > 0); - - switch (justify) { - case RightJustify: - start_pos += max_length - length; - break; - - case CenterJustify: - start_pos += (max_length - length) / 2; - break; - - case LeftJustify: - default: - break; - } - - return text_len; + frame.y_handle = frame.border_h + frame.y_border + frame.border_w; - - frame.snap_w = frame.width + (frame.border_w * 2); - frame.snap_h = frame.height + (frame.border_w * 2); } -BWindowGroup::BWindowGroup(Blackbox *b, Window _group) - : blackbox(b), group(_group) { - XWindowAttributes wattrib; - if (! XGetWindowAttributes(blackbox->getXDisplay(), group, &wattrib)) { - // group window doesn't seem to exist anymore - delete this; - return; - } +void OpenboxWindow::right_fixsize(int *gx, int *gy) { + // calculate the size of the client window and conform it to the + // size specified by the size hints of the client window... - int dx = frame.resize_w - client.base_width - (frame.mwm_border_w * 2) - ++ int dx = 1 + frame.resize_w - client.base_width - (frame.mwm_border_w * 2) - + (frame.border_w * 2) + (client.width_inc / 2); - int dy = frame.resize_h - frame.y_border - client.base_height - ++ int dy = 1 + frame.resize_h - frame.y_border - client.base_height - + frame.handle_h - (frame.border_w * 3) - (frame.mwm_border_w * 2) + + (client.height_inc / 2); - /* - watch for destroy notify on the group window (in addition to - any other events we are looking for) + if (dx < (signed) client.min_width) dx = client.min_width; + if (dy < (signed) client.min_height) dy = client.min_height; + if ((unsigned) dx > client.max_width) dx = client.max_width; + if ((unsigned) dy > client.max_height) dy = client.max_height; - since some managed windows can also be window group controllers, - we need to make sure that we don't clobber the event mask for the - managed window - */ - XSelectInput(blackbox->getXDisplay(), group, - wattrib.your_event_mask | StructureNotifyMask); + dx /= client.width_inc; + dy /= client.height_inc; - blackbox->saveGroupSearch(group, this); -} + if (gx) *gx = dx; + if (gy) *gy = dy; + dx = (dx * client.width_inc) + client.base_width; + dy = (dy * client.height_inc) + client.base_height; - frame.resize_w = dx + (frame.mwm_border_w * 2) + (frame.border_w * 2); -BWindowGroup::~BWindowGroup(void) { - blackbox->removeGroupSearch(group); ++ frame.resize_w = dx + (frame.mwm_border_w * 2) + (frame.border_w * 2) - 1; + frame.resize_h = dy + frame.y_border + frame.handle_h + - (frame.mwm_border_w * 2) + (frame.border_w * 3); ++ (frame.mwm_border_w * 2) + (frame.border_w * 3) - 1; + if (resize_zone & ZoneTop) + frame.resize_y = frame.y + frame.height - frame.resize_h + + screen->getBorderWidth() * 2; } -BlackboxWindow * -BWindowGroup::find(BScreen *screen, bool allow_transients) const { - BlackboxWindow *ret = blackbox->getFocusedWindow(); +void OpenboxWindow::left_fixsize(int *gx, int *gy) { + // calculate the size of the client window and conform it to the + // size specified by the size hints of the client window... - int dx = frame.x + frame.width - frame.resize_x - client.base_width - ++ int dx = 1 + frame.x + frame.width - frame.resize_x - client.base_width - + (frame.mwm_border_w * 2) + (client.width_inc / 2); - int dy = frame.resize_h - frame.y_border - client.base_height - ++ int dy = 1 + frame.resize_h - frame.y_border - client.base_height - + frame.handle_h - (frame.border_w * 3) - (frame.mwm_border_w * 2) + + (client.height_inc / 2); - // does the focus window match (or any transient_fors)? - while (ret) { - if (ret->getScreen() == screen && ret->getGroupWindow() == group) { - if (ret->isTransient() && allow_transients) break; - else if (! ret->isTransient()) break; - } + if (dx < (signed) client.min_width) dx = client.min_width; + if (dy < (signed) client.min_height) dy = client.min_height; + if ((unsigned) dx > client.max_width) dx = client.max_width; + if ((unsigned) dy > client.max_height) dy = client.max_height; - ret = ret->getTransientFor(); - } + dx /= client.width_inc; + dy /= client.height_inc; - if (ret) return ret; + if (gx) *gx = dx; + if (gy) *gy = dy; - // the focus window didn't match, look in the group's window list - BlackboxWindowList::const_iterator it, end = windowList.end(); - for (it = windowList.begin(); it != end; ++it) { - ret = *it; - if (ret->getScreen() == screen && ret->getGroupWindow() == group) { - if (ret->isTransient() && allow_transients) break; - else if (! ret->isTransient()) break; - } - } + dx = (dx * client.width_inc) + client.base_width; + dy = (dy * client.height_inc) + client.base_height; - frame.resize_w = dx + (frame.mwm_border_w * 2) + (frame.border_w * 2); - return ret; ++ frame.resize_w = dx + (frame.mwm_border_w * 2) + (frame.border_w * 2) - 1; + frame.resize_x = frame.x + frame.width - frame.resize_w + + (frame.border_w * 2); + frame.resize_h = dy + frame.y_border + frame.handle_h + - (frame.mwm_border_w * 2) + (frame.border_w * 3); ++ (frame.mwm_border_w * 2) + (frame.border_w * 3) - 1; + if (resize_zone & ZoneTop) + frame.resize_y = frame.y + frame.height - frame.resize_h + + screen->getBorderWidth() * 2; + } diff --cc src/Window.h index d6e9f809,00000000..01a27d19 mode 100644,000000..100644 --- a/src/Window.h +++ b/src/Window.h @@@ -1,330 -1,0 +1,363 @@@ +// Window.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Window_hh +#define __Window_hh + +#include +#include +#ifdef SHAPE +# include +#endif // SHAPE + +#include "BaseDisplay.h" +#include "Timer.h" +#include "Windowmenu.h" ++#include "Geometry.h" + +// forward declaration +class OpenboxWindow; + +#define MwmHintsFunctions (1l << 0) +#define MwmHintsDecorations (1l << 1) + +#define MwmFuncAll (1l << 0) +#define MwmFuncResize (1l << 1) +#define MwmFuncMove (1l << 2) +#define MwmFuncIconify (1l << 3) +#define MwmFuncMaximize (1l << 4) +#define MwmFuncClose (1l << 5) + +#define MwmDecorAll (1l << 0) +#define MwmDecorBorder (1l << 1) +#define MwmDecorHandle (1l << 2) +#define MwmDecorTitle (1l << 3) +#define MwmDecorMenu (1l << 4) +#define MwmDecorIconify (1l << 5) +#define MwmDecorMaximize (1l << 6) + +// this structure only contains 3 elements... the Motif 2.0 structure contains +// 5... we only need the first 3... so that is all we will define +typedef struct MwmHints { + unsigned long flags, functions, decorations; +} MwmHints; + +#define PropMwmHintsElements 3 + + +class OpenboxWindow : public TimeoutHandler { +private: + BImageControl *image_ctrl; - Openbox *openbox; ++ Openbox &openbox; + BScreen *screen; + Display *display; + BTimer *timer; + OpenboxAttributes openbox_attrib; + + Time lastButtonPressTime; // used for double clicks, when were we clicked + Windowmenu *windowmenu; + + int window_number, workspace_number; + unsigned long current_state; ++ bool place_window; // place the window ourselves when mapped ++ bool mapped; // this prevents setState from screwing up the ++ // window mapping process + + enum FocusMode { F_NoInput = 0, F_Passive, + F_LocallyActive, F_GloballyActive }; + FocusMode focus_mode; + + enum ResizeZones { + ZoneTop = 1 << 0, + ZoneBottom = 1 << 1, + ZoneLeft = 1 << 2, + ZoneRight = 1 << 3 + }; + unsigned int resize_zone; // bitmask of ResizeZones values + + struct _flags { + Bool moving, // is moving? + resizing, // is resizing? + shaded, // is shaded? + visible, // is visible? + iconic, // is iconified? + transient, // is a transient window? + focused, // has focus? + stuck, // is omnipresent + modal, // is modal? (must be dismissed to continue) + send_focus_message, // should we send focus messages to our client? + shaped, // does the frame use the shape extension? + managed; // under openbox's control? + // maximize is special, the number corresponds + // with a mouse button + // if 0, not maximized + unsigned int maximized; // 1 = HorizVert, 2 = Vertical, 3 = Horizontal + } flags; + + struct _client { - OpenboxWindow *transient_for, // which window are we a transient for? ++ OpenboxWindow *transient_for, // which window are we a transient for? + *transient; // which window is our transient? + + Window window, // the client's window + window_group; // the client's window group + + char *title, *icon_title; + size_t title_len; // strlen(title) + + int x, y, + old_bw; // client's borderwidth + + unsigned int width, height, + title_text_w, // width as rendered in the current font + min_width, min_height, // can not be resized smaller + max_width, max_height, // can not be resized larger + width_inc, height_inc, // increment step + min_aspect_x, min_aspect_y, // minimum aspect ratio + max_aspect_x, max_aspect_y, // maximum aspect ratio + base_width, base_height, + win_gravity; + + unsigned long initial_state, normal_hint_flags, wm_hint_flags; + + MwmHints *mwm_hint; + OpenboxHints *openbox_hint; + } client; + + struct _functions { + Bool resize, move, iconify, maximize, close; + } functions; + + /* + * client window = the application's window + * frame window = the window drawn around the outside of the client window + * by the window manager which contains items like the + * titlebar and close button + * title = the titlebar drawn above the client window, it displays the + * window's name and any buttons for interacting with the window, + * such as iconify, maximize, and close + * label = the window in the titlebar where the title is drawn + * buttons = maximize, iconify, close + * handle = the bar drawn at the bottom of the window, which contains the + * left and right grips used for resizing the window + * grips = the smaller reactangles in the handle, one of each side of it. + * When clicked and dragged, these resize the window interactively + * border = the line drawn around the outside edge of the frame window, + * between the title, the bordered client window, and the handle. + * Also drawn between the grips and the handle + */ + + /* + * what decorations do we have? + * this is based on the type of the client window as well as user input + * the menu is not really decor, but it goes hand in hand with the decor + */ + struct _decorations { + Bool titlebar, handle, border, iconify, maximize, close, menu; + } decorations; + + struct _frame { + // u -> unfocused, f -> has focus + unsigned long ulabel_pixel, flabel_pixel, utitle_pixel, + ftitle_pixel, uhandle_pixel, fhandle_pixel, ubutton_pixel, + fbutton_pixel, pbutton_pixel, uborder_pixel, fborder_pixel, + ugrip_pixel, fgrip_pixel; + Pixmap ulabel, flabel, utitle, ftitle, uhandle, fhandle, + ubutton, fbutton, pbutton, ugrip, fgrip; + + Window window, // the frame + plate, // holds the client + title, + label, + handle, + close_button, iconify_button, maximize_button, + right_grip, left_grip; + + + unsigned int resize_w, resize_h; + int resize_x, resize_y, // size and location of box drawn while resizing + move_x, move_y; // location of box drawn while moving + + int x, y, + grab_x, grab_y, // where was the window when it was grabbed? + y_border, y_handle; // where within frame is the border and handle + + unsigned int width, height, title_h, label_w, label_h, handle_h, + button_w, button_h, grip_w, grip_h, mwm_border_w, border_h, border_w, - bevel_w, snap_w, snap_h; ++ bevel_w; + } frame; + +protected: - Bool getState(void); ++ Bool getState(); + Window createToplevelWindow(int x, int y, unsigned int width, + unsigned int height, unsigned int borderwidth); + Window createChildWindow(Window parent, Cursor = None); + - void getWMName(void); - void getWMIconName(void); - void getWMNormalHints(void); - void getWMProtocols(void); - void getWMHints(void); - void getMWMHints(void); - void getOpenboxHints(void); - void setNetWMAttributes(void); - void associateClientWindow(void); - void decorate(void); - void decorateLabel(void); - void positionButtons(Bool redecorate_label = False); - void positionWindows(void); - void createCloseButton(void); - void createIconifyButton(void); - void createMaximizeButton(void); - void redrawLabel(void); - void redrawAllButtons(void); ++ void getWMName(); ++ void getWMIconName(); ++ void getWMNormalHints(); ++ void getWMProtocols(); ++ void getWMHints(); ++ void getMWMHints(); ++ void getOpenboxHints(); ++ void setNetWMAttributes(); ++ void associateClientWindow(); ++ void decorate(); ++ void decorateLabel(); ++ void positionButtons(); ++ void positionWindows(); ++ void createCloseButton(); ++ void createIconifyButton(); ++ void createMaximizeButton(); ++ void redrawLabel(); ++ void redrawAllButtons(); + void redrawCloseButton(Bool); + void redrawIconifyButton(Bool); + void redrawMaximizeButton(Bool); - void restoreGravity(void); - void setGravityOffsets(void); ++ void restoreGravity(); ++ void setGravityOffsets(); + void setState(unsigned long); - void upsize(void); - void downsize(void); ++ void upsize(); ++ void downsize(); + void right_fixsize(int *gx = 0, int *gy = 0); + void left_fixsize(int *gx = 0, int *gy = 0); ++ void doMove(int x, int y); + + +public: - OpenboxWindow(Openbox *b, Window w, BScreen *s = (BScreen *) 0); - virtual ~OpenboxWindow(void); - - inline Bool isTransient(void) const { return flags.transient; } - inline Bool isFocused(void) const { return flags.focused; } - inline Bool isVisible(void) const { return flags.visible; } - inline Bool isIconic(void) const { return flags.iconic; } - inline Bool isShaded(void) const { return flags.shaded; } - inline Bool isMaximized(void) const { return flags.maximized; } - inline Bool isMaximizedFull(void) const { return flags.maximized == 1; } - inline Bool isStuck(void) const { return flags.stuck; } - inline Bool isIconifiable(void) const { return functions.iconify; } - inline Bool isMaximizable(void) const { return functions.maximize; } - inline Bool isResizable(void) const { return functions.resize; } - inline Bool isClosable(void) const { return functions.close; } - - inline Bool hasTitlebar(void) const { return decorations.titlebar; } - inline Bool hasTransient(void) const ++ OpenboxWindow(Openbox &b, Window w, BScreen *s = (BScreen *) 0); ++ virtual ~OpenboxWindow(); ++ ++ inline Bool isTransient() const { return flags.transient; } ++ inline Bool isFocused() const { return flags.focused; } ++ inline Bool isVisible() const { return flags.visible; } ++ inline Bool isIconic() const { return flags.iconic; } ++ inline Bool isShaded() const { return flags.shaded; } ++ inline Bool isMaximized() const { return flags.maximized; } ++ inline Bool isMaximizedFull() const { return flags.maximized == 1; } ++ inline Bool isStuck() const { return flags.stuck; } ++ inline Bool isIconifiable() const { return functions.iconify; } ++ inline Bool isMaximizable() const { return functions.maximize; } ++ inline Bool isResizable() const { return functions.resize; } ++ inline Bool isClosable() const { return functions.close; } ++ ++ inline Bool hasTitlebar() const { return decorations.titlebar; } ++ inline Bool hasTransient() const + { return ((client.transient) ? True : False); } + - inline OpenboxWindow *getTransient(void) { return client.transient; } - inline OpenboxWindow *getTransientFor(void) { return client.transient_for; } - - inline BScreen *getScreen(void) { return screen; } - - inline const Window &getFrameWindow(void) const { return frame.window; } - inline const Window &getClientWindow(void) const { return client.window; } - - inline Windowmenu * getWindowmenu(void) { return windowmenu; } - - inline char **getTitle(void) { return &client.title; } - inline char **getIconTitle(void) { return &client.icon_title; } - inline const int &getXFrame(void) const { return frame.x; } - inline const int &getYFrame(void) const { return frame.y; } - inline const int &getXClient(void) const { return client.x; } - inline const int &getYClient(void) const { return client.y; } - inline const int &getWorkspaceNumber(void) const { return workspace_number; } - inline const int &getWindowNumber(void) const { return window_number; } - - inline const unsigned int &getWidth(void) const { return frame.width; } - inline const unsigned int &getHeight(void) const { return frame.height; } - inline const unsigned int &getClientHeight(void) const - { return client.height; } - inline const unsigned int &getClientWidth(void) const - { return client.width; } - inline const unsigned int &getTitleHeight(void) const ++ inline OpenboxWindow *getTransient() { return client.transient; } ++ inline OpenboxWindow *getTransientFor() { return client.transient_for; } ++ ++ inline BScreen *getScreen() { return screen; } ++ ++ inline const Window &getFrameWindow() const { return frame.window; } ++ inline const Window &getClientWindow() const { return client.window; } ++ ++ inline Windowmenu * getWindowmenu() { return windowmenu; } ++ ++ inline char **getTitle() { return &client.title; } ++ inline char **getIconTitle() { return &client.icon_title; } ++ //inline const int &getXFrame() const { return frame.x; } ++ //inline const int &getYFrame() const { return frame.y; } ++ //inline const int &getXClient() const { return client.x; } ++ //inline const int &getYClient() const { return client.y; } ++ inline const int &getWorkspaceNumber() const { return workspace_number; } ++ inline const int &getWindowNumber() const { return window_number; } ++ ++ //inline const unsigned int &getWidth() const { return frame.width; } ++ //inline const unsigned int &getHeight() const { ++ // if (!flags.shaded) ++ // return frame.height; ++ // else ++ // return frame.title_h; ++ //} ++ //inline const unsigned int &getClientHeight() const ++ //{ return client.height; } ++ //inline const unsigned int &getClientWidth() const ++ //{ return client.width; } ++ inline const unsigned int &getTitleHeight() const + { return frame.title_h; } + ++ //inline const Point origin() const { ++ // return Point(frame.x, frame.y); ++ //} ++ //inline const Point clientOrigin() const { ++ // return Point(client.x, client.y); ++ //} ++ //inline const Size size() const { ++ // return Size(frame.width, flags.shaded ? frame.title_h : frame.height); ++ //} ++ //inline const Size clientSize() const { ++ // return Size(client.width, client.height); ++ //} ++ inline const Rect area() const { ++ return Rect(frame.x, frame.y, frame.width, ++ flags.shaded ? frame.title_h : frame.height); ++ } ++ inline const Rect clientArea() const { ++ return Rect(client.x, client.y, client.width, client.height); ++ } ++ + inline void setWindowNumber(int n) { window_number = n; } + - Bool validateClient(void); - Bool setInputFocus(void); ++ bool validateClient(); ++ bool setInputFocus(); + + void setFocusFlag(Bool); - void iconify(void); - void deiconify(Bool reassoc = True, Bool raise = True); - void close(void); - void withdraw(void); ++ void iconify(); ++ void deiconify(bool reassoc = true, bool raise = true, bool initial = false); ++ void close(); ++ void withdraw(); + void maximize(unsigned int button); - void shade(void); - void stick(void); - void unstick(void); - void reconfigure(void); ++ void shade(); ++ void stick(); ++ void unstick(); ++ void reconfigure(); + void installColormap(Bool); - void restore(void); ++ void restore(); + void configure(int dx, int dy, unsigned int dw, unsigned int dh); + void setWorkspace(int n); + void changeOpenboxHints(OpenboxHints *); - void restoreAttributes(void); ++ void restoreAttributes(); + ++ void startMove(int x, int y); ++ void endMove(); ++ + void buttonPressEvent(XButtonEvent *); + void buttonReleaseEvent(XButtonEvent *); + void motionNotifyEvent(XMotionEvent *); + void destroyNotifyEvent(XDestroyWindowEvent *); + void mapRequestEvent(XMapRequestEvent *); + void mapNotifyEvent(XMapEvent *); + void unmapNotifyEvent(XUnmapEvent *); + void propertyNotifyEvent(Atom); + void exposeEvent(XExposeEvent *); + void configureRequestEvent(XConfigureRequestEvent *); + +#ifdef SHAPE + void shapeEvent(XShapeEvent *); +#endif // SHAPE + - virtual void timeout(void); ++ virtual void timeout(); +}; + + +#endif // __Window_hh diff --cc src/Windowmenu.cc index d9da5b86,bfe1a1e5..af20a9c7 --- a/src/Windowmenu.cc +++ b/src/Windowmenu.cc @@@ -30,52 -25,53 +30,52 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -extern "C" { -#ifdef HAVE_STRING_H +#include "i18n.h" +#include "openbox.h" +#include "Screen.h" +#include "Window.h" +#include "Windowmenu.h" +#include "Workspace.h" + - #ifdef STDC_HEADERS ++#ifdef HAVE_STRING_H # include - #endif // STDC_HEADERS + #endif // HAVE_STRING_H -} -#include "i18n.hh" -#include "blackbox.hh" -#include "Screen.hh" -#include "Window.hh" -#include "Windowmenu.hh" -#include "Workspace.hh" - Windowmenu::Windowmenu(OpenboxWindow *win) : Basemenu(win->getScreen()) { - -Windowmenu::Windowmenu(BlackboxWindow *win) : Basemenu(win->getScreen()) { -- window = win; - screen = window->getScreen(); ++Windowmenu::Windowmenu(OpenboxWindow &win) : Basemenu(*win.getScreen()), ++ window(win), screen(*win.getScreen()) ++{ setTitleVisibility(False); setMovable(False); setInternalMenu(); -- sendToMenu = new SendtoWorkspacemenu(this); - insert(i18n(WindowmenuSet, WindowmenuSendTo, "Send To ..."), - sendToMenu); - insert(i18n(WindowmenuSet, WindowmenuShade, "Shade"), - BScreen::WindowShade); - insert(i18n(WindowmenuSet, WindowmenuIconify, "Iconify"), - BScreen::WindowIconify); - insert(i18n(WindowmenuSet, WindowmenuMaximize, "Maximize"), - BScreen::WindowMaximize); - insert(i18n(WindowmenuSet, WindowmenuRaise,"Raise"), - BScreen::WindowRaise); - insert(i18n(WindowmenuSet, WindowmenuLower, "Lower"), - BScreen::WindowLower); - insert(i18n(WindowmenuSet, WindowmenuStick, "Stick"), - BScreen::WindowStick); - insert(i18n(WindowmenuSet, WindowmenuKillClient, "Kill Client"), - BScreen::WindowKill); - insert(i18n(WindowmenuSet, WindowmenuClose, "Close"), - BScreen::WindowClose); ++ sendToMenu = new SendtoWorkspacemenu(*this); + insert(i18n->getMessage(WindowmenuSet, WindowmenuSendTo, "Send To ..."), + sendToMenu); + insert(i18n->getMessage(WindowmenuSet, WindowmenuShade, "Shade"), + BScreen::WindowShade); + insert(i18n->getMessage(WindowmenuSet, WindowmenuIconify, "Iconify"), + BScreen::WindowIconify); + insert(i18n->getMessage(WindowmenuSet, WindowmenuMaximize, "Maximize"), + BScreen::WindowMaximize); + insert(i18n->getMessage(WindowmenuSet, WindowmenuRaise,"Raise"), + BScreen::WindowRaise); + insert(i18n->getMessage(WindowmenuSet, WindowmenuLower, "Lower"), + BScreen::WindowLower); + insert(i18n->getMessage(WindowmenuSet, WindowmenuStick, "Stick"), + BScreen::WindowStick); + insert(i18n->getMessage(WindowmenuSet, WindowmenuKillClient, "Kill Client"), + BScreen::WindowKill); + insert(i18n->getMessage(WindowmenuSet, WindowmenuClose, "Close"), + BScreen::WindowClose); update(); -- setItemEnabled(1, window->hasTitlebar()); -- setItemEnabled(2, window->isIconifiable()); -- setItemEnabled(3, window->isMaximizable()); -- setItemEnabled(8, window->isClosable()); ++ setItemEnabled(1, window.hasTitlebar()); ++ setItemEnabled(2, window.isIconifiable()); ++ setItemEnabled(3, window.isMaximizable()); ++ setItemEnabled(8, window.isClosable()); } @@@ -85,71 -81,67 +85,71 @@@ Windowmenu::~Windowmenu(void) void Windowmenu::show(void) { -- if (isItemEnabled(1)) setItemSelected(1, window->isShaded()); -- if (isItemEnabled(3)) setItemSelected(3, window->isMaximized()); -- if (isItemEnabled(6)) setItemSelected(6, window->isStuck()); ++ if (isItemEnabled(1)) setItemSelected(1, window.isShaded()); ++ if (isItemEnabled(3)) setItemSelected(3, window.isMaximized()); ++ if (isItemEnabled(6)) setItemSelected(6, window.isStuck()); Basemenu::show(); } -void Windowmenu::itemSelected(int button, unsigned int index) { - if (button != 1) - return; - +void Windowmenu::itemSelected(int button, int index) { BasemenuItem *item = find(index); - hide(); - switch (item->function()) { - case BScreen::WindowShade: - window->shade(); - break; - - case BScreen::WindowIconify: - window->iconify(); - break; - - case BScreen::WindowMaximize: - window->maximize(1); // full maximize - break; - - case BScreen::WindowClose: - window->close(); - break; - - case BScreen::WindowRaise: { - Workspace *wkspc = getScreen()->getWorkspace(window->getWorkspaceNumber()); - wkspc->raiseWindow(window); - } - break; - - case BScreen::WindowLower: { - Workspace *wkspc = getScreen()->getWorkspace(window->getWorkspaceNumber()); - wkspc->lowerWindow(window); - } - break; - - case BScreen::WindowStick: - window->stick(); - break; - - case BScreen::WindowKill: - XKillClient(getScreen()->getBaseDisplay()->getXDisplay(), - window->getClientWindow()); - break; + /* Added by Scott Moynes, April 8, 2002 + Ignore the middle button for every item except the maximize + button in the window menu. Maximize needs it for + horizontal/vertical maximize, however, for the others it is + inconsistent with the rest of the window behaviour. + */ + if(button != 2) { + hide(); + switch (item->function()) { + case BScreen::WindowShade: - window->shade(); ++ window.shade(); + break; + + case BScreen::WindowIconify: - window->iconify(); ++ window.iconify(); + break; + + case BScreen::WindowMaximize: - window->maximize((unsigned int) button); ++ window.maximize((unsigned int) button); + break; + + case BScreen::WindowClose: - window->close(); ++ window.close(); + break; + + case BScreen::WindowRaise: - screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window); ++ screen.getWorkspace(window.getWorkspaceNumber())->raiseWindow(&window); + break; + + case BScreen::WindowLower: - screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window); ++ screen.getWorkspace(window.getWorkspaceNumber())->lowerWindow(&window); + break; + + case BScreen::WindowStick: - window->stick(); ++ window.stick(); + break; + + case BScreen::WindowKill: - XKillClient(screen->getBaseDisplay()->getXDisplay(), - window->getClientWindow()); ++ XKillClient(screen.getBaseDisplay().getXDisplay(), ++ window.getClientWindow()); + break; + } + } else if (item->function() == BScreen::WindowMaximize) { + hide(); - window->maximize((unsigned int) button); ++ window.maximize((unsigned int) button); } } void Windowmenu::reconfigure(void) { -- setItemEnabled(1, window->hasTitlebar()); -- setItemEnabled(2, window->isIconifiable()); -- setItemEnabled(3, window->isMaximizable()); -- setItemEnabled(8, window->isClosable()); ++ setItemEnabled(1, window.hasTitlebar()); ++ setItemEnabled(2, window.isIconifiable()); ++ setItemEnabled(3, window.isMaximizable()); ++ setItemEnabled(8, window.isClosable()); sendToMenu->reconfigure(); @@@ -157,10 -149,11 +157,8 @@@ } --Windowmenu::SendtoWorkspacemenu::SendtoWorkspacemenu(Windowmenu *w) - : Basemenu(w->screen) { - windowmenu = w; - : Basemenu(w->getScreen()) { - - window = w->window; -- ++Windowmenu::SendtoWorkspacemenu::SendtoWorkspacemenu(Windowmenu &w) ++ : Basemenu(w.screen), windowmenu(w) { setTitleVisibility(False); setMovable(False); setInternalMenu(); @@@ -168,30 -161,40 +166,30 @@@ } -void Windowmenu::SendtoWorkspacemenu::itemSelected(int button, - unsigned int index) { +void Windowmenu::SendtoWorkspacemenu::itemSelected(int button, int index) { if (button > 2) return; - if (index <= windowmenu->screen->getCount()) { - if (index == windowmenu->screen->getCurrentWorkspaceID()) return; - if (windowmenu->window->isStuck()) windowmenu->window->stick(); - if (index <= getScreen()->getWorkspaceCount()) { - if (index == getScreen()->getCurrentWorkspaceID()) return; - if (window->isStuck()) window->stick(); ++ if (index <= windowmenu.screen.getWorkspaceCount()) { ++ if (index == windowmenu.screen.getCurrentWorkspaceID()) return; ++ if (windowmenu.window.isStuck()) windowmenu.window.stick(); - if (button == 1) windowmenu->window->withdraw(); - windowmenu->screen->reassociateWindow(windowmenu->window, index, True); - if (button == 2) windowmenu->screen->changeWorkspaceID(index); - if (button == 1) window->withdraw(); - getScreen()->reassociateWindow(window, index, True); - if (button == 2) getScreen()->changeWorkspaceID(index); ++ if (button == 1) windowmenu.window.withdraw(); ++ windowmenu.screen.reassociateWindow(&(windowmenu.window), index, True); ++ if (button == 2) windowmenu.screen.changeWorkspaceID(index); } hide(); } void Windowmenu::SendtoWorkspacemenu::update(void) { - unsigned int i, r = getCount(), - workspace_count = getScreen()->getWorkspaceCount(); - if (r > workspace_count) { - for (i = r; i < workspace_count; ++i) + int i, r = getCount(); + + if (r != 0) + for (i = 0; i < r; ++i) remove(0); - r = getCount(); - } - for (i = 0; i < windowmenu->screen->getCount(); ++i) - insert(windowmenu->screen->getWorkspace(i)->getName()); - for (i = 0; i < workspace_count; ++i) { - if (r < workspace_count) { - insert(getScreen()->getWorkspace(i)->getName()); - ++r; - } else { - changeItemLabel(i, getScreen()->getWorkspace(i)->getName()); - setItemEnabled(i, i != getScreen()->getCurrentWorkspaceID()); - } - } ++ for (i = 0; i < windowmenu.screen.getWorkspaceCount(); ++i) ++ insert(windowmenu.screen.getWorkspace(i)->getName()); Basemenu::update(); } diff --cc src/Windowmenu.h index 53206df4,26c51457..d892abc5 --- a/src/Windowmenu.h +++ b/src/Windowmenu.h @@@ -35,18 -33,19 +35,18 @@@ class Toolbar class Windowmenu : public Basemenu { private: - OpenboxWindow *window; - BScreen *screen; - BlackboxWindow *window; ++ OpenboxWindow &window; ++ BScreen &screen; class SendtoWorkspacemenu : public Basemenu { private: - Windowmenu *windowmenu; - BlackboxWindow *window; - SendtoWorkspacemenu(const SendtoWorkspacemenu&); - SendtoWorkspacemenu& operator=(const SendtoWorkspacemenu&); ++ Windowmenu &windowmenu; protected: - virtual void itemSelected(int button, unsigned int index); + virtual void itemSelected(int, int); public: - SendtoWorkspacemenu(Windowmenu *); - SendtoWorkspacemenu(Windowmenu *w); ++ SendtoWorkspacemenu(Windowmenu &); void update(void); @@@ -63,7 -64,7 +63,7 @@@ protected public: - Windowmenu(OpenboxWindow *); - Windowmenu(BlackboxWindow *win); ++ Windowmenu(OpenboxWindow &); virtual ~Windowmenu(void); inline Basemenu *getSendToMenu(void) { return (Basemenu *) sendToMenu; } diff --cc src/Workspace.cc index fa1f7990,64710a59..03f988ec --- a/src/Workspace.cc +++ b/src/Workspace.cc @@@ -1,5 -1,6 +1,6 @@@ -// -*- mode: C++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// Workspace.cc for Blackbox - an X11 Window manager -// Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry +// Workspace.cc for Openbox ++// Copyright (c) 2002 - 2002 Ben Jansens (ben@orodu.net) +// Copyright (c) 2001 Sean 'Shaleh' Perry // Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) // // Permission is hereby granted, free of charge, to any person obtaining a @@@ -30,473 -25,608 +31,599 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -extern "C" { -#include -#include - + #ifdef HAVE_STDIO_H + # include + #endif // HAVE_STDIO_H + -#ifdef HAVE_STRING_H ++#ifdef HAVE_STDLIB_H ++# include ++#endif // HAVE_STDLIB_H ++ ++#ifdef HAVE_STRING_H + # include + #endif // HAVE_STRING_H -} - -#include + -#include -#include - -using std::string; - -#include "i18n.hh" -#include "blackbox.hh" -#include "Clientmenu.hh" -#include "Netizen.hh" -#include "Screen.hh" -#include "Toolbar.hh" -#include "Util.hh" -#include "Window.hh" -#include "Workspace.hh" -#include "Windowmenu.hh" +#include +#include +#include "i18n.h" +#include "openbox.h" +#include "Clientmenu.h" +#include "Screen.h" +#include "Toolbar.h" +#include "Window.h" +#include "Workspace.h" +#include "Windowmenu.h" ++#include "Geometry.h" ++#include "Util.h" + - #ifdef HAVE_STDIO_H - # include - #endif // HAVE_STDIO_H - - #ifdef STDC_HEADERS - # include - #endif // STDC_HEADERS - - - Workspace::Workspace(BScreen *scrn, int i) { - screen = scrn; - - cascade_x = cascade_y = 32; ++#include ++#include ++typedef std::vector rectList; -Workspace::Workspace(BScreen *scrn, unsigned int i) { - screen = scrn; ++Workspace::Workspace(BScreen &scrn, int i) : screen(scrn) { ++ cascade_x = cascade_y = 0; ++ _focused = _last = (OpenboxWindow *) 0; + id = i; - stackingList = new LinkedList; - windowList = new LinkedList; - clientmenu = new Clientmenu(this); - - lastfocus = (OpenboxWindow *) 0; - cascade_x = cascade_y = 32; ++ clientmenu = new Clientmenu(*this); - id = i; + name = (char *) 0; - char *tmp = screen->getNameOfWorkspace(id); - setName(tmp); ++ setName(screen.getNameOfWorkspace(id)); +} - clientmenu = new Clientmenu(this); - lastfocus = (BlackboxWindow *) 0; +Workspace::~Workspace(void) { - delete stackingList; - delete windowList; + delete clientmenu; - setName(screen->getNameOfWorkspace(id)); + if (name) + delete [] name; } - const int Workspace::addWindow(OpenboxWindow *w, Bool place) { - if (! w) return -1; -void Workspace::addWindow(BlackboxWindow *w, bool place) { - assert(w != 0); ++void Workspace::addWindow(OpenboxWindow *w, bool place) { ++ ASSERT(w); -- if (place) placeWindow(w); ++ if (place) placeWindow(*w); w->setWorkspace(id); - w->setWindowNumber(windowList->count()); - w->setWindowNumber(windowList.size()); ++ w->setWindowNumber(_windows.size()); - stackingList->insert(w, 0); - windowList->insert(w); - stackingList.push_front(w); - windowList.push_back(w); ++ _zorder.push_front(w); ++ _windows.push_back(w); - clientmenu->insert(w->getTitle()); + clientmenu->insert((const char **) w->getTitle()); clientmenu->update(); -- screen->updateNetizenWindowAdd(w->getClientWindow(), id); ++ screen.updateNetizenWindowAdd(w->getClientWindow(), id); raiseWindow(w); - - return w->getWindowNumber(); } - const int Workspace::removeWindow(OpenboxWindow *w) { -unsigned int Workspace::removeWindow(BlackboxWindow *w) { - assert(w != 0); ++int Workspace::removeWindow(OpenboxWindow *w) { + if (! w) return -1; - stackingList->remove(w); - stackingList.remove(w); ++ winVect::iterator winit = std::find(_windows.begin(), _windows.end(), w); - if (w->isFocused()) { - if (w->isTransient() && w->getTransientFor() && - w->getTransientFor()->isVisible()) { - w->getTransientFor()->setInputFocus(); - } else if (screen->isSloppyFocus()) { - screen->getOpenbox()->setFocusedWindow((OpenboxWindow *) 0); - } else { - OpenboxWindow *top = stackingList->first(); - if (! top || ! top->setInputFocus()) { - screen->getOpenbox()->setFocusedWindow((OpenboxWindow *) 0); - XSetInputFocus(screen->getOpenbox()->getXDisplay(), - screen->getToolbar()->getWindowID(), - RevertToParent, CurrentTime); - } - } - if (w->isFocused() && ! screen->getBlackbox()->doShutdown()) { - BlackboxWindow *newfocus = 0; - if (w->isTransient()) - newfocus = w->getTransientFor(); - if (! newfocus && ! stackingList.empty()) - newfocus = stackingList.front(); - if (! newfocus || ! newfocus->setInputFocus()) - screen->getBlackbox()->setFocusedWindow(0); ++ if (winit == _windows.end()) { ++ if (w == _last) ++ _last = 0; ++ if (w == _focused) ++ _focused = 0; ++ return _windows.size(); } - - if (lastfocus == w) - lastfocus = (BlackboxWindow *) 0; - - windowList.remove(w); + - if (lastfocus == w) - lastfocus = (OpenboxWindow *) 0; ++ _zorder.remove(w); + - windowList->remove(w->getWindowNumber()); ++ if (w == _last) ++ _last = (OpenboxWindow *) 0; ++ if (w == _focused) { ++ OpenboxWindow *fw = (OpenboxWindow *) 0; ++ if (w->isTransient() && w->getTransientFor() && ++ w->getTransientFor()->isVisible()) ++ fw = w->getTransientFor(); ++ else if (screen.sloppyFocus()) // sloppy focus ++ fw = (OpenboxWindow *) 0; ++ else if (!_zorder.empty()) // click focus ++ fw = _zorder.front(); ++ ++ if (fw == (OpenboxWindow *) 0 || !fw->setInputFocus()) ++ screen.getOpenbox().focusWindow(0); ++ } ++ ++ _windows.erase(winit); clientmenu->remove(w->getWindowNumber()); clientmenu->update(); -- screen->updateNetizenWindowDel(w->getClientWindow()); ++ screen.updateNetizenWindowDel(w->getClientWindow()); + - BlackboxWindowList::iterator it = windowList.begin(); - const BlackboxWindowList::iterator end = windowList.end(); - unsigned int i = 0; - for (; it != end; ++it, ++i) ++ winVect::iterator it = _windows.begin(); ++ for (int i=0; it != _windows.end(); ++it, ++i) + (*it)->setWindowNumber(i); + - if (i == 0) - cascade_x = cascade_y = 32; ++ // are there any non-sticky windows left? ++ bool remain = false; ++ for (it = _windows.begin(); it != _windows.end(); ++it) ++ if (!(*it)->isStuck()) { ++ remain = true; ++ break; ++ } ++ if (!remain) // reset cascade when there are no non-sticky windows left ++ cascade_x = cascade_y = 0; ++ ++ return _windows.size(); ++} - LinkedListIterator it(windowList); - OpenboxWindow *bw = it.current(); - for (int i = 0; bw; it++, i++, bw = it.current()) - bw->setWindowNumber(i); - return i; + - return windowList->count(); ++void Workspace::focusWindow(OpenboxWindow *win) { ++ if (_focused != (OpenboxWindow *) 0) ++ clientmenu->setItemSelected(_focused->getWindowNumber(), false); ++ _focused = win; ++ // make sure the focused window belongs to this workspace before highlighting ++ // it in the menu (sticky windows arent in this workspace's menu). ++ if (_focused != (OpenboxWindow *) 0 && _focused->getWorkspaceNumber() == id) ++ clientmenu->setItemSelected(_focused->getWindowNumber(), true); ++ if (win != (OpenboxWindow *) 0) ++ _last = win; } void Workspace::showAll(void) { - LinkedListIterator it(stackingList); - for (OpenboxWindow *bw = it.current(); bw; it++, bw = it.current()) - bw->deiconify(False, False); - std::for_each(stackingList.begin(), stackingList.end(), - std::mem_fun(&BlackboxWindow::show)); ++ winList::iterator it; ++ for (it = _zorder.begin(); it != _zorder.end(); ++it) ++ (*it)->deiconify(false, false); } void Workspace::hideAll(void) { - LinkedList lst; - // withdraw in reverse order to minimize the number of Expose events -- - LinkedListIterator it(stackingList); - for (OpenboxWindow *bw = it.current(); bw; it++, bw = it.current()) - lst.insert(bw, 0); - BlackboxWindowList lst(stackingList.rbegin(), stackingList.rend()); -- - LinkedListIterator it2(&lst); - for (OpenboxWindow *bw = it2.current(); bw; it2++, bw = it2.current()) - BlackboxWindowList::iterator it = lst.begin(); - const BlackboxWindowList::iterator end = lst.end(); - for (; it != end; ++it) { - BlackboxWindow *bw = *it; -- if (! bw->isStuck()) -- bw->withdraw(); ++ // Sticky windows are hidden and then reshown so that Mouse EnterNotify events ++ // are generated properly and sloppy focus works right with sticky windows. ++ winList::reverse_iterator it; ++ for (it = _zorder.rbegin(); it != _zorder.rend(); ++it) { ++ (*it)->withdraw(); ++ if ((*it)->isStuck()) ++ (*it)->deiconify(false, false); + } } void Workspace::removeAll(void) { - LinkedListIterator it(windowList); - for (OpenboxWindow *bw = it.current(); bw; it++, bw = it.current()) - bw->iconify(); - while (! windowList.empty()) - windowList.front()->iconify(); -} - - -/* - * returns the number of transients for win, plus the number of transients - * associated with each transient of win - */ -static int countTransients(const BlackboxWindow * const win) { - int ret = win->getTransients().size(); - if (ret > 0) { - BlackboxWindowList::const_iterator it, end = win->getTransients().end(); - for (it = win->getTransients().begin(); it != end; ++it) { - ret += countTransients(*it); - } - } - return ret; -} - - -/* - * puts the transients of win into the stack. windows are stacked above - * the window before it in the stackvector being iterated, meaning - * stack[0] is on bottom, stack[1] is above stack[0], stack[2] is above - * stack[1], etc... - */ -void Workspace::raiseTransients(const BlackboxWindow * const win, - StackVector::iterator &stack) { - if (win->getTransients().size() == 0) return; // nothing to do - - // put win's transients in the stack - BlackboxWindowList::const_iterator it, end = win->getTransients().end(); - for (it = win->getTransients().begin(); it != end; ++it) { - *stack++ = (*it)->getFrameWindow(); - screen->updateNetizenWindowRaise((*it)->getClientWindow()); - - if (! (*it)->isIconic()) { - Workspace *wkspc = screen->getWorkspace((*it)->getWorkspaceNumber()); - wkspc->stackingList.remove((*it)); - wkspc->stackingList.push_front((*it)); - } - } - - // put transients of win's transients in the stack - for (it = win->getTransients().begin(); it != end; ++it) { - raiseTransients(*it, stack); - } ++ while (! _windows.empty()) ++ _windows.front()->iconify(); } -void Workspace::lowerTransients(const BlackboxWindow * const win, - StackVector::iterator &stack) { - if (win->getTransients().size() == 0) return; // nothing to do +void Workspace::raiseWindow(OpenboxWindow *w) { + OpenboxWindow *win = (OpenboxWindow *) 0, *bottom = w; - // put transients of win's transients in the stack - BlackboxWindowList::const_reverse_iterator it, - end = win->getTransients().rend(); - for (it = win->getTransients().rbegin(); it != end; ++it) { - lowerTransients(*it, stack); - } + while (bottom->isTransient() && bottom->getTransientFor()) + bottom = bottom->getTransientFor(); - // put win's transients in the stack - for (it = win->getTransients().rbegin(); it != end; ++it) { - *stack++ = (*it)->getFrameWindow(); - screen->updateNetizenWindowLower((*it)->getClientWindow()); + int i = 1; + win = bottom; + while (win->hasTransient() && win->getTransient()) { + win = win->getTransient(); - if (! (*it)->isIconic()) { - Workspace *wkspc = screen->getWorkspace((*it)->getWorkspaceNumber()); - wkspc->stackingList.remove((*it)); - wkspc->stackingList.push_back((*it)); - } + i++; } -} + Window *nstack = new Window[i], *curr = nstack; + Workspace *wkspc; -void Workspace::raiseWindow(BlackboxWindow *w) { - BlackboxWindow *win = w; + win = bottom; - while (True) { ++ while (true) { + *(curr++) = win->getFrameWindow(); - screen->updateNetizenWindowRaise(win->getClientWindow()); ++ screen.updateNetizenWindowRaise(win->getClientWindow()); - // walk up the transient_for's to the window that is not a transient - while (win->isTransient()) { - if (! win->getTransientFor()) break; - win = win->getTransientFor(); - } - - // get the total window count (win and all transients) - unsigned int i = 1 + countTransients(win); + if (! win->isIconic()) { - wkspc = screen->getWorkspace(win->getWorkspaceNumber()); - wkspc->stackingList->remove(win); - wkspc->stackingList->insert(win, 0); ++ wkspc = screen.getWorkspace(win->getWorkspaceNumber()); ++ wkspc->_zorder.remove(win); ++ wkspc->_zorder.push_front(win); + } - // stack the window with all transients above - StackVector stack_vector(i); - StackVector::iterator stack = stack_vector.begin(); + if (! win->hasTransient() || ! win->getTransient()) + break; - *(stack++) = win->getFrameWindow(); - screen->updateNetizenWindowRaise(win->getClientWindow()); - if (! win->isIconic()) { - Workspace *wkspc = screen->getWorkspace(win->getWorkspaceNumber()); - wkspc->stackingList.remove(win); - wkspc->stackingList.push_front(win); + win = win->getTransient(); } - screen->raiseWindows(nstack, i); - raiseTransients(win, stack); ++ screen.raiseWindows(nstack, i); - screen->raiseWindows(&stack_vector[0], stack_vector.size()); + delete [] nstack; } -void Workspace::lowerWindow(BlackboxWindow *w) { - BlackboxWindow *win = w; +void Workspace::lowerWindow(OpenboxWindow *w) { + OpenboxWindow *win = (OpenboxWindow *) 0, *bottom = w; - // walk up the transient_for's to the window that is not a transient - while (win->isTransient()) { - if (! win->getTransientFor()) break; - win = win->getTransientFor(); - } - - // get the total window count (win and all transients) - unsigned int i = 1 + countTransients(win); - - // stack the window with all transients above - StackVector stack_vector(i); - StackVector::iterator stack = stack_vector.begin(); + while (bottom->isTransient() && bottom->getTransientFor()) + bottom = bottom->getTransientFor(); - lowerTransients(win, stack); + int i = 1; + win = bottom; + while (win->hasTransient() && win->getTransient()) { + win = win->getTransient(); - *(stack++) = win->getFrameWindow(); - screen->updateNetizenWindowLower(win->getClientWindow()); - if (! win->isIconic()) { - Workspace *wkspc = screen->getWorkspace(win->getWorkspaceNumber()); - wkspc->stackingList.remove(win); - wkspc->stackingList.push_back(win); + i++; } - XLowerWindow(screen->getBaseDisplay()->getXDisplay(), stack_vector.front()); - XRestackWindows(screen->getBaseDisplay()->getXDisplay(), - &stack_vector[0], stack_vector.size()); -} + Window *nstack = new Window[i], *curr = nstack; + Workspace *wkspc; - while (True) { ++ while (true) { + *(curr++) = win->getFrameWindow(); - screen->updateNetizenWindowLower(win->getClientWindow()); ++ screen.updateNetizenWindowLower(win->getClientWindow()); -void Workspace::reconfigure(void) { - clientmenu->reconfigure(); - std::for_each(windowList.begin(), windowList.end(), - std::mem_fun(&BlackboxWindow::reconfigure)); -} - - -void Workspace::updateFocusModel(void) { - std::for_each(windowList.begin(), windowList.end(), - std::mem_fun(&BlackboxWindow::updateFocusModel)); -} + if (! win->isIconic()) { - wkspc = screen->getWorkspace(win->getWorkspaceNumber()); - wkspc->stackingList->remove(win); - wkspc->stackingList->insert(win); ++ wkspc = screen.getWorkspace(win->getWorkspaceNumber()); ++ wkspc->_zorder.remove(win); ++ wkspc->_zorder.push_back(win); + } + if (! win->getTransientFor()) + break; -BlackboxWindow *Workspace::getWindow(unsigned int index) { - if (index < windowList.size()) { - BlackboxWindowList::iterator it = windowList.begin(); - for(; index > 0; --index, ++it); /* increment to index */ - return *it; + win = win->getTransientFor(); } - return 0; -} - screen->getOpenbox()->grab(); ++ screen.getOpenbox().grab(); - XLowerWindow(screen->getBaseDisplay()->getXDisplay(), *nstack); - XRestackWindows(screen->getBaseDisplay()->getXDisplay(), nstack, i); -BlackboxWindow* -Workspace::getNextWindowInList(BlackboxWindow *w) { - BlackboxWindowList::iterator it = std::find(windowList.begin(), - windowList.end(), - w); - assert(it != windowList.end()); // window must be in list - ++it; // next window - if (it == windowList.end()) - return windowList.front(); // if we walked off the end, wrap around ++ XLowerWindow(screen.getBaseDisplay().getXDisplay(), *nstack); ++ XRestackWindows(screen.getBaseDisplay().getXDisplay(), nstack, i); - screen->getOpenbox()->ungrab(); - return *it; ++ screen.getOpenbox().ungrab(); + + delete [] nstack; } -BlackboxWindow* Workspace::getPrevWindowInList(BlackboxWindow *w) { - BlackboxWindowList::iterator it = std::find(windowList.begin(), - windowList.end(), - w); - assert(it != windowList.end()); // window must be in list - if (it == windowList.begin()) - return windowList.back(); // if we walked of the front, wrap around +void Workspace::reconfigure(void) { + clientmenu->reconfigure(); - LinkedListIterator it(windowList); - for (OpenboxWindow *bw = it.current(); bw; it++, bw = it.current()) { - if (bw->validateClient()) - bw->reconfigure(); - } - return *(--it); ++ winVect::iterator it; ++ for (it = _windows.begin(); it != _windows.end(); ++it) ++ if ((*it)->validateClient()) ++ (*it)->reconfigure(); } -BlackboxWindow* Workspace::getTopWindowOnStack(void) const { - return stackingList.front(); +OpenboxWindow *Workspace::getWindow(int index) { - if ((index >= 0) && (index < windowList->count())) - return windowList->find(index); ++ if ((index >= 0) && (index < (signed)_windows.size())) ++ return _windows[index]; + else - return 0; ++ return (OpenboxWindow *) 0; } - const int Workspace::getCount(void) { - return windowList->count(); -void Workspace::sendWindowList(Netizen &n) { - BlackboxWindowList::iterator it = windowList.begin(), - end = windowList.end(); - for(; it != end; ++it) - n.sendWindowAdd((*it)->getClientWindow(), getID()); ++int Workspace::getCount(void) { ++ return (signed)_windows.size(); } -unsigned int Workspace::getCount(void) const { - return windowList.size(); +void Workspace::update(void) { + clientmenu->update(); - screen->getToolbar()->redrawWindowLabel(True); ++ screen.getToolbar()->redrawWindowLabel(true); } - Bool Workspace::isCurrent(void) { -bool Workspace::isCurrent(void) const { -- return (id == screen->getCurrentWorkspaceID()); ++bool Workspace::isCurrent(void) { ++ return (id == screen.getCurrentWorkspaceID()); } - Bool Workspace::isLastWindow(OpenboxWindow *w) { - return (w == windowList->last()); -bool Workspace::isLastWindow(const BlackboxWindow* const w) const { - return (w == windowList.back()); --} -- void Workspace::setCurrent(void) { -- screen->changeWorkspaceID(id); ++ screen.changeWorkspaceID(id); } - void Workspace::setName(char *new_name) { -void Workspace::setName(const string& new_name) { - if (! new_name.empty()) { - name = new_name; ++void Workspace::setName(const char *new_name) { + if (name) + delete [] name; + + if (new_name) { + name = bstrdup(new_name); } else { - string tmp =i18n(WorkspaceSet, WorkspaceDefaultNameFormat, "Workspace %d"); - assert(tmp.length() < 32); - char default_name[32]; - sprintf(default_name, tmp.c_str(), id + 1); - name = default_name; + name = new char[128]; + sprintf(name, i18n->getMessage(WorkspaceSet, WorkspaceDefaultNameFormat, + "Workspace %d"), id + 1); } - + clientmenu->setLabel(name); clientmenu->update(); - screen->saveWorkspaceNames(); ++ screen.saveWorkspaceNames(); } -/* - * Calculate free space available for window placement. - */ -typedef std::vector rectList; +void Workspace::shutdown(void) { - while (windowList->count()) { - windowList->first()->restore(); - delete windowList->first(); ++ while (!_windows.empty()) ++ _windows[0]->restore(); ++} + + static rectList calcSpace(const Rect &win, const rectList &spaces) { - Rect isect, extra; + rectList result; - rectList::const_iterator siter, end = spaces.end(); - for (siter = spaces.begin(); siter != end; ++siter) { - const Rect &curr = *siter; - - if(! win.intersects(curr)) { - result.push_back(curr); - continue; - } ++ rectList::const_iterator siter; ++ for(siter=spaces.begin(); siter!=spaces.end(); ++siter) { ++ const Rect &curr = *siter; ++ ++ if(!win.Intersect(curr)) { ++ result.push_back(curr); ++ continue; ++ } ++ //Check for space to the left of the window ++ if(win.x() > curr.x()) ++ result.push_back(Rect(curr.x(), curr.y(), ++ win.x() - curr.x() + 1, ++ curr.h())); ++ //Check for space above the window ++ if(win.y() > siter->y()) ++ result.push_back(Rect(curr.x(), curr.y(), ++ curr.w(), ++ win.y() - curr.y() + 1)); ++ //Check for space to the right of the window ++ if(win.right() < curr.right()) ++ result.push_back(Rect(win.right(), ++ curr.top(), ++ curr.right() - win.right(), ++ curr.h())); ++ //Check for space below the window ++ if(win.bottom() < curr.bottom()) ++ result.push_back(Rect(curr.x(), ++ win.bottom(), ++ curr.w(), ++ curr.bottom()-win.bottom())); + - /* Use an intersection of win and curr to determine the space around - * curr that we can use. - * - * NOTE: the spaces calculated can overlap. - */ - isect = curr & win; - - // left - extra.setCoords(curr.left(), curr.top(), - isect.left() - 1, curr.bottom()); - if (extra.valid()) result.push_back(extra); - - // top - extra.setCoords(curr.left(), curr.top(), - curr.right(), isect.top() - 1); - if (extra.valid()) result.push_back(extra); - - // right - extra.setCoords(isect.right() + 1, curr.top(), - curr.right(), curr.bottom()); - if (extra.valid()) result.push_back(extra); - - // bottom - extra.setCoords(curr.left(), isect.bottom() + 1, - curr.right(), curr.bottom()); - if (extra.valid()) result.push_back(extra); } + return result; } - void Workspace::placeWindow(OpenboxWindow *win) { - Bool placed = False; - - const int win_w = win->getWidth() + (screen->getBorderWidth() * 4), - win_h = win->getHeight() + (screen->getBorderWidth() * 4), - #ifdef SLIT - slit_x = screen->getSlit()->getX() - screen->getBorderWidth(), - slit_y = screen->getSlit()->getY() - screen->getBorderWidth(), - slit_w = screen->getSlit()->getWidth() + - (screen->getBorderWidth() * 4), - slit_h = screen->getSlit()->getHeight() + - (screen->getBorderWidth() * 4), - #endif // SLIT - toolbar_x = screen->getToolbar()->getX() - screen->getBorderWidth(), - toolbar_y = screen->getToolbar()->getY() - screen->getBorderWidth(), - toolbar_w = screen->getToolbar()->getWidth() + - (screen->getBorderWidth() * 4), - toolbar_h = screen->getToolbar()->getHeight() + - (screen->getBorderWidth() * 4), - start_pos = 0, - change_y = - ((screen->getColPlacementDirection() == BScreen::TopBottom) ? 1 : -1), - change_x = - ((screen->getRowPlacementDirection() == BScreen::LeftRight) ? 1 : -1), - delta_x = 8, delta_y = 8; - - int test_x, test_y, place_x = 0, place_y = 0; - LinkedListIterator it(windowList); - - switch (screen->getPlacementPolicy()) { - case BScreen::RowSmartPlacement: { - test_y = (screen->getColPlacementDirection() == BScreen::TopBottom) ? - start_pos : screen->getHeight() - win_h - start_pos; - - while (!placed && - ((screen->getColPlacementDirection() == BScreen::BottomTop) ? - test_y > 0 : test_y + win_h < (signed) screen->getHeight())) { - test_x = (screen->getRowPlacementDirection() == BScreen::LeftRight) ? - start_pos : screen->getWidth() - win_w - start_pos; - - while (!placed && - ((screen->getRowPlacementDirection() == BScreen::RightLeft) ? - test_x > 0 : test_x + win_w < (signed) screen->getWidth())) { - placed = True; - - it.reset(); - for (OpenboxWindow *curr = it.current(); placed && curr; - it++, curr = it.current()) { - if (curr->isMaximizedFull()) // fully maximized, ignore it - continue; - int curr_w = curr->getWidth() + (screen->getBorderWidth() * 4); - int curr_h = - ((curr->isShaded()) ? curr->getTitleHeight() : curr->getHeight()) + - (screen->getBorderWidth() * 4); - - if (curr->getXFrame() < test_x + win_w && - curr->getXFrame() + curr_w > test_x && - curr->getYFrame() < test_y + win_h && - curr->getYFrame() + curr_h > test_y) { - placed = False; - } - } - - if (placed && - (toolbar_x < test_x + win_w && - toolbar_x + toolbar_w > test_x && - toolbar_y < test_y + win_h && - toolbar_y + toolbar_h > test_y) - #ifdef SLIT - || - (slit_x < test_x + win_w && - slit_x + slit_w > test_x && - slit_y < test_y + win_h && - slit_y + slit_h > test_y) - #endif // SLIT - ) - placed = False; - - if (placed) { - place_x = test_x; - place_y = test_y; - - break; - } - - test_x += (change_x * delta_x); - } -- - test_y += (change_y * delta_y); - } -static bool rowRLBT(const Rect &first, const Rect &second) { - if (first.bottom() == second.bottom()) - return first.right() > second.right(); - return first.bottom() > second.bottom(); ++bool rowRLBT(const Rect &first, const Rect &second){ ++ if (first.y()+first.h()==second.y()+second.h()) ++ return first.x()+first.w()>second.x()+second.w(); ++ return first.y()+first.h()>second.y()+second.h(); + } - -static bool rowRLTB(const Rect &first, const Rect &second) { - if (first.y() == second.y()) - return first.right() > second.right(); - return first.y() < second.y(); ++ ++bool rowRLTB(const Rect &first, const Rect &second){ ++ if (first.y()==second.y()) ++ return first.x()+first.w()>second.x()+second.w(); ++ return first.y() second.bottom(); ++bool rowLRBT(const Rect &first, const Rect &second){ ++ if (first.y()+first.h()==second.y()+second.h()) ++ return first.x()second.y()+second.h(); + } - -static bool rowLRTB(const Rect &first, const Rect &second) { - if (first.y() == second.y()) - return first.x() < second.x(); - return first.y() < second.y(); ++ ++bool rowLRTB(const Rect &first, const Rect &second){ ++ if (first.y()==second.y()) ++ return first.x() second.bottom(); - return first.x() < second.x(); ++ ++bool colLRBT(const Rect &first, const Rect &second){ ++ if (first.x()==second.x()) ++ return first.y()+first.h()>second.y()+second.h(); ++ return first.x() second.right(); ++bool colRLTB(const Rect &first, const Rect &second){ ++ if (first.x()+first.w()==second.x()+second.w()) ++ return first.y()second.x()+second.w(); + } - -static bool colRLBT(const Rect &first, const Rect &second) { - if (first.right() == second.right()) - return first.bottom() > second.bottom(); - return first.right() > second.right(); ++ ++bool colRLBT(const Rect &first, const Rect &second){ ++ if (first.x()+first.w()==second.x()+second.w()) ++ return first.y()+first.h()>second.y()+second.h(); ++ return first.x()+first.w()>second.x()+second.w(); + } + + -bool Workspace::smartPlacement(Rect& win, const Rect& availableArea) { ++//BestFitPlacement finds the smallest free space that fits the window ++//to be placed. It currentl ignores whether placement is right to left or top ++//to bottom. ++Point *Workspace::bestFitPlacement(const Size &win_size, const Rect &space) { ++ const Rect *best; + rectList spaces; - spaces.push_back(availableArea); //initially the entire screen is free - ++ rectList::const_iterator siter; ++ spaces.push_back(space); //initially the entire screen is free ++ + //Find Free Spaces - BlackboxWindowList::const_iterator wit = windowList.begin(), - end = windowList.end(); - Rect tmp; - for (; wit != end; ++wit) { - const BlackboxWindow* const curr = *wit; - - if (curr->isShaded()) continue; - - tmp.setRect(curr->frameRect().x(), curr->frameRect().y(), - curr->frameRect().width() + screen->getBorderWidth(), - curr->frameRect().height() + screen->getBorderWidth()); - - spaces = calcSpace(tmp, spaces); - } - - if (screen->getPlacementPolicy() == BScreen::RowSmartPlacement) { - if(screen->getRowPlacementDirection() == BScreen::LeftRight) { - if(screen->getColPlacementDirection() == BScreen::TopBottom) - std::sort(spaces.begin(), spaces.end(), rowLRTB); - else - std::sort(spaces.begin(), spaces.end(), rowLRBT); - } else { - if(screen->getColPlacementDirection() == BScreen::TopBottom) - std::sort(spaces.begin(), spaces.end(), rowRLTB); - else - std::sort(spaces.begin(), spaces.end(), rowRLBT); - } - } else { - if(screen->getColPlacementDirection() == BScreen::TopBottom) { - if(screen->getRowPlacementDirection() == BScreen::LeftRight) - std::sort(spaces.begin(), spaces.end(), colLRTB); - else - std::sort(spaces.begin(), spaces.end(), colRLTB); - } else { - if(screen->getRowPlacementDirection() == BScreen::LeftRight) - std::sort(spaces.begin(), spaces.end(), colLRBT); - else - std::sort(spaces.begin(), spaces.end(), colRLBT); ++ winVect::iterator it; ++ for (it = _windows.begin(); it != _windows.end(); ++it) ++ if (!(*it)->isMaximizedFull()) ++ spaces = calcSpace((*it)->area().Inflate(screen.getBorderWidth() * 4), ++ spaces); ++ ++ //Find first space that fits the window ++ best = NULL; ++ for (siter=spaces.begin(); siter!=spaces.end(); ++siter) { ++ if ((siter->w() >= win_size.w()) && (siter->h() >= win_size.h())) { ++ if (best==NULL) ++ best = &*siter; ++ else if(siter->w()*siter->h()h()*best->w()) ++ best = &*siter; + } + } - - rectList::const_iterator sit = spaces.begin(), spaces_end = spaces.end(); - for(; sit != spaces_end; ++sit) { - if (sit->width() >= win.width() && sit->height() >= win.height()) - break; - } - - if (sit == spaces_end) - return False; - - //set new position based on the empty space found - const Rect& where = *sit; - win.setX(where.x()); - win.setY(where.y()); - - // adjust the location() based on left/right and top/bottom placement - if (screen->getPlacementPolicy() == BScreen::RowSmartPlacement) { - if (screen->getRowPlacementDirection() == BScreen::RightLeft) - win.setX(where.right() - win.width()); - if (screen->getColPlacementDirection() == BScreen::BottomTop) - win.setY(where.bottom() - win.height()); - } else { - if (screen->getColPlacementDirection() == BScreen::BottomTop) - win.setY(win.y() + where.height() - win.height()); - if (screen->getRowPlacementDirection() == BScreen::RightLeft) - win.setX(win.x() + where.width() - win.width()); ++ if (best != NULL) { ++ Point *pt = new Point(best->origin()); ++ if (screen.colPlacementDirection() != BScreen::TopBottom) ++ pt->setY(pt->y() + (best->h() - win_size.h())); ++ if (screen.rowPlacementDirection() != BScreen::LeftRight) ++ pt->setX(pt->x() + (best->w() - win_size.w())); ++ return pt; } - return True; ++ return NULL; //fall back to cascade + } + ++Point *Workspace::underMousePlacement(const Size &win_size, const Rect &space) { ++ Point *pt; + -bool Workspace::underMousePlacement(Rect &win, const Rect &availableArea) { + int x, y, rx, ry; + Window c, r; + unsigned int m; - XQueryPointer(screen->getBlackbox()->getXDisplay(), screen->getRootWindow(), ++ XQueryPointer(screen.getOpenbox().getXDisplay(), screen.getRootWindow(), + &r, &c, &rx, &ry, &x, &y, &m); - x = rx - win.width() / 2; - y = ry - win.height() / 2; ++ pt = new Point(rx - win_size.w() / 2, ry - win_size.h() / 2); ++ ++ if (pt->x() < space.x()) ++ pt->setX(space.x()); ++ if (pt->y() < space.y()) ++ pt->setY(space.y()); ++ if (pt->x() + win_size.w() > space.x() + space.w()) ++ pt->setX(space.x() + space.w() - win_size.w()); ++ if (pt->y() + win_size.h() > space.y() + space.h()) ++ pt->setY(space.y() + space.h() - win_size.h()); ++ return pt; ++} + - if (x < availableArea.x()) - x = availableArea.x(); - if (y < availableArea.y()) - y = availableArea.y(); - if (x + win.width() > availableArea.x() + availableArea.width()) - x = availableArea.x() + availableArea.width() - win.width(); - if (y + win.height() > availableArea.y() + availableArea.height()) - y = availableArea.y() + availableArea.height() - win.height(); ++Point *Workspace::rowSmartPlacement(const Size &win_size, const Rect &space) { ++ const Rect *best; ++ rectList spaces; - case BScreen::ColSmartPlacement: { - test_x = (screen->getRowPlacementDirection() == BScreen::LeftRight) ? - start_pos : screen->getWidth() - win_w - start_pos; - - while (!placed && - ((screen->getRowPlacementDirection() == BScreen::RightLeft) ? - test_x > 0 : test_x + win_w < (signed) screen->getWidth())) { - test_y = (screen->getColPlacementDirection() == BScreen::TopBottom) ? - start_pos : screen->getHeight() - win_h - start_pos; - - while (!placed && - ((screen->getColPlacementDirection() == BScreen::BottomTop) ? - test_y > 0 : test_y + win_h < (signed) screen->getHeight())) { - placed = True; - - it.reset(); - for (OpenboxWindow *curr = it.current(); placed && curr; - it++, curr = it.current()) { - if (curr->isMaximizedFull()) // fully maximized, ignore it - continue; - int curr_w = curr->getWidth() + (screen->getBorderWidth() * 4); - int curr_h = - ((curr->isShaded()) ? curr->getTitleHeight() : curr->getHeight()) + - (screen->getBorderWidth() * 4); - - if (curr->getXFrame() < test_x + win_w && - curr->getXFrame() + curr_w > test_x && - curr->getYFrame() < test_y + win_h && - curr->getYFrame() + curr_h > test_y) { - placed = False; - } - } - - if (placed && - (toolbar_x < test_x + win_w && - toolbar_x + toolbar_w > test_x && - toolbar_y < test_y + win_h && - toolbar_y + toolbar_h > test_y) - #ifdef SLIT - || - (slit_x < test_x + win_w && - slit_x + slit_w > test_x && - slit_y < test_y + win_h && - slit_y + slit_h > test_y) - #endif // SLIT - ) - placed = False; - - if (placed) { - place_x = test_x; - place_y = test_y; - - break; - } - - test_y += (change_y * delta_y); - } - - test_x += (change_x * delta_x); - win.setX(x); - win.setY(y); ++ rectList::const_iterator siter; ++ spaces.push_back(space); //initially the entire screen is free ++ ++ //Find Free Spaces ++ winVect::iterator it; ++ for (it = _windows.begin(); it != _windows.end(); ++it) ++ if (!(*it)->isMaximizedFull()) ++ spaces = calcSpace((*it)->area().Inflate(screen.getBorderWidth() * 4), ++ spaces); ++ //Sort spaces by preference ++ if(screen.rowPlacementDirection() == BScreen::RightLeft) ++ if(screen.colPlacementDirection() == BScreen::TopBottom) ++ sort(spaces.begin(),spaces.end(),rowRLTB); ++ else ++ sort(spaces.begin(),spaces.end(),rowRLBT); ++ else ++ if(screen.colPlacementDirection() == BScreen::TopBottom) ++ sort(spaces.begin(),spaces.end(),rowLRTB); ++ else ++ sort(spaces.begin(),spaces.end(),rowLRBT); ++ best = NULL; ++ for (siter=spaces.begin(); siter!=spaces.end(); ++siter) ++ if ((siter->w() >= win_size.w()) && (siter->h() >= win_size.h())) { ++ best = &*siter; ++ break; + } - break; - return True; ++ if (best != NULL) { ++ Point *pt = new Point(best->origin()); ++ if (screen.colPlacementDirection() != BScreen::TopBottom) ++ pt->setY(best->y() + best->h() - win_size.h()); ++ if (screen.rowPlacementDirection() != BScreen::LeftRight) ++ pt->setX(best->x()+best->w()-win_size.w()); ++ return pt; + } - } // switch ++ return NULL; //fall back to cascade + } - if (! placed) { - if (((unsigned) cascade_x > (screen->getWidth() / 2)) || - ((unsigned) cascade_y > (screen->getHeight() / 2))) - cascade_x = cascade_y = 32; ++Point *Workspace::colSmartPlacement(const Size &win_size, const Rect &space) { ++ const Rect *best; ++ rectList spaces; - place_x = cascade_x; - place_y = cascade_y; -bool Workspace::cascadePlacement(Rect &win, const Rect &availableArea) { - if ((cascade_x > static_cast(availableArea.width() / 2)) || - (cascade_y > static_cast(availableArea.height() / 2))) - cascade_x = cascade_y = 32; ++ rectList::const_iterator siter; ++ spaces.push_back(space); //initially the entire screen is free ++ ++ //Find Free Spaces ++ winVect::iterator it; ++ for (it = _windows.begin(); it != _windows.end(); ++it) ++ if (!(*it)->isMaximizedFull()) ++ spaces = calcSpace((*it)->area().Inflate(screen.getBorderWidth() * 4), ++ spaces); ++ //Sort spaces by user preference ++ if(screen.colPlacementDirection() == BScreen::TopBottom) ++ if(screen.rowPlacementDirection() == BScreen::LeftRight) ++ sort(spaces.begin(),spaces.end(),colLRTB); ++ else ++ sort(spaces.begin(),spaces.end(),colRLTB); ++ else ++ if(screen.rowPlacementDirection() == BScreen::LeftRight) ++ sort(spaces.begin(),spaces.end(),colLRBT); ++ else ++ sort(spaces.begin(),spaces.end(),colRLBT); ++ ++ //Find first space that fits the window ++ best = NULL; ++ for (siter=spaces.begin(); siter!=spaces.end(); ++siter) ++ if ((siter->w() >= win_size.w()) && (siter->h() >= win_size.h())) { ++ best = &*siter; ++ break; ++ } - cascade_x += win->getTitleHeight(); - cascade_y += win->getTitleHeight(); - if (cascade_x == 32) { - cascade_x += availableArea.x(); - cascade_y += availableArea.y(); ++ if (best != NULL) { ++ Point *pt = new Point(best->origin()); ++ if (screen.colPlacementDirection() != BScreen::TopBottom) ++ pt->setY(pt->y() + (best->h() - win_size.h())); ++ if (screen.rowPlacementDirection() != BScreen::LeftRight) ++ pt->setX(pt->x() + (best->w() - win_size.w())); ++ return pt; } - - if (place_x + win_w > (signed) screen->getWidth()) - place_x = (((signed) screen->getWidth()) - win_w) / 2; - if (place_y + win_h > (signed) screen->getHeight()) - place_y = (((signed) screen->getHeight()) - win_h) / 2; ++ return NULL; //fall back to cascade ++} ++ + - win.setPos(cascade_x, cascade_y); ++Point *const Workspace::cascadePlacement(const OpenboxWindow &win, ++ const Rect &space) { ++ cascade_x += win.getTitleHeight(); ++ cascade_y += win.getTitleHeight(); ++ ++ const int min_x = space.x() + win.getTitleHeight(), ++ min_y = space.y() + win.getTitleHeight(); ++ ++ if (((cascade_x + win.area().w() + screen.getBorderWidth() * 2 > ++ (space.x() + space.w())) || ++ (cascade_y + win.area().h() + screen.getBorderWidth() * 2 > ++ (space.y() + space.h()))) || ++ (cascade_x < min_x || cascade_y < min_y)) { ++ cascade_x = min_x; ++ cascade_y = min_y; + - return True; ++ } ++ ++ return new Point(cascade_x, cascade_y); + } + + -void Workspace::placeWindow(BlackboxWindow *win) { - Rect availableArea(screen->availableArea()), - new_win(availableArea.x(), availableArea.y(), - win->frameRect().width(), win->frameRect().height()); - bool placed = False; ++void Workspace::placeWindow(OpenboxWindow &win) { ++ Rect space = screen.availableArea(); ++ const Size window_size(win.area().w()+screen.getBorderWidth() * 2, ++ win.area().h()+screen.getBorderWidth() * 2); ++ Point *place = NULL; + - switch (screen->getPlacementPolicy()) { ++ switch (screen.placementPolicy()) { ++ case BScreen::BestFitPlacement: ++ place = bestFitPlacement(window_size, space); ++ break; + case BScreen::RowSmartPlacement: ++ place = rowSmartPlacement(window_size, space); ++ break; + case BScreen::ColSmartPlacement: - placed = smartPlacement(new_win, availableArea); ++ place = colSmartPlacement(window_size, space); + break; + case BScreen::UnderMousePlacement: - placed = underMousePlacement(new_win, availableArea); - default: - break; // handled below ++ case BScreen::ClickMousePlacement: ++ place = underMousePlacement(window_size, space); ++ break; + } // switch - win->configure(place_x, place_y, win->getWidth(), win->getHeight()); - if (placed == False) { - cascadePlacement(new_win, availableArea); - cascade_x += win->getTitleHeight() + (screen->getBorderWidth() * 2); - cascade_y += win->getTitleHeight() + (screen->getBorderWidth() * 2); - } - - if (new_win.right() > availableArea.right()) - new_win.setX(availableArea.left()); - if (new_win.bottom() > availableArea.bottom()) - new_win.setY(availableArea.top()); - win->configure(new_win.x(), new_win.y(), new_win.width(), new_win.height()); ++ if (place == NULL) ++ place = cascadePlacement(win, space); ++ ++ ASSERT(place != NULL); ++ if (place->x() + window_size.w() > (signed) space.x() + space.w()) ++ place->setX(((signed) space.x() + space.w() - window_size.w()) / 2); ++ if (place->y() + window_size.h() > (signed) space.y() + space.h()) ++ place->setY(((signed) space.y() + space.h() - window_size.h()) / 2); ++ ++ win.configure(place->x(), place->y(), win.area().w(), win.area().h()); ++ delete place; } diff --cc src/Workspace.h index f9700bdc,00000000..8601c413 mode 100644,000000..100644 --- a/src/Workspace.h +++ b/src/Workspace.h @@@ -1,90 -1,0 +1,94 @@@ +// Workspace.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __Workspace_hh +#define __Workspace_hh + +#include + - #include "LinkedList.h" ++#include ++#include + +class BScreen; +class Clientmenu; +class Workspace; +class OpenboxWindow; ++class Size; ++class Rect; + +class Workspace { +private: - BScreen *screen; - OpenboxWindow *lastfocus; ++ BScreen &screen; + Clientmenu *clientmenu; + - LinkedList *stackingList, *windowList; ++ typedef std::vector winVect; ++ winVect _windows; ++ typedef std::list winList; ++ winList _zorder; + + char *name; + int id, cascade_x, cascade_y; + ++ OpenboxWindow *_focused, *_last; // last is the same as focused except ++ // that when focus is removed from all ++ // windows on the workspace, last doesnt ++ // change to NULL + +protected: - void placeWindow(OpenboxWindow *); - ++ void placeWindow(OpenboxWindow &); ++ Point *bestFitPlacement(const Size &win_size, const Rect &space); ++ Point *underMousePlacement(const Size &win_size, const Rect &space); ++ Point *rowSmartPlacement(const Size &win_size, const Rect &space); ++ Point *colSmartPlacement(const Size &win_size, const Rect &space); ++ Point *const cascadePlacement(const OpenboxWindow &window, const Rect &space); + +public: - Workspace(BScreen *, int = 0); ++ Workspace(BScreen &, int = 0); + ~Workspace(void); + - inline BScreen *getScreen(void) { return screen; } - - inline OpenboxWindow *getLastFocusedWindow(void) { return lastfocus; } - ++ inline BScreen &getScreen(void) { return screen; } + inline Clientmenu *getMenu(void) { return clientmenu; } - + inline const char *getName(void) const { return name; } - - inline const int &getWorkspaceID(void) const { return id; } - - inline void setLastFocusedWindow(OpenboxWindow *w) { lastfocus = w; } - ++ inline int getWorkspaceID(void) const { return id; } ++ inline OpenboxWindow *focusedWindow() { return _focused; } ++ inline OpenboxWindow *lastFocusedWindow() { return _last; } ++ void focusWindow(OpenboxWindow *win); + OpenboxWindow *getWindow(int); - - Bool isCurrent(void); - Bool isLastWindow(OpenboxWindow *); - - const int addWindow(OpenboxWindow *, Bool = False); - const int removeWindow(OpenboxWindow *); - const int getCount(void); - ++ bool isCurrent(void); ++ void addWindow(OpenboxWindow *, bool = false); ++ int removeWindow(OpenboxWindow *); ++ int getCount(void); + void showAll(void); + void hideAll(void); + void removeAll(void); + void raiseWindow(OpenboxWindow *); + void lowerWindow(OpenboxWindow *); + void reconfigure(); + void update(); + void setCurrent(void); - void setName(char *); ++ void setName(const char *); + void shutdown(void); +}; + + +#endif // __Workspace_hh + diff --cc src/Workspacemenu.cc index bec5f455,a63251ab..6a1e034b --- a/src/Workspacemenu.cc +++ b/src/Workspacemenu.cc @@@ -30,25 -25,20 +30,23 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -#include "i18n.hh" -#include "blackbox.hh" -#include "Screen.hh" -#include "Toolbar.hh" -#include "Workspacemenu.hh" -#include "Workspace.hh" +#include "i18n.h" +#include "openbox.h" +#include "Screen.h" +#include "Toolbar.h" +#include "Workspacemenu.h" +#include "Workspace.h" --Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) { - screen = scrn; - ++Workspacemenu::Workspacemenu(BScreen &scrn) : Basemenu(scrn), screen(scrn) { setInternalMenu(); - setLabel(i18n(WorkspacemenuSet, WorkspacemenuWorkspacesTitle, "Workspaces")); - insert(i18n(WorkspacemenuSet, WorkspacemenuNewWorkspace, "New Workspace")); - insert(i18n(WorkspacemenuSet, WorkspacemenuRemoveLast, "Remove Last")); + setLabel(i18n->getMessage(WorkspacemenuSet, WorkspacemenuWorkspacesTitle, + "Workspaces")); + insert(i18n->getMessage(WorkspacemenuSet, WorkspacemenuNewWorkspace, + "New Workspace")); + insert(i18n->getMessage(WorkspacemenuSet, WorkspacemenuRemoveLast, + "Remove Last")); } @@@ -56,14 -46,16 +54,14 @@@ void Workspacemenu::itemSelected(int bu if (button != 1) return; - if (index == 0) { - getScreen()->addWorkspace(); - } else if (index == 1) { - getScreen()->removeLastWorkspace(); - } else { - index -= 2; - const Workspace* const wkspc = getScreen()->getCurrentWorkspace(); - if (wkspc->getID() != index && index < getScreen()->getWorkspaceCount()) - getScreen()->changeWorkspaceID(index); - } - if (! (getScreen()->getWorkspacemenu()->isTorn() || isTorn())) + if (index == 0) - screen->addWorkspace(); ++ screen.addWorkspace(); + else if (index == 1) - screen->removeLastWorkspace(); - else if ((screen->getCurrentWorkspace()->getWorkspaceID() != - (index - 2)) && ((index - 2) < screen->getCount())) - screen->changeWorkspaceID(index - 2); ++ screen.removeLastWorkspace(); ++ else if ((screen.getCurrentWorkspace()->getWorkspaceID() != ++ (index - 2)) && ((index - 2) < screen.getWorkspaceCount())) ++ screen.changeWorkspaceID(index - 2); + - if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) ++ if (! (screen.getWorkspacemenu()->isTorn() || isTorn())) hide(); } diff --cc src/Workspacemenu.h index 6902315d,28052a9f..fa25814e --- a/src/Workspacemenu.h +++ b/src/Workspacemenu.h @@@ -31,13 -32,14 +31,13 @@@ class Toolbar class Workspacemenu : public Basemenu { private: - BScreen *screen; - Workspacemenu(const Workspacemenu&); - Workspacemenu& operator=(const Workspacemenu&); ++ BScreen &screen; protected: - virtual void itemSelected(int button, unsigned int index); + virtual void itemSelected(int, int); public: - Workspacemenu(BScreen *); - Workspacemenu(BScreen *scrn); ++ Workspacemenu(BScreen &); }; diff --cc src/i18n.cc index 18b77209,0eb0a911..6ba041be --- a/src/i18n.cc +++ b/src/i18n.cc @@@ -30,15 -25,20 +30,21 @@@ # include "../config.h" #endif // HAVE_CONFIG_H -extern "C" { +#include "i18n.h" + #include - #ifdef STDC_HEADERS -#ifdef HAVE_STDLIB_H ++#ifdef HAVE_STDLIB_H # include + #endif // HAVE_STDLIB_H + -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include + #endif // HAVE_STRING_H + -#ifdef HAVE_STDIO_H ++#ifdef HAVE_STDIO_H # include - #endif // STDC_HEADERS + #endif // HAVE_STDIO_H #ifdef HAVE_LOCALE_H # include @@@ -97,38 -90,30 +103,43 @@@ I18n::~I18n(void) } --void I18n::openCatalog(const char *catalog) { #if defined(NLS) && defined(HAVE_CATOPEN) - string catalog_filename = LOCALEPATH; - catalog_filename += '/'; - catalog_filename += locale; - catalog_filename += '/'; - catalog_filename += catalog; ++void I18n::openCatalog(const char *catalog) { + int lp = strlen(LOCALEPATH), lc = strlen(locale), + ct = strlen(catalog), len = lp + lc + ct + 3; + catalog_filename = new char[len]; + + strncpy(catalog_filename, LOCALEPATH, lp); + *(catalog_filename + lp) = '/'; + strncpy(catalog_filename + lp + 1, locale, lc); + *(catalog_filename + lp + lc + 1) = '/'; + strncpy(catalog_filename + lp + lc + 2, catalog, ct + 1); # ifdef MCLoadBySet - catalog_fd = catopen(catalog_filename.c_str(), MCLoadBySet); + catalog_fd = catopen(catalog_filename, MCLoadBySet); # else // !MCLoadBySet - catalog_fd = catopen(catalog_filename.c_str(), NL_CAT_LOCALE); + catalog_fd = catopen(catalog_filename, NL_CAT_LOCALE); # endif // MCLoadBySet if (catalog_fd == (nl_catd) -1) fprintf(stderr, "failed to open catalog, using default messages\n"); -#endif // HAVE_CATOPEN + } +#else // !HAVE_CATOPEN - ++void I18n::openCatalog(const char *) { + catalog_filename = (char *) 0; - #endif // HAVE_CATOPEN +} ++#endif // HAVE_CATOPEN + - const char *I18n::getMessage(int set, int msg, const char *msgString) const { -const char* I18n::operator()(int set, int msg, const char *msgString) const { #if defined(NLS) && defined(HAVE_CATGETS) ++const char *I18n::getMessage(int set, int msg, const char *msgString) const { if (catalog_fd != (nl_catd) -1) - return catgets(catalog_fd, set, msg, msgString); + return (const char *) catgets(catalog_fd, set, msg, msgString); else --#endif return msgString; } ++#else ++const char *I18n::getMessage(int, int, const char *msgString) const { ++ return msgString; ++} ++#endif diff --cc src/main.cc index 0a0ad5ba,c06543a1..84e0d90e --- a/src/main.cc +++ b/src/main.cc @@@ -39,10 -32,13 +39,13 @@@ # include #endif // HAVE_STDIO_H - #ifdef STDC_HEADERS -#ifdef HAVE_STDLIB_H ++#ifdef HAVE_STDLIB_H # include + #endif // HAVE_STDLIB_H + -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include - #endif // STDC_HEADERS + #endif // HAVE_STRING_H #ifdef HAVE_UNISTD_H #include @@@ -59,15 -59,17 +62,16 @@@ static void showHelp(int exitval) { // print program usage and command line options - printf(i18n(mainSet, mainUsage, - "Openbox %s : (c) 2002 - 2002 Ben Jansens\n" - " 2001 - 2002 Sean 'Shaleh' Perry\n" - " 1997 - 2000, 2002 Brad Hughes\n\n" - " -display \t\tuse display connection.\n" - " -rc \t\t\tuse alternate resource file.\n" - " -menu \t\tuse alternate menu file.\n" - " -version\t\t\tdisplay version and exit.\n" - " -help\t\t\t\tdisplay this help text and exit.\n\n"), - __openbox_version); + printf(i18n->getMessage(mainSet, mainUsage, + "Openbox %s : (c) 2002 - 2002 Ben Jansens\n" + "\t\t\t 2001 - 2002 Sean 'Shaleh' Perry\n\n" + "\t\t\t 1997 - 2000 Brad Hughes\n\n" + " -display \t\tuse display connection.\n" + " -rc \t\t\tuse alternate resource file.\n" ++ " -menu \t\t\tuse alternate menu file.\n" + " -version\t\t\tdisplay version and exit.\n" + " -help\t\t\t\tdisplay this help text and exit.\n\n"), + __openbox_version); // some people have requested that we print out compile options // as well @@@ -122,8 -117,9 +126,9 @@@ int main(int argc, char **argv) { char *session_display = (char *) 0; char *rc_file = (char *) 0; + char *menu_file = (char *) 0; - i18n.openCatalog("openbox.cat"); + NLSInit("openbox.cat"); for (int i = 1; i < argc; ++i) { if (! strcmp(argv[i], "-rc")) { @@@ -131,13 -127,25 +136,25 @@@ if ((++i) >= argc) { fprintf(stderr, - i18n->getMessage(mainSet, mainRCRequiresArg, - "error: '-rc' requires and argument\n")); - i18n(mainSet, mainRCRequiresArg, ++ i18n->getMessage(mainSet, mainRCRequiresArg, + "error: '-rc' requires and argument\n")); ::exit(1); } rc_file = argv[i]; + } else if (! strcmp(argv[i], "-menu")) { + // look for alternative menu file to use + + if ((++i) >= argc) { + fprintf(stderr, - i18n(mainSet, mainMENURequiresArg, - "error: '-menu' requires and argument\n")); ++ i18n->getMessage(mainSet, mainMENURequiresArg, ++ "error: '-menu' requires and argument\n")); + + ::exit(1); + } + + menu_file = argv[i]; } else if (! strcmp(argv[i], "-display")) { // check for -display option... to run on a display other than the one // set by the environment variable DISPLAY @@@ -179,8 -186,8 +196,8 @@@ _chdir2(getenv("X11ROOT")); #endif // __EMX__ - Openbox openbox(argc, argv, session_display, rc_file); - Blackbox blackbox(argv, session_display, rc_file, menu_file); - blackbox.eventLoop(); ++ Openbox openbox(argc, argv, session_display, rc_file, menu_file); + openbox.eventLoop(); return(0); } diff --cc src/openbox.cc index ad3ecc01,00000000..6d044fc3 mode 100644,000000..100644 --- a/src/openbox.cc +++ b/src/openbox.cc @@@ -1,1797 -1,0 +1,1106 @@@ +// openbox.cc for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +// stupid macros needed to access some functions in version 2 of the GNU C +// library +#ifndef _GNU_SOURCE +#define _GNU_SOURCE +#endif // _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif // HAVE_CONFIG_H + +#include +#include +#include +#include +#include + +#ifdef SHAPE +#include +#endif // SHAPE + +#include "i18n.h" +#include "openbox.h" +#include "Basemenu.h" +#include "Clientmenu.h" +#include "Rootmenu.h" +#include "Screen.h" + +#ifdef SLIT +#include "Slit.h" +#endif // SLIT + +#include "Toolbar.h" +#include "Window.h" +#include "Workspace.h" +#include "Workspacemenu.h" ++#include "Util.h" ++ ++#include ++#include + +#ifdef HAVE_STDIO_H +# include +#endif // HAVE_STDIO_H + - #ifdef STDC_HEADERS ++#ifdef HAVE_STDLIB_H +# include ++#endif // HAVE_STDLIB_H ++ ++#ifdef HAVE_STRING_H +# include - #endif // STDC_HEADERS ++#endif // HAVE_STRING_H + +#ifdef HAVE_UNISTD_H +# include +# include +#endif // HAVE_UNISTD_H + +#ifdef HAVE_SYS_PARAM_H +# include +#endif // HAVE_SYS_PARAM_H + +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif // MAXPATHLEN + +#ifdef HAVE_SYS_SELECT_H +# include +#endif // HAVE_SYS_SELECT_H + +#ifdef HAVE_SIGNAL_H +# include +#endif // HAVE_SIGNAL_H + +#ifdef HAVE_SYS_SIGNAL_H +# include +#endif // HAVE_SYS_SIGNAL_H + +#ifdef HAVE_SYS_STAT_H +# include +# include +#endif // HAVE_SYS_STAT_H + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include +# else // !HAVE_SYS_TIME_H +# include +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +#ifdef HAVE_LIBGEN_H +# include +#endif // HAVE_LIBGEN_H + +#ifndef HAVE_BASENAME +static inline char *basename (char *s) { + char *save = s; + + while (*s) if (*s++ == '/') save = s; + + return save; +} +#endif // HAVE_BASENAME + + +// X event scanner for enter/leave notifies - adapted from twm +typedef struct scanargs { + Window w; + Bool leave, inferior, enter; +} scanargs; + +static Bool queueScanner(Display *, XEvent *e, char *args) { + if ((e->type == LeaveNotify) && + (e->xcrossing.window == ((scanargs *) args)->w) && + (e->xcrossing.mode == NotifyNormal)) { + ((scanargs *) args)->leave = True; + ((scanargs *) args)->inferior = (e->xcrossing.detail == NotifyInferior); + } else if ((e->type == EnterNotify) && + (e->xcrossing.mode == NotifyUngrab)) { + ((scanargs *) args)->enter = True; + } + + return False; +} + +Openbox *openbox; + + - Openbox::Openbox(int m_argc, char **m_argv, char *dpy_name, char *rc) - : BaseDisplay(m_argv[0], dpy_name) { ++Openbox::Openbox(int m_argc, char **m_argv, char *dpy_name, char *rc, ++ char *menu) : BaseDisplay(m_argv[0], dpy_name) { + grab(); + + if (! XSupportsLocale()) + fprintf(stderr, "X server does not support locale\n"); + + if (XSetLocaleModifiers("") == NULL) + fprintf(stderr, "cannot set locale modifiers\n"); + + ::openbox = this; + argc = m_argc; + argv = m_argv; - if (rc == NULL) { ++ if (rc == NULL || menu == NULL) { + char *homedir = getenv("HOME"); - - rc_file = new char[strlen(homedir) + strlen("/.openbox/rc") + 1]; - sprintf(rc_file, "%s/.openbox", homedir); - ++ char *configdir = new char[strlen(homedir) + strlen("/.openbox") + 1]; ++ sprintf(configdir, "%s/.openbox", homedir); + // try to make sure the ~/.openbox directory exists - mkdir(rc_file, S_IREAD | S_IWRITE | S_IEXEC | S_IRGRP | S_IWGRP | S_IXGRP | ++ mkdir(configdir, S_IREAD | S_IWRITE | S_IEXEC | ++ S_IRGRP | S_IWGRP | S_IXGRP | + S_IROTH | S_IWOTH | S_IXOTH); + - sprintf(rc_file, "%s/.openbox/rc", homedir); - } else { - rc_file = bstrdup(rc); - } + ++ if (rc == NULL) { ++ rc_file = new char[strlen(configdir) + strlen("/rc") + 1]; ++ sprintf(rc_file, "%s/rc", configdir); ++ } else ++ rc_file = bstrdup(rc); ++ ++ if (menu == NULL) { ++ menu_file = new char[strlen(configdir) + strlen("/menu") + 1]; ++ sprintf(menu_file, "%s/menu", configdir); ++ } else ++ menu_file = bstrdup(menu); ++ ++ delete [] configdir; ++ } ++ config.setFile(rc_file); ++ + no_focus = False; + - resource.menu_file = resource.style_file = (char *) 0; - resource.titlebar_layout = (char *) NULL; ++ resource.style_file = NULL; ++ resource.titlebar_layout = NULL; + resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec = 0; + - focused_window = masked_window = (OpenboxWindow *) 0; ++ current_screen = (BScreen *) 0; ++ masked_window = (OpenboxWindow *) 0; + masked = None; + - windowSearchList = new LinkedList; - menuSearchList = new LinkedList; - - #ifdef SLIT - slitSearchList = new LinkedList; - #endif // SLIT - - toolbarSearchList = new LinkedList; - groupSearchList = new LinkedList; - - menuTimestamps = new LinkedList; - - XrmInitialize(); - load_rc(); ++ load(); + +#ifdef HAVE_GETPID + openbox_pid = XInternAtom(getXDisplay(), "_BLACKBOX_PID", False); +#endif // HAVE_GETPID + - screenList = new LinkedList; - for (int i = 0; i < getNumberOfScreens(); i++) { - BScreen *screen = new BScreen(this, i); ++ for (unsigned int s = 0; s < numberOfScreens(); s++) { ++ BScreen *screen = new BScreen(*this, s, config); + + if (! screen->isScreenManaged()) { + delete screen; + continue; + } + - screenList->insert(screen); ++ screenList.push_back(screen); + } + - if (! screenList->count()) { ++ if (screenList.empty()) { + fprintf(stderr, + i18n->getMessage(openboxSet, openboxNoManagableScreens, + "Openbox::Openbox: no managable screens found, aborting.\n")); + ::exit(3); + } ++ current_screen = screenList.front(); + ++ // save current settings and default values ++ save(); ++ + XSynchronize(getXDisplay(), False); + XSync(getXDisplay(), False); + + reconfigure_wait = reread_menu_wait = False; + - timer = new BTimer(this, this); ++ timer = new BTimer(*this, *this); + timer->setTimeout(0); + timer->fireOnce(True); + + ungrab(); - } - - - Openbox::~Openbox(void) { - while (screenList->count()) - delete screenList->remove(0); + - while (menuTimestamps->count()) { - MenuTimestamp *ts = menuTimestamps->remove(0); ++ focusWindow(0); ++} + - if (ts->filename) - delete [] ts->filename; + - delete ts; - } ++Openbox::~Openbox() { ++ for_each(screenList.begin(), screenList.end(), ++ PointerAssassin()); + - if (resource.menu_file) - delete [] resource.menu_file; ++ for_each(menuTimestamps.begin(), menuTimestamps.end(), ++ PointerAssassin()); + + if (resource.style_file) + delete [] resource.style_file; + - delete timer; - - delete screenList; - delete menuTimestamps; ++ if (resource.titlebar_layout) ++ delete [] resource.titlebar_layout; + - delete windowSearchList; - delete menuSearchList; - delete toolbarSearchList; - delete groupSearchList; ++ delete timer; + + delete [] rc_file; - - #ifdef SLIT - delete slitSearchList; - #endif // SLIT ++ delete [] menu_file; +} + + +void Openbox::process_event(XEvent *e) { - if ((masked == e->xany.window) && masked_window && ++ if ((masked == e->xany.window && masked_window) && + (e->type == MotionNotify)) { + last_time = e->xmotion.time; + masked_window->motionNotifyEvent(&e->xmotion); - + return; + } + + switch (e->type) { + case ButtonPress: { + // strip the lock key modifiers + e->xbutton.state &= ~(NumLockMask | ScrollLockMask | LockMask); + + last_time = e->xbutton.time; + + OpenboxWindow *win = (OpenboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + +#ifdef SLIT + Slit *slit = (Slit *) 0; +#endif // SLIT + + Toolbar *tbar = (Toolbar *) 0; + + if ((win = searchWindow(e->xbutton.window))) { + win->buttonPressEvent(&e->xbutton); + + if (e->xbutton.button == 1) + win->installColormap(True); + } else if ((menu = searchMenu(e->xbutton.window))) { + menu->buttonPressEvent(&e->xbutton); + +#ifdef SLIT + } else if ((slit = searchSlit(e->xbutton.window))) { + slit->buttonPressEvent(&e->xbutton); +#endif // SLIT + + } else if ((tbar = searchToolbar(e->xbutton.window))) { + tbar->buttonPressEvent(&e->xbutton); + } else { - LinkedListIterator it(screenList); - BScreen *screen = it.current(); - for (; screen; it++, screen = it.current()) { ++ ScreenList::iterator it; ++ for (it = screenList.begin(); it != screenList.end(); ++it) { ++ BScreen *screen = *it; + if (e->xbutton.window == screen->getRootWindow()) { + if (e->xbutton.button == 1) { + if (! screen->isRootColormapInstalled()) + screen->getImageControl()->installRootColormap(); + + if (screen->getWorkspacemenu()->isVisible()) + screen->getWorkspacemenu()->hide(); + + if (screen->getRootmenu()->isVisible()) + screen->getRootmenu()->hide(); + } else if (e->xbutton.button == 2) { + int mx = e->xbutton.x_root - + (screen->getWorkspacemenu()->getWidth() / 2); + int my = e->xbutton.y_root - + (screen->getWorkspacemenu()->getTitleHeight() / 2); + + if (mx < 0) mx = 0; + if (my < 0) my = 0; + + if (mx + screen->getWorkspacemenu()->getWidth() > - screen->getWidth()) - mx = screen->getWidth() - ++ screen->size().w()) ++ mx = screen->size().w() - + screen->getWorkspacemenu()->getWidth() - + screen->getBorderWidth(); + + if (my + screen->getWorkspacemenu()->getHeight() > - screen->getHeight()) - my = screen->getHeight() - ++ screen->size().h()) ++ my = screen->size().h() - + screen->getWorkspacemenu()->getHeight() - + screen->getBorderWidth(); + + screen->getWorkspacemenu()->move(mx, my); + + if (! screen->getWorkspacemenu()->isVisible()) { + screen->getWorkspacemenu()->removeParent(); + screen->getWorkspacemenu()->show(); + } + } else if (e->xbutton.button == 3) { + int mx = e->xbutton.x_root - + (screen->getRootmenu()->getWidth() / 2); + int my = e->xbutton.y_root - + (screen->getRootmenu()->getTitleHeight() / 2); + + if (mx < 0) mx = 0; + if (my < 0) my = 0; + - if (mx + screen->getRootmenu()->getWidth() > screen->getWidth()) - mx = screen->getWidth() - ++ if (mx + screen->getRootmenu()->getWidth() > screen->size().w()) ++ mx = screen->size().w() - + screen->getRootmenu()->getWidth() - + screen->getBorderWidth(); + - if (my + screen->getRootmenu()->getHeight() > screen->getHeight()) - my = screen->getHeight() - ++ if (my + screen->getRootmenu()->getHeight() > screen->size().h()) ++ my = screen->size().h() - + screen->getRootmenu()->getHeight() - + screen->getBorderWidth(); + + screen->getRootmenu()->move(mx, my); + + if (! screen->getRootmenu()->isVisible()) { + checkMenu(); + screen->getRootmenu()->show(); + } + } else if (e->xbutton.button == 4) { - if ((screen->getCurrentWorkspaceID()-1)<0) - screen->changeWorkspaceID(screen->getCount()-1); ++ if ((screen->getCurrentWorkspaceID() + 1) > ++ screen->getWorkspaceCount() - 1) ++ screen->changeWorkspaceID(0); + else - screen->changeWorkspaceID(screen->getCurrentWorkspaceID()-1); ++ screen->changeWorkspaceID(screen->getCurrentWorkspaceID() + 1); + } else if (e->xbutton.button == 5) { - if ((screen->getCurrentWorkspaceID()+1)>screen->getCount()-1) - screen->changeWorkspaceID(0); ++ if ((screen->getCurrentWorkspaceID() - 1) < 0) ++ screen->changeWorkspaceID(screen->getWorkspaceCount() - 1); + else - screen->changeWorkspaceID(screen->getCurrentWorkspaceID()+1); ++ screen->changeWorkspaceID(screen->getCurrentWorkspaceID() - 1); + } + } + } + } + + break; + } + + case ButtonRelease: { + // strip the lock key modifiers + e->xbutton.state &= ~(NumLockMask | ScrollLockMask | LockMask); + + last_time = e->xbutton.time; + + OpenboxWindow *win = (OpenboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + + if ((win = searchWindow(e->xbutton.window))) + win->buttonReleaseEvent(&e->xbutton); + else if ((menu = searchMenu(e->xbutton.window))) + menu->buttonReleaseEvent(&e->xbutton); + else if ((tbar = searchToolbar(e->xbutton.window))) + tbar->buttonReleaseEvent(&e->xbutton); + + break; + } + + case ConfigureRequest: { + OpenboxWindow *win = (OpenboxWindow *) 0; + +#ifdef SLIT + Slit *slit = (Slit *) 0; +#endif // SLIT + + if ((win = searchWindow(e->xconfigurerequest.window))) { + win->configureRequestEvent(&e->xconfigurerequest); + +#ifdef SLIT + } else if ((slit = searchSlit(e->xconfigurerequest.window))) { + slit->configureRequestEvent(&e->xconfigurerequest); +#endif // SLIT + + } else { + grab(); + + if (validateWindow(e->xconfigurerequest.window)) { + XWindowChanges xwc; + + xwc.x = e->xconfigurerequest.x; + xwc.y = e->xconfigurerequest.y; + xwc.width = e->xconfigurerequest.width; + xwc.height = e->xconfigurerequest.height; + xwc.border_width = e->xconfigurerequest.border_width; + xwc.sibling = e->xconfigurerequest.above; + xwc.stack_mode = e->xconfigurerequest.detail; + + XConfigureWindow(getXDisplay(), e->xconfigurerequest.window, + e->xconfigurerequest.value_mask, &xwc); + } + + ungrab(); + } + + break; + } + + case MapRequest: { +#ifdef DEBUG + fprintf(stderr, + i18n->getMessage(openboxSet, openboxMapRequest, + "Openbox::process_event(): MapRequest for 0x%lx\n"), + e->xmaprequest.window); +#endif // DEBUG + + OpenboxWindow *win = searchWindow(e->xmaprequest.window); + + if (! win) - win = new OpenboxWindow(this, e->xmaprequest.window); ++ win = new OpenboxWindow(*this, e->xmaprequest.window); + + if ((win = searchWindow(e->xmaprequest.window))) + win->mapRequestEvent(&e->xmaprequest); + + break; + } + + case MapNotify: { + OpenboxWindow *win = searchWindow(e->xmap.window); + + if (win) + win->mapNotifyEvent(&e->xmap); + + break; + } + + case UnmapNotify: { + OpenboxWindow *win = (OpenboxWindow *) 0; + +#ifdef SLIT + Slit *slit = (Slit *) 0; +#endif // SLIT + + if ((win = searchWindow(e->xunmap.window))) { + win->unmapNotifyEvent(&e->xunmap); - if (focused_window == win) - focused_window = (OpenboxWindow *) 0; +#ifdef SLIT + } else if ((slit = searchSlit(e->xunmap.window))) { + slit->removeClient(e->xunmap.window); +#endif // SLIT + + } + + break; + } + + case DestroyNotify: { + OpenboxWindow *win = (OpenboxWindow *) 0; + +#ifdef SLIT + Slit *slit = (Slit *) 0; +#endif // SLIT + + if ((win = searchWindow(e->xdestroywindow.window))) { + win->destroyNotifyEvent(&e->xdestroywindow); - if (focused_window == win) - focused_window = (OpenboxWindow *) 0; +#ifdef SLIT + } else if ((slit = searchSlit(e->xdestroywindow.window))) { + slit->removeClient(e->xdestroywindow.window, False); +#endif // SLIT + } + + break; + } + + case MotionNotify: { + // strip the lock key modifiers + e->xbutton.state &= ~(NumLockMask | ScrollLockMask | LockMask); + + last_time = e->xmotion.time; + + OpenboxWindow *win = (OpenboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + + if ((win = searchWindow(e->xmotion.window))) + win->motionNotifyEvent(&e->xmotion); + else if ((menu = searchMenu(e->xmotion.window))) + menu->motionNotifyEvent(&e->xmotion); + + break; + } + + case PropertyNotify: { + last_time = e->xproperty.time; + + if (e->xproperty.state != PropertyDelete) { + OpenboxWindow *win = searchWindow(e->xproperty.window); + + if (win) + win->propertyNotifyEvent(e->xproperty.atom); + } + + break; + } + + case EnterNotify: { + last_time = e->xcrossing.time; + + BScreen *screen = (BScreen *) 0; + OpenboxWindow *win = (OpenboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + +#ifdef SLIT + Slit *slit = (Slit *) 0; +#endif // SLIT + + if (e->xcrossing.mode == NotifyGrab) break; + + XEvent dummy; + scanargs sa; + sa.w = e->xcrossing.window; + sa.enter = sa.leave = False; + XCheckIfEvent(getXDisplay(), &dummy, queueScanner, (char *) &sa); + + if ((e->xcrossing.window == e->xcrossing.root) && + (screen = searchScreen(e->xcrossing.window))) { + screen->getImageControl()->installRootColormap(); + } else if ((win = searchWindow(e->xcrossing.window))) { - if (win->getScreen()->isSloppyFocus() && ++ if (win->getScreen()->sloppyFocus() && + (! win->isFocused()) && (! no_focus)) { + grab(); + + if (((! sa.leave) || sa.inferior) && win->isVisible() && + win->setInputFocus()) + win->installColormap(True); + + ungrab(); + } + } else if ((menu = searchMenu(e->xcrossing.window))) { + menu->enterNotifyEvent(&e->xcrossing); + } else if ((tbar = searchToolbar(e->xcrossing.window))) { + tbar->enterNotifyEvent(&e->xcrossing); +#ifdef SLIT + } else if ((slit = searchSlit(e->xcrossing.window))) { + slit->enterNotifyEvent(&e->xcrossing); +#endif // SLIT + } + break; + } + + case LeaveNotify: { + last_time = e->xcrossing.time; + + OpenboxWindow *win = (OpenboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + +#ifdef SLIT + Slit *slit = (Slit *) 0; +#endif // SLIT + + if ((menu = searchMenu(e->xcrossing.window))) + menu->leaveNotifyEvent(&e->xcrossing); + else if ((win = searchWindow(e->xcrossing.window))) + win->installColormap(False); + else if ((tbar = searchToolbar(e->xcrossing.window))) + tbar->leaveNotifyEvent(&e->xcrossing); +#ifdef SLIT + else if ((slit = searchSlit(e->xcrossing.window))) + slit->leaveNotifyEvent(&e->xcrossing); +#endif // SLIT + + break; + } + + case Expose: { + OpenboxWindow *win = (OpenboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + + if ((win = searchWindow(e->xexpose.window))) + win->exposeEvent(&e->xexpose); + else if ((menu = searchMenu(e->xexpose.window))) + menu->exposeEvent(&e->xexpose); + else if ((tbar = searchToolbar(e->xexpose.window))) + tbar->exposeEvent(&e->xexpose); + + break; + } + + case KeyPress: { + Toolbar *tbar = searchToolbar(e->xkey.window); + + if (tbar && tbar->isEditing()) + tbar->keyPressEvent(&e->xkey); + + break; + } + + case ColormapNotify: { + BScreen *screen = searchScreen(e->xcolormap.window); + + if (screen) + screen->setRootColormapInstalled((e->xcolormap.state == + ColormapInstalled) ? True : False); + + break; + } + + case FocusIn: { + if (e->xfocus.mode == NotifyUngrab || e->xfocus.detail == NotifyPointer) + break; + + OpenboxWindow *win = searchWindow(e->xfocus.window); - if (win && ! win->isFocused()) - setFocusedWindow(win); ++ if (win && !win->isFocused()) ++ focusWindow(win); + + break; + } + + case FocusOut: + break; + + case ClientMessage: { + if (e->xclient.format == 32) { + if (e->xclient.message_type == getWMChangeStateAtom()) { + OpenboxWindow *win = searchWindow(e->xclient.window); + if (! win || ! win->validateClient()) return; + + if (e->xclient.data.l[0] == IconicState) + win->iconify(); + if (e->xclient.data.l[0] == NormalState) + win->deiconify(); + } else if (e->xclient.message_type == getOpenboxChangeWorkspaceAtom()) { + BScreen *screen = searchScreen(e->xclient.window); + + if (screen && e->xclient.data.l[0] >= 0 && - e->xclient.data.l[0] < screen->getCount()) ++ e->xclient.data.l[0] < screen->getWorkspaceCount()) + screen->changeWorkspaceID(e->xclient.data.l[0]); + } else if (e->xclient.message_type == getOpenboxChangeWindowFocusAtom()) { + OpenboxWindow *win = searchWindow(e->xclient.window); + + if (win && win->isVisible() && win->setInputFocus()) + win->installColormap(True); + } else if (e->xclient.message_type == getOpenboxCycleWindowFocusAtom()) { + BScreen *screen = searchScreen(e->xclient.window); + + if (screen) { + if (! e->xclient.data.l[0]) + screen->prevFocus(); + else + screen->nextFocus(); + } + } else if (e->xclient.message_type == getOpenboxChangeAttributesAtom()) { + OpenboxWindow *win = searchWindow(e->xclient.window); + + if (win && win->validateClient()) { + OpenboxHints net; + net.flags = e->xclient.data.l[0]; + net.attrib = e->xclient.data.l[1]; + net.workspace = e->xclient.data.l[2]; + net.stack = e->xclient.data.l[3]; + net.decoration = e->xclient.data.l[4]; + + win->changeOpenboxHints(&net); + } + } + } + + break; + } + + + default: { +#ifdef SHAPE + if (e->type == getShapeEventBase()) { + XShapeEvent *shape_event = (XShapeEvent *) e; + OpenboxWindow *win = (OpenboxWindow *) 0; + + if ((win = searchWindow(e->xany.window)) || + (shape_event->kind != ShapeBounding)) + win->shapeEvent(shape_event); + } +#endif // SHAPE + + } + } // switch +} + + +Bool Openbox::handleSignal(int sig) { + switch (sig) { + case SIGHUP: - reconfigure(); - break; - + case SIGUSR1: - reload_rc(); ++ reconfigure(); + break; + + case SIGUSR2: + rereadMenu(); + break; + + case SIGPIPE: + case SIGSEGV: + case SIGFPE: + case SIGINT: + case SIGTERM: + shutdown(); + + default: + return False; + } + + return True; +} + + +BScreen *Openbox::searchScreen(Window window) { - LinkedListIterator it(screenList); - - for (BScreen *curr = it.current(); curr; it++, curr = it.current()) { - if (curr->getRootWindow() == window) { - return curr; - } - } - ++ ScreenList::iterator it; ++ for (it = screenList.begin(); it != screenList.end(); ++it) ++ if ((*it)->getRootWindow() == window) ++ return *it; + return (BScreen *) 0; +} + + +OpenboxWindow *Openbox::searchWindow(Window window) { - LinkedListIterator it(windowSearchList); - - for (WindowSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) { - return tmp->getData(); - } - } - - return (OpenboxWindow *) 0; ++ WindowLookup::iterator it = windowSearchList.find(window); ++ if (it == windowSearchList.end()) ++ return (OpenboxWindow *) 0; ++ return it->second; +} + + +OpenboxWindow *Openbox::searchGroup(Window window, OpenboxWindow *win) { - OpenboxWindow *w = (OpenboxWindow *) 0; - LinkedListIterator it(groupSearchList); - - for (WindowSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) { - w = tmp->getData(); - if (w->getClientWindow() != win->getClientWindow()) - return win; - } - } - ++ WindowLookup::iterator it = groupSearchList.find(window); ++ if (it != groupSearchList.end()) ++ if (it->second->getClientWindow() != win->getClientWindow()) ++ return win; + return (OpenboxWindow *) 0; +} + + +Basemenu *Openbox::searchMenu(Window window) { - LinkedListIterator it(menuSearchList); - - for (MenuSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) - return tmp->getData(); - } - - return (Basemenu *) 0; ++ MenuLookup::iterator it = menuSearchList.find(window); ++ if (it == menuSearchList.end()) ++ return (Basemenu *) 0; ++ return it->second; +} + + +Toolbar *Openbox::searchToolbar(Window window) { - LinkedListIterator it(toolbarSearchList); - - for (ToolbarSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) - return tmp->getData(); - } - - return (Toolbar *) 0; ++ ToolbarLookup::iterator it = toolbarSearchList.find(window); ++ if (it == toolbarSearchList.end()) ++ return (Toolbar *) 0; ++ return it->second; +} + + +#ifdef SLIT +Slit *Openbox::searchSlit(Window window) { - LinkedListIterator it(slitSearchList); - - for (SlitSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) - return tmp->getData(); - } - - return (Slit *) 0; ++ SlitLookup::iterator it = slitSearchList.find(window); ++ if (it == slitSearchList.end()) ++ return (Slit *) 0; ++ return it->second; +} +#endif // SLIT + + +void Openbox::saveWindowSearch(Window window, OpenboxWindow *data) { - windowSearchList->insert(new WindowSearch(window, data)); ++ windowSearchList.insert(WindowLookupPair(window, data)); +} + + +void Openbox::saveGroupSearch(Window window, OpenboxWindow *data) { - groupSearchList->insert(new WindowSearch(window, data)); ++ groupSearchList.insert(WindowLookupPair(window, data)); +} + + +void Openbox::saveMenuSearch(Window window, Basemenu *data) { - menuSearchList->insert(new MenuSearch(window, data)); ++ menuSearchList.insert(MenuLookupPair(window, data)); +} + + +void Openbox::saveToolbarSearch(Window window, Toolbar *data) { - toolbarSearchList->insert(new ToolbarSearch(window, data)); ++ toolbarSearchList.insert(ToolbarLookupPair(window, data)); +} + + +#ifdef SLIT +void Openbox::saveSlitSearch(Window window, Slit *data) { - slitSearchList->insert(new SlitSearch(window, data)); ++ slitSearchList.insert(SlitLookupPair(window, data)); +} +#endif // SLIT + + +void Openbox::removeWindowSearch(Window window) { - LinkedListIterator it(windowSearchList); - for (WindowSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) { - windowSearchList->remove(tmp); - delete tmp; - break; - } - } ++ windowSearchList.erase(window); +} + + +void Openbox::removeGroupSearch(Window window) { - LinkedListIterator it(groupSearchList); - for (WindowSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) { - groupSearchList->remove(tmp); - delete tmp; - break; - } - } ++ groupSearchList.erase(window); +} + + +void Openbox::removeMenuSearch(Window window) { - LinkedListIterator it(menuSearchList); - for (MenuSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) { - menuSearchList->remove(tmp); - delete tmp; - break; - } - } ++ menuSearchList.erase(window); +} + + +void Openbox::removeToolbarSearch(Window window) { - LinkedListIterator it(toolbarSearchList); - for (ToolbarSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) { - toolbarSearchList->remove(tmp); - delete tmp; - break; - } - } ++ toolbarSearchList.erase(window); +} + + +#ifdef SLIT +void Openbox::removeSlitSearch(Window window) { - LinkedListIterator it(slitSearchList); - for (SlitSearch *tmp = it.current(); tmp; it++, tmp = it.current()) { - if (tmp->getWindow() == window) { - slitSearchList->remove(tmp); - delete tmp; - break; - } - } ++ slitSearchList.erase(window); +} +#endif // SLIT + + +void Openbox::restart(const char *prog) { + shutdown(); + + if (prog) { + execlp(prog, prog, NULL); + perror(prog); + } + + // fall back in case the above execlp doesn't work + execvp(argv[0], argv); + execvp(basename(argv[0]), argv); +} + + - void Openbox::shutdown(void) { ++void Openbox::shutdown() { + BaseDisplay::shutdown(); + - XSetInputFocus(getXDisplay(), PointerRoot, None, CurrentTime); - - LinkedListIterator it(screenList); - for (BScreen *s = it.current(); s; it++, s = it.current()) - s->shutdown(); ++ std::for_each(screenList.begin(), screenList.end(), ++ std::mem_fun(&BScreen::shutdown)); + ++ focusWindow(0); ++ + XSync(getXDisplay(), False); - - save_rc(); +} + + - void Openbox::save_rc(void) { - XrmDatabase new_openboxrc = (XrmDatabase) 0; - char rc_string[1024]; - - load_rc(); - - sprintf(rc_string, "session.menuFile: %s", resource.menu_file); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.colorsPerChannel: %d", - resource.colors_per_channel); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.titlebarLayout: %s", - resource.titlebar_layout); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.doubleClickInterval: %lu", - resource.double_click_interval); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.autoRaiseDelay: %lu", ++void Openbox::save() { ++ config.setAutoSave(false); ++ ++ // save all values as they are so that the defaults will be written to the rc ++ // file ++ ++ config.setValue("session.colorsPerChannel", ++ resource.colors_per_channel); ++ config.setValue("session.styleFile", resource.style_file); ++ config.setValue("session.titlebarLayout", resource.titlebar_layout); ++ config.setValue("session.doubleClickInterval", ++ (long)resource.double_click_interval); ++ config.setValue("session.autoRaiseDelay", + ((resource.auto_raise_delay.tv_sec * 1000) + + (resource.auto_raise_delay.tv_usec / 1000))); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.cacheLife: %lu", resource.cache_life / 60000); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.cacheMax: %lu", resource.cache_max); - XrmPutLineResource(&new_openboxrc, rc_string); - - LinkedListIterator it(screenList); - for (BScreen *screen = it.current(); screen; it++, screen = it.current()) { - int screen_number = screen->getScreenNumber(); - - #ifdef SLIT - char *slit_placement = (char *) 0; - - switch (screen->getSlitPlacement()) { - case Slit::TopLeft: slit_placement = "TopLeft"; break; - case Slit::CenterLeft: slit_placement = "CenterLeft"; break; - case Slit::BottomLeft: slit_placement = "BottomLeft"; break; - case Slit::TopCenter: slit_placement = "TopCenter"; break; - case Slit::BottomCenter: slit_placement = "BottomCenter"; break; - case Slit::TopRight: slit_placement = "TopRight"; break; - case Slit::BottomRight: slit_placement = "BottomRight"; break; - case Slit::CenterRight: default: slit_placement = "CenterRight"; break; - } ++ config.setValue("session.cacheLife", (long)resource.cache_life / 60000); ++ config.setValue("session.cacheMax", (long)resource.cache_max); + - sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number, - slit_placement); - XrmPutLineResource(&new_openboxrc, rc_string); ++ std::for_each(screenList.begin(), screenList.end(), ++ std::mem_fun(&BScreen::save)); + - sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number, - ((screen->getSlitDirection() == Slit::Horizontal) ? "Horizontal" : - "Vertical")); - XrmPutLineResource(&new_openboxrc, rc_string); - - const char *rootcmd; - if ((rootcmd = screen->getRootCommand()) != NULL) { - sprintf(rc_string, "session.screen%d.rootCommand: %s", screen_number, - rootcmd); - XrmPutLineResource(&new_openboxrc, rc_string); - } - - sprintf(rc_string, "session.screen%d.slit.onTop: %s", screen_number, - ((screen->getSlit()->isOnTop()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number, - ((screen->getSlit()->doAutoHide()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - #endif // SLIT - - sprintf(rc_string, "session.opaqueMove: %s", - ((screen->doOpaqueMove()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.imageDither: %s", - ((screen->getImageControl()->doDither()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.fullMaximization: %s", screen_number, - ((screen->doFullMax()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.focusNewWindows: %s", screen_number, - ((screen->doFocusNew()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.focusLastWindow: %s", screen_number, - ((screen->doFocusLast()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", - screen_number, - ((screen->getRowPlacementDirection() == BScreen::LeftRight) ? - "LeftToRight" : "RightToLeft")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.colPlacementDirection: %s", - screen_number, - ((screen->getColPlacementDirection() == BScreen::TopBottom) ? - "TopToBottom" : "BottomToTop")); - XrmPutLineResource(&new_openboxrc, rc_string); - - char *placement = (char *) 0; - switch (screen->getPlacementPolicy()) { - case BScreen::CascadePlacement: - placement = "CascadePlacement"; - break; - - case BScreen::ColSmartPlacement: - placement = "ColSmartPlacement"; - break; - - case BScreen::RowSmartPlacement: - default: - placement = "RowSmartPlacement"; - break; - } - sprintf(rc_string, "session.screen%d.windowPlacement: %s", screen_number, - placement); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.windowZones: %i", screen_number, - screen->getWindowZones()); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.focusModel: %s", screen_number, - ((screen->isSloppyFocus()) ? - ((screen->doAutoRaise()) ? "AutoRaiseSloppyFocus" : - "SloppyFocus") : - "ClickToFocus")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.workspaces: %d", screen_number, - screen->getCount()); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.toolbar.onTop: %s", screen_number, - ((screen->getToolbar()->isOnTop()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.toolbar.autoHide: %s", screen_number, - ((screen->getToolbar()->doAutoHide()) ? "True" : "False")); - XrmPutLineResource(&new_openboxrc, rc_string); - - char *toolbar_placement = (char *) 0; - - switch (screen->getToolbarPlacement()) { - case Toolbar::TopLeft: toolbar_placement = "TopLeft"; break; - case Toolbar::BottomLeft: toolbar_placement = "BottomLeft"; break; - case Toolbar::TopCenter: toolbar_placement = "TopCenter"; break; - case Toolbar::TopRight: toolbar_placement = "TopRight"; break; - case Toolbar::BottomRight: toolbar_placement = "BottomRight"; break; - case Toolbar::BottomCenter: default: - toolbar_placement = "BottomCenter"; break; - } - - sprintf(rc_string, "session.screen%d.toolbar.placement: %s", screen_number, - toolbar_placement); - XrmPutLineResource(&new_openboxrc, rc_string); - - load_rc(screen); - - // these are static, but may not be saved in the users .openbox/rc, - // writing these resources will allow the user to edit them at a later - // time... but loading the defaults before saving allows us to rewrite the - // users changes... - - #ifdef HAVE_STRFTIME - sprintf(rc_string, "session.screen%d.strftimeFormat: %s", screen_number, - screen->getStrftimeFormat()); - XrmPutLineResource(&new_openboxrc, rc_string); - #else // !HAVE_STRFTIME - sprintf(rc_string, "session.screen%d.dateFormat: %s", screen_number, - ((screen->getDateFormat() == B_EuropeanDate) ? - "European" : "American")); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.clockFormat: %d", screen_number, - ((screen->isClock24Hour()) ? 24 : 12)); - XrmPutLineResource(&new_openboxrc, rc_string); - #endif // HAVE_STRFTIME - - sprintf(rc_string, "session.screen%d.edgeSnapThreshold: %d", screen_number, - screen->getEdgeSnapThreshold()); - XrmPutLineResource(&new_openboxrc, rc_string); - - sprintf(rc_string, "session.screen%d.toolbar.widthPercent: %d", - screen_number, screen->getToolbarWidthPercent()); - XrmPutLineResource(&new_openboxrc, rc_string); - - // write out the users workspace names - int i, len = 0; - for (i = 0; i < screen->getCount(); i++) - len += strlen((screen->getWorkspace(i)->getName()) ? - screen->getWorkspace(i)->getName() : "Null") + 1; - - char *resource_string = new char[len + 1024], - *save_string = new char[len], *save_string_pos = save_string, - *name_string_pos; - if (save_string) { - for (i = 0; i < screen->getCount(); i++) { - len = strlen((screen->getWorkspace(i)->getName()) ? - screen->getWorkspace(i)->getName() : "Null") + 1; - name_string_pos = - (char *) ((screen->getWorkspace(i)->getName()) ? - screen->getWorkspace(i)->getName() : "Null"); - - while (--len) *(save_string_pos++) = *(name_string_pos++); - *(save_string_pos++) = ','; - } - } - - *(--save_string_pos) = '\0'; - - sprintf(resource_string, "session.screen%d.workspaceNames: %s", - screen_number, save_string); - XrmPutLineResource(&new_openboxrc, resource_string); - - delete [] resource_string; - delete [] save_string; - } - - XrmDatabase old_openboxrc = XrmGetFileDatabase(rc_file); - - XrmMergeDatabases(new_openboxrc, &old_openboxrc); - XrmPutFileDatabase(old_openboxrc, rc_file); - XrmDestroyDatabase(old_openboxrc); ++ config.setAutoSave(true); ++ config.save(); +} + ++void Openbox::load() { ++ if (!config.load()) ++ config.create(); + - void Openbox::load_rc(void) { - XrmDatabase database = (XrmDatabase) 0; - - database = XrmGetFileDatabase(rc_file); - - XrmValue value; - char *value_type; - - if (resource.menu_file) - delete [] resource.menu_file; - - if (XrmGetResource(database, "session.menuFile", "Session.MenuFile", - &value_type, &value)) - resource.menu_file = bstrdup(value.addr); ++ std::string s; ++ long l; ++ ++ if (config.getValue("session.colorsPerChannel", "Session.ColorsPerChannel", ++ l)) ++ resource.colors_per_channel = (l < 2 ? 2 : (l > 6 ? 6 : l)); // >= 2, <= 6 + else - resource.menu_file = bstrdup(DEFAULTMENU); - - if (XrmGetResource(database, "session.colorsPerChannel", - "Session.ColorsPerChannel", &value_type, &value)) { - if (sscanf(value.addr, "%d", &resource.colors_per_channel) != 1) { - resource.colors_per_channel = 4; - } else { - if (resource.colors_per_channel < 2) resource.colors_per_channel = 2; - if (resource.colors_per_channel > 6) resource.colors_per_channel = 6; - } - } else { + resource.colors_per_channel = 4; - } + + if (resource.style_file) + delete [] resource.style_file; - - if (XrmGetResource(database, "session.styleFile", "Session.StyleFile", - &value_type, &value)) - resource.style_file = bstrdup(value.addr); ++ if (config.getValue("session.styleFile", "Session.StyleFile", s)) ++ resource.style_file = bstrdup(s.c_str()); + else + resource.style_file = bstrdup(DEFAULTSTYLE); + - if (XrmGetResource(database, "session.titlebarLayout", - "Session.TitlebarLayout", &value_type, &value)) { - resource.titlebar_layout = bstrdup(value.addr == NULL ? "ILMC" : - value.addr); - } else { ++ if (resource.titlebar_layout) ++ delete [] resource.titlebar_layout; ++ if (config.getValue("session.titlebarLayout", "Session.TitlebarLayout", s)) ++ resource.titlebar_layout = bstrdup(s.c_str()); ++ else + resource.titlebar_layout = bstrdup("ILMC"); - } + - if (XrmGetResource(database, "session.doubleClickInterval", - "Session.DoubleClickInterval", &value_type, &value)) { - if (sscanf(value.addr, "%lu", &resource.double_click_interval) != 1) - resource.double_click_interval = 250; - } else { ++ if (config.getValue("session.doubleClickInterval", ++ "Session.DoubleClickInterval", l)) ++ resource.double_click_interval = l; ++ else + resource.double_click_interval = 250; - } + - if (XrmGetResource(database, "session.autoRaiseDelay", - "Session.AutoRaiseDelay", &value_type, &value)) { - if (sscanf(value.addr, "%ld", &resource.auto_raise_delay.tv_usec) != 1) - resource.auto_raise_delay.tv_usec = 400; - } else { ++ if (config.getValue("session.autoRaiseDelay", "Session.AutoRaiseDelay", l)) ++ resource.auto_raise_delay.tv_usec = l; ++ else + resource.auto_raise_delay.tv_usec = 400; - } - + resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec / 1000; + resource.auto_raise_delay.tv_usec -= + (resource.auto_raise_delay.tv_sec * 1000); + resource.auto_raise_delay.tv_usec *= 1000; + - if (XrmGetResource(database, "session.cacheLife", "Session.CacheLife", - &value_type, &value)) { - if (sscanf(value.addr, "%lu", &resource.cache_life) != 1) - resource.cache_life = 5l; - } else { - resource.cache_life = 5l; - } - ++ if (config.getValue("session.cacheLife", "Session.CacheLife", l)) ++ resource.cache_life = l; ++ else ++ resource.cache_life = 51; + resource.cache_life *= 60000; + - if (XrmGetResource(database, "session.cacheMax", "Session.CacheMax", - &value_type, &value)) { - if (sscanf(value.addr, "%lu", &resource.cache_max) != 1) - resource.cache_max = 200; - } else { ++ if (config.getValue("session.cacheMax", "Session.CacheMax", l)) ++ resource.cache_max = l; ++ else + resource.cache_max = 200; - } - } - - - void Openbox::load_rc(BScreen *screen) { - XrmDatabase database = (XrmDatabase) 0; - - database = XrmGetFileDatabase(rc_file); - - XrmValue value; - char *value_type, name_lookup[1024], class_lookup[1024]; - int screen_number = screen->getScreenNumber(); - - sprintf(name_lookup, "session.screen%d.fullMaximization", screen_number); - sprintf(class_lookup, "Session.Screen%d.FullMaximization", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "true", value.size)) - screen->saveFullMax(True); - else - screen->saveFullMax(False); - } else { - screen->saveFullMax(False); - } - sprintf(name_lookup, "session.screen%d.focusNewWindows", screen_number); - sprintf(class_lookup, "Session.Screen%d.FocusNewWindows", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "true", value.size)) - screen->saveFocusNew(True); - else - screen->saveFocusNew(False); - } else { - screen->saveFocusNew(False); - } - sprintf(name_lookup, "session.screen%d.focusLastWindow", screen_number); - sprintf(class_lookup, "Session.Screen%d.focusLastWindow", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "true", value.size)) - screen->saveFocusLast(True); - else - screen->saveFocusLast(False); - } else { - screen->saveFocusLast(False); - } - sprintf(name_lookup, "session.screen%d.rowPlacementDirection", - screen_number); - sprintf(class_lookup, "Session.Screen%d.RowPlacementDirection", - screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "righttoleft", value.size)) - screen->saveRowPlacementDirection(BScreen::RightLeft); - else - screen->saveRowPlacementDirection(BScreen::LeftRight); - } else { - screen->saveRowPlacementDirection(BScreen::LeftRight); - } - sprintf(name_lookup, "session.screen%d.colPlacementDirection", - screen_number); - sprintf(class_lookup, "Session.Screen%d.ColPlacementDirection", - screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "bottomtotop", value.size)) - screen->saveColPlacementDirection(BScreen::BottomTop); - else - screen->saveColPlacementDirection(BScreen::TopBottom); - } else { - screen->saveColPlacementDirection(BScreen::TopBottom); - } - sprintf(name_lookup, "session.screen%d.workspaces", screen_number); - sprintf(class_lookup, "Session.Screen%d.Workspaces", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - int i; - if (sscanf(value.addr, "%d", &i) != 1) i = 1; - screen->saveWorkspaces(i); - } else { - screen->saveWorkspaces(1); - } - sprintf(name_lookup, "session.screen%d.toolbar.widthPercent", - screen_number); - sprintf(class_lookup, "Session.Screen%d.Toolbar.WidthPercent", - screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - int i; - if (sscanf(value.addr, "%d", &i) != 1) i = 66; - - if (i <= 0 || i > 100) - i = 66; - - screen->saveToolbarWidthPercent(i); - } else { - screen->saveToolbarWidthPercent(66); - } - sprintf(name_lookup, "session.screen%d.toolbar.placement", screen_number); - sprintf(class_lookup, "Session.Screen%d.Toolbar.Placement", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "TopLeft", value.size)) - screen->saveToolbarPlacement(Toolbar::TopLeft); - else if (! strncasecmp(value.addr, "BottomLeft", value.size)) - screen->saveToolbarPlacement(Toolbar::BottomLeft); - else if (! strncasecmp(value.addr, "TopCenter", value.size)) - screen->saveToolbarPlacement(Toolbar::TopCenter); - else if (! strncasecmp(value.addr, "TopRight", value.size)) - screen->saveToolbarPlacement(Toolbar::TopRight); - else if (! strncasecmp(value.addr, "BottomRight", value.size)) - screen->saveToolbarPlacement(Toolbar::BottomRight); - else - screen->saveToolbarPlacement(Toolbar::BottomCenter); - } else { - screen->saveToolbarPlacement(Toolbar::BottomCenter); - } - screen->removeWorkspaceNames(); - - sprintf(name_lookup, "session.screen%d.workspaceNames", screen_number); - sprintf(class_lookup, "Session.Screen%d.WorkspaceNames", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - char *search = bstrdup(value.addr); - - for (int i = 0; i < screen->getNumberOfWorkspaces(); i++) { - char *nn; - - if (! i) nn = strtok(search, ","); - else nn = strtok(NULL, ","); - - if (nn) screen->addWorkspaceName(nn); - else break; - } - - delete [] search; - } - - sprintf(name_lookup, "session.screen%d.toolbar.onTop", screen_number); - sprintf(class_lookup, "Session.Screen%d.Toolbar.OnTop", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "true", value.size)) - screen->saveToolbarOnTop(True); - else - screen->saveToolbarOnTop(False); - } else { - screen->saveToolbarOnTop(False); - } - sprintf(name_lookup, "session.screen%d.toolbar.autoHide", screen_number); - sprintf(class_lookup, "Session.Screen%d.Toolbar.autoHide", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "true", value.size)) - screen->saveToolbarAutoHide(True); - else - screen->saveToolbarAutoHide(False); - } else { - screen->saveToolbarAutoHide(False); - } - sprintf(name_lookup, "session.screen%d.focusModel", screen_number); - sprintf(class_lookup, "Session.Screen%d.FocusModel", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "clicktofocus", value.size)) { - screen->saveAutoRaise(False); - screen->saveSloppyFocus(False); - } else if (! strncasecmp(value.addr, "autoraisesloppyfocus", value.size)) { - screen->saveSloppyFocus(True); - screen->saveAutoRaise(True); - } else { - screen->saveSloppyFocus(True); - screen->saveAutoRaise(False); - } - } else { - screen->saveSloppyFocus(True); - screen->saveAutoRaise(False); - } - - sprintf(name_lookup, "session.screen%d.windowZones", screen_number); - sprintf(class_lookup, "Session.Screen%d.WindowZones", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - int i = atoi(value.addr); - screen->saveWindowZones((i == 1 || i == 2 || i == 4) ? i : 1); - } else { - screen->saveWindowZones(1); - } - - sprintf(name_lookup, "session.screen%d.windowPlacement", screen_number); - sprintf(class_lookup, "Session.Screen%d.WindowPlacement", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "RowSmartPlacement", value.size)) - screen->savePlacementPolicy(BScreen::RowSmartPlacement); - else if (! strncasecmp(value.addr, "ColSmartPlacement", value.size)) - screen->savePlacementPolicy(BScreen::ColSmartPlacement); - else - screen->savePlacementPolicy(BScreen::CascadePlacement); - } else { - screen->savePlacementPolicy(BScreen::RowSmartPlacement); - } - #ifdef SLIT - sprintf(name_lookup, "session.screen%d.slit.placement", screen_number); - sprintf(class_lookup, "Session.Screen%d.Slit.Placement", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "TopLeft", value.size)) - screen->saveSlitPlacement(Slit::TopLeft); - else if (! strncasecmp(value.addr, "CenterLeft", value.size)) - screen->saveSlitPlacement(Slit::CenterLeft); - else if (! strncasecmp(value.addr, "BottomLeft", value.size)) - screen->saveSlitPlacement(Slit::BottomLeft); - else if (! strncasecmp(value.addr, "TopCenter", value.size)) - screen->saveSlitPlacement(Slit::TopCenter); - else if (! strncasecmp(value.addr, "BottomCenter", value.size)) - screen->saveSlitPlacement(Slit::BottomCenter); - else if (! strncasecmp(value.addr, "TopRight", value.size)) - screen->saveSlitPlacement(Slit::TopRight); - else if (! strncasecmp(value.addr, "BottomRight", value.size)) - screen->saveSlitPlacement(Slit::BottomRight); - else - screen->saveSlitPlacement(Slit::CenterRight); - } else { - screen->saveSlitPlacement(Slit::CenterRight); - } - sprintf(name_lookup, "session.screen%d.slit.direction", screen_number); - sprintf(class_lookup, "Session.Screen%d.Slit.Direction", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "Horizontal", value.size)) - screen->saveSlitDirection(Slit::Horizontal); - else - screen->saveSlitDirection(Slit::Vertical); - } else { - screen->saveSlitDirection(Slit::Vertical); - } - sprintf(name_lookup, "session.screen%d.slit.onTop", screen_number); - sprintf(class_lookup, "Session.Screen%d.Slit.OnTop", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "True", value.size)) - screen->saveSlitOnTop(True); - else - screen->saveSlitOnTop(False); - } else { - screen->saveSlitOnTop(False); - } - sprintf(name_lookup, "session.screen%d.slit.autoHide", screen_number); - sprintf(class_lookup, "Session.Screen%d.Slit.AutoHide", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (! strncasecmp(value.addr, "True", value.size)) - screen->saveSlitAutoHide(True); - else - screen->saveSlitAutoHide(False); - } else { - screen->saveSlitAutoHide(False); - } - #endif // SLIT - - #ifdef HAVE_STRFTIME - sprintf(name_lookup, "session.screen%d.strftimeFormat", screen_number); - sprintf(class_lookup, "Session.Screen%d.StrftimeFormat", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - screen->saveStrftimeFormat(value.addr); - } else { - screen->saveStrftimeFormat("%I:%M %p"); - } - #else // HAVE_STRFTIME - sprintf(name_lookup, "session.screen%d.dateFormat", screen_number); - sprintf(class_lookup, "Session.Screen%d.DateFormat", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - if (strncasecmp(value.addr, "european", value.size)) - screen->saveDateFormat(B_AmericanDate); - else - screen->saveDateFormat(B_EuropeanDate); - } else { - screen->saveDateFormat(B_AmericanDate); - } - sprintf(name_lookup, "session.screen%d.clockFormat", screen_number); - sprintf(class_lookup, "Session.Screen%d.ClockFormat", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - int clock; - if (sscanf(value.addr, "%d", &clock) != 1) screen->saveClock24Hour(False); - else if (clock == 24) screen->saveClock24Hour(True); - else screen->saveClock24Hour(False); - } else { - screen->saveClock24Hour(False); - } - #endif // HAVE_STRFTIME - - sprintf(name_lookup, "session.screen%d.edgeSnapThreshold", screen_number); - sprintf(class_lookup, "Session.Screen%d.EdgeSnapThreshold", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - int threshold; - if (sscanf(value.addr, "%d", &threshold) != 1) - screen->saveEdgeSnapThreshold(0); - else - screen->saveEdgeSnapThreshold(threshold); - } else { - screen->saveEdgeSnapThreshold(0); - } - sprintf(name_lookup, "session.screen%d.imageDither", screen_number); - sprintf(class_lookup, "Session.Screen%d.ImageDither", screen_number); - if (XrmGetResource(database, "session.imageDither", "Session.ImageDither", - &value_type, &value)) { - if (! strncasecmp("true", value.addr, value.size)) - screen->saveImageDither(True); - else - screen->saveImageDither(False); - } else { - screen->saveImageDither(True); - } - - sprintf(name_lookup, "session.screen%d.rootCommand", screen_number); - sprintf(class_lookup, "Session.Screen%d.RootCommand", screen_number); - if (XrmGetResource(database, name_lookup, class_lookup, &value_type, - &value)) { - screen->saveRootCommand(value.addr); - } else - screen->saveRootCommand(NULL); - - if (XrmGetResource(database, "session.opaqueMove", "Session.OpaqueMove", - &value_type, &value)) { - if (! strncasecmp("true", value.addr, value.size)) - screen->saveOpaqueMove(True); - else - screen->saveOpaqueMove(False); - } else { - screen->saveOpaqueMove(False); - } - XrmDestroyDatabase(database); - } - - - void Openbox::reload_rc(void) { - load_rc(); - reconfigure(); +} + + - void Openbox::reconfigure(void) { ++void Openbox::reconfigure() { + reconfigure_wait = True; + + if (! timer->isTiming()) timer->start(); +} + + - void Openbox::real_reconfigure(void) { ++void Openbox::real_reconfigure() { + grab(); + - XrmDatabase new_openboxrc = (XrmDatabase) 0; - char style[MAXPATHLEN + 64]; - - sprintf(style, "session.styleFile: %s", resource.style_file); - XrmPutLineResource(&new_openboxrc, style); ++ load(); ++ ++ for_each(menuTimestamps.begin(), menuTimestamps.end(), ++ PointerAssassin()); ++ menuTimestamps.clear(); + - XrmDatabase old_openboxrc = XrmGetFileDatabase(rc_file); ++ std::for_each(screenList.begin(), screenList.end(), ++ std::mem_fun(&BScreen::reconfigure)); + - XrmMergeDatabases(new_openboxrc, &old_openboxrc); - XrmPutFileDatabase(old_openboxrc, rc_file); - if (old_openboxrc) XrmDestroyDatabase(old_openboxrc); ++ ungrab(); ++} + - for (int i = 0, n = menuTimestamps->count(); i < n; i++) { - MenuTimestamp *ts = menuTimestamps->remove(0); + - if (ts) { - if (ts->filename) - delete [] ts->filename; ++void Openbox::checkMenu() { ++ MenuTimestampList::iterator it; ++ for (it = menuTimestamps.begin(); it != menuTimestamps.end(); ++it) { ++ struct stat buf; + - delete ts; ++ if (stat((*it)->filename, &buf) || (*it)->timestamp != buf.st_ctime) { ++ rereadMenu(); ++ return; + } + } - - LinkedListIterator it(screenList); - for (BScreen *screen = it.current(); screen; it++, screen = it.current()) { - screen->reconfigure(); - } - - ungrab(); +} + + - void Openbox::checkMenu(void) { - Bool reread = False; - LinkedListIterator it(menuTimestamps); - for (MenuTimestamp *tmp = it.current(); tmp && (! reread); - it++, tmp = it.current()) { ++void Openbox::addMenuTimestamp(const char *filename) { ++ bool found = false; ++ ++ MenuTimestampList::iterator it; ++ for (it = menuTimestamps.begin(); it != menuTimestamps.end(); ++it) ++ if (! strcmp((*it)->filename, filename)) { ++ found = true; ++ break; ++ } ++ if (!found) { + struct stat buf; + - if (! stat(tmp->filename, &buf)) { - if (tmp->timestamp != buf.st_ctime) - reread = True; - } else { - reread = True; ++ if (! stat(filename, &buf)) { ++ MenuTimestamp *ts = new MenuTimestamp; ++ ++ ts->filename = bstrdup(filename); ++ ts->timestamp = buf.st_ctime; ++ ++ menuTimestamps.push_back(ts); + } + } - - if (reread) rereadMenu(); +} + - - void Openbox::rereadMenu(void) { ++void Openbox::rereadMenu() { + reread_menu_wait = True; + + if (! timer->isTiming()) timer->start(); +} + + - void Openbox::real_rereadMenu(void) { - for (int i = 0, n = menuTimestamps->count(); i < n; i++) { - MenuTimestamp *ts = menuTimestamps->remove(0); - - if (ts) { - if (ts->filename) - delete [] ts->filename; - - delete ts; - } - } ++void Openbox::real_rereadMenu() { ++ std::for_each(menuTimestamps.begin(), menuTimestamps.end(), ++ PointerAssassin()); ++ menuTimestamps.clear(); + - LinkedListIterator it(screenList); - for (BScreen *screen = it.current(); screen; it++, screen = it.current()) - screen->rereadMenu(); ++ std::for_each(screenList.begin(), screenList.end(), ++ std::mem_fun(&BScreen::rereadMenu)); +} + + - void Openbox::saveStyleFilename(const char *filename) { ++void Openbox::setStyleFilename(const char *filename) { + if (resource.style_file) + delete [] resource.style_file; + + resource.style_file = bstrdup(filename); ++ config.setValue("session.styleFile", resource.style_file); +} + + - void Openbox::saveMenuFilename(const char *filename) { - Bool found = False; - - LinkedListIterator it(menuTimestamps); - for (MenuTimestamp *tmp = it.current(); tmp && (! found); - it++, tmp = it.current()) { - if (! strcmp(tmp->filename, filename)) found = True; - } - if (! found) { - struct stat buf; - - if (! stat(filename, &buf)) { - MenuTimestamp *ts = new MenuTimestamp; - - ts->filename = bstrdup(filename); - ts->timestamp = buf.st_ctime; - - menuTimestamps->insert(ts); - } - } - } - - - void Openbox::timeout(void) { ++void Openbox::timeout() { + if (reconfigure_wait) + real_reconfigure(); + + if (reread_menu_wait) + real_rereadMenu(); + + reconfigure_wait = reread_menu_wait = False; +} + + - void Openbox::setFocusedWindow(OpenboxWindow *win) { - BScreen *old_screen = (BScreen *) 0, *screen = (BScreen *) 0; - OpenboxWindow *old_win = (OpenboxWindow *) 0; ++OpenboxWindow *Openbox::focusedWindow() { ++ Workspace *w; ++ if (current_screen) ++ if ((w = current_screen->getCurrentWorkspace())) ++ return w->focusedWindow(); ++ return (OpenboxWindow *) 0; ++} ++ ++ ++void Openbox::focusWindow(OpenboxWindow *win) { ++ BScreen *old_screen = (BScreen *) 0; + Toolbar *old_tbar = (Toolbar *) 0, *tbar = (Toolbar *) 0; + Workspace *old_wkspc = (Workspace *) 0, *wkspc = (Workspace *) 0; + - if (focused_window) { - old_win = focused_window; ++ OpenboxWindow *old_win = focusedWindow(); ++ if (old_win != (OpenboxWindow *) 0) { + old_screen = old_win->getScreen(); - old_tbar = old_screen->getToolbar(); + old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber()); ++ old_tbar = old_screen->getToolbar(); + - old_win->setFocusFlag(False); - old_wkspc->getMenu()->setItemSelected(old_win->getWindowNumber(), False); - } - - if (win && ! win->isIconic()) { - screen = win->getScreen(); - tbar = screen->getToolbar(); - wkspc = screen->getWorkspace(win->getWorkspaceNumber()); - - focused_window = win; - - win->setFocusFlag(True); - wkspc->getMenu()->setItemSelected(win->getWindowNumber(), True); - } else { - focused_window = (OpenboxWindow *) 0; ++ old_win->setFocusFlag(false); ++ old_wkspc->focusWindow((OpenboxWindow *) 0); + } + - if (tbar) - tbar->redrawWindowLabel(True); - if (screen) - screen->updateNetizenWindowFocus(); ++ if (win && !win->isIconic()) { ++ current_screen = win->getScreen(); ++ tbar = current_screen->getToolbar(); ++ wkspc = current_screen->getWorkspace(win->getWorkspaceNumber()); ++ win->setFocusFlag(true); ++ wkspc->focusWindow(win); ++ ++ if (tbar) ++ tbar->redrawWindowLabel(true); ++ current_screen->updateNetizenWindowFocus(); ++ } else ++ XSetInputFocus(getXDisplay(), current_screen->getRootWindow(), None, ++ CurrentTime); + + if (old_tbar && old_tbar != tbar) - old_tbar->redrawWindowLabel(True); - if (old_screen && old_screen != screen) ++ old_tbar->redrawWindowLabel(true); ++ if (old_screen && old_screen != current_screen) + old_screen->updateNetizenWindowFocus(); +} diff --cc src/openbox.h index 6f23e035,00000000..f5a74503 mode 100644,000000..100644 --- a/src/openbox.h +++ b/src/openbox.h @@@ -1,212 -1,0 +1,231 @@@ +// openbox.h for Openbox +// Copyright (c) 2001 Sean 'Shaleh' Perry +// Copyright (c) 1997 - 2000 Brad Hughes (bhughes@tcac.net) +// +// Permission is hereby granted, free of charge, to any person obtaining a +// copy of this software and associated documentation files (the "Software"), +// to deal in the Software without restriction, including without limitation +// the rights to use, copy, modify, merge, publish, distribute, sublicense, +// and/or sell copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following conditions: +// +// The above copyright notice and this permission notice shall be included in +// all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +// DEALINGS IN THE SOFTWARE. + +#ifndef __openbox_hh +#define __openbox_hh + +#include +#include + +#ifdef HAVE_STDIO_H +# include +#endif // HAVE_STDIO_H + +#ifdef TIME_WITH_SYS_TIME +# include +# include +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include +# else // !HAVE_SYS_TIME_H +# include +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + - - #include "LinkedList.h" ++#include "Resource.h" +#include "BaseDisplay.h" +#include "Timer.h" + ++#include ++#include ++ +//forward declaration +class BScreen; +class Openbox; +class BImageControl; +class OpenboxWindow; +class Basemenu; +class Toolbar; +#ifdef SLIT +class Slit; +#endif // SLIT + +template +class DataSearch { +private: + Window window; + Z *data; + +public: + DataSearch(Window w, Z *d): window(w), data(d) {} + - inline const Window &getWindow(void) const { return window; } - inline Z *getData(void) { return data; } ++ inline const Window &getWindow() const { return window; } ++ inline Z *getData() { return data; } +}; + + +class Openbox : public BaseDisplay, public TimeoutHandler { +private: + typedef struct MenuTimestamp { ++ virtual ~MenuTimestamp() { ++ if (filename != (char *) 0) ++ delete [] filename; ++ } + char *filename; + time_t timestamp; + } MenuTimestamp; + + struct resource { + Time double_click_interval; + - char *menu_file, *style_file; ++ char *style_file; + char *titlebar_layout; + int colors_per_channel; + timeval auto_raise_delay; + unsigned long cache_life, cache_max; + } resource; + - typedef DataSearch WindowSearch; - LinkedList *windowSearchList, *groupSearchList; - typedef DataSearch MenuSearch; - LinkedList *menuSearchList; - typedef DataSearch ToolbarSearch; - LinkedList *toolbarSearchList; ++ typedef std::map WindowLookup; ++ typedef WindowLookup::value_type WindowLookupPair; ++ WindowLookup windowSearchList, groupSearchList; ++ ++ typedef std::map MenuLookup; ++ typedef MenuLookup::value_type MenuLookupPair; ++ MenuLookup menuSearchList; ++ ++ typedef std::map ToolbarLookup; ++ typedef ToolbarLookup::value_type ToolbarLookupPair; ++ ToolbarLookup toolbarSearchList; + +#ifdef SLIT - typedef DataSearch SlitSearch; - LinkedList *slitSearchList; ++ typedef std::map SlitLookup; ++ typedef SlitLookup::value_type SlitLookupPair; ++ SlitLookup slitSearchList; +#endif // SLIT + - LinkedList *menuTimestamps; - LinkedList *screenList; ++ typedef std::list MenuTimestampList; ++ MenuTimestampList menuTimestamps; + - OpenboxWindow *focused_window, *masked_window; ++ typedef std::list ScreenList; ++ ScreenList screenList; ++ ++ BScreen *current_screen; ++ OpenboxWindow *masked_window; + BTimer *timer; + +#ifdef HAVE_GETPID + Atom openbox_pid; +#endif // HAVE_GETPID + + Bool no_focus, reconfigure_wait, reread_menu_wait; + Time last_time; + Window masked; - char *rc_file, **argv; ++ char *menu_file, *rc_file, **argv; + int argc; ++ Resource config; + + +protected: - void load_rc(void); - void save_rc(void); - void reload_rc(void); - void real_rereadMenu(void); - void real_reconfigure(void); ++ void load(); ++ void save(); ++ void real_rereadMenu(); ++ void real_reconfigure(); + + virtual void process_event(XEvent *); + + +public: - Openbox(int, char **, char * = 0, char * = 0); - virtual ~Openbox(void); ++ Openbox(int, char **, char * = 0, char * = 0, char * = 0); ++ virtual ~Openbox(); + +#ifdef HAVE_GETPID - inline const Atom &getOpenboxPidAtom(void) const { return openbox_pid; } ++ inline const Atom &getOpenboxPidAtom() const { return openbox_pid; } +#endif // HAVE_GETPID + + Basemenu *searchMenu(Window); + + OpenboxWindow *searchGroup(Window, OpenboxWindow *); + OpenboxWindow *searchWindow(Window); - inline OpenboxWindow *getFocusedWindow(void) { return focused_window; } ++ OpenboxWindow *focusedWindow(); ++ void focusWindow(OpenboxWindow *w); + - BScreen *getScreen(int); + BScreen *searchScreen(Window); - - inline const Time &getDoubleClickInterval(void) const ++ ++ inline Resource &getConfig() { ++ return config; ++ } ++ inline const Time &getDoubleClickInterval() const + { return resource.double_click_interval; } - inline const Time &getLastTime(void) const { return last_time; } ++ inline const Time &getLastTime() const { return last_time; } + + Toolbar *searchToolbar(Window); + - inline const char *getStyleFilename(void) const ++ inline const char *getStyleFilename() const + { return resource.style_file; } - inline const char *getMenuFilename(void) const - { return resource.menu_file; } ++ inline const char *getMenuFilename() const ++ { return menu_file; } ++ void addMenuTimestamp(const char *filename); + - inline const int &getColorsPerChannel(void) const ++ inline const int &getColorsPerChannel() const + { return resource.colors_per_channel; } + - inline const timeval &getAutoRaiseDelay(void) const ++ inline const timeval &getAutoRaiseDelay() const + { return resource.auto_raise_delay; } + - inline const char *getTitleBarLayout(void) const ++ inline const char *getTitleBarLayout() const + { return resource.titlebar_layout; } + - inline const unsigned long &getCacheLife(void) const ++ inline const unsigned long &getCacheLife() const + { return resource.cache_life; } - inline const unsigned long &getCacheMax(void) const ++ inline const unsigned long &getCacheMax() const + { return resource.cache_max; } + ++ inline OpenboxWindow *getMaskedWindow() const ++ { return masked_window; } + inline void maskWindowEvents(Window w, OpenboxWindow *bw) + { masked = w; masked_window = bw; } + inline void setNoFocus(Bool f) { no_focus = f; } + - void setFocusedWindow(OpenboxWindow *w); - void shutdown(void); - void load_rc(BScreen *); - void saveStyleFilename(const char *); - void saveMenuFilename(const char *); ++ void shutdown(); ++ void setStyleFilename(const char *); + void saveMenuSearch(Window, Basemenu *); + void saveWindowSearch(Window, OpenboxWindow *); + void saveToolbarSearch(Window, Toolbar *); + void saveGroupSearch(Window, OpenboxWindow *); + void removeMenuSearch(Window); + void removeWindowSearch(Window); + void removeToolbarSearch(Window); + void removeGroupSearch(Window); + void restart(const char * = 0); - void reconfigure(void); - void rereadMenu(void); - void checkMenu(void); ++ void reconfigure(); ++ void rereadMenu(); ++ void checkMenu(); + + virtual Bool handleSignal(int); + - virtual void timeout(void); ++ virtual void timeout(); + +#ifdef SLIT + Slit *searchSlit(Window); + + void saveSlitSearch(Window, Slit *); + void removeSlitSearch(Window); +#endif // SLIT + +#ifndef HAVE_STRFTIME + + enum { B_AmericanDate = 1, B_EuropeanDate }; +#endif // HAVE_STRFTIME +}; + + +#endif // __openbox_hh diff --cc util/Makefile.am index 3c75a4c4,9d60a964..76c68393 --- a/util/Makefile.am +++ b/util/Makefile.am @@@ -1,18 -1,21 +1,18 @@@ -# util/Makefile.am for Blackbox - an X11 Window manager +# util/Makefile.am for Openbox -CPPFLAGS= @CPPFLAGS@ @DEBUG@ +CPPFLAGS= @CPPFLAGS@ @DEBUG@ @NLS@ @TIMEDCACHE@ @NEWWMSPEC@ @INTERLACE@ \ - @ORDEREDPSEUDO@ ++@ORDEREDPSEUDO@ @CLOBBER@ bin_SCRIPTS = bsetbg bin_PROGRAMS = bsetroot bsetroot_SOURCES = bsetroot.cc - bsetroot_LDADD = ../src/BaseDisplay.o ../src/LinkedList.o ../src/Timer.o ../src/Image.o ../src/i18n.o -bsetroot_LDADD = ../src/BaseDisplay.o ../src/Color.o ../src/GCCache.o ../src/Texture.o ../src/Timer.o ../src/Image.o ../src/ImageControl.o ../src/i18n.o ../src/Util.o ++bsetroot_LDADD = ../src/BaseDisplay.o ../src/Timer.o ../src/Image.o ../src/i18n.o ../src/Geometry.o MAINTAINERCLEANFILES = Makefile.in distclean-local: - rm -f *\~ .\#* + rm -f *\~ -# local dependencies - -bsetroot.o: bsetroot.cc ../config.h ../src/i18n.hh \ - ../src/../nls/blackbox-nls.hh ../src/GCCache.hh ../src/BaseDisplay.hh \ - ../src/Timer.hh ../src/Color.hh ../src/Texture.hh ../src/Util.hh \ - bsetroot.hh ../src/Image.hh +bsetroot.o: bsetroot.cc ../config.h bsetroot.h ../src/BaseDisplay.h \ - ../src/LinkedList.h ../src/Timer.h ../src/Image.h ++ ../src/Timer.h ../src/Image.h ../src/Geometry.h diff --cc util/Makefile.in index aefa5e99,792fa51a..f2404586 --- a/util/Makefile.in +++ b/util/Makefile.in @@@ -77,14 -70,13 +77,14 @@@ VERSION = @VERSION gencat_cmd = @gencat_cmd@ regex_cmd = @regex_cmd@ - CPPFLAGS = @CPPFLAGS@ @DEBUG@ @NLS@ @TIMEDCACHE@ @NEWWMSPEC@ @INTERLACE@ @ORDEREDPSEUDO@ -CPPFLAGS = @CPPFLAGS@ @DEBUG@ ++CPPFLAGS = @CPPFLAGS@ @DEBUG@ @NLS@ @TIMEDCACHE@ @NEWWMSPEC@ @INTERLACE@ @ORDEREDPSEUDO@ @CLOBBER@ + bin_SCRIPTS = bsetbg bin_PROGRAMS = bsetroot bsetroot_SOURCES = bsetroot.cc - bsetroot_LDADD = ../src/BaseDisplay.o ../src/LinkedList.o ../src/Timer.o ../src/Image.o ../src/i18n.o -bsetroot_LDADD = ../src/BaseDisplay.o ../src/Color.o ../src/GCCache.o ../src/Texture.o ../src/Timer.o ../src/Image.o ../src/ImageControl.o ../src/i18n.o ../src/Util.o ++bsetroot_LDADD = ../src/BaseDisplay.o ../src/Timer.o ../src/Image.o ../src/i18n.o ../src/Geometry.o MAINTAINERCLEANFILES = Makefile.in mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs @@@ -101,8 -93,9 +101,8 @@@ X_LIBS = @X_LIBS X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ bsetroot_OBJECTS = bsetroot.o - bsetroot_DEPENDENCIES = ../src/BaseDisplay.o ../src/LinkedList.o \ - ../src/Timer.o ../src/Image.o ../src/i18n.o -bsetroot_DEPENDENCIES = ../src/BaseDisplay.o ../src/Color.o \ -../src/GCCache.o ../src/Texture.o ../src/Timer.o ../src/Image.o \ -../src/ImageControl.o ../src/i18n.o ../src/Util.o ++bsetroot_DEPENDENCIES = ../src/BaseDisplay.o ../src/Timer.o \ ++../src/Image.o ../src/i18n.o ../src/Geometry.o bsetroot_LDFLAGS = SCRIPTS = $(bin_SCRIPTS) @@@ -375,10 -310,14 +317,10 @@@ maintainer-clean-generic clean mostlycl distclean-local: - rm -f *\~ .\#* - -# local dependencies + rm -f *\~ -bsetroot.o: bsetroot.cc ../config.h ../src/i18n.hh \ - ../src/../nls/blackbox-nls.hh ../src/GCCache.hh ../src/BaseDisplay.hh \ - ../src/Timer.hh ../src/Color.hh ../src/Texture.hh ../src/Util.hh \ - bsetroot.hh ../src/Image.hh +bsetroot.o: bsetroot.cc ../config.h bsetroot.h ../src/BaseDisplay.h \ - ../src/LinkedList.h ../src/Timer.h ../src/Image.h ++ ../src/Timer.h ../src/Image.h ../src/Geometry.h # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. diff --cc util/bsetbg index a0675aa6,fda6022d..8e01b0e8 --- a/util/bsetbg +++ b/util/bsetbg @@@ -20,675 -20,479 +20,480 @@@ # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # DEALINGS IN THE SOFTWARE. + PATH=$PATH:/usr/bin:/usr/local/bin:/usr/X11R6/bin - error_msg() - { - case $INFO in yes|y|1) info_msg; esac - - case $1 in - 1) - echo; echo "$NAME: configuration error: $OPTION=\"$VALUE\"" - echo "$NAME: please edit $CONFIG and provide the correct variable." - ;; - 2) - echo; echo "$NAME: error: couldn't execute '$APP'! tried to run fallback option $ARGUMENT" - echo "$NAME: but quit because of the following error in $CONFIG:" - echo "$NAME: $OPTION= $VALUE" - echo "$NAME: please edit $CONFIG and provide the correct variable!" - ;; - 3) - echo; echo "$NAME: error: couldn't find any suitable image applications in the system path!" - echo - error_msg url - ;; - 4) - echo; echo "$NAME: error: invalid option, or non-existent image ($ARGUMENT)." - ;; - 5) - echo; echo "$NAME: error: the image you specified ($IMAGE) could not be found." - ;; - 6) - echo; echo "$NAME: error: please specify a valid image." - ;; - 7) - echo; echo "$NAME: error: bsetroot couldn't be found! check your openbox installation." - ;; - 8) - echo; echo "$NAME: error: wrong number of arguments!" - echo "$NAME: make sure you enclosed the options for '$APP' in double quotes." - ;; - nobgapp) - echo; echo "$NAME: error: tried to run '$VALUE' for $ARGUMENT argument," - echo "$NAME: but couldnt find '$APP' in the path! please fix the following" - echo "$NAME: line in $CONFIG to point to an existing application:" - echo "$NAME: $OPTION=\"$VALUE\"" - ;; - nogrep) - echo "$NAME: error: couldn't find grep!" - echo "this script needs grep to be in your path in order to function." - echo "you can get GNU grep from ftp://ftp.gnu.org/bin/gnu/grep/" && exit 1 - ;; - url) - echo "it is suggested that you use qiv, xli (xsetbg), or xv." - echo "you can obtain them at the following locations:" - echo - echo " qiv: http://www.klografx.de/software/qiv.shtml" - echo " xli: http://pantransit.reptiles.org/prog/#xli" - echo " xv: http://www.trilon.com/xv/downloads.html" - echo - echo "the above URLs are current as of 05/23/2000." - esac - exit 1 - } -img_apps="display xli xsetbg Esetroot qiv wmsetbg xv" ++img_apps="qiv xli xv wmsetbg Esetroot display xsetbg" + display_full_cmd="display -geometry 800x600 -window root" + display_tile_cmd="display -window root" + display_center_cmd="display -backdrop -window root" + display_default_cmd="$display_center_cmd" - help_msg() - { - echo "$NAME $VERSION: $MORE" - echo "options:" - echo - echo " (none) image is set using default values" - echo - echo " -full, -f image is set fullscreen" - echo " -tile, -t image is set tiled" - echo " -center, -c image is set centered" - echo - echo " -app, -a image is set using with" - echo " <"'"application options"'"> quote-enclosed \"options\" and" - echo " -center, -c|-tile, -t|-full, -f default fallback option" - echo - echo " -display display to connect to (bsetroot only)" - echo " -mod sets bsetroot modula pattern" - echo " -foreground, -fg modula foreground color" - echo " -background, -bg modula background color" - echo - echo " -gradient sets bsetroot gradient texture" - echo " -from gradient start color" - echo " -to gradient end color" - echo - echo " -solid sets bsetroot solid color" - echo - echo " -version, -v outputs $NAME's version number" - echo " -info, -i outputs configuration info" - echo " -help, -h this message" - echo - echo "usage: " - exit 0 - } + Esetroot_full_cmd="Esetroot -scale" + Esetroot_tile_cmd="Esetroot" + Esetroot_center_cmd="Esetroot -c" + Esetroot_default_cmd="$Esetroot_center_cmd" + wmsetbg_full_cmd="wmsetbg -s -S" + wmsetbg_tile_cmd="wmsetbg -t" + wmsetbg_center_cmd="wmsetbg -e" + wmsetbg_default_cmd="$wmsetbg_center_cmd" - info_msg() - { - case $ERROR in - [1-3]) - SUMMARY="error: some variables are blank" - ;; - 4) - SUMMARY="no values have been specified" - ;; - 0) - SUMMARY="looks good" - esac - - case $APP_ERROR in [1-4]) - SUMMARY="error: some applications couldn't be found!" - esac - - case `which bsetroot 2>&1` in - */*bsetroot) - BSETROOT=`which bsetroot` - ;; - *) - BSETROOT="(error: not found)" - case $ERROR in - 1-4) - SUMMARY="$SUMMARY, and bsetroot does not seem to be present." - ;; - *) - SUMMARY="$SUMMARY, but bsetroot does not seem to be present." - esac - esac - - echo "$NAME $VERSION configuration:" - echo - echo " bsetroot: $BSETROOT" - echo - echo " reading configuration from: $CONFIG" - echo - echo " configuration values:" - echo - case $FULL_BGAPP_MSG in - *"not found") - echo " fullscreen (ERROR): $FULL_BGAPP_MSG" - ;; - *) - echo " fullscreen (FULL): $FULL_MSG" - esac - - echo - - case $TILE_BGAPP_MSG in - *"not found") - echo " tiled (ERROR): $TILE_BGAPP_MSG" - ;; - *) - echo " tiled (TILE): $TILE_MSG" - esac - - echo - - case $CENTER_BGAPP_MSG in - *"not found") - echo " centered (ERROR): $CENTER_BGAPP_MSG" - ;; - *) - echo " centered (CENTER): $CENTER_MSG" - esac - - echo - - case $DEFAULT_BGAPP_MSG in - *"not found") - echo " default (ERROR): $DEFAULT_BGAPP_MSG" - ;; - *) - echo " default (DEFAULT): $DEFAULT_MSG" - esac - echo - echo " summary: $SUMMARY" - exit 0 - } + qiv_full_cmd="qiv --root_s" + qiv_tile_cmd="qiv --root_t" + qiv_center_cmd="qiv --root" + qiv_default_cmd="$qiv_center_cmd" + + xv_full_cmd="xv -max -smooth -root -quit" + xv_tile_cmd="xv -root -quit" + xv_center_cmd="xv -rmode 5 -root -quit" + xv_default_cmd="$xv_center_cmd" + + xli_full_cmd="xli -fullscreen -onroot -quiet" + xli_tile_cmd="xli -onroot -quiet" + xli_center_cmd="xli -center -onroot quiet" + xli_default_cmd="$xli_center_cmd" + -xsetbg_full_cmd="xsetbg -fullscreen" ++xsetbg_full_cmd="xsetbg -fillscreen" + xsetbg_tile_cmd="xsetbg" + xsetbg_center_cmd="xsetbg -center" + xsetbg_default_cmd="$xsetbg_center_cmd" + + ################################## + me=${0##*/} + version=2.1 + copyright="(c) 2000-$(date +%Y) by Timothy M. King (http://lordzork.com/)" + config=$HOME/.bsetbgrc + last_cmd_file=$HOME/.bsetbg_last_cmd + refresh_cmd=xrefresh + p=$me: - find_app() + quit() { - case `which $1 2>&1` in - */*$1) - echo "$NAME: checking for $1... `which $1`" - echo "### $app" >> $TMPFILE - echo "# FULL=\"$full\"" >> $TMPFILE - echo "# TILE=\"$tile\"" >> $TMPFILE - echo "# CENTER=\"$center\"" >> $TMPFILE - echo "# DEFAULT=\"$default\"" >> $TMPFILE - echo >> $TMPFILE - - FULL=$full - TILE=$tile - CENTER=$center - DEFAULT=$default - APP=$app - ;; - *) - echo "$NAME: checking for $1... not found." - esac + [ "$1" ] && rc=$1 && shift 1 + [ "$*" ] && echo -e $* + exit ${rc:-0} } - search_display() -bool() { ++bool() +{ - ### display - full="display -geometry 800x600 -window root" - tile="display -window root" - center="display -backdrop -window root" - default=$center - find_app display + case $1 in + [yY][eE][sS]|1|[yY]|[tT][rR][uU][eE]|[oO][nN]) : ;; + *) return 1 ;; + esac } - search_Esetroot() + check_exe_in_path() { - ### Esetroot - full="Esetroot -scale" - tile="Esetroot" - center="Esetroot -c" - default=$center - find_app Esetroot + if [ -z "$1" ]; then + return 1 + elif [ -x "$(which $1 2>/dev/null)" ]; then + return 0 + elif [ -x "$(type $1 2>/dev/null)" ]; then + return 0 + else + return 1 + fi } - search_wmsetbg() + help_msg() { - ### wmsetbg - full="wmsetbg -s -S" - tile="wmsetbg -t" - center="wmsetbg -e" - default=$center - find_app wmsetbg + cat < center an image on the desktop + -tile tile an image on the desktop + -full stretch an image to fill the desktop + -exec specify an external command to execute + + -post arguments to be passed to the post-command + -debug prints commands without executing them + EOF + + # this is extremely lame, but probably more portable than grep -E + bsetroot_help=$(bsetroot -help 2>&1| grep -v "^bsetroot" | grep -v "^ -help") + case $bsetroot_help in + BaseDisplay*) echo ;; + *-gradient*) echo "$bsetroot_help" + esac + + cat < generate a config file + -help this message + -version output version information + EOF + quit ${1:-0} } - search_xli() + get_apps() { - ### xli - case `which xsetbg 2>&1` in - */*xsetbg) - full="xsetbg -fillscreen" - tile="xsetbg" - center="xsetbg -center" - default=$center - app="xsetbg (xli)" - find_app xsetbg - ;; - *) - case `which xli 2>&1` in */*xli) - full="xli -fillscreen -onroot -quiet" - tile="xli -onroot -quiet" - center="xli -center -onroot quiet" - default=$center - app=xli - find_app xli - esac - esac + for a in $img_apps; do + if check_exe_in_path $a; then + eval center_cmd=\$$a\_center_cmd + eval full_cmd=\$$a\_full_cmd + eval tile_cmd=\$$a\_tile_cmd + eval default_cmd=\$$a\_default_cmd + return 0 + else + if [ "$not_found" ]; then + not_found="$not_found $a" + else + not_found=$a + fi + fi + done + return 1 } - search_qiv() + do_generate() { - ### qiv - full="qiv --root_s" - tile="qiv --root_t" - center="qiv --root" - default=$center - find_app qiv + echo -e "# created by $me $version on $(date)\n#" + echo -e "# seting NO_EXEC to a boolean value (eg true/false) will cause $me" + echo -e "# to never modify the root window\n#" + echo -e "#NO_EXEC=\n#" + echo -e "# POST_COMMAND can be set to a command that will be run run every time" + echo -e "# $me sets the root image\n#" + echo -e "#POST_COMMAND=\n#" + echo -e "# if LOG_LAST_CMD is set (boolean), bsetbg will keep a log of the last" + echo -e "# two successful commands.\n#" + echo -e "#LOG_LAST_CMD=\n#" + echo -e "# the LOGFILE specifies the file that bsetbg uses when LOG_LAST_CMD" + echo -e "# is defined. this defaults to ~/.bsetbg_last_cmd .\n#" + echo -e "#LOGFILE=\n#" + echo -e "# the following are default configuration values for the most popular image" + echo -e "# programs. See the man page of the respective application for more info.\n" + + [ "$*" ] && img_apps="$*" + + for a in $img_apps; do + if check_exe_in_path $a; then + if ! bool $have_match; then + q='\"' + [ "$(eval echo \$$a\_center_cmd)" ] && + eval echo CENTER=$q\$$a\_center_cmd$q && + + [ "$(eval echo \$$a\_full_cmd)" ] && + eval echo FULL=$q\$$a\_full_cmd$q && + + [ "$(eval echo \$$a\_tile_cmd)" ] && + eval echo TILE=$q\$$a\_tile_cmd$q && + + [ "$(eval echo \$$a\_default_cmd)" ] && + eval echo -e DEFAULT=$q\$$a\_default_cmd$q \\\\n && + + have_match=1 + else + [ "$(eval echo \$$a\_center_cmd)" ] && + eval echo \\#CENTER=$q\$$a\_center_cmd$q + + [ "$(eval echo \$$a\_full_cmd)" ] && + eval echo \\#FULL=$q\$$a\_full_cmd$q + + [ "$(eval echo \$$a\_tile_cmd)" ] && + eval echo \\#TILE=$q\$$a\_tile_cmd$q + + [ "$(eval echo \$$a\_default_cmd)" ] && + eval echo -e \\#DEFAULT=$q\$$a\_default_cmd$q \\\\n + fi + fi + done + quit 0 } - search_xv() + do_bsetroot() { - ### xv - full="xv -max -smooth -root -quit" - tile="xv -root -quit" - center="xv -rmode 5 -root -quit" - default=$center - find_app xv - } + if check_exe_in_path bsetroot; then + read_config + $debug bsetroot $* 2>/dev/null; rc=$? + + if [ "$rc" -gt 0 ]; then + help_msg $rc + else + log_cmd bsetroot $*; $refresh_cmd 2>/dev/null + fi + else + quit 1 "couldn't find bsetroot in $PATH" + fi + } - rm_tmpfiles() + do_standard() { - [ -f $TMPFILE ] && rm -f $TMPFILE - } + [ -z "$1" ] && help_msg 1 + bool $noconfig || read_config - create_config() - { - trap rm_tmpfiles INT QUIT STOP TERM - case $UID in 0) - if [ "$ARGUMENT" != "-r" ]; then - echo "$NAME: running X as root is a security hazard, and is NOT a good idea!" - echo "$NAME: if you insist upon having a ~/.bsetbgrc for root, run bsetbg with" - echo "$NAME: the '-r' flag to force its creation. you have been warned!" - exit 1 + get_img_command $1 + check_img_command $do_this + + case $# in + 1) file="$1" ;; + *) file="$2" + esac + + if [ -f "$file" ]; then + exec_img_command $do_this $file + else + quit 1 "$file does not exist" fi - esac - - case $ARGUMENT in - -r) - echo "$NAME: creating configuration for root (BAD IDEA)..." - ;; - *) - echo "$NAME: $CONFIG not found, creating..." - esac - - for app in $IMAGE_APPS; do - search_$app - done - - if [ -z "$FULL" ] || [ -z "TILE" ] || [ -z "$CENTER" ]; then - rm -f $TMPFILE - INFO= && error_msg 3 - fi - - echo "# $CONFIG" >> $CONFIG - echo "#" >> $CONFIG - echo "# automagically generated with loving care by $NAME $VERSION on `date`" >> $CONFIG - echo "#" >> $CONFIG - echo "# uncomment the set below that corresponds to your favorite root-image" >> $CONFIG - echo "# application, or mix and match to suit your pleasure." >> $CONFIG - echo "#" >> $CONFIG - echo "# xli misbehaves under larger screen resolutions when using the -fillscreen" >> $CONFIG - echo "# option. use -fullscreen if your resolution is higher than 1024x768." >> $CONFIG - echo "#" >> $CONFIG - echo; echo >> $CONFIG - echo "### $APP" >> $CONFIG - echo "FULL=\"$FULL\"" >> $CONFIG - echo "TILE=\"$TILE\"" >> $CONFIG - echo "CENTER=\"$CENTER\"" >> $CONFIG - echo "DEFAULT=\"$DEFAULT\"" >> $CONFIG - echo >> $CONFIG - - cat $TMPFILE | grep -v $APP >> $CONFIG - - rm -f $TMPFILE - - if [ -f $CONFIG ]; then - echo "$NAME: default configuration was created in $CONFIG." - else - echo "ERROR: $CONFIG not found!" && exit 1 - fi - } + } - check_config_apps() + do_exec() { - BGAPP=$1 - case `which $1 2>&1` in - */*$1) - BGAPP_MSG="`which $1`" - ;; - *) - BGAPP_MSG="$BGAPP: not found" - APP_ERROR=`expr $APP_ERROR + 1` - esac - } + [ "$#" -lt 3 ] && help_msg 3 + + bool $noconfig || read_config + + # check to see if -*c, -*f, or -*t were spcified, if so + # assume the last argument is a filename + b_arg=$(eval echo \$$(( $# - 1 )) ) + app=$1 + + case $b_arg in + -c|*-center|c|-t|*-tile*|t|-f|*-full|f) + eval file=\$$# + f_args="$b_arg $file" + esac + # put the rest of the arguments into the varialbe $e_args + while [ "$*" ]; do + for a in "$*"; do + case $1 in + $b_arg|$file) : ;; + *) e_args="$e_args "$1"" + esac + shift 1 + done + done + + # with $f_args defined, check for image and do things normally + if [ "$f_args" ]; then + [ ! -f "$file" ] && quit 1 "$file does not exist" + + if check_img_command $e_args; then + do_this="$e_args" + else + read_config + get_img_command $f_args + check_img_command $do_this + echo "$p couldn't find '$app' in path, using $type command instead" + fi + # without $f_args, run the command blindly if it's in $PATH + elif check_exe_in_path $e_args; then + do_this="$e_args" + else + quit 1 "$p unable to run the following command: $e_args" + fi - check_config_vars() + exec_img_command $do_this $file + } + + get_img_command() { - ERROR=0 - APP_ERROR=0 - - if [ -z "$FULL" ]; then - FULL_MSG="(no value)" && ERROR=`expr $ERROR + 1` - else - check_config_apps $FULL - FULL_BGAPP_MSG=$BGAPP_MSG - FULL_BGAPP=$BGAPP - FULL_MSG="$FULL" - fi - - if [ -z "$TILE" ]; then - TILE_MSG="(no value)" && ERROR=`expr $ERROR + 1` - else - check_config_apps $TILE - TILE_BGAPP_MSG=$BGAPP_MSG - TILE_BGAPP=$BGAPP - TILE_MSG="$TILE" - fi - - if [ -z "$CENTER" ]; then - CENTER_MSG="(no value)" && ERROR=`expr $ERROR + 1` - else - check_config_apps $CENTER - CENTER_BGAPP_MSG=$BGAPP_MSG - CENTER_BGAPP=$BGAPP - CENTER_MSG="$CENTER" - fi - - if [ -z "$DEFAULT" ]; then - DEFAULT_MSG="(no value)" && ERROR=`expr $ERROR + 1` - else - check_config_apps $DEFAULT - DEFAULT_BGAPP_MSG=$BGAPP_MSG - DEFAULT_BGAPP=$BGAPP - DEFAULT_MSG="$DEFAULT" - fi + case $1 in + *-full|-f|f) type=full; do_this="$full_cmd" ;; + *-tile|-t|t) type=tile; do_this="$tile_cmd" ;; + *-center|-c|c) type=center; do_this="$center_cmd" ;; + *) type=default; do_this="$default_cmd" + esac } - - final_error_check() + check_img_command() { - case $ARGUMENT in - *full|-f|c) - OPTION=FULL - VALUE=$FULL_MSG - FB_ARG=$FULL - case $FULL_BGAPP_MSG in *"not found") - APP=$FULL_BGAPP - error_msg nobgapp - esac - ;; - *tile|-t|t) - OPTION=TILE - VALUE=$TILE_MSG - FB_ARG=$TILE - case $TILE_BGAPP_MSG in *"not found") - APP=$TILE_BGAPP - error_msg nobgapp - esac - ;; - *center|-c|c) - OPTION=CENTER - VALUE=$CENTER_MSG - FB_ARG=$CENTER - case $CENTER_BGAPP_MSG in *"not found") - APP=$CENTER_BGAPP - error_msg nobgapp - esac - ;; - *) - OPTION=DEFAULT - VALUE=$DEFAULT_MSG - FB_ARG=$DEFAULT - ARGUMENT=default - case $DEFAULT_BGAPP_MSG in *"not found") - APP=$DEFAULT_BGAPP - error_msg nobgapp - esac - - if [ "$IMAGE_EXISTS" != yes ]; then - error_msg 4; fi - esac - - case $VALUE in "(no value)") - if [ -n "$APP" ]; then - error_msg 2 + if check_exe_in_path $1; then + do_this="$*" + rc=0 + elif get_apps; then + get_img_command $* + rc=1 else - error_msg 1 + quit 1 "$p couldn't find a suitable image program. tried the following:\\n + $(for a in $not_found; do echo " $a\\n"; done)" fi - esac - } + if [ "$rc" -gt 0 -a -z "$e_args" ] && bool $read_config; then + echo "$p couldn't find a suitable $type command in $config" + fi - check_config() - { - if [ ! -f $CONFIG ]; then - create_config - fi - - check_old_config - . $CONFIG - check_config_vars - final_error_check + return $rc } - - check_image() + exec_img_command() { - case "$IMAGE" in - *~/*) - IMAGE="$HOME/`basename $IMAGE`" - esac - - case $NOARG in - yes|y|1) - NUM=4 - ;; - *) - if [ -n "$IMAGE" ]; then - NUM=5 - else - NUM=6 - fi - case $IMAGE in $ARGUMENT|"."|"./") - error_msg 6 - esac - esac - - if [ ! -e "$IMAGE" ]; then - error_msg $NUM - else - IMAGE_EXISTS=yes - fi - } + unset rc + command=$* + if [ "$debug" ]; then + $debug $command + else + $command >/dev/null 2>&1; rc=$? + fi - exec_app() - { - case `which $APP 2>&1` in - */*$APP) - check_image - final_error_check - exec $APP $ARGS "$IMAGE" - ;; - *) - check_image - check_config - exec $FB_ARG "$IMAGE" - esac + if [ "$rc" -gt 0 ]; then + echo "$p '$command' exited with status $rc" + get_apps + noconfig=1 + parse_args ${f_args:-$my_args} + echo "$p using '$command' as $type" + $debug $command >/dev/null 2>&1; rc=$? + [ "$rc" = 0 ] && log_cmd $do_this $file && $refresh_cmd 2>/dev/null + else + log_cmd $do_this $file; xrefresh 2>/dev/null + fi + return $rc } + log_cmd() + { + bool $LOG_LAST_CMD || return 1 + [ "$debug" ] && return 1 + echo -e "$prev_cmd\n$*" >$last_cmd_file + return $? + } - check_bsetroot_args() + read_config() { - case $1 in - -mod) - ARGS="$1 $2 $3 $4 $5 $6 $7" - ;; - -gradient) - ARGS="$1 $2 $3 $4 $5 $6" - ;; - -solid) - ARGS="$1 $2" - esac + [ -f $config ] || return 1 + + if bool $read_config; then + unset read_config + else + read_config=1 + fi + + . $HOME/.bsetbgrc 2>/dev/null + check_no_exec + + full_cmd=$FULL + center_cmd=$CENTER + tile_cmd=$TILE + default_cmd=$CENTER + last_cmd_file=${LOGFILE:-$last_cmd_file} + + bool $LOG_LAST_CMD && prev_cmd=$(tail -n 1 $last_cmd_file 2>/dev/null) } + check_no_exec() + { + bool $NO_EXEC && + quit 0 "$p no_exec mode. the root window will not be modified." + } - exec_bsetroot() + post_command() { - case `which bsetroot 2>&1` in - */*bsetroot) - exec bsetroot $ARGS - ;; - *) - error_msg 7 - esac + if [ -n "$POST_COMMAND" -a "$rc" -le 0 ]; then + if [ -n "$debug" ]; then + $debug "running post_command: $POST_COMMAND $post_args" + else + post_command_output=$($POST_COMMAND $post_args 2>&1); erc=$? + if [ "$erc" -gt 0 ]; then + echo "$p post-command '$POST_COMMAND $post_args' exited with status $erc" + [ -n "$post_command_output" ] && + echo "$POST_COMMAND $post_args: $post_command_output" + fi + fi + fi } + add_arg() + { + [ "$1" ] || return 1 + if [ "$args" ]; then + args="$args $1" + else + args=$1 + fi + } - check_old_config() + add_post_arg() { - if [ -f $CONFIG ]; then - . $CONFIG - if [ -n "$BGAPP" ] || [ -n "$CENTER_ARGS" ] || \ - [ -n "$TILED_ARGS" ] || [ -n "$OTHER_ARGS" ] || \ - [ -n "$DEFAULT_ARGS" ]; then - echo " this version of $NAME ($VERSION) no longer uses the old configuration format." - echo " please update $CONFIG with the new syntax:" - echo - echo " CENTER=\"value\"" - echo " FULL=\"value\"" - echo " TILE=\"value\"" - echo " DEFAULT=\"value\"" - echo - echo " see the sample.config file for details." - exit 0 + [ -z "$1" ] && return 1 + if [ "$post_args" ]; then + post_args="$post_args $1" + else + post_args=$1 fi - fi } - - debug() - { - echo "DEBUG:--------------------------" - echo "config: $CONFIG" - echo "full: $FULL" - echo "tile: $TILE" - echo "center: $CENTER" - echo "default: $DEFAULT" - echo "error: $ERROR" - echo "app error: $APP_ERROR" - echo "argument: $ARGUMENT" - echo "________________________________" - echo + check_cmd() + { + if [ -z "$command" ]; then + command=${2:-$1}; eval ${3:-${2:-$1}}=1 + elif bool $do_post; then + add_post_arg ${1} + else + finished=1 + fi } - IMAGE_APPS="display Esetroot wmsetbg xv xli qiv" - CONFIG="$HOME/.bsetbgrc" - NAME=bsetbg - VERSION=1.12 - MORE="(C) 2000 by lordzork industries (http://lordzork.com/)" - PATH=$PATH:/usr/bin:/usr/local/bin:/usr/X11R6/bin:/usr/X11/bin - TMPFILE=`tempfile --prefix=bsetbg` - ARGUMENT=$1 - - - case `which grep 2>&1` in */*grep) : ;; - *) - error_msg nogrep - esac - - case $1 in - *-full|-f|f) - check_config - IMAGE=$2 && check_image - exec $FULL "$IMAGE" - ;; - *-tile|*tiled|-t|t) - check_config - IMAGE=$2 && check_image - exec $TILE "$IMAGE" - ;; - *-center|-c|c) - check_config - IMAGE=$2 && check_image - exec $CENTER "$IMAGE" - ;; - *-app|-a|a) - APP=$2 - ARGS="$3" - case $# in - 4) - ARGMENT=$3 - IMAGE=$4 - exec_app - ;; - 5) - COMMAND=`shift 1 && echo $*` - ARGUMENT=$4 - IMAGE=$5 - exec_app - ;; - *) - error_msg 8 - esac - ;; - -mod|-gradient|-solid) - check_bsetroot_args $* - exec_bsetroot - ;; - -display) - shift 1 && check_bsetroot_args $* - ARGS="-display $ARGS" - exec_bsetroot - ;; - *-info|-i|i) - INFO=yes - check_config - info_msg - ;; - *-version|-v|v) - echo; echo " $NAME version $VERSION"; echo " $MORE"; exit 0 - ;; - *-help|-h|h) - help_msg - ;; - -r) - case $UID in - 0) - if [ -f $CONFIG ]; then - exit 1 - else - create_config - fi - ;; - *) - exit 1 + parse_args() + { + case $1 in + -d|*-debug|d) + unset refresh_cmd; debug=echo\ $me\_debug: ;; + + -p|-*-post|p) + unset finished do_standard do_exec; do_post=1 ;; + + -c|*-center|c|-t|*-tile*|t|-f|*-full|f) + case $command in + do_standard|do_generate|do_bsetroot) + finished=1 ;; + do_exec) + if ! bool $got_fcmd; then + add_arg $1 args; got_fcmd=1 + else + finished=1 + fi ;; + *) + add_arg $1; do_standard=1; command=do_standard + esac ;; + + -a|*-app|a|-e|*-exec|e) + check_cmd "do_exec" ;; + + -mod|-gradient|-solid|-display) + check_cmd "do_bsetroot" && add_arg $1 ;; + + -g|*-generate*|g) + check_cmd $1 "do_generate" ;; + + -v|*-version|v) + [ -z "$command" ] && quit 0 $me $version $copyright ;; + + -h|*-help|h) + [ -z "$command" ] && help_msg ;; + + *) + bool $finished && return 1 + + case $1 in -*) + bool $do_exec || bool $do_bsetroot || bool $do_post || help_msg 1 + esac + + if bool $do_standard || bool $do_exec || bool $do_bsetroot || bool $do_generate; then + add_arg $1 + elif bool $do_post; then + add_post_arg $1 + else + add_arg $1; command=do_standard; finished=1 + fi esac - ;; - *) - if [ -n "$1" ]; then - NOARG=yes - IMAGE=$1 && check_image - check_config && final_error_check - exec $DEFAULT "$1" - else - if [ ! -f $CONFIG ]; then - create_config && exit 0 - fi - help_msg - fi - esac + } + + [ -z "$*" ] && help_msg 1 + + my_args=$* + + for arg in "$@"; do + parse_args "$arg" + shift 1 + done + + [ "$debug" ] && echo + + $command $args + post_command $rc + + quit $rc diff --cc util/bsetroot.cc index f0912cab,47939aec..d0be44b6 --- a/util/bsetroot.cc +++ b/util/bsetroot.cc @@@ -1,34 -1,62 +1,58 @@@ -// -*- mode++; indent-tabs-mode: nil; c-basic-offset: 2; -*- -// bsetroot.cc for Blackbox - an X11 Window manager ++// bsetroot.cc for Openbox ++// Copyright (c) 2002 - 2002 Ben Janens (ben@orodu.net) + // Copyright (c) 2001 - 2002 Sean 'Shaleh' Perry + // Copyright (c) 1997 - 2000, 2002 Brad Hughes + // + // Permission is hereby granted, free of charge, to any person obtaining a + // copy of this software and associated documentation files (the "Software"), + // to deal in the Software without restriction, including without limitation + // the rights to use, copy, modify, merge, publish, distribute, sublicense, + // and/or sell copies of the Software, and to permit persons to whom the + // Software is furnished to do so, subject to the following conditions: + // + // The above copyright notice and this permission notice shall be included in + // all copies or substantial portions of the Software. + // + // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + // DEALINGS IN THE SOFTWARE. + #ifdef HAVE_CONFIG_H # include "../config.h" #endif // HAVE_CONFIG_H - #ifdef STDC_HEADERS -extern "C" { -#ifdef HAVE_STDLIB_H -# include -#endif // HAVE_STDLIB_H - -#ifdef HAVE_STRING_H ++#ifdef HAVE_STRING_H # include + #endif // HAVE_STRING_H + ++#ifdef HAVE_STDLIB_H +# include - #endif // STDC_HEADERS ++#endif // HAVE_STDLIB_H + #ifdef HAVE_STDIO_H # include #endif // HAVE_STDIO_H -} -#include "../src/i18n.hh" -#include "../src/GCCache.hh" -#include "../src/Texture.hh" -#include "../src/Util.hh" -#include "bsetroot.hh" +#include "../src/i18n.h" ++#include "../src/BaseDisplay.h" ++#include "../src/Image.h" +#include "bsetroot.h" - -I18n i18n; ++#include bsetroot::bsetroot(int argc, char **argv, char *dpy_name) : BaseDisplay(argv[0], dpy_name) { - pixmaps = (Pixmap *) 0; grad = fore = back = (char *) 0; - bool mod = False, sol = False, grd = False; + Bool mod = False, sol = False, grd = False; - int mod_x = 0, mod_y = 0, i = 0; + int mod_x = 0, mod_y = 0; - img_ctrl = new BImageControl*[getNumberOfScreens()]; - for (; i < getNumberOfScreens(); i++) - img_ctrl[i] = new BImageControl(this, getScreenInfo(i), True); - - for (i = 1; i < argc; i++) { + for (int i = 1; i < argc; i++) { if (! strcmp("-help", argv[i])) { usage(); } else if ((! strcmp("-fg", argv[i])) || @@@ -75,19 -103,17 +99,18 @@@ if ((mod + sol + grd) != True) { fprintf(stderr, - i18n-> - getMessage( - #ifdef NLS - bsetrootSet, bsetrootMustSpecify, - #else // !NLS - 0, 0, - #endif // NLS - "%s: error: must specify one of: -solid, -mod, -gradient\n"), - i18n(bsetrootSet, bsetrootMustSpecify, - "%s: error: must specify one of: -solid, -mod, -gradient\n"), -- getApplicationName()); - ++ i18n->getMessage(bsetrootSet, bsetrootMustSpecify, ++ "%s: error: must specify one of: " ++ "-solid, -mod, -gradient\n"), ++ getApplicationName()); + usage(2); } - + - img_ctrl = new BImageControl*[getNumberOfScreens()]; - for (unsigned int s = 0; s < getNumberOfScreens(); ++s) - img_ctrl[s] = new BImageControl(this, getScreenInfo(s), True); ++ img_ctrl = new BImageControl*[numberOfScreens()]; ++ for (unsigned int s = 0, n = numberOfScreens(); s < n; ++s) ++ img_ctrl[s] = new BImageControl(*this, *getScreenInfo(s), true); + if (sol && fore) solid(); else if (mod && mod_x && mod_y && fore && back) modula(mod_x, mod_y); else if (grd && grad && fore && back) gradient(); @@@ -96,41 -122,104 +119,111 @@@ bsetroot::~bsetroot(void) { + XSetCloseDownMode(getXDisplay(), RetainPermanent); + XKillClient(getXDisplay(), AllTemporary); - if (pixmaps) { - int i; - for (i = 0; i < getNumberOfScreens(); i++) - if (pixmaps[i] != None) { - XSetCloseDownMode(getXDisplay(), RetainTemporary); - break; - } - std::for_each(img_ctrl, img_ctrl + getNumberOfScreens(), PointerAssassin()); ++ std::for_each(img_ctrl, img_ctrl + numberOfScreens(), PointerAssassin()); + + delete [] img_ctrl; + } + + + // adapted from wmsetbg + void bsetroot::setPixmapProperty(int screen, Pixmap pixmap) { + static Atom rootpmap_id = None, esetroot_id = None; + Atom type; + int format; + unsigned long length, after; + unsigned char *data; + const ScreenInfo *screen_info = getScreenInfo(screen); - delete [] pixmaps; + if (rootpmap_id == None) { + rootpmap_id = XInternAtom(getXDisplay(), "_XROOTPMAP_ID", False); + esetroot_id = XInternAtom(getXDisplay(), "ESETROOT_PMAP_ID", False); } - if (img_ctrl) { - int i = 0; - for (; i < getNumberOfScreens(); i++) - delete img_ctrl[i]; + XGrabServer(getXDisplay()); + + /* Clear out the old pixmap */ + XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id, 0L, 1L, False, AnyPropertyType, - &type, &format, &length, &after, &data); ++ rootpmap_id, 0L, 1L, False, AnyPropertyType, ++ &type, &format, &length, &after, &data); + + if ((type == XA_PIXMAP) && (format == 32) && (length == 1)) { + unsigned char* data_esetroot = 0; + XGetWindowProperty(getXDisplay(), screen_info->getRootWindow(), + esetroot_id, 0L, 1L, False, AnyPropertyType, + &type, &format, &length, &after, &data_esetroot); + if (data && data_esetroot && *((Pixmap *) data)) { + XKillClient(getXDisplay(), *((Pixmap *) data)); + XSync(getXDisplay(), False); + XFree(data_esetroot); + } + XFree(data); + } - delete [] img_ctrl; + if (pixmap) { + XChangeProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id, XA_PIXMAP, 32, PropModeReplace, - (unsigned char *) &pixmap, 1); ++ rootpmap_id, XA_PIXMAP, 32, PropModeReplace, ++ (unsigned char *) &pixmap, 1); + XChangeProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id, XA_PIXMAP, 32, PropModeReplace, - (unsigned char *) &pixmap, 1); ++ esetroot_id, XA_PIXMAP, 32, PropModeReplace, ++ (unsigned char *) &pixmap, 1); + } else { + XDeleteProperty(getXDisplay(), screen_info->getRootWindow(), - rootpmap_id); ++ rootpmap_id); + XDeleteProperty(getXDisplay(), screen_info->getRootWindow(), - esetroot_id); ++ esetroot_id); } + + XUngrabServer(getXDisplay()); + XFlush(getXDisplay()); } - void bsetroot::solid(void) { - register int screen = 0; + // adapted from wmsetbg + Pixmap bsetroot::duplicatePixmap(int screen, Pixmap pixmap, - int width, int height) { ++ int width, int height) { + XSync(getXDisplay(), False); + + Pixmap copyP = XCreatePixmap(getXDisplay(), - getScreenInfo(screen)->getRootWindow(), - width, height, - DefaultDepth(getXDisplay(), screen)); ++ getScreenInfo(screen)->getRootWindow(), ++ width, height, ++ DefaultDepth(getXDisplay(), screen)); + XCopyArea(getXDisplay(), pixmap, copyP, DefaultGC(getXDisplay(), screen), - 0, 0, width, height, 0, 0); ++ 0, 0, width, height, 0, 0); + XSync(getXDisplay(), False); + + return copyP; + } - for (; screen < getNumberOfScreens(); screen++) { + + void bsetroot::solid(void) { - for (unsigned int screen = 0; screen < getNumberOfScreens(); screen++) { - BColor c(fore, this, screen); ++ for (unsigned int screen = 0, n = numberOfScreens(); screen < n; screen++) { + BColor c; + + img_ctrl[screen]->parseColor(&c, fore); + if (! c.isAllocated()) c.setPixel(BlackPixel(getXDisplay(), screen)); + - XSetWindowBackground(getXDisplay(), getScreenInfo(screen)->getRootWindow(), + const ScreenInfo *screen_info = getScreenInfo(screen); + + XSetWindowBackground(getXDisplay(), screen_info->getRootWindow(), - c.pixel()); + c.getPixel()); - XClearWindow(getXDisplay(), getScreenInfo(screen)->getRootWindow()); + XClearWindow(getXDisplay(), screen_info->getRootWindow()); + + Pixmap pixmap = XCreatePixmap(getXDisplay(), - screen_info->getRootWindow(), - 8, 8, DefaultDepth(getXDisplay(), screen)); - BPen pen(c); - XFillRectangle(getXDisplay(), pixmap, pen.gc(), 0, 0, 8, 8); ++ screen_info->getRootWindow(), ++ 8, 8, DefaultDepth(getXDisplay(), screen)); ++ ++ XSetForeground(getXDisplay(), DefaultGC(getXDisplay(), screen), ++ c.getPixel()); ++ XFillRectangle(getXDisplay(), pixmap, DefaultGC(getXDisplay(), screen), ++ 0, 0, 8, 8); + + setPixmapProperty(screen, duplicatePixmap(screen, pixmap, 8, 8)); + + XFreePixmap(getXDisplay(), pixmap); } } @@@ -139,58 -228,55 +232,63 @@@ void bsetroot::modula(int x, int y) char data[32]; long pattern; - register int screen, i; + unsigned int screen, i; ++ unsigned int n = numberOfScreens(); - pixmaps = new Pixmap[getNumberOfScreens()]; - -- for (pattern = 0, screen = 0; screen < getNumberOfScreens(); screen++) { ++ for (pattern = 0, screen = 0; screen < n; screen++) { for (i = 0; i < 16; i++) { pattern <<= 1; if ((i % x) == 0) pattern |= 0x0001; } - for (i = 0; i < 16; i++) + for (i = 0; i < 16; i++) { if ((i % y) == 0) { - data[(i * 2)] = static_cast(0xff); - data[(i * 2) + 1] = static_cast(0xff); + data[(i * 2)] = (char) 0xff; + data[(i * 2) + 1] = (char) 0xff; } else { data[(i * 2)] = pattern & 0xff; data[(i * 2) + 1] = (pattern >> 8) & 0xff; } + } - BColor f(fore, this, screen), b(back, this, screen); + BColor f, b; GC gc; Pixmap bitmap; - XGCValues gcv; ++ + const ScreenInfo *screen_info = getScreenInfo(screen); bitmap = XCreateBitmapFromData(getXDisplay(), - getScreenInfo(screen)->getRootWindow(), data, + screen_info->getRootWindow(), data, 16, 16); - ++ + img_ctrl[screen]->parseColor(&f, fore); + img_ctrl[screen]->parseColor(&b, back); + + if (! f.isAllocated()) f.setPixel(WhitePixel(getXDisplay(), screen)); + if (! b.isAllocated()) b.setPixel(BlackPixel(getXDisplay(), screen)); + XGCValues gcv; - gcv.foreground = f.pixel(); - gcv.background = b.pixel(); + gcv.foreground = f.getPixel(); + gcv.background = b.getPixel(); - gc = XCreateGC(getXDisplay(), getScreenInfo(screen)->getRootWindow(), + gc = XCreateGC(getXDisplay(), screen_info->getRootWindow(), GCForeground | GCBackground, &gcv); - pixmaps[screen] = - XCreatePixmap(getXDisplay(), getScreenInfo(screen)->getRootWindow(), - 16, 16, getScreenInfo(screen)->getDepth()); + Pixmap pixmap = XCreatePixmap(getXDisplay(), - screen_info->getRootWindow(), - 16, 16, screen_info->getDepth()); ++ screen_info->getRootWindow(), ++ 16, 16, screen_info->getDepth()); - XCopyPlane(getXDisplay(), bitmap, pixmaps[screen], gc, + XCopyPlane(getXDisplay(), bitmap, pixmap, gc, 0, 0, 16, 16, 0, 0, 1l); XSetWindowBackgroundPixmap(getXDisplay(), - getScreenInfo(screen)->getRootWindow(), - pixmaps[screen]); - XClearWindow(getXDisplay(), getScreenInfo(screen)->getRootWindow()); + screen_info->getRootWindow(), + pixmap); + XClearWindow(getXDisplay(), screen_info->getRootWindow()); + + setPixmapProperty(screen, - duplicatePixmap(screen, pixmap, 16, 16)); ++ duplicatePixmap(screen, pixmap, 16, 16)); XFreeGC(getXDisplay(), gc); XFreePixmap(getXDisplay(), bitmap); @@@ -204,93 -288,76 +300,82 @@@ void bsetroot::gradient(void) { - register int screen; - - pixmaps = new Pixmap[getNumberOfScreens()]; - - for (screen = 0; screen < getNumberOfScreens(); screen++) { - for (unsigned int screen = 0; screen < getNumberOfScreens(); screen++) { - BTexture texture(grad, this, screen, img_ctrl[screen]); ++ for (unsigned int screen = 0, n = numberOfScreens(); screen < n; screen++) { + BTexture texture; + img_ctrl[screen]->parseTexture(&texture, grad); + img_ctrl[screen]->parseColor(texture.getColor(), fore); + img_ctrl[screen]->parseColor(texture.getColorTo(), back); + const ScreenInfo *screen_info = getScreenInfo(screen); - texture.setColor(BColor(fore, this, screen)); - texture.setColorTo(BColor(back, this, screen)); + if (! texture.getColor()->isAllocated()) + texture.getColor()->setPixel(WhitePixel(getXDisplay(), screen)); + if (! texture.getColorTo()->isAllocated()) + texture.getColorTo()->setPixel(BlackPixel(getXDisplay(), screen)); - pixmaps[screen] = - img_ctrl[screen]->renderImage(getScreenInfo(screen)->getWidth(), - getScreenInfo(screen)->getHeight(), + Pixmap pixmap = - img_ctrl[screen]->renderImage(screen_info->getWidth(), - screen_info->getHeight(), - texture); ++ img_ctrl[screen]->renderImage(screen_info->size().w(), ++ screen_info->size().h(), + &texture); XSetWindowBackgroundPixmap(getXDisplay(), - getScreenInfo(screen)->getRootWindow(), - pixmaps[screen]); - XClearWindow(getXDisplay(), getScreenInfo(screen)->getRootWindow()); - - if (! (getScreenInfo(screen)->getVisual()->c_class & 1)) { - img_ctrl[screen]->removeImage(pixmaps[screen]); - img_ctrl[screen]->timeout(); - pixmaps[screen] = None; + screen_info->getRootWindow(), + pixmap); + XClearWindow(getXDisplay(), screen_info->getRootWindow()); + + setPixmapProperty(screen, - duplicatePixmap(screen, pixmap, - screen_info->getWidth(), - screen_info->getHeight())); ++ duplicatePixmap(screen, pixmap, ++ screen_info->size().w(), ++ screen_info->size().h())); + + if (! (screen_info->getVisual()->c_class & 1)) { + img_ctrl[screen]->removeImage(pixmap); } } } void bsetroot::usage(int exit_code) { - fprintf(stderr, - i18n-> - getMessage( - #ifdef NLS - bsetrootSet, bsetrootUsage, - #else // !NLS - 0, 0, - #endif // NLS - "%s 2.0 : (c) 1997-1999 Brad Hughes\n\n" - " -display display connection\n" - " -mod modula pattern\n" - " -foreground, -fg modula foreground color\n" - " -background, -bg modula background color\n\n" - " -gradient gradient texture\n" - " -from gradient start color\n" - " -to gradient end color\n\n" - " -solid solid color\n\n" - " -help print this help text and exit\n"), - getApplicationName()); - - exit(exit_code); + fprintf(stderr, - i18n(bsetrootSet, bsetrootUsage, - "%s 2.0\n\n" - "Copyright (c) 1997-2000, 2002 Bradley T Hughes\n" - "Copyright (c) 2001-2002 Sean 'Shaleh' Perry\n\n" - " -display display connection\n" - " -mod modula pattern\n" - " -foreground, -fg modula foreground color\n" - " -background, -bg modula background color\n\n" - " -gradient gradient texture\n" - " -from gradient start color\n" - " -to gradient end color\n\n" - " -solid solid color\n\n" - " -help print this help text and exit\n"), - getApplicationName()); ++ i18n->getMessage(bsetrootSet, bsetrootUsage, ++ "%s 2.0\n\n" ++ "Copyright (c) 1997-2000, 2002 Bradley T Hughes\n" ++ "Copyright (c) 2001-2002 Sean 'Shaleh' Perry\n\n" ++ " -display display connection\n" ++ " -mod modula pattern\n" ++ " -foreground, -fg modula foreground color\n" ++ " -background, -bg modula background color\n\n" ++ " -gradient gradient texture\n" ++ " -from gradient start color\n" ++ " -to gradient end color\n\n" ++ " -solid solid color\n\n" ++ " -help print this help text and exit\n"), ++ getApplicationName()); + + exit(exit_code); } - int main(int argc, char **argv) { char *display_name = (char *) 0; - int i = 1; - + - i18n.openCatalog("openbox.cat"); - + NLSInit("openbox.cat"); + - for (; i < argc; i++) { + for (int i = 1; i < argc; i++) { if (! strcmp(argv[i], "-display")) { // check for -display option - + if ((++i) >= argc) { - fprintf(stderr, - i18n->getMessage( - #ifdef NLS - mainSet, mainDISPLAYRequiresArg, - #else // !NLS - 0, 0, - #endif // NLS - "error: '-display' requires an argument\n")); - - fprintf(stderr, i18n(mainSet, mainDISPLAYRequiresArg, - "error: '-display' requires an argument\n")); ++ fprintf(stderr, i18n->getMessage(mainSet, mainDISPLAYRequiresArg, ++ "error: '-display' requires an argument\n")); + ::exit(1); } - + display_name = argv[i]; } } - + bsetroot app(argc, argv, display_name); - + return 0; } ++ diff --cc util/bsetroot.h index ca535562,00000000..7bd3ff01 mode 100644,000000..100644 --- a/util/bsetroot.h +++ b/util/bsetroot.h @@@ -1,33 -1,0 +1,34 @@@ +#ifndef __bsetroot2_hh +#define __bsetroot2_hh + +#include "../src/BaseDisplay.h" +#include "../src/Image.h" + - +class bsetroot : public BaseDisplay { +private: + BImageControl **img_ctrl; - Pixmap *pixmaps; + + char *fore, *back, *grad; + ++ // no copying!! ++ bsetroot(const bsetroot &); ++ bsetroot& operator=(const bsetroot&); + - protected: - inline virtual void process_event(XEvent *) { } ++ inline virtual void process_event(XEvent * /*unused*/) { } + - +public: - bsetroot(int, char **, char * = 0); ++ bsetroot(int argc, char **argv, char *dpy_name = 0); + ~bsetroot(void); + - inline virtual Bool handleSignal(int) { return False; } ++ inline virtual Bool handleSignal(int /*unused*/) { return False; } ++ ++ void setPixmapProperty(int screen, Pixmap pixmap); ++ Pixmap duplicatePixmap(int screen, Pixmap pixmap, int width, int height); + + void gradient(void); - void modula(int, int); ++ void modula(int x, int y); + void solid(void); - void usage(int = 0); ++ void usage(int exit_code = 0); +}; + - +#endif // __bsetroot2_hh