all repos — fluxbox @ 18830ac9add80cbd3bf7369307d7e35a519dca9b

custom fork of the fluxbox windowmanager

Initial revision
fluxgen fluxgen
commit

18830ac9add80cbd3bf7369307d7e35a519dca9b

parent

1523b48bff07dead084af3064ad11c79a9b25df0

302 files changed, 54314 insertions(+), 0 deletions(-)

jump to
A AUTHORS

@@ -0,0 +1,63 @@

+-- AUTHORS for Fluxbox +Author: + Henrik Kinnunen <fluxgen@linuxmail.org> + +Contributors: + Joel Carlbark <skypher@linuxmail.org> + - suggestions, bug reports, beta testing, styles + and some code. + Cleas Nästén <pekdon@gmx.net> + - suggestions, bug reports, beta testing and + Tab placement/alignment code. + Johan Andersson <xfs@linux.se> + - suggestions, bug reports and beta testing + Oliwier Ptak <aleczapka@gmx.net> + - suggestions, styles and webpage + +-- AUTHORS for Blackbox 0.61.1 - an X11 Window manager + +Author: + Brad Hughes <bhughes@trolltech.com> + +Co-author: + Jeff Raven <jraven@psu.edu> + +Contributors: + Jeffrey Sean Connell <ankh@canuck.gen.nz> + - debugger class code (ommited from sources) + Frank Belew <frb@umr.edu> + - dgradient code + Scott Garner <mrfab@arn.net> + - suggestions, bug reports and beta testing (*the* beta moron) + David Doan <ddoan@usa.net> + - testing of 8bpp code + Mark Seward <illuzion@paradise.net.nz> + - beta testing, bug reports and 32bpp testing + Keith Bolland <prime@strip.net.nz> + - beta testing, bug reports and suggestions + James Spooner <spoons@xtra.co.nz> + - beta testing, bug reports + Fred Knieper <derf@tamu.edu> + - beta testing, bug reports + Steve Udell <hettar@teleport.com> + - beta testing, bug reports, questions (very good ones) + Gregory Barlow <barlowg@ncssm-server.ncssm.edu> + - bug reports and patches/suggestions (original middle click advocate) + Dyon Balding <dyon.balding@eng.monash.edu.au> + - patch for Smart(er)Placement window placement + Mike Cole <mike@mydot.com> + - co-author/hacker of Image.cc (local LUG buddy) + John Kennis <jkennis@chello.nl> + - author of bbtools/beta testing/bug reports + Wilbert Berendsen <wbsoft@xs4all.nl> + - author of blackbox/bsetroot manpages + +I would also like to thank the creators of WindowMaker. Reading the existing +code has helped me immensely, and the BImage class follows the RImage data type +very closely (the 8bpp code and dithering code was based off of WindowMaker's +wrlib). + +I recently stumbled upon a library called ccmalloc (which is included in the +source tarball with blackbox) that has helped me immensely. Many thanks to +Armin Biere <armin@ira.uka.de> for this debugging aid. +
A COPYING

@@ -0,0 +1,41 @@

+Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) + +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. + +--- Copyright for the blackbox partions of the code: + +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.
A ChangeLog

@@ -0,0 +1,204 @@

+Changes for 0.1.5: +*01/12/09 + * Added execCommand to keybindings + * Added new theme qnx-photon + * Fixed util/Makefile.am + * Buggfix in Tab::insert +*01/12/08: + * Fixed "Move Group to..."-bugg (me) + * Updated AUTHORS (me) + * Fixed ungrabbing keys in Keys::load (me) + * Added rootCommand override (Joel Carlbark) + * Updated Tab code (Cleas Nästén) + * Moved some structs and enums in to the classes + to clean up the global namespace. (me) + * Added grabNextTab, grabPrevTab, grabAbortKeychain (me) + * Added mergeTree in class Keys (me) + * Added Italian nls (Thanks Giuseppe Ciotta <giuseppe.ciotta@libero.it>) + * Changed name on the includeguards (me) + * Updated the doc/Coding_style (me) + * Added "none" to titlebar config + so users can create a titlebar without buttons (Joel Carlbark) + * Fixed reversed justify in menustyle (me) +*01/12/05: + * Updated Tab code (Claes Nästén) +*01/12/03: + * Added "tab" in Windowmenu.cc (me) + * Updated Tab code (Claes Nästén) +*01/12/01: + * Fixed chained keybinding so we can do "emacs-keybindingstyle" (me) +*01/11/30: + * Fixed position code for tabs (me) + * Fixed tabconfigmenu bugg (me) + * Added new keybinding code (me) + * Removed old bbkeys code (me) +*01/11/29: + * applied Tab position patch (Claes Nästén) + * Fixed transient_for-bugg, Fluxbox::~FluxboxWindow (me) + client.transient_for didn't got focus and caused the (me) + Fluxbox::focused_window to be a badpointer since + the focused_window was pointing to an already destroyed + FluxboxWindow. (me) +*01/11/27: + * Added alignment for tabs in Tab.cc (me) +*01/11/22: + * Added wheelscroll to change tab on titlebar. Window.cc/.hh (me) +*01/11/20: + * Screen.hh/cc Added updateWorkspaceNamesAtom + updates the gnome atom _WIN_WORKSPACE_NAMES (me) +*01/11/18: + * Window.cc Fixed "invalid pixmap" error (me) +*01/11/17: + * Gnome _WIN_WORKSPACE (me) + * Gnome _WIN_WORKSPACE_COUNT (me) + * Gnome _WIN_CLIENT_LIST (me) +*01/11/15: + * Added --enable-gnome to configure.in (me) +*01/11/14: + * Added Gnome atoms (BaseDisplay.cc/hh) (me) +*01/11/13: + * Fixed grabs for window. No we can Alt+Move window with + Numlock, Capslock and Scrolllock on. (me) + * Fixed nls for "Use Icons" and "Use Tabs" (Claes Nästén) + * Removed BScreen::LoadStyle() (me) +*01/11/12: + * Tab::draw, DrawString (me) + * FluxboxWindow::redrawLabel, DrawString (me) + * Moved strcasestr to misc.hh/cc (me) + * Added DrawString function in misc.hh/cc (me) + * Added misc.cc/hh (me) +*01/11/11: + * Theme.cc/.hh added to source, handles all theme loading (me) +*01/11/09: + * Fixed bugg in Fluxbox::getRcFilename() (me) +*01/11/07: + * Removed a not working wheelscroll on rootwindow in fluxbox.cc (me) + * Moved wheelscroll in Toolbar.cc from pressEvent to releaseEvent (me) + * Fixed some nls in data (me) +*01/11/06: + * Fixed syntaxerror in Makro and CleanColor theme (me) + * First part of restructure for themes (me) +*01/11/05: + * Clean up in IconBar.cc (me) +*01/11/04: + * Fixed so it compiles with gcc 3.0.x (me) + +Changes for 0.1.4: +*01/11/03: Added new theme: Carbondioxide by skypher +*01/11/03: Fixed bsetbg in utils/Makefile.am +*01/11/02: Clean up +*01/11/02: Added session.iconbar to config file +*01/11/02: Changed the generate_menu skript to clean sh +*01/11/02: Updated skyphers theme (Clean, CleanColor, MerleyKay, Makro) +*01/11/02: Fixed parentrelative in tabs +*01/11/02: Fixed so the tab disconnects when it iconifies +*01/11/02: Added "Use Iconbar" to configmenu +*01/11/01: Added iconbar to the toolbar (new files IconBar.cc/.hh) +*01/10/31: Added border to tabs +*01/10/31: Removed workspace change when wheelscroll on titlebar +*01/10/31: Fixed so shade is correct when linkin tabs +*01/10/31: Fixed default color/texture for tab to be the same as titlebar + if the theme is a blackbox theme. +*01/10/29: Added KDE support (thanks Dan Williams for the blackbox patch) +*01/10/29: Fixed reconfigure-bugg for tabs +*01/10/28: Added "Use Tabs" in configure menu +*01/10/28: Added theme support for tabs +*01/10/28: Fixed the move bugg when moving a tablist + +Changes for 0.1.3: + +* Default focusmode is ClickToFocus + changed in fluxbox.cc + +* fluxbox.hh + added resource.tabs + +* fluxbox.cc + added enterNotify for tabs + added load/save in load_rc() save_rc() for resource.tabs + +* blackbox-nls.hh + added WindowmenuSendGroupTo + +* Windowmenu.hh,.cc + added sendGroupTo() so we can send a hole + list to another workspace + +* Tab.hh,.cc: + Added functions: iconify, deiconfigy, withdraw, + disconnect, insert, shade + EnterNotifyMask for tabwindow + +* fluxbox.cc: getRcFilename + fixed correct lenght on dbfile + +* Window.cc: motionNotifyEvent + removed unnecessary 'else if'-statement + +* Screen.cc: LoadStyle() + changed exit to throw + +* Screen.cc: prevWorkspace, nextWorkspace + fixed revers workspace change. + +Changes for Fluxbox 0.1.2: + +* Added doc/Coding_style + +* FluxboxWindow.cc: FluxboxWindow::buttonPressEvent + fixed so the shade button is drawn in pressed mode. + +* CleanColor theme: error fixed. + +* default theme is now: Clean + +* fluxbox.hh,.cc: execCommand removed + uses bexec from BaseDisplay.hh, to grabExecute in process_event, instead. + +* Window.cc: FluxboxWindow::FluxboxWindow + Changed event_mask for XGrabButton frame.plate from 0 to AnyModifier + and ungrabs Mod1-3. + This should fix the focus "bugg" when num lock, caps lock or scroll lock + are pressed. + +* fluxbox.cc: Fluxbox::process_event + fixed an error check on getAction in + KeyPress case. + +* I18n class is now singleton type + +* Changed name on: + Blackbox class to Fluxbox + BlackboxWindow to FluxboxWindow + +* Changed name on file blackbox.cc and blackbox.hh to + fluxbox.cc and fluxbox.hh + +Changes from Blackbox 0.61.1 to Fluxbox 0.1.1: + +* Integrated bbkeys in code. + "session.keyFile: thekeyfile" in the file init + +* "make dist" now creates a "functional" tarball + +* Escape cancels edit workspace name + and return to old name + +* New coding style + using tab instead of space for ident + +* Variable titlebar + The buttons on the titlebar can now be configured. + +* Wheelscroll + Wheelscroll function on titlebar and toolbar changes workspace + +* Config path + The config path is now ~/.fluxbox + +* Toolbar.cc: ~Toolbar + memory leak fix + It didnt remove some windows in ToolbarSearch. + +* Blackbox class now singleton type +
A INSTALL

@@ -0,0 +1,94 @@

+-- INSTALL for Fluxbox + +Compilation and Installation: +-------------------------------- + The `configure' shell script attempts to guess correct values for +various system-dependent variables used during compilation. It uses +those values to create a `Makefile' in each directory in the +Blackbox source tree. + +Finally, it creates a shell script `config.status' that you can run +in the future to recreate the current configuration, a file +`config.cache' that saves the results of its tests to speed up +reconfiguring, and a file `config.log' containing compiler output +(useful mainly for debugging `configure'). + + If you need to do unusual things to compile Blackbox, please try +to figure out how `configure' could check whether to do them, and mail +diffs or instructions to bhughes@tcac.net so they can be considered +for the next release. If at some point `config.cache' contains +results you don't want to keep, you may remove or edit it. + + The file `configure.in' is used to create `configure' by a program +called `autoconf'. You only need `configure.in' if you want to change +it or regenerate `configure' using a newer version of `autoconf'. + +The simplest way to compile this package is: + + 1. `cd' to the directory containing the package's source code and type + `./configure' to configure the package for your system. If you're + using `csh' on an old version of System V, you might need to type + `sh ./configure' instead to prevent `csh' from trying to execute + `configure' itself. + + Running `configure' takes awhile. While running, it prints some + messages telling which features it is checking for. + + 2. Type `make' to compile the package. + + 3. Type `make install' to install the programs and any data files and + documentation. + + 4. You can remove the program binaries and object files from the + source code directory by typing `make clean'. To also remove the + files that `configure' created (so you can compile the package for + a different kind of computer), type `make distclean'. + + +Compilers and Options: +---------------------- + Some systems require unusual options for compilation or linking that +the `configure' script does not know about. You can give `configure' +initial values for variables by setting them in the environment. Using +a Bourne-compatible shell, you can do that on the command line like +this: + CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure + +Or on systems that have the `env' program, you can do it like this: + env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure + + +Optional Features: +------------------ +Fluxbox supports the XShape extension of X11R6. This support is enabled by +default, but may be overridden by specifying `--disable-shape' on the configure +script's command line. + +Fluxbox supports Window Maker dockapps (warning: restarts from wmaker to +fluxbox don't always handle dockapps correctly) with a gadget called the Slit. +The Slit is compiled into Blackbox by default, but may be overridden by +specifying `--disable-slit' on the configure script's command line. + +Fluxbox supports a rendering effect called "faked interlacing" which darkens +every other line in rendered images. This support works only for gradient +images. It is compiled in by default, but may be overridden by specifying +`--disable-interlace' on the configure script's command line. + +Fluxbox provides an alternative rendering algorithm for dithering on +pseudocolor (8 bit) displays. A noticeable pattern is visible when using +this; it's a matter of taste whether this looks better than the default +algorithm. It is disabled by default, but may be overridden by specifying +'--enable-ordered-pseudo' on the configure script's command line. + +Fluxbox uses a timer which allows it to periodically flush its pixmap +cache. It is enabled by default, but may be overridden by specifying +'--disable-timed-cache' on the configure script's command line. + +Also, `configure' can usually find the X include and library files +automatically, but if it doesn't, you can use the `configure' +options `--x-includes=DIR' and `--x-libraries=DIR' to specify +their locations. + + +Please read the README file also. +
A Makefile.am

@@ -0,0 +1,9 @@

+# Makefile.am for Fluxbox 0.1.x + +SUBDIRS = data doc nls src util +MAINTAINERCLEANFILES = aclocal.m4 config.h.in configure Makefile.in stamp-h.in + +uninstall-local: + rmdir $(pkgdatadir) +distclean-local: + rm -f *\~
A Makefile.in

@@ -0,0 +1,384 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Fluxbox 0.1.x + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +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 COPYING ChangeLog INSTALL \ +Makefile.am Makefile.in NEWS TODO aclocal.m4 config.guess config.h.in \ +config.sub configure configure.in install-sh ltconfig ltmain.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) --gnu --include-deps Makefile + +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) + $(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; \ + 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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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 + -rm -f libtool + +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 *\~ + +# 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:
A NEWS

@@ -0,0 +1,11 @@

+So whats new in 0.1.5? + * Keybinding code and new keyconfiguresstyle + * Keybindings: NextTab, PrevTab and AbortKeychain + * Tab placement and alignment + * wheelscroll on titlebar changes between tabs + * Toggle tab on windows + * Semi-sloppy focus + * Italian nls + * a session.rootCommand to override the Themes rootCommand + * and some buggfixes +
A README

@@ -0,0 +1,35 @@

+Fluxbox builds on Blackbox source but has different goals. +For copyright see COPYING + +Compile and Install: + +# ./configure +# make +and then as root +# make install + +for KDE slitsupport: + ./configure --enable-kde + +To disable tabs and/or iconbar just change it in configure menu. + +To use your own configuration: +Create a directorory, in your homedir, called .fluxbox +and copy: init, titlebar and menu from fluxbox datapath. +Dont forget to change session.menuFile and session.titlebarFile +in the file init. + +You can use your old blackbox configuration file too. Just copy +.blackboxrc to ~/.fluxbox/init . The same goes for menu file. +The bbkeys config file can be selected in the file init: +session.keyFile: <filename here> +You can also use the Blackbox themes in Fluxbox. +If there isn't any format for the tab in the theme then +the tab will have the same theme as the titlebar. + +Thanks: +Blackbox team +#linux.se@dalnet, #linux.se@openproject.net +skypher of openprojects for buggtesting and providing fluxbox with themes: +Clean CleanColor Makro, Carbondioxide and MerleyKay. +skarin, Perc, xfs, skypher and skywarper for buggtesting
A TODO

@@ -0,0 +1,37 @@

+TODO for Fluxbox 0.2.0 +* sloppy focus - auto-raise +- Fix configurable toolbar + so the user can configure toolbar in a config file + +- Fix so config file is created @ $HOME if first use + and config files is copied and configured + +- Fix so toolbar dont hide if its autohide and + you are in "change workspace mode" + +- grabKillWindow to keygrabber grabCloseWindow + +* Fluxbox::real_reconfigure ...check "session.styleFile %s" +* grabRootmenu +* wheel-config support +* separator in the menus +* slit-maximize-stop +(* restructure BImageControl::parseTexture) +* slit.onTop and slit.placement "bugg" when changin in configurefile +* fix "move group to..." without tab bugg. +* 0,0-pos fix +* reconfigure tar upp nya dekorationer + +07:39AM <dopey> also, (2) fluxbox wont currently build on linux-hppa, needs the config.{sub, + guess} updated from ftp://ftp.gnu.org/pub/gnu/config/ + +* Create fbrun style app +* Add wheelscroll-workspace-change configuration (reversed order or + regular)- Add "system menu" for minimized apps in the toolbar. + (Close, Kill, Send to, etc) + +* HUP the window manager, so it re-reads the + .fluxbox/init - rather than having to kill the window manager to change those + settings (like the key map) + +* "Iconify group" in Windowmenu
A aclocal.m4

@@ -0,0 +1,573 @@

+dnl aclocal.m4 generated automatically by aclocal 1.4 + +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_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_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_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)]) + + +# serial 40 AC_PROG_LIBTOOL +AC_DEFUN(AC_PROG_LIBTOOL, +[AC_REQUIRE([AC_LIBTOOL_SETUP])dnl + +# Save cache, so that ltconfig can load it +AC_CACHE_SAVE + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| AC_MSG_ERROR([libtool configure failed]) + +# Reload cache, that may have been modified by ltconfig +AC_CACHE_LOAD + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' +AC_SUBST(LIBTOOL)dnl + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log +]) + +AC_DEFUN(AC_LIBTOOL_SETUP, +[AC_PREREQ(2.13)dnl +AC_REQUIRE([AC_ENABLE_SHARED])dnl +AC_REQUIRE([AC_ENABLE_STATIC])dnl +AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +AC_REQUIRE([AC_PROG_RANLIB])dnl +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_PROG_LD])dnl +AC_REQUIRE([AC_PROG_NM])dnl +AC_REQUIRE([AC_PROG_LN_S])dnl +dnl + +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" +ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN], +[libtool_flags="$libtool_flags --enable-dlopen"]) +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[libtool_flags="$libtool_flags --enable-win32-dll"]) +AC_ARG_ENABLE(libtool-lock, + [ --disable-libtool-lock avoid locking (might break parallel builds)]) +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '[#]line __oline__ "configure"' > conftest.$ac_ext + if AC_TRY_EVAL(ac_compile); then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf, + [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])]) + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + +ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL], +[*-*-cygwin* | *-*-mingw*) + AC_CHECK_TOOL(DLLTOOL, dlltool, false) + AC_CHECK_TOOL(AS, as, false) + AC_CHECK_TOOL(OBJDUMP, objdump, false) + ;; +]) +esac +]) + +# AC_LIBTOOL_DLOPEN - enable checks for dlopen support +AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])]) + +# AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's +AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])]) + +# AC_ENABLE_SHARED - implement the --enable-shared flag +# Usage: AC_ENABLE_SHARED[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_SHARED, [dnl +define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(shared, +changequote(<<, >>)dnl +<< --enable-shared[=PKGS] build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl +]) + +# AC_DISABLE_SHARED - set the default shared flag to --disable-shared +AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_SHARED(no)]) + +# AC_ENABLE_STATIC - implement the --enable-static flag +# Usage: AC_ENABLE_STATIC[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_STATIC, [dnl +define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(static, +changequote(<<, >>)dnl +<< --enable-static[=PKGS] build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_static=AC_ENABLE_STATIC_DEFAULT)dnl +]) + +# AC_DISABLE_STATIC - set the default static flag to --disable-static +AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_STATIC(no)]) + + +# AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag +# Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)] +# Where DEFAULT is either `yes' or `no'. If omitted, it defaults to +# `yes'. +AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl +define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl +AC_ARG_ENABLE(fast-install, +changequote(<<, >>)dnl +<< --enable-fast-install[=PKGS] optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT], +changequote([, ])dnl +[p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac], +enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl +]) + +# AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install +AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl +AC_ENABLE_FAST_INSTALL(no)]) + +# AC_PROG_LD - find the path to the GNU or non-GNU linker +AC_DEFUN(AC_PROG_LD, +[AC_ARG_WITH(gnu-ld, +[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +AC_REQUIRE([AC_PROG_CC])dnl +AC_REQUIRE([AC_CANONICAL_HOST])dnl +AC_REQUIRE([AC_CANONICAL_BUILD])dnl +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + AC_MSG_CHECKING([for ld used by GCC]) + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. +changequote(,)dnl + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' +changequote([,])dnl + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + AC_MSG_CHECKING([for GNU ld]) +else + AC_MSG_CHECKING([for non-GNU ld]) +fi +AC_CACHE_VAL(ac_cv_path_LD, +[if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi]) +LD="$ac_cv_path_LD" +if test -n "$LD"; then + AC_MSG_RESULT($LD) +else + AC_MSG_RESULT(no) +fi +test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +AC_PROG_LD_GNU +]) + +AC_DEFUN(AC_PROG_LD_GNU, +[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld, +[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi]) +]) + +# AC_PROG_NM - find the path to a BSD-compatible name lister +AC_DEFUN(AC_PROG_NM, +[AC_MSG_CHECKING([for BSD-compatible nm]) +AC_CACHE_VAL(ac_cv_path_NM, +[if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi]) +NM="$ac_cv_path_NM" +AC_MSG_RESULT([$NM]) +]) + +# AC_CHECK_LIBM - check for math library +AC_DEFUN(AC_CHECK_LIBM, +[AC_REQUIRE([AC_CANONICAL_HOST])dnl +LIBM= +case "$lt_target" in +*-*-beos* | *-*-cygwin*) + # These system don't have libm + ;; +*-ncr-sysv4.3*) + AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw") + AC_CHECK_LIB(m, main, LIBM="$LIBM -lm") + ;; +*) + AC_CHECK_LIB(m, main, LIBM="-lm") + ;; +esac +]) + +# AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl convenience library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-convenience to the +# configure arguments. Note that LIBLTDL and INCLTDL are not +# AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called. If DIR is not +# provided, it is assumed to be `libltdl'. LIBLTDL will be prefixed +# with '${top_builddir}/' and INCLTDL will be prefixed with +# '${top_srcdir}/' (note the single quotes!). If your package is not +# flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + case "$enable_ltdl_convenience" in + no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;; + "") enable_ltdl_convenience=yes + ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;; + esac + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) +]) + +# AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for +# the libltdl installable library and INCLTDL to the include flags for +# the libltdl header and adds --enable-ltdl-install to the configure +# arguments. Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is +# AC_CONFIG_SUBDIRS called. If DIR is not provided and an installed +# libltdl is not found, it is assumed to be `libltdl'. LIBLTDL will +# be prefixed with '${top_builddir}/' and INCLTDL will be prefixed +# with '${top_srcdir}/' (note the single quotes!). If your package is +# not flat and you're not using automake, define top_builddir and +# top_srcdir appropriately in the Makefiles. +# In the future, this macro may have to be called after AC_PROG_LIBTOOL. +AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl + AC_CHECK_LIB(ltdl, main, + [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no], + [if test x"$enable_ltdl_install" = xno; then + AC_MSG_WARN([libltdl not installed, but installation disabled]) + else + enable_ltdl_install=yes + fi + ]) + if test x"$enable_ltdl_install" = x"yes"; then + ac_configure_args="$ac_configure_args --enable-ltdl-install" + LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la + INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl']) + else + ac_configure_args="$ac_configure_args --enable-ltdl-install=no" + LIBLTDL="-lltdl" + INCLTDL= + fi +]) + +dnl old names +AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl +AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl +AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl +AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl +AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl +AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl +AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl + +dnl This is just to silence aclocal about the macro not being used +ifelse([AC_DISABLE_FAST_INSTALL])dnl + +# Add --enable-maintainer-mode option to configure. +# From Jim Meyering + +# serial 1 + +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_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_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>>, <<[^ ]>>, <<>>), <<>>, +<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, +<<am_indx=1 +for am_file in <<$1>>; 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([,]))]) +
A config.guess

@@ -0,0 +1,1183 @@

+#! /bin/sh +# Attempt to guess a canonical system name. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner <bothner@cygnus.com>. +# Please send patches to <config-patches@gnu.org>. +# +# This script attempts to guess a canonical system name similar to +# config.sub. If it succeeds, it prints the system name on stdout, and +# exits with 0. Otherwise, it exits with 1. +# +# The plan is that this can be called by configure scripts if you +# don't specify an explicit system type (host/target name). +# +# Only a few systems have been added to this list; please add others +# (but try to keep the structure clean). +# + +# Use $HOST_CC if defined. $CC may point to a cross-compiler +if test x"$CC_FOR_BUILD" = x; then + if test x"$HOST_CC" != x; then + CC_FOR_BUILD="$HOST_CC" + else + if test x"$CC" != x; then + CC_FOR_BUILD="$CC" + else + CC_FOR_BUILD=cc + fi + fi +fi + + +# This is needed to find uname on a Pyramid OSx when run in the BSD universe. +# (ghazi@noc.rutgers.edu 8/24/94.) +if (test -f /.attbin/uname) >/dev/null 2>&1 ; then + PATH=$PATH:/.attbin ; export PATH +fi + +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown +UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown +UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown + +dummy=dummy-$$ +trap 'rm -f $dummy.c $dummy.o $dummy; exit 1' 1 2 15 + +# Note: order is significant - the case branches are not exclusive. + +case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in + *:NetBSD:*:*) + # Netbsd (nbsd) targets should (where applicable) match one or + # more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*, + # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently + # switched to ELF, *-*-netbsd* would select the old + # object file format. This provides both forward + # compatibility and a consistent mechanism for selecting the + # object file format. + # Determine the machine/vendor (is the vendor relevant). + case "${UNAME_MACHINE}" in + amiga) machine=m68k-cbm ;; + arm32) machine=arm-unknown ;; + atari*) machine=m68k-atari ;; + sun3*) machine=m68k-sun ;; + mac68k) machine=m68k-apple ;; + macppc) machine=powerpc-apple ;; + hp3[0-9][05]) machine=m68k-hp ;; + ibmrt|romp-ibm) machine=romp-ibm ;; + *) machine=${UNAME_MACHINE}-unknown ;; + esac + # The Operating System including object format. + if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep __ELF__ >/dev/null + then + # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). + # Return netbsd for either. FIX? + os=netbsd + else + os=netbsdelf + fi + # The OS release + release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: + # contains redundant information, the shorter form: + # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. + echo "${machine}-${os}${release}" + exit 0 ;; + alpha:OSF1:*:*) + if test $UNAME_RELEASE = "V4.0"; then + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` + fi + # A Vn.n version is a released version. + # A Tn.n version is a released field test version. + # A Xn.n version is an unreleased experimental baselevel. + # 1.2 uses "1.2" for uname -r. + cat <<EOF >$dummy.s + .data +\$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main +main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[VTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` + exit 0 ;; + Alpha\ *:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # Should we change UNAME_MACHINE based on the output of uname instead + # of the specific Alpha model? + echo alpha-pc-interix + exit 0 ;; + 21064:Windows_NT:50:3) + echo alpha-dec-winnt3.5 + exit 0 ;; + Amiga*:UNIX_System_V:4.0:*) + echo m68k-cbm-sysv4 + exit 0;; + amiga:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:[Aa]miga[Oo][Ss]:*:*) + echo ${UNAME_MACHINE}-unknown-amigaos + exit 0 ;; + arc64:OpenBSD:*:*) + echo mips64el-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + arc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + hkmips:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + pmax:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + sgi:OpenBSD:*:*) + echo mips-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + wgrisc:OpenBSD:*:*) + echo mipsel-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + *:OS/390:*:*) + echo i370-ibm-openedition + exit 0 ;; + arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) + echo arm-acorn-riscix${UNAME_RELEASE} + exit 0;; + SR2?01:HI-UX/MPP:*:*) + echo hppa1.1-hitachi-hiuxmpp + exit 0;; + Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) + # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. + if test "`(/bin/universe) 2>/dev/null`" = att ; then + echo pyramid-pyramid-sysv3 + else + echo pyramid-pyramid-bsd + fi + exit 0 ;; + NILE*:*:*:dcosx) + echo pyramid-pyramid-svr4 + exit 0 ;; + sun4H:SunOS:5.*:*) + echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) + echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + i86pc:SunOS:5.*:*) + echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:6*:*) + # According to config.sub, this is the proper way to canonicalize + # SunOS6. Hard to guess exactly what SunOS6 will be like, but + # it's likely to be more like Solaris than SunOS4. + echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + sun4*:SunOS:*:*) + case "`/usr/bin/arch -k`" in + Series*|S4*) + UNAME_RELEASE=`uname -v` + ;; + esac + # Japanese Language versions have a version number like `4.1.3-JL'. + echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` + exit 0 ;; + sun3*:SunOS:*:*) + echo m68k-sun-sunos${UNAME_RELEASE} + exit 0 ;; + sun*:*:4.2BSD:*) + UNAME_RELEASE=`(head -1 /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` + test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 + case "`/bin/arch`" in + sun3) + echo m68k-sun-sunos${UNAME_RELEASE} + ;; + sun4) + echo sparc-sun-sunos${UNAME_RELEASE} + ;; + esac + exit 0 ;; + aushp:SunOS:*:*) + echo sparc-auspex-sunos${UNAME_RELEASE} + exit 0 ;; + atari*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + # The situation for MiNT is a little confusing. The machine name + # can be virtually everything (everything which is not + # "atarist" or "atariste" at least should have a processor + # > m68000). The system name ranges from "MiNT" over "FreeMiNT" + # to the lowercase version "mint" (or "freemint"). Finally + # the system name "TOS" denotes a system which is actually not + # MiNT. But MiNT is downward compatible to TOS, so this should + # be no problem. + atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) + echo m68k-atari-mint${UNAME_RELEASE} + exit 0 ;; + milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) + echo m68k-milan-mint${UNAME_RELEASE} + exit 0 ;; + hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) + echo m68k-hades-mint${UNAME_RELEASE} + exit 0 ;; + *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) + echo m68k-unknown-mint${UNAME_RELEASE} + exit 0 ;; + sun3*:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mac68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme68k:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + mvme88k:OpenBSD:*:*) + echo m88k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + powerpc:machten:*:*) + echo powerpc-apple-machten${UNAME_RELEASE} + exit 0 ;; + RISC*:Mach:*:*) + echo mips-dec-mach_bsd4.3 + exit 0 ;; + RISC*:ULTRIX:*:*) + echo mips-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + VAX*:ULTRIX*:*:*) + echo vax-dec-ultrix${UNAME_RELEASE} + exit 0 ;; + 2020:CLIX:*:* | 2430:CLIX:*:*) + echo clipper-intergraph-clix${UNAME_RELEASE} + exit 0 ;; + mips:*:*:UMIPS | mips:*:*:RISCos) + sed 's/^ //' << EOF >$dummy.c +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif + #if defined (host_mips) && defined (MIPSEB) + #if defined (SYSTYPE_SYSV) + printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_SVR4) + printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); + #endif + #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) + printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); + #endif + #endif + exit (-1); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy \ + && ./$dummy `echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` \ + && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo mips-mips-riscos${UNAME_RELEASE} + exit 0 ;; + Night_Hawk:Power_UNIX:*:*) + echo powerpc-harris-powerunix + exit 0 ;; + m88k:CX/UX:7*:*) + echo m88k-harris-cxux7 + exit 0 ;; + m88k:*:4*:R4*) + echo m88k-motorola-sysv4 + exit 0 ;; + m88k:*:3*:R3*) + echo m88k-motorola-sysv3 + exit 0 ;; + AViiON:dgux:*:*) + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` + if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] + then + if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ + [ ${TARGET_BINARY_INTERFACE}x = x ] + then + echo m88k-dg-dgux${UNAME_RELEASE} + else + echo m88k-dg-dguxbcs${UNAME_RELEASE} + fi + else + echo i586-dg-dgux${UNAME_RELEASE} + fi + exit 0 ;; + M88*:DolphinOS:*:*) # DolphinOS (SVR3) + echo m88k-dolphin-sysv3 + exit 0 ;; + M88*:*:R3*:*) + # Delta 88k system running SVR3 + echo m88k-motorola-sysv3 + exit 0 ;; + XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) + echo m88k-tektronix-sysv3 + exit 0 ;; + Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) + echo m68k-tektronix-bsd + exit 0 ;; + *:IRIX*:*:*) + echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` + exit 0 ;; + ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. + echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id + exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX ' + i?86:AIX:*:*) + echo i386-ibm-aix + exit 0 ;; + *:AIX:2:3) + if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then + sed 's/^ //' << EOF >$dummy.c + #include <sys/systemcfg.h> + + main() + { + if (!__power_pc()) + exit(1); + puts("powerpc-ibm-aix3.2.5"); + exit(0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo rs6000-ibm-aix3.2.5 + elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then + echo rs6000-ibm-aix3.2.4 + else + echo rs6000-ibm-aix3.2 + fi + exit 0 ;; + *:AIX:*:4) + IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -1 | awk '{ print $1 }'` + if /usr/sbin/lsattr -EHl ${IBM_CPU_ID} | grep POWER >/dev/null 2>&1; then + IBM_ARCH=rs6000 + else + IBM_ARCH=powerpc + fi + if [ -x /usr/bin/oslevel ] ; then + IBM_REV=`/usr/bin/oslevel` + else + IBM_REV=4.${UNAME_RELEASE} + fi + echo ${IBM_ARCH}-ibm-aix${IBM_REV} + exit 0 ;; + *:AIX:*:*) + echo rs6000-ibm-aix + exit 0 ;; + ibmrt:4.4BSD:*|romp-ibm:BSD:*) + echo romp-ibm-bsd4.4 + exit 0 ;; + ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and + echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to + exit 0 ;; # report: romp-ibm BSD 4.3 + *:BOSX:*:*) + echo rs6000-bull-bosx + exit 0 ;; + DPX/2?00:B.O.S.:*:*) + echo m68k-bull-sysv3 + exit 0 ;; + 9000/[34]??:4.3bsd:1.*:*) + echo m68k-hp-bsd + exit 0 ;; + hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) + echo m68k-hp-bsd4.4 + exit 0 ;; + 9000/[34678]??:HP-UX:*:*) + case "${UNAME_MACHINE}" in + 9000/31? ) HP_ARCH=m68000 ;; + 9000/[34]?? ) HP_ARCH=m68k ;; + 9000/[678][0-9][0-9]) + sed 's/^ //' << EOF >$dummy.c + + #define _HPUX_SOURCE + #include <stdlib.h> + #include <unistd.h> + + int main () + { + #if defined(_SC_KERNEL_BITS) + long bits = sysconf(_SC_KERNEL_BITS); + #endif + long cpu = sysconf (_SC_CPU_VERSION); + + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1"); break; + case CPU_PA_RISC2_0: + #if defined(_SC_KERNEL_BITS) + switch (bits) + { + case 64: puts ("hppa2.0w"); break; + case 32: puts ("hppa2.0n"); break; + default: puts ("hppa2.0"); break; + } break; + #else /* !defined(_SC_KERNEL_BITS) */ + puts ("hppa2.0"); break; + #endif + default: puts ("hppa1.0"); break; + } + exit (0); + } +EOF + (CCOPTS= $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null ) && HP_ARCH=`./$dummy` + rm -f $dummy.c $dummy + esac + HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` + echo ${HP_ARCH}-hp-hpux${HPUX_REV} + exit 0 ;; + 3050*:HI-UX:*:*) + sed 's/^ //' << EOF >$dummy.c + #include <unistd.h> + int + main () + { + long cpu = sysconf (_SC_CPU_VERSION); + /* The order matters, because CPU_IS_HP_MC68K erroneously returns + true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct + results, however. */ + if (CPU_IS_PA_RISC (cpu)) + { + switch (cpu) + { + case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; + case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; + case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; + default: puts ("hppa-hitachi-hiuxwe2"); break; + } + } + else if (CPU_IS_HP_MC68K (cpu)) + puts ("m68k-hitachi-hiuxwe2"); + else puts ("unknown-hitachi-hiuxwe2"); + exit (0); + } +EOF + $CC_FOR_BUILD $dummy.c -o $dummy && ./$dummy && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + echo unknown-hitachi-hiuxwe2 + exit 0 ;; + 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) + echo hppa1.1-hp-bsd + exit 0 ;; + 9000/8??:4.3bsd:*:*) + echo hppa1.0-hp-bsd + exit 0 ;; + *9??*:MPE/iX:*:*) + echo hppa1.0-hp-mpeix + exit 0 ;; + hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) + echo hppa1.1-hp-osf + exit 0 ;; + hp8??:OSF1:*:*) + echo hppa1.0-hp-osf + exit 0 ;; + i?86:OSF1:*:*) + if [ -x /usr/sbin/sysversion ] ; then + echo ${UNAME_MACHINE}-unknown-osf1mk + else + echo ${UNAME_MACHINE}-unknown-osf1 + fi + exit 0 ;; + parisc*:Lites*:*:*) + echo hppa1.1-hp-lites + exit 0 ;; + hppa*:OpenBSD:*:*) + echo hppa-unknown-openbsd + exit 0 ;; + C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) + echo c1-convex-bsd + exit 0 ;; + C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) + echo c34-convex-bsd + exit 0 ;; + C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) + echo c38-convex-bsd + exit 0 ;; + C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) + echo c4-convex-bsd + exit 0 ;; + CRAY*X-MP:*:*:*) + echo xmp-cray-unicos + exit 0 ;; + CRAY*Y-MP:*:*:*) + echo ymp-cray-unicos${UNAME_RELEASE} + exit 0 ;; + CRAY*[A-Z]90:*:*:*) + echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ + | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ + -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ + exit 0 ;; + CRAY*TS:*:*:*) + echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*T3E:*:*:*) + echo alpha-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY*SV1:*:*:*) + echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' + exit 0 ;; + CRAY-2:*:*:*) + echo cray2-cray-unicos + exit 0 ;; + F300:UNIX_System_V:*:*) + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "f300-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit 0 ;; + F301:UNIX_System_V:*:*) + echo f301-fujitsu-uxpv`echo $UNAME_RELEASE | sed 's/ .*//'` + exit 0 ;; + hp300:OpenBSD:*:*) + echo m68k-unknown-openbsd${UNAME_RELEASE} + exit 0 ;; + i?86:BSD/386:*:* | i?86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) + echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} + exit 0 ;; + sparc*:BSD/OS:*:*) + echo sparc-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:BSD/OS:*:*) + echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} + exit 0 ;; + *:FreeBSD:*:*) + echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` + exit 0 ;; + *:OpenBSD:*:*) + echo ${UNAME_MACHINE}-unknown-openbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` + exit 0 ;; + i*:CYGWIN*:*) + echo ${UNAME_MACHINE}-pc-cygwin + exit 0 ;; + i*:MINGW*:*) + echo ${UNAME_MACHINE}-pc-mingw32 + exit 0 ;; + i*:Windows_NT*:* | Pentium*:Windows_NT*:*) + # How do we know it's Interix rather than the generic POSIX subsystem? + # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we + # UNAME_MACHINE based on the output of uname instead of i386? + echo i386-pc-interix + exit 0 ;; + i*:UWIN*:*) + echo ${UNAME_MACHINE}-pc-uwin + exit 0 ;; + p*:CYGWIN*:*) + echo powerpcle-unknown-cygwin + exit 0 ;; + prep*:SunOS:5.*:*) + echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit 0 ;; + *:GNU:*:*) + echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` + exit 0 ;; + *:Linux:*:*) + + # The BFD linker knows what the default object file format is, so + # first see if it will tell us. cd to the root directory to prevent + # problems with other programs or directories called `ld' in the path. + ld_help_string=`cd /; ld --help 2>&1` + ld_supported_emulations=`echo $ld_help_string \ + | sed -ne '/supported emulations:/!d + s/[ ][ ]*/ /g + s/.*supported emulations: *// + s/ .*// + p'` + case "$ld_supported_emulations" in + *ia64) + echo "${UNAME_MACHINE}-unknown-linux" + exit 0 + ;; + i?86linux) + echo "${UNAME_MACHINE}-pc-linux-gnuaout" + exit 0 + ;; + elf_i?86) + echo "${UNAME_MACHINE}-pc-linux" + exit 0 + ;; + i?86coff) + echo "${UNAME_MACHINE}-pc-linux-gnucoff" + exit 0 + ;; + sparclinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + armlinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32arm*) + echo "${UNAME_MACHINE}-unknown-linux-gnuoldld" + exit 0 + ;; + armelf_linux*) + echo "${UNAME_MACHINE}-unknown-linux-gnu" + exit 0 + ;; + m68klinux) + echo "${UNAME_MACHINE}-unknown-linux-gnuaout" + exit 0 + ;; + elf32ppc | elf32ppclinux) + # Determine Lib Version + cat >$dummy.c <<EOF +#include <features.h> +#if defined(__GLIBC__) +extern char __libc_version[]; +extern char __libc_release[]; +#endif +main(argc, argv) + int argc; + char *argv[]; +{ +#if defined(__GLIBC__) + printf("%s %s\n", __libc_version, __libc_release); +#else + printf("unkown\n"); +#endif + return 0; +} +EOF + LIBC="" + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null + if test "$?" = 0 ; then + ./$dummy | grep 1\.99 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.c $dummy + echo powerpc-unknown-linux-gnu${LIBC} + exit 0 + ;; + esac + + if test "${UNAME_MACHINE}" = "alpha" ; then + cat <<EOF >$dummy.s + .data + \$Lformat: + .byte 37,100,45,37,120,10,0 # "%d-%x\n" + + .text + .globl main + .align 4 + .ent main + main: + .frame \$30,16,\$26,0 + ldgp \$29,0(\$27) + .prologue 1 + .long 0x47e03d80 # implver \$0 + lda \$2,-1 + .long 0x47e20c21 # amask \$2,\$1 + lda \$16,\$Lformat + mov \$0,\$17 + not \$1,\$18 + jsr \$26,printf + ldgp \$29,0(\$26) + mov 0,\$16 + jsr \$26,exit + .end main +EOF + LIBC="" + $CC_FOR_BUILD $dummy.s -o $dummy 2>/dev/null + if test "$?" = 0 ; then + case `./$dummy` in + 0-0) + UNAME_MACHINE="alpha" + ;; + 1-0) + UNAME_MACHINE="alphaev5" + ;; + 1-1) + UNAME_MACHINE="alphaev56" + ;; + 1-101) + UNAME_MACHINE="alphapca56" + ;; + 2-303) + UNAME_MACHINE="alphaev6" + ;; + 2-307) + UNAME_MACHINE="alphaev67" + ;; + esac + + objdump --private-headers $dummy | \ + grep ld.so.1 > /dev/null + if test "$?" = 0 ; then + LIBC="libc1" + fi + fi + rm -f $dummy.s $dummy + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} ; exit 0 + elif test "${UNAME_MACHINE}" = "mips" ; then + cat >$dummy.c <<EOF +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __MIPSEB__ + printf ("%s-unknown-linux-gnu\n", argv[1]); +#endif +#ifdef __MIPSEL__ + printf ("%sel-unknown-linux-gnu\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + elif test "${UNAME_MACHINE}" = "s390"; then + echo s390-ibm-linux && exit 0 + else + # Either a pre-BFD a.out linker (linux-gnuoldld) + # or one that does not give us useful --help. + # GCC wants to distinguish between linux-gnuoldld and linux-gnuaout. + # If ld does not provide *any* "supported emulations:" + # that means it is gnuoldld. + echo "$ld_help_string" | grep >/dev/null 2>&1 "supported emulations:" + test $? != 0 && echo "${UNAME_MACHINE}-pc-linux-gnuoldld" && exit 0 + + case "${UNAME_MACHINE}" in + i?86) + VENDOR=pc; + ;; + *) + VENDOR=unknown; + ;; + esac + # Determine whether the default compiler is a.out or elf + cat >$dummy.c <<EOF +#include <features.h> +#ifdef __cplusplus +#include <stdio.h> /* for printf() prototype */ + int main (int argc, char *argv[]) { +#else + int main (argc, argv) int argc; char *argv[]; { +#endif +#ifdef __ELF__ +# ifdef __GLIBC__ +# if __GLIBC__ >= 2 + printf ("%s-${VENDOR}-linux-gnu\n", argv[1]); +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +# else + printf ("%s-${VENDOR}-linux-gnulibc1\n", argv[1]); +# endif +#else + printf ("%s-${VENDOR}-linux-gnuaout\n", argv[1]); +#endif + return 0; +} +EOF + $CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy "${UNAME_MACHINE}" && rm $dummy.c $dummy && exit 0 + rm -f $dummy.c $dummy + fi ;; +# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions +# are messed up and put the nodename in both sysname and nodename. + i?86:DYNIX/ptx:4*:*) + echo i386-sequent-sysv4 + exit 0 ;; + i?86:UNIX_SV:4.2MP:2.*) + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, + # I just have to hope. -- rms. + # Use sysv4.2uw... so that sysv4* matches it. + echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} + exit 0 ;; + i?86:*:4.*:* | i?86:SYSTEM_V:4.*:*) + UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` + if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then + echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} + fi + exit 0 ;; + i?86:*:5:7*) + # Fixed at (any) Pentium or better + UNAME_MACHINE=i586 + if [ ${UNAME_SYSTEM} = "UnixWare" ] ; then + echo ${UNAME_MACHINE}-sco-sysv${UNAME_RELEASE}uw${UNAME_VERSION} + else + echo ${UNAME_MACHINE}-pc-sysv${UNAME_RELEASE} + fi + exit 0 ;; + i?86:*:3.2:*) + if test -f /usr/options/cb.name; then + UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name` + echo ${UNAME_MACHINE}-pc-isc$UNAME_REL + elif /bin/uname -X 2>/dev/null >/dev/null ; then + UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')` + (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486 + (/bin/uname -X|egrep '^Machine.*Pentium' >/dev/null) \ + && UNAME_MACHINE=i586 + (/bin/uname -X|egrep '^Machine.*Pent ?II' >/dev/null) \ + && UNAME_MACHINE=i686 + (/bin/uname -X|egrep '^Machine.*Pentium Pro' >/dev/null) \ + && UNAME_MACHINE=i686 + echo ${UNAME_MACHINE}-pc-sco$UNAME_REL + else + echo ${UNAME_MACHINE}-pc-sysv32 + fi + exit 0 ;; + i?86:*DOS:*:*) + echo ${UNAME_MACHINE}-pc-msdosdjgpp + exit 0 ;; + pc:*:*:*) + # Left here for compatibility: + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i386. + echo i386-pc-msdosdjgpp + exit 0 ;; + Intel:Mach:3*:*) + echo i386-pc-mach3 + exit 0 ;; + paragon:*:*:*) + echo i860-intel-osf1 + exit 0 ;; + i860:*:4.*:*) # i860-SVR4 + if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then + echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 + else # Add other i860-SVR4 vendors below as they are discovered. + echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 + fi + exit 0 ;; + mini*:CTIX:SYS*5:*) + # "miniframe" + echo m68010-convergent-sysv + exit 0 ;; + M68*:*:R3V[567]*:*) + test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;; + 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 4850:*:4.0:3.0) + OS_REL='' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4.3${OS_REL} && exit 0 + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && echo i586-ncr-sysv4.3${OS_REL} && exit 0 ;; + 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && echo i486-ncr-sysv4 && exit 0 ;; + m68*:LynxOS:2.*:*) + echo m68k-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + mc68030:UNIX_System_V:4.*:*) + echo m68k-atari-sysv4 + exit 0 ;; + i?86:LynxOS:2.*:* | i?86:LynxOS:3.[01]*:*) + echo i386-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + TSUNAMI:LynxOS:2.*:*) + echo sparc-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + rs6000:LynxOS:2.*:* | PowerPC:LynxOS:2.*:*) + echo rs6000-unknown-lynxos${UNAME_RELEASE} + exit 0 ;; + SM[BE]S:UNIX_SV:*:*) + echo mips-dde-sysv${UNAME_RELEASE} + exit 0 ;; + RM*:ReliantUNIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + RM*:SINIX-*:*:*) + echo mips-sni-sysv4 + exit 0 ;; + *:SINIX-*:*:*) + if uname -p 2>/dev/null >/dev/null ; then + UNAME_MACHINE=`(uname -p) 2>/dev/null` + echo ${UNAME_MACHINE}-sni-sysv4 + else + echo ns32k-sni-sysv + fi + exit 0 ;; + PENTIUM:CPunix:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort + # says <Richard.M.Bartel@ccMail.Census.GOV> + echo i586-unisys-sysv4 + exit 0 ;; + *:UNIX_System_V:4*:FTX*) + # From Gerald Hewes <hewes@openmarket.com>. + # How about differentiating between stratus architectures? -djm + echo hppa1.1-stratus-sysv4 + exit 0 ;; + *:*:*:FTX*) + # From seanf@swdc.stratus.com. + echo i860-stratus-sysv4 + exit 0 ;; + mc68*:A/UX:*:*) + echo m68k-apple-aux${UNAME_RELEASE} + exit 0 ;; + news*:NEWS-OS:*:6*) + echo mips-sony-newsos6 + exit 0 ;; + R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) + if [ -d /usr/nec ]; then + echo mips-nec-sysv${UNAME_RELEASE} + else + echo mips-unknown-sysv${UNAME_RELEASE} + fi + exit 0 ;; + BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. + echo powerpc-be-beos + exit 0 ;; + BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. + echo powerpc-apple-beos + exit 0 ;; + BePC:BeOS:*:*) # BeOS running on Intel PC compatible. + echo i586-pc-beos + exit 0 ;; + SX-4:SUPER-UX:*:*) + echo sx4-nec-superux${UNAME_RELEASE} + exit 0 ;; + SX-5:SUPER-UX:*:*) + echo sx5-nec-superux${UNAME_RELEASE} + exit 0 ;; + Power*:Rhapsody:*:*) + echo powerpc-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Rhapsody:*:*) + echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} + exit 0 ;; + *:Darwin:*:*) + echo `uname -p`-apple-darwin${UNAME_RELEASE} + exit 0 ;; + *:procnto*:*:* | *:QNX:[0123456789]*:*) + if test "${UNAME_MACHINE}" = "x86pc"; then + UNAME_MACHINE=pc + fi + echo `uname -p`-${UNAME_MACHINE}-nto-qnx + exit 0 ;; + *:QNX:*:4*) + echo i386-pc-qnx + exit 0 ;; + NSR-W:NONSTOP_KERNEL:*:*) + echo nsr-tandem-nsk${UNAME_RELEASE} + exit 0 ;; + BS2000:POSIX*:*:*) + echo bs2000-siemens-sysv + exit 0 ;; + DS/*:UNIX_System_V:*:*) + echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} + exit 0 ;; +esac + +#echo '(No uname command or uname output not recognized.)' 1>&2 +#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2 + +cat >$dummy.c <<EOF +#ifdef _SEQUENT_ +# include <sys/types.h> +# include <sys/utsname.h> +#endif +main () +{ +#if defined (sony) +#if defined (MIPSEB) + /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, + I don't know.... */ + printf ("mips-sony-bsd\n"); exit (0); +#else +#include <sys/param.h> + printf ("m68k-sony-newsos%s\n", +#ifdef NEWSOS4 + "4" +#else + "" +#endif + ); exit (0); +#endif +#endif + +#if defined (__arm) && defined (__acorn) && defined (__unix) + printf ("arm-acorn-riscix"); exit (0); +#endif + +#if defined (hp300) && !defined (hpux) + printf ("m68k-hp-bsd\n"); exit (0); +#endif + +#if defined (NeXT) +#if !defined (__ARCHITECTURE__) +#define __ARCHITECTURE__ "m68k" +#endif + int version; + version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; + if (version < 4) + printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); + else + printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); + exit (0); +#endif + +#if defined (MULTIMAX) || defined (n16) +#if defined (UMAXV) + printf ("ns32k-encore-sysv\n"); exit (0); +#else +#if defined (CMU) + printf ("ns32k-encore-mach\n"); exit (0); +#else + printf ("ns32k-encore-bsd\n"); exit (0); +#endif +#endif +#endif + +#if defined (__386BSD__) + printf ("i386-pc-bsd\n"); exit (0); +#endif + +#if defined (sequent) +#if defined (i386) + printf ("i386-sequent-dynix\n"); exit (0); +#endif +#if defined (ns32000) + printf ("ns32k-sequent-dynix\n"); exit (0); +#endif +#endif + +#if defined (_SEQUENT_) + struct utsname un; + + uname(&un); + + if (strncmp(un.version, "V2", 2) == 0) { + printf ("i386-sequent-ptx2\n"); exit (0); + } + if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ + printf ("i386-sequent-ptx1\n"); exit (0); + } + printf ("i386-sequent-ptx\n"); exit (0); + +#endif + +#if defined (vax) +#if !defined (ultrix) + printf ("vax-dec-bsd\n"); exit (0); +#else + printf ("vax-dec-ultrix\n"); exit (0); +#endif +#endif + +#if defined (alliant) && defined (i860) + printf ("i860-alliant-bsd\n"); exit (0); +#endif + + exit (1); +} +EOF + +$CC_FOR_BUILD $dummy.c -o $dummy 2>/dev/null && ./$dummy && rm $dummy.c $dummy && exit 0 +rm -f $dummy.c $dummy + +# Apollos put the system type in the environment. + +test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; } + +# Convex versions that predate uname can use getsysinfo(1) + +if [ -x /usr/convex/getsysinfo ] +then + case `getsysinfo -f cpu_type` in + c1*) + echo c1-convex-bsd + exit 0 ;; + c2*) + if getsysinfo -f scalar_acc + then echo c32-convex-bsd + else echo c2-convex-bsd + fi + exit 0 ;; + c34*) + echo c34-convex-bsd + exit 0 ;; + c38*) + echo c38-convex-bsd + exit 0 ;; + c4*) + echo c4-convex-bsd + exit 0 ;; + esac +fi + +#echo '(Unable to guess system type)' 1>&2 + +exit 1
A config.h.in

@@ -0,0 +1,106 @@

+/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define as the return type of signal handlers (int or void). */ +#undef RETSIGTYPE + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +/* Define if you can safely include both <sys/time.h> and <time.h>. */ +#undef TIME_WITH_SYS_TIME + +/* Define if the X Window System is missing or not being used. */ +#undef X_DISPLAY_MISSING + +/* Define if you have the basename function. */ +#undef HAVE_BASENAME + +/* Define if you have the catclose function. */ +#undef HAVE_CATCLOSE + +/* Define if you have the catgets function. */ +#undef HAVE_CATGETS + +/* Define if you have the catopen function. */ +#undef HAVE_CATOPEN + +/* Define if you have the getpid function. */ +#undef HAVE_GETPID + +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the sigaction function. */ +#undef HAVE_SIGACTION + +/* Define if you have the snprintf function. */ +#undef HAVE_SNPRINTF + +/* Define if you have the strcasestr function. */ +#undef HAVE_STRCASESTR + +/* Define if you have the strftime function. */ +#undef HAVE_STRFTIME + +/* Define if you have the vsnprintf function. */ +#undef HAVE_VSNPRINTF + +/* Define if you have the <ctype.h> header file. */ +#undef HAVE_CTYPE_H + +/* Define if you have the <dirent.h> header file. */ +#undef HAVE_DIRENT_H + +/* Define if you have the <errno.h> header file. */ +#undef HAVE_ERRNO_H + +/* Define if you have the <fcntl.h> header file. */ +#undef HAVE_FCNTL_H + +/* Define if you have the <libgen.h> header file. */ +#undef HAVE_LIBGEN_H + +/* Define if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the <nl_types.h> header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the <process.h> header file. */ +#undef HAVE_PROCESS_H + +/* Define if you have the <signal.h> header file. */ +#undef HAVE_SIGNAL_H + +/* Define if you have the <stdarg.h> header file. */ +#undef HAVE_STDARG_H + +/* Define if you have the <stdio.h> header file. */ +#undef HAVE_STDIO_H + +/* Define if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the <sys/select.h> header file. */ +#undef HAVE_SYS_SELECT_H + +/* Define if you have the <sys/signal.h> header file. */ +#undef HAVE_SYS_SIGNAL_H + +/* Define if you have the <sys/stat.h> header file. */ +#undef HAVE_SYS_STAT_H + +/* Define if you have the <sys/time.h> header file. */ +#undef HAVE_SYS_TIME_H + +/* Define if you have the <sys/types.h> header file. */ +#undef HAVE_SYS_TYPES_H + +/* Define if you have the <sys/wait.h> header file. */ +#undef HAVE_SYS_WAIT_H + +/* Define if you have the <time.h> header file. */ +#undef HAVE_TIME_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H
A config.sub

@@ -0,0 +1,1268 @@

+#! /bin/sh +# Configuration validation subroutine script, version 1.1. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. +# +# This file is (in principle) common to ALL GNU software. +# The presence of a machine in this file suggests that SOME GNU software +# can handle that machine. It does not imply ALL GNU software can. +# +# This file is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, +# Boston, MA 02111-1307, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Written by Per Bothner <bothner@cygnus.com>. +# Please send patches to <config-patches@gnu.org>. +# +# Configuration subroutine to validate and canonicalize a configuration type. +# Supply the specified configuration type as an argument. +# If it is invalid, we print an error message on stderr and exit with code 1. +# Otherwise, we print the canonical config type on stdout and succeed. + +# This file is supposed to be the same for all GNU packages +# and recognize all the CPU types, system types and aliases +# that are meaningful with *any* GNU software. +# Each package is responsible for reporting which valid configurations +# it does not support. The user should be able to distinguish +# a failure to support a valid configuration from a meaningless +# configuration. + +# The goal of this file is to map all the various variations of a given +# machine specification into a single specification in the form: +# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM +# or in some cases, the newer four-part form: +# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM +# It is wrong to echo any other type of specification. + +if [ x$1 = x ] +then + echo Configuration name missing. 1>&2 + echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 + echo "or $0 ALIAS" 1>&2 + echo where ALIAS is a recognized configuration type. 1>&2 + exit 1 +fi + +# First pass through any local machine types. +case $1 in + *local*) + echo $1 + exit 0 + ;; + *) + ;; +esac + +# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). +# Here we must recognize all the valid KERNEL-OS combinations. +maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` +case $maybe_os in + nto-qnx* | linux-gnu*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; + *) + basic_machine=`echo $1 | sed 's/-[^-]*$//'` + if [ $basic_machine != $1 ] + then os=`echo $1 | sed 's/.*-/-/'` + else os=; fi + ;; +esac + +### Let's recognize common machines as not being operating systems so +### that things like config.sub decstation-3100 work. We also +### recognize some manufacturers as not being operating systems, so we +### can provide default operating systems below. +case $os in + -sun*os*) + # Prevent following clause from handling this invalid input. + ;; + -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ + -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ + -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ + -apple) + os= + basic_machine=$1 + ;; + -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; + -scout) + ;; + -wrs) + os=-vxworks + basic_machine=$1 + ;; + -hiux*) + os=-hiuxwe2 + ;; + -sco5) + os=-sco3.2v5 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco4) + os=-sco3.2v4 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2.[4-9]*) + os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco3.2v[4-9]*) + # Don't forget version if it is 3.2v4 or newer. + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -sco*) + os=-sco3.2v2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -udk*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -isc) + os=-isc2.2 + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -clix*) + basic_machine=clipper-intergraph + ;; + -isc*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` + ;; + -lynx*) + os=-lynxos + ;; + -ptx*) + basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` + ;; + -windowsnt*) + os=`echo $os | sed -e 's/windowsnt/winnt/'` + ;; + -psos*) + os=-psos + ;; + -mint | -mint[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; +esac + +# Decode aliases for certain CPU-COMPANY combinations. +case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. + tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ + | arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ + | 580 | i960 | h8300 \ + | x86 | ppcbe | mipsbe | mipsle | shbe | shle | armbe | armle \ + | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ + | hppa64 \ + | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \ + | alphaev6[78] \ + | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ + | 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ + | mips64orion | mips64orionel | mipstx39 | mipstx39el \ + | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ + | mips64vr5000 | miprs64vr5000el | mcore \ + | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ + | thumb | d10v | fr30 | avr) + basic_machine=$basic_machine-unknown + ;; + m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) + ;; + + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. + i[34567]86) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. + *-*-*) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; + # Recognize the basic CPU types with company name. + # FIXME: clean up the formatting here. + vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ + | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ + | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ + | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ + | xmp-* | ymp-* \ + | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* | armbe-* | armle-* \ + | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \ + | hppa2.0n-* | hppa64-* \ + | alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \ + | alphaev6[78]-* \ + | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ + | clipper-* | orion-* \ + | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ + | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ + | mips64el-* | mips64orion-* | mips64orionel-* \ + | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ + | mipstx39-* | mipstx39el-* | mcore-* \ + | f301-* | armv*-* | s390-* | sv1-* | t3e-* \ + | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ + | thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* \ + | bs2000-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. + 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; + 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) + basic_machine=m68000-att + ;; + 3b*) + basic_machine=we32k-att + ;; + a29khif) + basic_machine=a29k-amd + os=-udi + ;; + adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; + alliant | fx80) + basic_machine=fx80-alliant + ;; + altos | altos3068) + basic_machine=m68k-altos + ;; + am29k) + basic_machine=a29k-none + os=-bsd + ;; + amdahl) + basic_machine=580-amdahl + os=-sysv + ;; + amiga | amiga-*) + basic_machine=m68k-cbm + ;; + amigaos | amigados) + basic_machine=m68k-cbm + os=-amigaos + ;; + amigaunix | amix) + basic_machine=m68k-cbm + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; + apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; + aux) + basic_machine=m68k-apple + os=-aux + ;; + balance) + basic_machine=ns32k-sequent + os=-dynix + ;; + convex-c1) + basic_machine=c1-convex + os=-bsd + ;; + convex-c2) + basic_machine=c2-convex + os=-bsd + ;; + convex-c32) + basic_machine=c32-convex + os=-bsd + ;; + convex-c34) + basic_machine=c34-convex + os=-bsd + ;; + convex-c38) + basic_machine=c38-convex + os=-bsd + ;; + cray | ymp) + basic_machine=ymp-cray + os=-unicos + ;; + cray2) + basic_machine=cray2-cray + os=-unicos + ;; + [ctj]90-cray) + basic_machine=c90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola + ;; + delta88) + basic_machine=m88k-motorola + os=-sysv3 + ;; + dpx20 | dpx20-*) + basic_machine=rs6000-bull + os=-bosx + ;; + dpx2* | dpx2*-bull) + basic_machine=m68k-bull + os=-sysv3 + ;; + ebmon29k) + basic_machine=a29k-amd + os=-ebmon + ;; + elxsi) + basic_machine=elxsi-elxsi + os=-bsd + ;; + encore | umax | mmax) + basic_machine=ns32k-encore + ;; + es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; + fx2800) + basic_machine=i860-alliant + ;; + genix) + basic_machine=ns32k-ns + ;; + gmicro) + basic_machine=tron-gmicro + os=-sysv + ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + h8300hms) + basic_machine=h8300-hitachi + os=-hms + ;; + h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; + h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; + harris) + basic_machine=m88k-harris + os=-sysv3 + ;; + hp300-*) + basic_machine=m68k-hp + ;; + hp300bsd) + basic_machine=m68k-hp + os=-bsd + ;; + hp300hpux) + basic_machine=m68k-hp + os=-hpux + ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k2[0-9][0-9] | hp9k31[0-9]) + basic_machine=m68000-hp + ;; + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; + hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; + hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; + hppa-next) + os=-nextstep3 + ;; + hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; + hppro) + basic_machine=hppa1.1-hp + os=-proelf + ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm + ;; +# I'm not sure what "Sysv32" means. Should this be sysv3.2? + i[34567]86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; + i[34567]86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; + i[34567]86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; + i[34567]86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; + i386mach) + basic_machine=i386-mach + os=-mach + ;; + i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; + i386-go32 | go32) + basic_machine=i386-unknown + os=-go32 + ;; + i386-mingw32 | mingw32) + basic_machine=i386-unknown + os=-mingw32 + ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in + -irix*) + ;; + *) + os=-irix4 + ;; + esac + ;; + isi68 | isi) + basic_machine=m68k-isi + os=-sysv + ;; + m88k-omron*) + basic_machine=m88k-omron + ;; + magnum | m3230) + basic_machine=mips-mips + os=-sysv + ;; + merlin) + basic_machine=ns32k-utek + os=-sysv + ;; + miniframe) + basic_machine=m68000-convergent + ;; + *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) + basic_machine=m68k-atari + os=-mint + ;; + mipsel*-linux*) + basic_machine=mipsel-unknown + os=-linux-gnu + ;; + mips*-linux*) + basic_machine=mips-unknown + os=-linux-gnu + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` + ;; + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; + mmix*) + basic_machine=mmix-knuth + os=-mmixware + ;; + monitor) + basic_machine=m68k-rom68k + os=-coff + ;; + msdos) + basic_machine=i386-unknown + os=-msdos + ;; + mvs) + basic_machine=i370-ibm + os=-mvs + ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) + basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) + basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) + basic_machine=m68k-sony + os=-newsos + ;; + news1000) + basic_machine=m68030-sony + os=-newsos + ;; + news-3600 | risc-news) + basic_machine=mips-sony + os=-newsos + ;; + necv70) + basic_machine=v70-nec + os=-sysv + ;; + next | m*-next ) + basic_machine=m68k-next + case $os in + -nextstep* ) + ;; + -ns2*) + os=-nextstep2 + ;; + *) + os=-nextstep3 + ;; + esac + ;; + nh3000) + basic_machine=m68k-harris + os=-cxux + ;; + nh[45]000) + basic_machine=m88k-harris + os=-cxux + ;; + nindy960) + basic_machine=i960-intel + os=-nindy + ;; + mon960) + basic_machine=i960-intel + os=-mon960 + ;; + np1) + basic_machine=np1-gould + ;; + nsr-tandem) + basic_machine=nsr-tandem + ;; + op50n-* | op60c-*) + basic_machine=hppa1.1-oki + os=-proelf + ;; + OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; + os68k) + basic_machine=m68k-none + os=-os68k + ;; + pa-hitachi) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 + ;; + paragon) + basic_machine=i860-intel + os=-osf + ;; + pbd) + basic_machine=sparc-tti + ;; + pbb) + basic_machine=m68k-tti + ;; + pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; + pentium | p5 | k5 | k6 | nexen) + basic_machine=i586-pc + ;; + pentiumpro | p6 | 6x86) + basic_machine=i686-pc + ;; + pentiumii | pentium2) + basic_machine=i786-pc + ;; + pentium-* | p5-* | k5-* | k6-* | nexen-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumpro-* | p6-* | 6x86-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) + basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; + power) basic_machine=rs6000-ibm + ;; + ppc) basic_machine=powerpc-unknown + ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown + ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ps2) + basic_machine=i386-ibm + ;; + rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; + rm[46]00) + basic_machine=mips-siemens + ;; + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; + sa29200) + basic_machine=a29k-amd + os=-udi + ;; + sequent) + basic_machine=i386-sequent + ;; + sh) + basic_machine=sh-hitachi + os=-hms + ;; + sparclite-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; + sps7) + basic_machine=m68k-bull + os=-sysv2 + ;; + spur) + basic_machine=spur-unknown + ;; + st2000) + basic_machine=m68k-tandem + ;; + stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; + sun2) + basic_machine=m68000-sun + ;; + sun2os3) + basic_machine=m68000-sun + os=-sunos3 + ;; + sun2os4) + basic_machine=m68000-sun + os=-sunos4 + ;; + sun3os3) + basic_machine=m68k-sun + os=-sunos3 + ;; + sun3os4) + basic_machine=m68k-sun + os=-sunos4 + ;; + sun4os3) + basic_machine=sparc-sun + os=-sunos3 + ;; + sun4os4) + basic_machine=sparc-sun + os=-sunos4 + ;; + sun4sol2) + basic_machine=sparc-sun + os=-solaris2 + ;; + sun3 | sun3-*) + basic_machine=m68k-sun + ;; + sun4) + basic_machine=sparc-sun + ;; + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; + sv1) + basic_machine=sv1-cray + os=-unicos + ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; + t3e) + basic_machine=t3e-cray + os=-unicos + ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; + udi29k) + basic_machine=a29k-amd + os=-udi + ;; + ultra3) + basic_machine=a29k-nyu + os=-sym1 + ;; + v810 | necv810) + basic_machine=v810-nec + os=-none + ;; + vaxv) + basic_machine=vax-dec + os=-sysv + ;; + vms) + basic_machine=vax-dec + os=-vms + ;; + vpp*|vx|vx-*) + basic_machine=f301-fujitsu + ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks + ;; + vxworks68) + basic_machine=m68k-wrs + os=-vxworks + ;; + vxworks29k) + basic_machine=a29k-wrs + os=-vxworks + ;; + w65*) + basic_machine=w65-wdc + os=-none + ;; + w89k-*) + basic_machine=hppa1.1-winbond + os=-proelf + ;; + xmp) + basic_machine=xmp-cray + os=-unicos + ;; + xps | xps100) + basic_machine=xps100-honeywell + ;; + z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; + none) + basic_machine=none-none + os=-none + ;; + +# Here we handle the default manufacturer of certain CPU types. It is in +# some cases the only manufacturer, in others, it is the most popular. + w89k) + basic_machine=hppa1.1-winbond + ;; + op50n) + basic_machine=hppa1.1-oki + ;; + op60c) + basic_machine=hppa1.1-oki + ;; + mips) + if [ x$os = x-linux-gnu ]; then + basic_machine=mips-unknown + else + basic_machine=mips-mips + fi + ;; + romp) + basic_machine=romp-ibm + ;; + rs6000) + basic_machine=rs6000-ibm + ;; + vax) + basic_machine=vax-dec + ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; + sparc | sparcv9) + basic_machine=sparc-sun + ;; + cydra) + basic_machine=cydra-cydrome + ;; + orion) + basic_machine=orion-highlevel + ;; + orion105) + basic_machine=clipper-highlevel + ;; + mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; + pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; + c4x*) + basic_machine=c4x-none + os=-coff + ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 + ;; +esac + +# Here we canonicalize certain aliases for manufacturers. +case $basic_machine in + *-digital*) + basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` + ;; + *-commodore*) + basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` + ;; + *) + ;; +esac + +# Decode manufacturer-specific aliases for certain operating systems. + +if [ x"$os" != x"" ] +then +case $os in + # First match some system type aliases + # that might get confused with valid system types. + # -solaris* is a basic system type, with this one exception. + -solaris1 | -solaris1.*) + os=`echo $os | sed -e 's|solaris1|sunos4|'` + ;; + -solaris) + os=-solaris2 + ;; + -svr4*) + os=-sysv4 + ;; + -unixware*) + os=-sysv4.2uw + ;; + -gnu/linux*) + os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` + ;; + # First accept the basic system types. + # The portable systems comes first. + # Each alternative MUST END IN A *, to match a version number. + # -sysv* is not here because it comes later, after sysvr4. + -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ + | -aos* \ + | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ + | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ + | -hiux* | -386bsd* | -netbsd* | -openbsd* | -freebsd* | -riscix* \ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ + | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \ + | -openstep* | -oskit*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; + -qnx*) + case $basic_machine in + x86-* | i[34567]86-*) + ;; + *) + os=-nto$os + ;; + esac + ;; + -nto*) + os=-nto-qnx + ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ + | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ + | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; + -sunos5*) + os=`echo $os | sed -e 's|sunos5|solaris2|'` + ;; + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; + -opened*) + os=-openedition + ;; + -wince*) + os=-wince + ;; + -osfrose*) + os=-osfrose + ;; + -osf*) + os=-osf + ;; + -utek*) + os=-bsd + ;; + -dynix*) + os=-bsd + ;; + -acis*) + os=-aos + ;; + -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; + -ns2 ) + os=-nextstep2 + ;; + -nsk) + os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) + os=`echo $os | sed -e 's|sinix|sysv|'` + ;; + -sinix*) + os=-sysv4 + ;; + -triton*) + os=-sysv3 + ;; + -oss*) + os=-sysv3 + ;; + -svr4) + os=-sysv4 + ;; + -svr3) + os=-sysv3 + ;; + -sysvr4) + os=-sysv4 + ;; + # This must come after -sysvr4. + -sysv*) + ;; + -ose*) + os=-ose + ;; + -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; + -*mint | -*MiNT) + os=-mint + ;; + -none) + ;; + *) + # Get rid of the `-' at the beginning of $os. + os=`echo $os | sed 's/[^-]*-//'` + echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 + exit 1 + ;; +esac +else + +# Here we handle the default operating systems that come with various machines. +# The value should be what the vendor currently ships out the door with their +# machine or put another way, the most popular os provided with the machine. + +# Note that if you're going to try to match "-MANUFACTURER" here (say, +# "-sun"), then you have to tell the case statement up towards the top +# that MANUFACTURER isn't an operating system. Otherwise, code above +# will signal an error saying that MANUFACTURER isn't an operating +# system, and we'll never get to this point. + +case $basic_machine in + *-acorn) + os=-riscix1.2 + ;; + arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; + pdp11-*) + os=-none + ;; + *-dec | vax-*) + os=-ultrix4.2 + ;; + m68*-apollo) + os=-domain + ;; + i386-sun) + os=-sunos4.0.2 + ;; + m68000-sun) + os=-sunos3 + # This also exists in the configure program, but was not the + # default. + # os=-sunos4 + ;; + m68*-cisco) + os=-aout + ;; + mips*-cisco) + os=-elf + ;; + mips*-*) + os=-elf + ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; + sparc-* | *-sun) + os=-sunos4.1.1 + ;; + *-be) + os=-beos + ;; + *-ibm) + os=-aix + ;; + *-wec) + os=-proelf + ;; + *-winbond) + os=-proelf + ;; + *-oki) + os=-proelf + ;; + *-hp) + os=-hpux + ;; + *-hitachi) + os=-hiux + ;; + i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) + os=-sysv + ;; + *-cbm) + os=-amigaos + ;; + *-dg) + os=-dgux + ;; + *-dolphin) + os=-sysv3 + ;; + m68k-ccur) + os=-rtu + ;; + m88k-omron*) + os=-luna + ;; + *-next ) + os=-nextstep + ;; + *-sequent) + os=-ptx + ;; + *-crds) + os=-unos + ;; + *-ns) + os=-genix + ;; + i370-*) + os=-mvs + ;; + *-next) + os=-nextstep3 + ;; + *-gould) + os=-sysv + ;; + *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; + *-sgi) + os=-irix + ;; + *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; + f301-fujitsu) + os=-uxpv + ;; + *-rom68k) + os=-coff + ;; + *-*bug) + os=-coff + ;; + *-apple) + os=-macos + ;; + *-atari*) + os=-mint + ;; + *) + os=-none + ;; +esac +fi + +# Here we handle the case where we know the os, and the CPU type, but not the +# manufacturer. We pick the logical manufacturer. +vendor=unknown +case $basic_machine in + *-unknown) + case $os in + -riscix*) + vendor=acorn + ;; + -sunos*) + vendor=sun + ;; + -aix*) + vendor=ibm + ;; + -beos*) + vendor=be + ;; + -hpux*) + vendor=hp + ;; + -mpeix*) + vendor=hp + ;; + -hiux*) + vendor=hitachi + ;; + -unos*) + vendor=crds + ;; + -dgux*) + vendor=dg + ;; + -luna*) + vendor=omron + ;; + -genix*) + vendor=ns + ;; + -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; + -vxsim* | -vxworks*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; + -hms*) + vendor=hitachi + ;; + -mpw* | -macos*) + vendor=apple + ;; + -*mint | -*MiNT) + vendor=atari + ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; +esac + +echo $basic_machine$os
A configure

@@ -0,0 +1,3967 @@

+#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --enable-shared[=PKGS] build shared libraries [default=yes]" +ac_help="$ac_help + --enable-static[=PKGS] build static libraries [default=yes]" +ac_help="$ac_help + --enable-fast-install[=PKGS] optimize for fast installation [default=yes]" +ac_help="$ac_help + --with-gnu-ld assume the C compiler uses GNU ld [default=no]" +ac_help="$ac_help + --disable-libtool-lock avoid locking (might break parallel builds)" +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-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-kde KDE slit support [default=no]" +ac_help="$ac_help + --enable-gnome GNOME support [default=no] (DEVELOPMENT)" +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. +# The variables have the same names as the options, with +# dashes changed to underlines. +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 +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 + + 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 + + -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 ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) + 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" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) + datadir="$ac_optarg" ;; + + -disable-* | --disable-*) + ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` + # Reject names that are not valid shell variable names. + 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=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + 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'" ;; + + -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) + # 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 ;; + -host=* | --host=* | --hos=* | --ho=*) + 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" ;; + + -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) + 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 ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) + target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + + -version | --version | --versio | --versi | --vers) + echo "configure generated by autoconf version 2.13" + exit 0 ;; + + -with-* | --with-*) + ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # Reject names that are not valid shell variable names. + 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=yes ;; + esac + eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) + ac_package=`echo $ac_option|sed -e 's/-*without-//'` + # Reject names that are not valid shell variable names. + 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-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 "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } + ;; + + *) + 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 + { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } +fi + +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 + +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 + 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 + +# 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 + +# 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/main.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_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 "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else + { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi +fi +srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +# 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 "loading site script $ac_site_file" + . "$ac_site_file" + fi +done + +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + 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-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 + fi +done +if test -z "$ac_aux_dir"; then + { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } +fi +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 +# 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:593: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +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 + ;; + esac + done + IFS="$ac_save_IFS" + +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 "$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_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +echo "configure:646: 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 "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 "configure: error: newly created file is older than distributed files! +Check your system clock" 1>&2; exit 1; } +fi +rm -f conftest* +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" +# Use a double $ so make ignores it. +test "$program_suffix" != NONE && + 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:703: 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}"' +EOF +# GNU make sometimes prints "make[1]: Entering...", which would confuse us. +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 conftestmake +fi +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$ac_t""yes" 1>&6 + SET_MAKE= +else + echo "$ac_t""no" 1>&6 + SET_MAKE="MAKE=${MAKE-make}" +fi + + +PACKAGE=fluxbox + +VERSION=0.1.5 + +if test "`cd $srcdir && pwd`" != "`pwd`" && test -f $srcdir/config.status; then + { 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 $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:742: 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 "$ac_t""found" 1>&6 +else + ACLOCAL="$missing_dir/missing aclocal" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +echo "configure:755: 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 "$ac_t""found" 1>&6 +else + AUTOCONF="$missing_dir/missing autoconf" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working automake""... $ac_c" 1>&6 +echo "configure:768: 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 "$ac_t""found" 1>&6 +else + AUTOMAKE="$missing_dir/missing automake" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +echo "configure:781: 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 "$ac_t""found" 1>&6 +else + AUTOHEADER="$missing_dir/missing autoheader" + echo "$ac_t""missing" 1>&6 +fi + +echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +echo "configure:794: 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 "$ac_t""found" 1>&6 +else + MAKEINFO="$missing_dir/missing makeinfo" + echo "$ac_t""missing" 1>&6 +fi + + + +test x$prefix = "xNONE" && prefix="$ac_default_prefix" + + +# 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:814: 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_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" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:844: 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 + 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 $# -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 "$ac_dir/$ac_word" "$@" + shift + ac_cv_prog_CC="$@" + fi +fi +fi +fi +CC="$ac_cv_prog_CC" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + 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:895: 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_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" +if test -n "$CC"; then + echo "$ac_t""$CC" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + ;; + esac + 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:927: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +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 + +cat > conftest.$ac_ext << EOF + +#line 938 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:943: \"$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 + ac_cv_prog_cc_cross=yes + fi +else + 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 + +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:969: 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 + +echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +echo "configure:974: 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.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:983: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +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:1002: 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 + ac_cv_prog_cc_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cc_g" 1>&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 + +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:1038: 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 + 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" +if test -n "$CXX"; then + echo "$ac_t""$CXX" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$CXX" && break +done +test -n "$CXX" || CXX="gcc" + + +echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +echo "configure:1070: 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 1081 "configure" +#include "confdefs.h" + +int main(){return(0);} +EOF +if { (eval echo configure:1086: \"$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 "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 + +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:1112: 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 + +echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 +echo "configure:1117: 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 <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1126: \"$ac_try\") 1>&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 + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +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:1145: 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 + ac_cv_prog_cxx_g=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_prog_cxx_g" 1>&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 + +# 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 +# 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 $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +echo "configure:1188: checking for a BSD compatible install" >&5 +if test -z "$INSTALL"; then +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 + ;; + esac + done + IFS="$ac_save_IFS" + +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 "$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_PROGRAM}' + +test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +# Check whether --enable-shared or --disable-shared was given. +if test "${enable_shared+set}" = set; then + enableval="$enable_shared" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_shared=yes ;; +no) enable_shared=no ;; +*) + enable_shared=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_shared=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_shared=yes +fi + +# Check whether --enable-static or --disable-static was given. +if test "${enable_static+set}" = set; then + enableval="$enable_static" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_static=yes ;; +no) enable_static=no ;; +*) + enable_static=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_static=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_static=yes +fi + +# Check whether --enable-fast-install or --disable-fast-install was given. +if test "${enable_fast_install+set}" = set; then + enableval="$enable_fast_install" + p=${PACKAGE-default} +case "$enableval" in +yes) enable_fast_install=yes ;; +no) enable_fast_install=no ;; +*) + enable_fast_install=no + # Look at the argument we got. We use all the common list separators. + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:," + for pkg in $enableval; do + if test "X$pkg" = "X$p"; then + enable_fast_install=yes + fi + done + IFS="$ac_save_ifs" + ;; +esac +else + enable_fast_install=yes +fi + + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:1316: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +echo $ac_n "checking build system type""... $ac_c" 1>&6 +echo "configure:1337: checking build system type" >&5 + +build_alias=$build +case "$build_alias" in +NONE) + case $nonopt in + NONE) build_alias=$host_alias ;; + *) build_alias=$nonopt ;; + esac ;; +esac + +build=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $build_alias` +build_cpu=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$build" 1>&6 + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1357: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + 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_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +# Check whether --with-gnu-ld or --without-gnu-ld was given. +if test "${with_gnu_ld+set}" = set; then + withval="$with_gnu_ld" + test "$withval" = no || with_gnu_ld=yes +else + with_gnu_ld=no +fi + +ac_prog=ld +if test "$ac_cv_prog_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC""... $ac_c" 1>&6 +echo "configure:1396: checking for ld used by GCC" >&5 + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we aren't using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac +elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld""... $ac_c" 1>&6 +echo "configure:1420: checking for GNU ld" >&5 +else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 +echo "configure:1423: checking for non-GNU ld" >&5 +fi +if eval "test \"`echo '$''{'ac_cv_path_LD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + ac_cv_path_LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" +else + ac_cv_path_LD="$LD" # Let the user override the test with a path. +fi +fi + +LD="$ac_cv_path_LD" +if test -n "$LD"; then + echo "$ac_t""$LD" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +test -z "$LD" && { echo "configure: error: no acceptable ld found in \$PATH" 1>&2; exit 1; } +echo $ac_n "checking if the linker ($LD) is GNU ld""... $ac_c" 1>&6 +echo "configure:1458: checking if the linker ($LD) is GNU ld" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gnu_ld'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + ac_cv_prog_gnu_ld=yes +else + ac_cv_prog_gnu_ld=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gnu_ld" 1>&6 + + +echo $ac_n "checking for BSD-compatible nm""... $ac_c" 1>&6 +echo "configure:1474: checking for BSD-compatible nm" >&5 +if eval "test \"`echo '$''{'ac_cv_path_NM'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$NM"; then + # Let the user override the test. + ac_cv_path_NM="$NM" +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" + for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + ac_cv_path_NM="$ac_dir/nm -p" + break + else + ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm +fi +fi + +NM="$ac_cv_path_NM" +echo "$ac_t""$NM" 1>&6 + +echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 +echo "configure:1510: checking whether ln -s works" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + rm -f conftestdata +if ln -s X conftestdata 2>/dev/null +then + rm -f conftestdata + ac_cv_prog_LN_S="ln -s" +else + ac_cv_prog_LN_S=ln +fi +fi +LN_S="$ac_cv_prog_LN_S" +if test "$ac_cv_prog_LN_S" = "ln -s"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + +case "$target" in +NONE) lt_target="$host" ;; +*) lt_target="$target" ;; +esac + +# Check for any special flags to pass to ltconfig. +libtool_flags="--cache-file=$cache_file" +test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared" +test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static" +test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install" +test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc" +test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld" + + +# Check whether --enable-libtool-lock or --disable-libtool-lock was given. +if test "${enable_libtool_lock+set}" = set; then + enableval="$enable_libtool_lock" + : +fi + +test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock" +test x"$silent" = xyes && libtool_flags="$libtool_flags --silent" + +# Some flags need to be propagated to the compiler or linker for good +# libtool support. +case "$lt_target" in +*-*-irix6*) + # Find out which ABI we are using. + echo '#line 1559 "configure"' > conftest.$ac_ext + if { (eval echo configure:1560: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case "`/usr/bin/file conftest.o`" in + *32-bit*) + LD="${LD-ld} -32" + ;; + *N32*) + LD="${LD-ld} -n32" + ;; + *64-bit*) + LD="${LD-ld} -64" + ;; + esac + fi + rm -rf conftest* + ;; + +*-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 +echo "configure:1581: checking whether the C compiler needs -belf" >&5 +if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1586 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:1593: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + lt_cv_cc_needs_belf=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + lt_cv_cc_needs_belf=no +fi +rm -f conftest* +fi + +echo "$ac_t""$lt_cv_cc_needs_belf" 1>&6 + if test x"$lt_cv_cc_needs_belf" != x"yes"; then + # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf + CFLAGS="$SAVE_CFLAGS" + fi + ;; + + +esac + + +# Save cache, so that ltconfig can load it +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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# 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. +# +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 \ + -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 + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + + +# Actually configure libtool. ac_aux_dir is where install-sh is found. +CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \ +LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \ +LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \ +DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \ +${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \ +$libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \ +|| { echo "configure: error: libtool configure failed" 1>&2; exit 1; } + +# Reload cache, that may have been modified by ltconfig +if test -r "$cache_file"; then + echo "loading cache $cache_file" + . $cache_file +else + echo "creating cache $cache_file" + > $cache_file +fi + + +# This can be used to rebuild libtool when needed +LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh" + +# Always use our own libtool. +LIBTOOL='$(SHELL) $(top_builddir)/libtool' + +# Redirect the config.log output again, so that the ltconfig log is not +# clobbered by the next message. +exec 5>>./config.log + + +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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1700: 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 + 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 +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 + +test -n "$regex_cmd" && break +done + +if test x$regex_cmd = "x"; then + { echo "configure: error: error. sed is required to build the data files." 1>&2; exit 1; } +fi + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1734: 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 <<EOF +#line 1749 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1755: \"$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 <<EOF +#line 1766 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1772: \"$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} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 1783 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1789: \"$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=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1814: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1819 "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1827: \"$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* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 1844 "configure" +#include "confdefs.h" +#include <string.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 <<EOF +#line 1862 "configure" +#include "confdefs.h" +#include <stdlib.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + 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 <<EOF +#line 1883 "configure" +#include "confdefs.h" +#include <ctype.h> +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#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); } + +EOF +if { (eval echo configure:1894: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_header_stdc=no +fi +rm -fr conftest* +fi + +fi +fi + +echo "$ac_t""$ac_cv_header_stdc" 1>&6 +if test $ac_cv_header_stdc = yes; then + cat >> confdefs.h <<\EOF +#define STDC_HEADERS 1 +EOF + +fi + +for ac_hdr in errno.h 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 +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:1921: 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 +#line 1926 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1931: \"$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 +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 <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 +echo "configure:1958: 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 <<EOF +#line 1963 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <sys/time.h> +#include <time.h> +int main() { +struct tm *tp; +; return 0; } +EOF +if { (eval echo configure:1972: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_header_time=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_time=no +fi +rm -f conftest* +fi + +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 +EOF + +fi + + +for ac_func in basename +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:1996: 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 <<EOF +#line 2001 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +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 +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2024: \"$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 <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for basename in -lgen""... $ac_c" 1>&6 +echo "configure:2046: 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 <<EOF +#line 2054 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char basename(); + +int main() { +basename() +; return 0; } +EOF +if { (eval echo configure:2065: \"$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 -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 +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2091: 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 <<EOF +#line 2096 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +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 +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2119: \"$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 <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +echo $ac_n "checking for t_open in -lnsl""... $ac_c" 1>&6 +echo "configure:2144: 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_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2152 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +int main() { +t_open() +; return 0; } +EOF +if { (eval echo configure:2163: \"$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 $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6 +echo "configure:2184: 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_save_LIBS="$LIBS" +LIBS="-lsocket $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2192 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char socket(); + +int main() { +socket() +; return 0; } +EOF +if { (eval echo configure:2203: \"$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 + + +# 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:2229: checking for X" >&5 + +# 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 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 conftestdir +if mkdir conftestdir; then + cd conftestdir + # Make sure to not put "make" in the Imakefile rules, since we grep it out. + cat > Imakefile <<'EOF' +acfindx: + @echo 'ac_im_incroot="${INCROOT}"; ac_im_usrlibdir="${USRLIBDIR}"; ac_im_libdir="${LIBDIR}"' +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 + 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 conftestdir +fi + +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 <<EOF +#line 2291 "configure" +#include "confdefs.h" +#include <$x_direct_test_include> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2296: \"$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 "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + 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* +fi # $ac_x_includes = NO + +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="-l$x_direct_test_library $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2365 "configure" +#include "confdefs.h" + +int main() { +${x_direct_test_function}() +; return 0; } +EOF +if { (eval echo configure:2372: \"$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 "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 + for ac_extension in a so sl; do + 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* +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 "$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 "$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 <<\EOF +#define X_DISPLAY_MISSING 1 +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 + "SunOS 5"*) + echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 +echo "configure:2478: checking whether -R must be followed by a space" >&5 + ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" + cat > conftest.$ac_ext <<EOF +#line 2481 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2488: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_nospace=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_nospace=no +fi +rm -f conftest* + if test $ac_R_nospace = yes; then + 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 <<EOF +#line 2504 "configure" +#include "confdefs.h" + +int main() { + +; return 0; } +EOF +if { (eval echo configure:2511: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_R_space=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_R_space=no +fi +rm -f conftest* + if test $ac_R_space = yes; then + echo "$ac_t""yes" 1>&6 + X_LIBS="$X_LIBS -R $x_libraries" + else + echo "$ac_t""neither works" 1>&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@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). + echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 +echo "configure:2543: 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_save_LIBS="$LIBS" +LIBS="-ldnet $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2551 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +int main() { +dnet_ntoa() +; return 0; } +EOF +if { (eval echo configure:2562: \"$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 $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 +echo "configure:2584: 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_save_LIBS="$LIBS" +LIBS="-ldnet_stub $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2592 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +int main() { +dnet_ntoa() +; return 0; } +EOF +if { (eval echo configure:2603: \"$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 + + # msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT, + # to get the SysV transport functions. + # 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 dickey@clark.net. + echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 +echo "configure:2632: 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 <<EOF +#line 2637 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char gethostbyname(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + 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 +gethostbyname(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2660: \"$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 $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 +echo "configure:2681: 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_save_LIBS="$LIBS" +LIBS="-lnsl $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2689 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char gethostbyname(); + +int main() { +gethostbyname() +; return 0; } +EOF +if { (eval echo configure:2700: \"$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 -lnsl" +else + echo "$ac_t""no" 1>&6 +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@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:2730: 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 <<EOF +#line 2735 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char connect(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + 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 +connect(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2758: \"$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 $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 +echo "configure:2779: 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_save_LIBS="$LIBS" +LIBS="-lsocket $X_EXTRA_LIBS $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2787 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char connect(); + +int main() { +connect() +; return 0; } +EOF +if { (eval echo configure:2798: \"$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 + + # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. + echo $ac_n "checking for remove""... $ac_c" 1>&6 +echo "configure:2822: 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 <<EOF +#line 2827 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char remove(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + 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 +remove(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2850: \"$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 $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 +echo "configure:2871: 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_save_LIBS="$LIBS" +LIBS="-lposix $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2879 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char remove(); + +int main() { +remove() +; return 0; } +EOF +if { (eval echo configure:2890: \"$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 $ac_n "checking for shmat""... $ac_c" 1>&6 +echo "configure:2914: 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 <<EOF +#line 2919 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shmat(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + 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 +shmat(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2942: \"$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 $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 +echo "configure:2963: 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_save_LIBS="$LIBS" +LIBS="-lipc $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2971 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char shmat(); + +int main() { +shmat() +; return 0; } +EOF +if { (eval echo configure:2982: \"$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" + 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. + # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. + echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 +echo "configure:3015: 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 <<EOF +#line 3023 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char IceConnectionNumber(); + +int main() { +IceConnectionNumber() +; return 0; } +EOF +if { (eval echo configure:3034: \"$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" + +fi + + +test x$no_x = "xyes" && { echo "configure: error: Fluxbox 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 $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 +echo "configure:3070: 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_save_LIBS="$LIBS" +LIBS="-lX11 $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3078 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XOpenDisplay(); + +int main() { +XOpenDisplay() +; return 0; } +EOF +if { (eval echo configure:3089: \"$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 "$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 $ac_n "checking whether to build support for the XShape extension""... $ac_c" 1>&6 +echo "configure:3118: 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 + + +: ${enableval="yes"} +if test x$enableval = "xyes"; then + echo "$ac_t""yes" 1>&6 + echo $ac_n "checking for XShapeCombineShape in -lXext""... $ac_c" 1>&6 +echo "configure:3130: 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 <<EOF +#line 3138 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XShapeCombineShape(); + +int main() { +XShapeCombineShape() +; return 0; } +EOF +if { (eval echo configure:3149: \"$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:3165: checking for X11/extensions/shape.h" >&5 + cat > conftest.$ac_ext <<EOF +#line 3167 "configure" +#include "confdefs.h" +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> + +int main() { +long foo = ShapeSet +; return 0; } +EOF +if { (eval echo configure:3177: \"$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 "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 + +fi +rm -f conftest* + +else + echo "$ac_t""no" 1>&6 +fi + +else + echo "$ac_t""no" 1>&6 +fi + + +LIBS="$LIBS $Xext_lib" + +SLIT="" +echo $ac_n "checking whether to include the Slit""... $ac_c" 1>&6 +echo "configure:3203: 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 "$ac_t""yes" 1>&6 + SLIT="-DSLIT" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""yes" 1>&6 + SLIT="-DSLIT" + +fi + + + +NEWWMSPEC="" +echo $ac_n "checking whether to include the new WM Spec (DOES NOTHING)""... $ac_c" 1>&6 +echo "configure:3223: 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 "$ac_t""yes" 1>&6 + NEWWMSPEC="-DNEWWMSPEC" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""no" 1>&6 + +fi + + + + +INTERLACE="" +echo $ac_n "checking whether to include interlacing image code""... $ac_c" 1>&6 +echo "configure:3243: 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 "$ac_t""yes" 1>&6 + INTERLACE="-DINTERLACE" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""yes" 1>&6 + INTERLACE="-DINTERLACE" + +fi + + + +ORDEREDPSEUDO="" +echo $ac_n "checking whether to include Pseudocolor ordered dithering code""... $ac_c" 1>&6 +echo "configure:3263: 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 "$ac_t""yes" 1>&6 + ORDEREDPSEUDO="-DORDEREDPSEUDO" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""no" 1>&6 + +fi + + + +DEBUG="" +echo $ac_n "checking whether to include verbose debugging code""... $ac_c" 1>&6 +echo "configure:3282: 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 "$ac_t""yes" 1>&6 + DEBUG="-DDEBUG" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""no" 1>&6 + +fi + + + +NLS="" +echo $ac_n "checking whether to include NLS support""... $ac_c" 1>&6 +echo "configure:3301: 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 "$ac_t""yes" 1>&6 + NLS="-DNLS" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""yes" 1>&6 + NLS="-DNLS" + +fi + + + +echo $ac_n "checking for setlocale in -lxpg4""... $ac_c" 1>&6 +echo "configure:3320: 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_save_LIBS="$LIBS" +LIBS="-lxpg4 $LIBS" +cat > conftest.$ac_ext <<EOF +#line 3328 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char setlocale(); + +int main() { +setlocale() +; return 0; } +EOF +if { (eval echo configure:3339: \"$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. +set dummy $ac_prog; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3365: 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 + 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" +if test -n "$gencat_cmd"; then + echo "$ac_t""$gencat_cmd" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$gencat_cmd" && break +done + +if test x$gencat_cmd = "x"; then + NLS="" +fi + + +TIMEDCACHE="" +echo $ac_n "checking whether to use the new timed pixmap cache""... $ac_c" 1>&6 +echo "configure:3401: 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 "$ac_t""yes" 1>&6 + TIMEDCACHE="-DTIMEDCACHE" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""yes" 1>&6 + TIMEDCACHE="-DTIMEDCACHE" + +fi + + + +KDE="" +echo $ac_n "checking whether to have KDE slit support""... $ac_c" 1>&6 +echo "configure:3421: checking whether to have KDE slit support" >&5 +# Check whether --enable-kde or --disable-kde was given. +if test "${enable_kde+set}" = set; then + enableval="$enable_kde" + if test x$enableval = "xyes"; then + echo "$ac_t""yes" 1>&6 + KDE="-DKDE" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""no" 1>&6 + +fi + + + +GNOME="" +echo $ac_n "checking whether to have GNOME support""... $ac_c" 1>&6 +echo "configure:3440: checking whether to have GNOME support" >&5 +# Check whether --enable-gnome or --disable-gnome was given. +if test "${enable_gnome+set}" = set; then + enableval="$enable_gnome" + if test x$enableval = "xyes"; then + echo "$ac_t""yes" 1>&6 + GNOME="-DGNOME" + else + echo "$ac_t""no" 1>&6 + fi +else + echo "$ac_t""no" 1>&6 + +fi + + + +echo $ac_n "checking return type of signal handlers""... $ac_c" 1>&6 +echo "configure:3458: 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 <<EOF +#line 3463 "configure" +#include "confdefs.h" +#include <sys/types.h> +#include <signal.h> +#ifdef signal +#undef signal +#endif +#ifdef __cplusplus +extern "C" void (*signal (int, void (*)(int)))(int); +#else +void (*signal ()) (); +#endif + +int main() { +int i; +; return 0; } +EOF +if { (eval echo configure:3480: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_type_signal=void +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_type_signal=int +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_type_signal" 1>&6 +cat >> confdefs.h <<EOF +#define RETSIGTYPE $ac_cv_type_signal +EOF + + + +echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +echo "configure:3500: 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 "$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 + + + + +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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# 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. +# +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 \ + -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 + 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}' + +# 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[ ]*=[^:]*$/d' +fi + +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} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + 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 + +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/es_ES/Makefile +nls/et_EE/Makefile +nls/fr_FR/Makefile +nls/pt_BR/Makefile +nls/ru_RU/Makefile +nls/sv_SE/Makefile +nls/tr_TR/Makefile +nls/it_IT/Makefile +version.h config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > 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%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@build@%$build%g +s%@build_alias@%$build_alias%g +s%@build_cpu@%$build_cpu%g +s%@build_vendor@%$build_vendor%g +s%@build_os@%$build_os%g +s%@RANLIB@%$RANLIB%g +s%@LN_S@%$LN_S%g +s%@LIBTOOL@%$LIBTOOL%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%@DEBUG@%$DEBUG%g +s%@NLS@%$NLS%g +s%@gencat_cmd@%$gencat_cmd%g +s%@TIMEDCACHE@%$TIMEDCACHE%g +s%@KDE@%$KDE%g +s%@GNOME@%$GNOME%g +s%@MAINTAINER_MODE_TRUE@%$MAINTAINER_MODE_TRUE%g +s%@MAINTAINER_MODE_FALSE@%$MAINTAINER_MODE_FALSE%g +s%@MAINT@%$MAINT%g + +CEOF +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 + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile +src/Makefile +util/Makefile +data/Makefile +data/styles/Makefile +doc/Makefile +nls/Makefile +nls/C/Makefile +nls/da_DK/Makefile +nls/es_ES/Makefile +nls/et_EE/Makefile +nls/fr_FR/Makefile +nls/pt_BR/Makefile +nls/ru_RU/Makefile +nls/sv_SE/Makefile +nls/tr_TR/Makefile +nls/it_IT/Makefile +version.h"} +EOF +cat >> $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 + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # 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 "$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. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + 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 + + 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='\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='\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 <<EOF + CONFIG_HEADERS="config.h" +EOF +cat >> $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 + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + 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.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. + +rm -f conftest.tail +while : +do + 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 <<CEOF' >> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + 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.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 + # 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 + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <<EOF + + +EOF +cat >> $CONFIG_STATUS <<\EOF +test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h + +exit 0 +EOF +chmod +x $CONFIG_STATUS +rm -fr confdefs* $ac_clean_files +test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 +
A configure.in

@@ -0,0 +1,279 @@

+dnl configure.in for Fluxbox - created from configure.in Blackbox 0.61.1 +dnl Initialize autoconf and automake +AC_INIT(src/main.cc) +AM_INIT_AUTOMAKE(fluxbox,0.1.5,no-define) + +dnl Determine default prefix +test x$prefix = "xNONE" && prefix="$ac_default_prefix" + +dnl Check for various flavors of UNIX(r) +dnl AC_AIX +dnl AC_ISC_POSIX + +dnl TODO: do this +dnl AC_LANG_CPLUSPLUS + +dnl Locate required external software +AC_PROG_CC +AC_PROG_CXX +AC_PROG_INSTALL +AM_PROG_LIBTOOL + +AC_CHECK_PROGS(regex_cmd, sed) +if test x$regex_cmd = "x"; then + AC_MSG_ERROR([error. sed is required to build the data files.]) +fi + +dnl Check for system header files +AC_HEADER_STDC +AC_CHECK_HEADERS(errno.h 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) +AC_HEADER_TIME + +dnl Check for existance of basename(), setlocale() and strftime() +AC_CHECK_FUNCS(basename, , AC_CHECK_LIB(gen, basename, LIBS="$LIBS -lgen")) +AC_CHECK_FUNCS(getpid setlocale sigaction strftime strcasestr snprintf vsnprintf catopen catgets catclose) +AC_CHECK_LIB(nsl, t_open, LIBS="$LIBS -lnsl") +AC_CHECK_LIB(socket, socket, LIBS="$LIBS -lsocket") + +dnl Check for X headers and libraries +AC_PATH_X +AC_PATH_XTRA + +test x$no_x = "xyes" && AC_MSG_ERROR([Fluxbox requires the X Window System libraries and headers.]) + +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" + +dnl Check for required functions in -lX11 +AC_CHECK_LIB(X11, XOpenDisplay, + LIBS="$LIBS -lX11", + AC_MSG_ERROR([Could not find XOpenDisplay in -lX11.]) +) + +LIBS="$LIBS $X_EXTRA_LIBS" + +Xext_lib="" + +dnl Check for XShape extension support and proper library files. +SHAPE="" +AC_MSG_CHECKING([whether to build support for the XShape extension]) +AC_ARG_ENABLE( + shape, [ --enable-shape enable support of the XShape extension [default=yes]]) + +: ${enableval="yes"} +if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + AC_CHECK_LIB(Xext, XShapeCombineShape, + AC_MSG_CHECKING([for X11/extensions/shape.h]) + AC_TRY_LINK( +#include <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/extensions/shape.h> +, long foo = ShapeSet, + AC_MSG_RESULT([yes]) + SHAPE="-DSHAPE"; Xext_lib="-lXext", + AC_MSG_RESULT([no]) + ) + ) +else + AC_MSG_RESULT([no]) +fi +AC_SUBST(SHAPE) + +LIBS="$LIBS $Xext_lib" + +dnl Check for the Slit +SLIT="" +AC_MSG_CHECKING([whether to include the Slit]) +AC_ARG_ENABLE( + slit, [ --enable-slit include code for the Slit [default=yes]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + SLIT="-DSLIT" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([yes]) + SLIT="-DSLIT" +) +AC_SUBST(SLIT) + +dnl Check for the new WM Spec +NEWWMSPEC="" +AC_MSG_CHECKING([whether to include the new WM Spec (DOES NOTHING)]) +AC_ARG_ENABLE( + newspec, +[ --enable-newspec include code for the new WM Spec (DOES NOTHING) + [default=no]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + NEWWMSPEC="-DNEWWMSPEC" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([no]) +) +AC_SUBST(NEWWMSPEC) + + +dnl Check for Interlacing +INTERLACE="" +AC_MSG_CHECKING([whether to include interlacing image code]) +AC_ARG_ENABLE( + interlace, [ --enable-interlace include code for image interlacing [default=yes]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + INTERLACE="-DINTERLACE" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([yes]) + INTERLACE="-DINTERLACE" +) +AC_SUBST(INTERLACE) + +dnl Check for ordered 8bpp dithering +ORDEREDPSEUDO="" +AC_MSG_CHECKING([whether to include Pseudocolor ordered dithering code]) +AC_ARG_ENABLE(ordered-pseudo, +[ --enable-ordered-pseudo include code for ordered pseudocolor (8bpp) + dithering [default=no]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + ORDEREDPSEUDO="-DORDEREDPSEUDO" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([no]) +) +AC_SUBST(ORDEREDPSEUDO) + +dnl Check whether to include debugging code +DEBUG="" +AC_MSG_CHECKING([whether to include verbose debugging code]) +AC_ARG_ENABLE(debug, + [ --enable-debug include verbose debugging code [default=no]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + DEBUG="-DDEBUG" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([no]) +) +AC_SUBST(DEBUG) + +dnl Check whether to include natural language support (i18n) +NLS="" +AC_MSG_CHECKING([whether to include NLS support]) +AC_ARG_ENABLE(nls, + [ --enable-nls include natural language support [default=yes]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + NLS="-DNLS" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([yes]) + NLS="-DNLS" +) +AC_SUBST(NLS) + +AC_CHECK_LIB(xpg4, setlocale, LIBS="$LIBS -lxpg4") + +AC_CHECK_PROGS(gencat_cmd, gencat) +if test x$gencat_cmd = "x"; then + NLS="" +fi + + +dnl Check for new timed pixmap cache +TIMEDCACHE="" +AC_MSG_CHECKING([whether to use the new timed pixmap cache]) +AC_ARG_ENABLE( + timed-cache, +[ --enable-timed-cache use new timed pixmap cache [default=yes]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + TIMEDCACHE="-DTIMEDCACHE" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([yes]) + TIMEDCACHE="-DTIMEDCACHE" +) +AC_SUBST(TIMEDCACHE) + +dnl Check KDE +KDE="" +AC_MSG_CHECKING([whether to have KDE slit support]) +AC_ARG_ENABLE( + kde, +[ --enable-kde KDE slit support [default=no]], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + KDE="-DKDE" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([no]) +) +AC_SUBST(KDE) + +dnl Check GNOME +GNOME="" +AC_MSG_CHECKING([whether to have GNOME support]) +AC_ARG_ENABLE( + gnome, +[ --enable-gnome GNOME support [default=no] (DEVELOPMENT)], + if test x$enableval = "xyes"; then + AC_MSG_RESULT([yes]) + GNOME="-DGNOME" + else + AC_MSG_RESULT([no]) + fi, + AC_MSG_RESULT([no]) +) +AC_SUBST(GNOME) + +dnl Determine the return type of signal handlers +AC_TYPE_SIGNAL + +dnl Determine if maintainer portions of the Makefiles should be included. +AM_MAINTAINER_MODE + +dnl Print results +AC_MSG_RESULT([]) +AC_MSG_RESULT([ $PACKAGE version $VERSION configured successfully.]) +AC_MSG_RESULT([]) +AC_MSG_RESULT([Using '$prefix' for installation.]) +AC_MSG_RESULT([Using '$CXX' for C++ compiler.]) +AC_MSG_RESULT([Building with '$CXXFLAGS' for C++ compiler flags.]) +AC_MSG_RESULT([Building with '$LIBS' for linker flags.]) +AC_MSG_RESULT([]) + +dnl Output files +AM_CONFIG_HEADER(config.h) +AC_OUTPUT(Makefile +src/Makefile +util/Makefile +data/Makefile +data/styles/Makefile +doc/Makefile +nls/Makefile +nls/C/Makefile +nls/da_DK/Makefile +nls/es_ES/Makefile +nls/et_EE/Makefile +nls/fr_FR/Makefile +nls/pt_BR/Makefile +nls/ru_RU/Makefile +nls/sv_SE/Makefile +nls/tr_TR/Makefile +nls/it_IT/Makefile +version.h)
A data/Makefile.am

@@ -0,0 +1,16 @@

+# data/Makefile.am for Fluxbox - an X11 Window manager + +SUBDIRS = styles +CLEANFILES = menu menu.in menu.pre init +MAINTAINERCLEANFILES = Makefile.in +pkgdata_DATA = titlebar keys menu init +EXTRA_DIST= titlebar keys init.in generate_menu README.style README.menu README +all-local: menu init +distclean-local: + rm -f *\~ +init: init.in + @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," init.in > init +menu: generate_menu + ./generate_menu + @regex_cmd@ -e "s,\@VERSION\@,$(VERSION)," menu.in > menu.pre + @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," menu.pre > menu
A data/Makefile.in

@@ -0,0 +1,333 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Fluxbox - an X11 Window manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +SUBDIRS = styles +CLEANFILES = menu menu.in menu.pre init +MAINTAINERCLEANFILES = Makefile.in +pkgdata_DATA = titlebar keys menu init +EXTRA_DIST = titlebar keys init.in generate_menu README.style README.menu README +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DATA = $(pkgdata_DATA) + +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 --include-deps data/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-pkgdataDATA: $(pkgdata_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + @list='$(pkgdata_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(pkgdatadir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(pkgdatadir)/$$p; \ + fi; fi; \ + done + +uninstall-pkgdataDATA: + @$(NORMAL_UNINSTALL) + list='$(pkgdata_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(pkgdatadir)/$$p; \ + done + +# 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; \ + 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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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-pkgdataDATA +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: uninstall-pkgdataDATA +uninstall: uninstall-recursive +all-am: Makefile $(DATA) all-local +all-redirect: all-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + + +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 + -rm -f libtool + +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: uninstall-pkgdataDATA install-pkgdataDATA 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-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 init +distclean-local: + rm -f *\~ +init: init.in + @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," init.in > init +menu: generate_menu + ./generate_menu + @regex_cmd@ -e "s,\@VERSION\@,$(VERSION)," menu.in > menu.pre + @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," menu.pre > 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:
A data/README

@@ -0,0 +1,17 @@

+-- data/README for Blackbox 0.61.x - an X11 Window manager + +The data/ directory holds some menu and style (or theme) examples for Blackbox. +These are installed as system defaults, and are ALWAYS overwritten when +upgrading or otherwise re-installing Blackbox. Changes to them are +discouraged, because of this reason. + +In the data/ directory, you will find a file named `menu' and a directory +named `styles.' These are the system defaults that are installed when +Blackbox is built, and they are intended as examples on how to customize and +control the appearance of Blackbox. In the event that a user does not have +a defined menu and/or style, Blackbox falls back on the example menu and/or +styles included here. + +For information on creating/editing a menu, see the file README.menu. + +For information on creating/editing a style, see the file README.style.
A data/README.menu

@@ -0,0 +1,372 @@

+-- data/README.menu for Blackbox 0.61.x - an X11 Window manager + +Creating a user defined menu: +----------------------------- +Creating a menu for Blackbox requires a text editor of some sort. Familiarity +with your choice of text editor is assumed, since editor preference differs +as much (if not more than) window manager preference. + +First, we need to decide on a location for our custom menu. Your home +directory is the most logical solution, since you will most likely not have +write access anywhere else. You place the menu file in any directory, and +give it any name you choose, as we will later tell Blackbox the path or +location for this file. + +As an example, let's assume that my home directory is `/home/bhughes' (which it +is). I've decided to keep all my Blackbox related files in a directory named +`blackbox.' After creating the directory, I now have two options for creating +my new menu. I can either copy the system default (usually in +`/usr/local/share/Blackbox/menu') to this directory, or I can create a new +one from scratch. Let's do the latter, for the sake of completeness. + +I've decided to name the file `rootmenu.' I fire up my favorite text editor +and now have a clean file. So let's begin. + + +Menu syntax: +------------ +The menu syntax is very simple and very effective. There are upto three +fields in a menu line. They are of the form: + + [tag] (label or filename) {command or filename} + +The supported tags are as follows: + +[begin] (label for root menu) + + This tells Blackbox to start parsing the menu file. This tag is + required for Blackbox to parse your menu file. If it cannot find it, + the system default menu is used instead. + +[end] + + This tells Blackbox that it is at the end of a menu. This can either + be a submenu or the main root menu. There must be at least one + of these tags in your menu to correspond to the required [begin] tag. + +[exec] (label for command) {shell command} + + This tells Blackbox to insert a command item into the menu. When you + select the menu item from the menu, Blackbox runs `shell command.' + +[exit] (label for exit) + + This tells Blackbox to insert an item that shuts down and exits + Blackbox. Any open windows are reparented to the root window before + Blackbox exits. + +[include] (filename) + + This tells Blackbox to parse the file specified by `filename' inline + with the current menu. `filename' can be the full path to a file + (such as /usr/local/share/Blackbox/brueghel/stylesmenu) or it can + begin with `~/', which will be expanded into your home directory + (e.g. [include] (~/blackbox/stylesmenu) will include + /home/bhughes/blackbox/stylesmenu in my menu) + +[nop] (label - optional) + + This tells Blackbox to insert a non-operational item into the current + menu. This can be used to help format the menu into blocks or sections + if so desired (e.g. you could put all your ssh accounts together, add + a [nop] and then add all your telnet accounts together). [nop] does + accept a label, but it is not required, and a blank item will be used + if none is supplied. + +[style] (label) {filename} + + This tells Blackbox to read `filename' and apply the new textures, + colors and fonts to the current running session. The filename is + just like the [include] tag, it can be the full path to the file, + or it can be of the form `~/path/from/home/dir.' Blackbox also + re-reads the entire menu structure from disk, incase the menu has + changed. + +[submenu] (label) {title for menu - optional} + + This tells Blackbox to create and parse a new menu. This menu is + inserted as a submenu into the parent menu. These menus are parsed + recursively, so there is no limit to the number of levels or nested + submenus you can have. The title for the new menu is optional, if + none is supplied, the new menu's title is the same as the item label. + +[reconfig] (label) + + This tells Blackbox to reread the current style and menu files and + apply any changes. This is useful for creating a new style or theme, + as you don't have to constantly restart Blackbox every time you save + your style. + +[restart] (label) {shell command - optional} + + This tells Blackbox to restart. If `shell command' is supplied, it + shuts down and runs the command (which is commonly the name of another + window manager). If the command is omitted, Blackbox restarts itself. + +[workspaces] (label) + + This tells Blackbox to insert a "link" to the workspaces menu directly + into your menu. This is handy for those users who can't access the + workspace menu directly (e.g. if you don't have a 3 button mouse, it's + rather hard to middle click to show the workspace menu). This is a + "link" to the systems workspace menu, so multiple [workspaces] tags + will display the same workspace menu, so expect it to move around if + you do so. ;) + +[config] (label) + + This tells Blackbox to insert the ConfigMenu into your menu. From + this menu you can configure several options stored in your + ~/.blackboxrc, and the changes take effect immediately. + +Comments may be inserted on any line of the file, as long as the first +character on the line is a `#.' + +Also, in the labels/commands/filenames fields, you can escape any character +like so: + + [exec] (\(my cool\) \{XTERM\}) {\(xterm -T \\\"cool XTERM\\\"\)} + +Using `\\' inserts a literal back-slash into the label/command/filename field. + + +Putting it all together: +------------------------ +Alrighty, so let's see if we can understand the arcane incantation above. It +says we have to have a [begin] and an [end] tag, which create our menu and +give it a title. Let's do that first: + + + [begin] (Example \[Menu\]) + + [end] + +Simple enough. Now let's add some items to the list. We always want to have +access to a terminal emulator, be it a regular xterm or something else. +So we add the item to our menu, and it now looks like this: + +... +[begin] (Example \[Menu\]) +[exec] (xterm) {xterm -ls} +[end] +... + +Great! Now let's add us some items to run an irc client, netscape, xv and +some other common programs. This gives up this: + +... +[begin] (Example \[Menu\]) +[exec] (xterm) {xterm -ls} +[exec] (efnet irc) {xterm -e irc fnord irc.efnet.net} +[exec] (Netscape Navigator) {netscape} +[exec] (xv 3.10a) {xv} +[exec] (XEmacs) {xemacs} +[exec] (The GIMP) {gimp} +[exec] (Video Tune) {xvidtune} +[end] +... + +Whoa, wait a second. This menu file is beginning to look a little cluttered. +Not a problem, just like programmers indent and space their code, we can +do this with our menu file, so let's clean it up a bit: + +... +[begin] (Example \[Menu\]) + [exec] (xterm) {xterm -ls} + [exec] (efnet irc) {xterm -e irc fnord irc.efnet.net} + + [exec] (Netscape Navigator) {netscape} + [exec] (XEmacs) {xemacs} + + [exec] (xv 3.10a) {xv} + [exec] (The GIMP) {gimp} + + [exec] (Video Tune) {xvidtune} +[end] +... + +Ahh... now that looks a little better. Now we decide that we kind of like the +spacing in the file, and decide we want to apply it to the menu itself. Now +we take advantage of the [nop] tag: + +... +[begin] (Example \[Menu\]) + [exec] (xterm) {xterm -ls} + [exec] (efnet irc) {xterm -e irc fnord irc.efnet.net} + + [nop] + + [exec] (Netscape Navigator) {netscape} + [exec] (XEmacs) {xemacs} + + [nop] + + [exec] (xv 3.10a) {xv} + [exec] (The GIMP) {gimp} + + [nop] + + [exec] (Video Tune) {xvidtune} +[end] +... + +Now, let's create a submenu to put some items to change between all these +themes we downloaded from http://blackbox.themes.org/. Let's assume we +untarred the themes into the ~/.blackbox directory like the documentation on +the themes.org site recommends. + +... +[begin] (Example \[Menu\]) + [exec] (xterm) {xterm -ls} + [exec] (efnet irc) {xterm -e irc fnord irc.efnet.net} + + [nop] + + [exec] (Netscape Navigator) {netscape} + [exec] (XEmacs) {xemacs} + + [nop] + + [exec] (xv 3.10a) {xv} + [exec] (The GIMP) {gimp} + + [nop] + + [exec] (Video Tune) {xvidtune} + + [submenu] (Themes) {Themes from blackbox.themes.org} + [style] (Blackbox) {~/.blackbox/Styles/blackbox} + [style] (Blackbox II) {~/.blackbox/Styles/blackbox2} + [style] (Hardware) {~/.blackbox/Styles/hardware} + [style] (Nova) {~/.blackbox/Styles/nova} + [style] (Orbital) {~/.blackbox/Styles/orbital} + [style] (Orbital II) {~/.blackbox/Styles/orbital2} + [style] (Seething) {~/.blackbox/Styles/seething} + [style] (Zero) {~/.blackbox/Styles/zero} + [style] (Cold Fusion) {~/.blackbox/Styles/coldfusion} + [end] +[end] +... + +Even better. Now hold on a second, if we have our themes and styles in +~/.blackbox why do we have to have our menu in ~/blackbox? Answer: WE DON'T! +This is where the choice comes. Do we keep our stuff in two separate +directories? Do we put it all in one directory? That is up to you to decide. +I personally prefer to keep everything in one directory (but, I use ~/blackbox +and have been for a long, long time; long before blackbox.themes.org was +even thought of... and again that is *personal* preference, not a hard-fast +rule). + +Now that we've gotten a feel for the menu syntax, we decide to finish off our +menu. In addition to the styles we downloaded, we decide we also want to +keep a submenu for the default styles that came with Blackbox. All we need +to do is [include] the styles file from the share directory for Blackbox. +After putting everything together, we have: + + +... +# custom menu file for Blackbox + +[begin] (Example \[Menu\]) + [exec] (xterm) {xterm -ls} + [exec] (efnet irc) {xterm -e irc fnord irc.efnet.net} + + [nop] + + [exec] (Netscape Navigator) {netscape} + [exec] (XEmacs) {xemacs} + + [nop] + + [exec] (xv 3.10a) {xv} + [exec] (The GIMP) {gimp} + + [nop] + + [exec] (Video Tune) {xvidtune} + + [nop] (...) + + [submenu] (Themes) {Themes from blackbox.themes.org} + [style] (Blackbox) {~/.blackbox/Styles/blackbox} + [style] (Blackbox II) {~/.blackbox/Styles/blackbox2} + [style] (Hardware) {~/.blackbox/Styles/hardware} + [style] (Nova) {~/.blackbox/Styles/nova} + [style] (Orbital) {~/.blackbox/Styles/orbital} + [style] (Orbital II) {~/.blackbox/Styles/orbital2} + [style] (Seething) {~/.blackbox/Styles/seething} + [style] (Zero) {~/.blackbox/Styles/zero} + [style] (Cold Fusion) {~/.blackbox/Styles/coldfusion} + +# include the default style menu... this is assuming Blackbox was installed +# into /usr/local + + [nop] + + [include] (/usr/local/share/Blackbox/styles/stylesmenu) + [end] + + [workspaces] (Workspace list) + + [submenu] (Restart) {Restart which?} + [restart] (Blackbox) + +# let's also give us access to some other window managers + + [restart] (Window Maker) {wmaker} + [restart] (Enlightenment) {enlightenment} + [restart] (KWM) {kwm} + [restart] (TWM) {twm} + [end] + + [nop] (...) + + [reconfig] (Reconfigure) + [exit] (Quit!) +[end] +... + +And voila! our menu file is finished. Now we need to tell Blackbox to read +this menu file. We do this by editing the file ~/.blackboxrc. + +NOTE: your ~/.blackboxrc is auotmatically updated every time Blackbox restarts, +reconfigures, changes styles or exits. Changes to dynamic data like workspace +count, names, etc. is lost. About the only thing you can change and have it +preserved is the menu filename, which is what we are about to change. + +The format of ~/.blackboxrc is in the X resource database format (just like +~/.Xdefaults). Since the file is updated automatically, it may be full of +stuff or it may not even exist (especially if this is the first time we've +ran Blackbox). Don't worry if you have to create ~/.blackboxrc, Blackbox will +see the file the next time it starts. + +What we need to do is change the resource for the menu's filename. This is +done by changing (or adding) the line that looks like so: + +... +session.menuFile: /path/to/some/file +... + +If this resource exists, we change it. If it does not, we add it. Depending +on where we put the menu file, our new resource could look like this: + +... +session.menuFile: /home/bhughes/blackbox/rootmenu +... + +We save ~/.blackboxrc and then restart Blackbox (reconfiguring doesn't work, +we need Blackbox to completely shutdown and reread ALL of it's configuration +files, not just the ones that control colors/fonts/etc.) + +If we've done everything correctly, Blackbox restarts itself and our new menu +is now ready for use. If something doesn't work, read over the above example +again to make sure you didn't forget a step or leave out the necessary tags. + +Now that Blackbox has been told where to find it's menu, it does a little more. +Blackbox 0.51.x introduces automagic menu updates. As long as you never +change session.menuFile, you will never have to restart or reconfigure Blackbox +whenever you change your menu. Blackbox watches the timestamps on all the +files it reads to build your menu. If any of them change, they are reread and +your menu updated. This check is done everytime you open the root menu. Like +I said... it is a check, it doesn't reread the menu everytime, it just looks +at the modification time and rereads when it changes.
A data/README.style

@@ -0,0 +1,330 @@

+-- data/README.style for Blackbox 0.61.x - an X11 Window manager + +Creating a new style (aka "theme"): +----------------------------------- +After getting Blackbox up and running, the next thing you want to do is change +the colors/fonts/etc. on the screen. Blackbox uses a "style" to read its +configuration information. A style in Blackbox consists of X resources placed +in a file. Just like the menu file (see README.menu), the style file can be +put anywhere on the filesystem; as long as you have read access to the file, +Blackbox can use it. + +First, we need to decide where to put our style file, and what to name it. +I recommend using the naming scheme described on http://blackbox.themes.org/ +when creating styles. + +Let's get started. Let's put our new style into a file named `results.' +Following the themes.org naming scheme, this file will go into +.blackbox/Styles. Same as with the menu file, we use our favorite text editor +to create the new style. + +X resources consist of a key and a value. The key is constructed of several +smaller keys, delimited by a period (`.'). Keys may also contain a star (`*') +to serve as a wildcard, which means that one line of typed text will match +several keys. This is useful for styles that are based on one or two colors. + +Blackbox allows you to configure it's three main components: the toolbar, the +menus and the window decorations. Lets begin by creating a style for our +toolbar. + +First we need to define a "texture" for the toolbar and it's components. +Textures tell Blackbox how to mold or shape the colors we supply. + +A texture is comprised of the following elements: + + Raised / Sunken / Flat give the component a raised, sunken + or flat appearance (respectively) + + Solid / Gradient tell Blackbox whether to draw a solid + or gradiented texture + + Interlaced tells Blackbox to interlace a + gradient (and gradient ONLY) texture + + Bevel1 / Bevel2 tells Blackbox which type of bevel + to use. + +NOTE on Bevel1 / Bevel2: + +Bevel1 is the default bevel. The shading is placed on the edge of the image. +Bevel2 is an alternative. The shading is placed one pixel in from the edge +of the image. + +Now that we understand that, let's define the textures for the toolbar. The +toolbar has a main frame, buttons, two labels and a clock label. The buttons +have 2 states, so we provide textures for both the normal and the pressed +state. + +... +toolbar: Raised Diagonal Gradient Bevel1 +toolbar.button: Raised Diagonal Gradient Bevel1 +toolbar.button.pressed: Sunken Diagonal Interlaced Gradient Bevel1 +toolbar.clock: Flat Interlaced Gradient +toolbar.label: Flat Interlaced Gradient +... + +NOTE: the texture strings don't have to be capitalized like they did in +previous versions. They are still placed in capitals here, because things like +the bbtools still use the old method. + +Next we define colors for the textures. Colors can be any valid X colorname +(from the RGB database) or it can be a color specifier, as described by +'man 1 X.' + +Let's see how our file looks after adding colors: + +... +toolbar: Raised Diagonal Gradient Bevel1 +toolbar.button: Raised Diagonal Gradient Bevel1 +toolbar.button.pressed: Sunken Diagonal Interlaced Gradient Bevel1 +toolbar.clock: Flat Interlaced Gradient +toolbar.label: Flat Interlaced Gradient + +toolbar.color: rgb:8/8/7 +toolbar.colorTo: grey20 +toolbar.button.color: grey +toolbar.button.colorTo: grey20 +toolbar.button.pressed.color: rgb:4/4/38 +toolbar.button.pressed.colorTo: rgb:f/f/d +toolbar.clock.color: grey20 +toolbar.clock.colorTo: rgb:8/8/7 +toolbar.label.color: grey20 +toolbar.label.colorTo: rgb:8/8/7 +toolbar.textColor: grey85 +... + +As you have noticed, all textures have a color and a colorTo key. These keys +are required for gradient images. For solids, only color is needed. You will +also notice that we have supplied the color for the text on the toolbar. Not +all textures have a text color, just certain base textures. + +Next, let's move onto the menus. Since Blackbox was written in C++, all of +the menus used in it are subclasses of one generic base class. Blackbox reads +the style for the configuration for that base class, which applies to all +the menus used in Blackbox. + +The menu has two main parts, the title and the frame. There is nothing +visible under them, so we only configure these two components. The menu frame +and menu title BOTH have a configurable text color, and the menu frame has a +highlight color and the corresponding highlighted text color key. Let's assign +some textures and colors to our menu, and see what our style file looks like +so far: + +... +toolbar: Raised Diagonal Gradient Bevel1 +toolbar.button: Raised Diagonal Gradient Bevel1 +toolbar.button.pressed: Sunken Diagonal Interlaced Gradient Bevel1 +toolbar.clock: Flat Interlaced Gradient +toolbar.label: Flat Interlaced Gradient + +toolbar.color: rgb:8/8/7 +toolbar.colorTo: grey20 +toolbar.button.color: grey +toolbar.button.colorTo: grey20 +toolbar.button.pressed.color: rgb:4/4/38 +toolbar.button.pressed.colorTo: rgb:f/f/d +toolbar.clock.color: grey20 +toolbar.clock.colorTo: rgb:8/8/7 +toolbar.label.color: grey20 +toolbar.label.colorTo: rgb:8/8/7 +toolbar.textColor: grey85 + +menu.title: Raised Diagonal Interlaced Gradient Bevel1 +menu.frame: Raised Diagonal Gradient Bevel1 + +menu.title.color: grey20 +menu.title.colorTo: rgb:8/8/7 +menu.title.textColor: grey85 +menu.frame.color: rgb:8/8/7 +menu.frame.colorTo: grey10 +menu.frame.textColor: white +menu.frame.highlightColor: grey85 +menu.frame.hiTextColor: grey20 +... + +Next, we need to configure our windows. Windows are like buttons, they have +two states, focused and unfocused. There for we define a separate texture +for unfocused windows and focused windows. The buttons on the titlebar +are focus dependant also, so we need to configure them as well. The buttons +only have one "pressed" state, so we only have to define that once, instead of +having a focus.pressed state and an unfocus.pressed state. The window frame +is the thin border around the client window. Let's be sure to catch it as well. + +After adding the window config, our style now looks like this: + +... + +toolbar: Raised Diagonal Gradient Bevel1 +toolbar.button: Raised Diagonal Gradient Bevel1 +toolbar.button.pressed: Sunken Diagonal Interlaced Gradient Bevel1 +toolbar.clock: Flat Interlaced Gradient +toolbar.label: Flat Interlaced Gradient + +toolbar.color: rgb:8/8/7 +toolbar.colorTo: grey20 +toolbar.button.color: grey +toolbar.button.colorTo: grey20 +toolbar.button.pressed.color: rgb:4/4/38 +toolbar.button.pressed.colorTo: rgb:f/f/d +toolbar.clock.color: grey20 +toolbar.clock.colorTo: rgb:8/8/7 +toolbar.label.color: grey20 +toolbar.label.colorTo: rgb:8/8/7 +toolbar.textColor: grey85 + +menu.title: Raised Diagonal Interlaced Gradient Bevel1 +menu.frame: Raised Diagonal Gradient Bevel1 + +menu.title.color: grey20 +menu.title.colorTo: rgb:8/8/7 +menu.title.textColor: grey85 +menu.frame.color: rgb:8/8/7 +menu.frame.colorTo: grey10 +menu.frame.textColor: white +menu.frame.highlightColor: grey85 +menu.frame.hiTextColor: grey20 + +window.focus: Raised Diagonal Interlaced Gradient Bevel1 +window.focus.button: Raised Diagonal Gradient Bevel1 +window.unfocus: Raised Diagonal Gradient Bevel1 +window.unfocus.button: Sunken Diagonal Gradient Bevel1 +window.button.pressed: Flat Diagonal Interlaced Gradient +window.frame: Raised Solid Bevel1 + +window.focus.color: grey +window.focus.colorTo: grey20 +window.focus.textColor: grey85 +window.focus.button.color: grey +window.focus.button.colorTo: grey20 +window.unfocus.color: rgb:8/8/7 +window.unfocus.colorTo: grey20 +window.unfocus.textColor: grey +window.unfocus.button.color: grey20 +window.unfocus.button.colorTo: grey +window.button.pressed.color: rgb:4/4/38 +window.button.pressed.colorTo: rgb:f/f/d +window.frame.color: grey85 +... + +Now all we have to do is finish off the style with a few miscellanous options. +These include the title and menu fonts/justification, border color, bevel and +handle widths, window move style and the root command. + +Fonts must be a valid X11 font screen, or a valid font alias. Use a utility +like `xfontsel' (and others) to preview fonts. Also use the utility +`xlsfonts' to spit out all the current X font names and aliases stored in +the X server. + +Justification can be one of three things: LeftJustify, CenterJustify or +RightJustify. + +The border color is the color applied to the 1 pixel border around the menu +frame/title and the window titlebar/buttons/handle/etc. Setting this color +can have drastic effects on your style, so don't just leave it set to `black' +all the time. ;) + +The bevel and handle widths control the size and spacing of decorations in +Blackbox. The larger the number, the more space Blackbox takes up. + +The window move style tells Blackbox how to move windows when you drag them +with your mouse. There are two options for it: Opaque or Wire. + +The root command is the command run every time the style is loaded (either at +startup or after a reconfigure/style-change). It is used to run a program +like xv, Esetroot, wmsetbg, etc. to set an image/color/pattern on the root +window. Just supply a command and it will be run. + +Also, as a note, an X resource file can have comments. Precede the line with +and exclamation mark `!' and the rest of the line will be ignored. + +Let's finish off the details and take a look at our finished style: + +... +! Results - theme for Blackbox 0.51.x +! by Brad Hughes bhughes@tcac.net + +! define the toolbars textures... note that the interlaced option is new +! in 0.51.x +toolbar: Raised Diagonal Gradient Bevel1 +toolbar.button: Raised Diagonal Gradient Bevel1 +toolbar.button.pressed: Sunken Diagonal Interlaced Gradient Bevel1 +toolbar.clock: Flat Interlaced Gradient +toolbar.label: Flat Interlaced Gradient + +! toolbar colors +toolbar.color: rgb:8/8/7 +toolbar.colorTo: grey20 +toolbar.button.color: grey +toolbar.button.colorTo: grey20 +toolbar.button.pressed.color: rgb:4/4/38 +toolbar.button.pressed.colorTo: rgb:f/f/d +toolbar.clock.color: grey20 +toolbar.clock.colorTo: rgb:8/8/7 +toolbar.label.color: grey20 +toolbar.label.colorTo: rgb:8/8/7 +toolbar.textColor: grey85 + +! menu textures +menu.title: Raised Diagonal Interlaced Gradient Bevel1 +menu.frame: Raised Diagonal Gradient Bevel1 + +! menu colors +menu.title.color: grey20 +menu.title.colorTo: rgb:8/8/7 +menu.title.textColor: grey85 +menu.frame.color: rgb:8/8/7 +menu.frame.colorTo: grey10 +menu.frame.textColor: white +menu.frame.highlightColor: grey85 +menu.frame.hiTextColor: grey20 + +! window textures +window.focus: Raised Diagonal Interlaced Gradient Bevel1 +window.focus.button: Raised Diagonal Gradient Bevel1 +window.unfocus: Raised Diagonal Gradient Bevel1 +window.unfocus.button: Sunken Diagonal Gradient Bevel1 +window.button.pressed: Flat Diagonal Interlaced Gradient +window.frame: Raised Solid Bevel1 + +! window colors +window.focus.color: grey +window.focus.colorTo: grey20 +window.focus.textColor: grey85 +window.focus.button.color: grey +window.focus.button.colorTo: grey20 +window.unfocus.color: rgb:8/8/7 +window.unfocus.colorTo: grey20 +window.unfocus.textColor: grey +window.unfocus.button.color: grey20 +window.unfocus.button.colorTo: grey +window.button.pressed.color: rgb:4/4/38 +window.button.pressed.colorTo: rgb:f/f/d +window.frame.color: grey85 + +! misc... +borderColor: rgb:2/2/1c + +moveStyle: Opaque + +menuJustify: CenterJustify +titleJustify: CenterJustify + +bevelWidth: 2 +handleWidth: 4 + +menuFont: lucidasans-10 +titleFont: lucidasans-bold-10 + +rootCommand: bsetroot -mod 4 4 -fg rgb:6/6/5c -bg grey20 +... + +Alright! Our style is finished. Let's see how the sucker looks. First we +need to tell Blackbox to use the new style. The way to do that is to edit +your menu (refer to README.menu for this) and add: + +[style] (Results) {~/.blackbox/Styles/results} + +somewhere in our menu. Taking advantage of Blackbox 0.51.x's (and up) +automagic menu updates, all we have to do is close and reopen the root menu +and our new style entry will be visible. Select it and Blackbox will apply +the new style we just created.
A data/generate_menu

@@ -0,0 +1,232 @@

+# generate_menu for Fluxbox +# Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +# +# 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. + +#!/bin/sh + +FILENAME=menu.in + + +# Start of menu + +echo "[begin] (Fluxbox @VERSION@)" > $FILENAME + +if [ -x `which xterm` ]; then + echo " [exec] (xterm) {xterm -fg white -bg black}" >> $FILENAME +fi + +if [ -x `which nedit` ]; then + echo " [exec] (nedit) {nedit}" >> $FILENAME +fi + +echo "[submenu] (Browsers)" >> $FILENAME + if [ -x `which netscape` ]; then + echo " [exec] (netscape) {netscape}" >> $FILENAME + fi + if [ -x `which opera` ]; then + echo " [exec] (opera) {opera}" >> $FILENAME + fi + if [ -x `which galeon` ]; then + echo " [exec] (galeon) {galeon}" >> $FILENAME + fi + if [ -x `which mozilla` ]; then + echo " [exec] (mozilla) {mozilla}" >> $FILENAME + fi + if [ -x `which konqueror` ]; then + echo " [exec] (konqueror) {konqueror}" >> $FILENAME + fi +echo "[end]" >> $FILENAME + + +echo "[submenu] (Editors)" >> $FILENAME + if [ -x `which nedit` ]; then + echo " [exec] (nedit) {nedit}" >> $FILENAME + fi + if [ -x `which vim` ]; then + echo " [exec] (vim) {vim -g}" >> $FILENAME + fi + if [ -x `which xemacs` ]; then + echo " [exec] (xemacs) {xemacs}" >> $FILENAME + fi + if [ -x `which gedit` ]; then + echo " [exec] (gedit) {gedit}" >> $FILENAME + fi + if [ -x `which xedit` ]; then + echo " [exec] (xedit) {xedit}" >> $FILENAME + fi + if [ -x `which kword` ]; then + echo " [exec] (kword) {kword}" >> $FILENAME + fi + +echo "[end]" >> $FILENAME + +echo "[submenu] (Net)" >> $FILENAME + if [ -x `which realplay` ]; then + echo " [exec] (realplay) {realplay}" >> $FILENAME + fi + + if [ -x `which licq` ]; then + echo " [exec] (licq) {licq}" >> $FILENAME + fi + if [ -x `which xchat` ]; then + echo " [exec] (xchat) {xchat}" >> $FILENAME + fi + if [ -x `which sylpheed` ]; then + echo " [exec] (sylpheed) {sylpheed}" >> $FILENAME + fi + if [ -x `which gftp` ]; then + echo " [exec] (gftp) {gftp}" >> $FILENAME + fi + if [ -x `which BitchX` ]; then + echo " [exec] (BitchX) {xterm -title BitchX -fg white -bg black -e BitchX -N}" >> $FILENAME + else + if [ -x `which bitchx` ]; then + echo " [exec] (BitchX) {xterm -title BitchX -fg white -bg black -e bitchx -N}" >> $FILENAME + fi + fi + if [ -x `which ircii` ]; then + echo " [exec] (ircii) {xterm -title ircii -fg white -bg black -e ircii -s}" >> $FILENAME + fi +echo "[end]" >> $FILENAME + + +echo "[submenu] (Graphics)" >> $FILENAME + if [ -x `which gimp` ]; then + echo " [exec] (gimp) {gimp}" >> $FILENAME + fi + if [ -x `which xv` ]; then + echo " [exec] (xv) {xv}" >> $FILENAME + fi + if [ -x `which gqview` ]; then + echo " [exec] (gqview) {gqview}" >> $FILENAME + fi + if [ -x `which xpaint` ]; then + echo " [exec] (xpaint) {xpaint}" >> $FILENAME + fi +echo "[end]" >> $FILENAME + +echo "[submenu] (Music)" >> $FILENAME + if [ -x `which xmms` ]; then + echo " [exec] (xmms) {xmms}" >> $FILENAME + fi + if [ -x `which gqmpeg` ]; then + echo " [exec] (gqmpeg) {gqmpeg}" >> $FILENAME + fi + if [ -x `which xmixer` ]; then + echo " [exec] (xmixer) {xmixer}" >> $FILENAME + fi + if [ -x `which gmix` ]; then + echo " [exec] (gmix) {gmix}" >> $FILENAME + fi + if [ -x `which xplaycd` ]; then + echo " [exec] (xplaycd) {xplaycd}" >> $FILENAME + fi + if [ -x `which soundtracker` ]; then + echo " [exec] (soundtracker) {soundtracker}" >> $FILENAME + fi +echo "[end]" >> $FILENAME + +echo "[submenu] (Terminals)" >> $FILENAME + if [ -x `which xterm` ]; then + echo " [exec] (xterm) {xterm -fg white -bg black}" >> $FILENAME + fi + if [ -x `which gnome-terminal` ]; then + echo " [exec] (gnome-terminal) {gnome-terminal}" >> $FILENAME + fi + if [ -x `which Eterm` ]; then + echo " [exec] (Eterm) {Eterm}" >> $FILENAME + fi + if [ -x `which konsole` ]; then + echo " [exec] (konsole) {konsole}" >> $FILENAME + fi + if [ -x `which aterm` ]; then + echo " [exec] (aterm) {aterm}" >> $FILENAME + fi + if [ -x `which rxvt` ]; then + echo " [exec] (rxvt) {rxvt}" >> $FILENAME + fi +echo "[end]" >> $FILENAME + + +echo "[submenu] (Misc)" >> $FILENAME + if [ -x `which acroread` ]; then + echo " [exec] (acroread) {acroread}" >> $FILENAME + fi + if [ -x `which gcalc` ]; then + echo " [exec] (gcalc) {gcalc}" >> $FILENAME + fi + if [ -x `which xgdb` ]; then + echo " [exec] (xgdb) {xgdb}" >> $FILENAME + fi + if [ -x `which ddd` ]; then + echo " [exec] (ddd) {ddd}" >> $FILENAME + fi + if [ -x `which xterm` ]; then + echo " [exec] (tail access_log) {xterm -fg white -bg black -title access_log -e tail -f /var/log/access_log}" >> $FILENAME + fi +echo "[end]" >> $FILENAME + +echo "[submenu] (X utils)" >> $FILENAME + if [ -x `which xpenguins` ]; then + echo " [exec] (xpenguins) {xpenguins}" >> $FILENAME + fi + if [ -x `which xcalc` ]; then + echo " [exec] (xcalc) {xcalc}" >> $FILENAME + fi + if [ -x `which xfontsel` ]; then + echo " [exec] (xfontsel) {xfontsel}" >> $FILENAME + fi + if [ -x `which xman` ]; then + echo " [exec] (xman) {xman}" >> $FILENAME + fi + if [ -x `which xload` ]; then + echo " [exec] (xload) {xload}" >> $FILENAME + fi + if [ -x `which xfig` ]; then + echo " [exec] (xfig) {xfig}" >> $FILENAME + fi + if [ -x `which xbiff` ]; then + echo " [exec] (xbiff) {xbiff}" >> $FILENAME + fi + if [ -x `which editres` ]; then + echo " [exec] (editres) {editres}" >> $FILENAME + fi + if [ -x `which viewres` ]; then + echo " [exec] (viewres) {viewres}" >> $FILENAME + fi + if [ -x `which xsnow` ]; then + echo " [exec] (xsnow) {xsnow}" >> $FILENAME + fi + if [ -x `which xclock` ]; then + echo " [exec] (xclock) {xclock}" >> $FILENAME + fi +echo "[end]" >> $FILENAME + + +echo "[workspaces] (Workspace List)" >> $FILENAME +echo "[submenu] (Styles) {Choose a style...}" >> $FILENAME +echo "[stylesdir] (@pkgdatadir@/styles)" >> $FILENAME +echo "[end]" >> $FILENAME +echo "[config] (Configuration)" >> $FILENAME +echo "[reconfig] (Reconfigure)" >> $FILENAME +echo "[restart] (Restart)" >> $FILENAME +echo "[exit] (Exit)" >> $FILENAME + +echo "[end]" >> $FILENAME
A data/init.in

@@ -0,0 +1,36 @@

+session.screen0.slit.placement: BottomRight +session.screen0.slit.direction: Vertical +session.screen0.slit.onTop: False +session.screen0.slit.autoHide: False +session.screen0.tab.placement: Top +session.screen0.tab.alignment: Left +session.screen0.tab.rotatevertical: True +session.screen0.toolbar.onTop: False +session.screen0.toolbar.autoHide: False +session.screen0.toolbar.placement: BottomCenter +session.screen0.toolbar.widthPercent: 66 +session.screen0.workspaceNames: one,two,three,four +session.screen0.strftimeFormat: %I:%M %p +session.screen0.focusNewWindows: True +session.screen0.focusModel: ClickToFocus +session.screen0.fullMaximization: False +session.screen0.edgeSnapThreshold: 0 +session.screen0.rowPlacementDirection: LeftToRight +session.screen0.workspaces: 4 +session.screen0.focusLastWindow: True +session.screen0.colPlacementDirection: TopToBottom +session.screen0.windowPlacement: RowSmartPlacement +session.opaqueMove: False +session.autoRaiseDelay: 250 +session.menuFile: @pkgdatadir@/menu +session.cacheLife: 5 +session.styleFile: @pkgdatadir@/styles/Clean +session.titlebarFile: @pkgdatadir@/titlebar +session.keyFile: @pkgdatadir@/keys +session.colorsPerChannel: 4 +session.doubleClickInterval: 250 +session.cacheMax: 200 +session.imageDither: True +session.iconbar: true +session.tab.width: 64 +session.tab.height: 16
A data/keys

@@ -0,0 +1,14 @@

+Mod1 Tab :NextWindow +Mod1 Shift Tab :PrevWindow +Mod1 F1 :Workspace1 +Mod1 F2 :Workspace2 +Mod1 F3 :Workspace3 +Mod1 F4 :Workspace4 +Mod1 F5 :Workspace5 +Mod1 F6 :Workspace6 +Mod1 F7 :Workspace7 +Mod1 F8 :Workspace8 +Mod1 F9 :Workspace9 +Mod1 F10 :Workspace10 +Mod1 F11 :Workspace11 +Mod1 F12 :Workspace12
A data/styles/Artwiz

@@ -0,0 +1,109 @@

+toolbar: raised gradient vertical +toolbar.color: rgb:80/84/88 +toolbar.colorTo: rgb:30/34/38 + +toolbar.button: raised gradient diagonal +toolbar.button.color: rgb:90/94/98 +toolbar.button.colorTo: rgb:20/24/28 +toolbar.button.picColor: white + +toolbar.button.pressed: sunken gradient diagonal +toolbar.button.pressed.color: black +toolbar.button.pressed.colorTo: rgb:80/98/d0 + +toolbar.clock: sunken gradient diagonal +toolbar.clock.color: rgb:10/20/30 +toolbar.clock.colorTo: rgb:70/80/90 +toolbar.clock.textColor: white + +toolbar.label: sunken gradient diagonal +toolbar.label.color: rgb:10/20/30 +toolbar.label.colorTo: rgb:70/80/90 +toolbar.label.textColor: white + +toolbar.windowLabel: sunken gradient diagonal +toolbar.windowLabel.color: rgb:10/20/30 +toolbar.windowLabel.colorTo: rgb:70/80/90 +toolbar.windowLabel.textColor: white + +toolbar.justify: center + + +menu.title: raised gradient diagonal +menu.title.color: rgb:90/94/98 +menu.title.colorTo: rgb:20/24/28 +menu.title.textColor: white +menu.title.justify: center + +menu.frame: sunken gradient diagonal +menu.frame.color: rgb:10/20/30 +menu.frame.colorTo: rgb:70/80/90 +menu.frame.textColor: rgb:90/a0/b0 +menu.frame.justify: center + +menu.hilite: raised gradient diagonal +menu.hilite.color: rgb:90/94/98 +menu.hilite.colorTo: rgb:20/24/28 +menu.hilite.textColor: white + +menu.bullet: empty +menu.bullet.position: right + + +window.title.focus: raised gradient vertical +window.title.focus.color: rgb:80/84/88 +window.title.focus.colorTo: rgb:30/34/38 +window.title.unfocus: raised vertical gradient +window.title.unfocus.color: rgb:50/54/58 +window.title.unfocus.colorTo: black + +window.label.focus: sunken diagonal gradient +window.label.focus.color: rgb:10/20/30 +window.label.focus.colorTo: rgb:70/80/90 +window.label.focus.textColor: white +window.label.unfocus: sunken gradient diagonal +window.label.unfocus.color: black +window.label.unfocus.colorTo: rgb:40/50/60 +window.label.unfocus.textColor: rgb:60/64/68 + +window.button.focus: raised gradient diagonal +window.button.focus.color: rgb:90/94/98 +window.button.focus.colorTo: rgb:20/24/28 +window.button.focus.picColor: white +window.button.unfocus: raised gradient diagonal +window.button.unfocus.color: rgb:50/54/58 +window.button.unfocus.colorTo: black +window.button.unfocus.picColor: rgb:70/74/78 +window.button.pressed: sunken gradient diagonal +window.button.pressed.color: rgb:20/40/50 +window.button.pressed.colorTo: rgb:60/70/80 + +window.frame.focusColor: rgb:40/44/48 +window.frame.unfocusColor: rgb:20/24/28 + +window.handle.focus: raised gradient diagonal +window.handle.focus.color: rgb:70/74/78 +window.handle.focus.colorTo: rgb:40/44/48 +window.handle.unfocus: raised gradient diagonal +window.handle.unfocus.color: rgb:50/54/58 +window.handle.unfocus.colorTo: black + +window.grip.focus: sunken diagonal gradient +window.grip.focus.color: rgb:20/30/40 +window.grip.focus.colorTo: rgb:60/70/80 +window.grip.unfocus: sunken diagonal gradient +window.grip.unfocus.color: black +window.grip.unfocus.colorTo: rgb:30/40/50 + +window.justify: center + + +borderColor: black + +bevelWidth: 2 +borderWidth: 1 +handleWidth: 5 + +rootCommand: bsetroot -mod 4 4 -bg rgb:10/18/20 -fg rgb:30/38/40 + +*Font: -*-lucidatypewriter-medium-r-*-*-*-100-*-*-*-*-*-*
A data/styles/Blue

@@ -0,0 +1,145 @@

+! Blue for Fluxbox by Fluxgen +! http://fluxbox.sourceforge.net +! Oct 31 2001 + +! Miscellaneous settings... +style.name: Blue +style.author: Henrik Kinnunen +style.date: Wed Oct 31 2001 +style.credits: +style.comments: + + +! Toolbar settings... +toolbar.button: Raised Bevel1 Gradient Diagonal +toolbar.button.color: gray +toolbar.button.colorTo: gray +toolbar.button.picColor: black + +toolbar.button.pressed: Sunken Bevel1 Gradient Diagonal +toolbar.button.pressed.color: gray +toolbar.button.pressed.colorTo: gray + +toolbar.label: parentrelative +toolbar.label.color: gray +toolbar.label.textColor: black + +toolbar.windowLabel: Sunken Bevel1 Gradient PipeCross +toolbar.windowLabel.color: gray +toolbar.windowLabel.colorTo: gray +toolbar.windowLabel.textColor: black + +toolbar.clock: Sunken +toolbar.clock.color: gray +toolbar.clock.textColor: #000000 + +toolbar: Sunken Bevel1 Gradient Pyramid +toolbar.color: gray +toolbar.colorTo: gray +toolbar.textColor: black +toolbar.justify: Center + + +! Menu settings... +menu.frame: Flat Gradient Vertical +menu.frame.color: lightblue +menu.frame.colorTo: blue +menu.frame.textColor: #000000 +menu.frame.justify: Left + +menu.title: Raised Bevel1 Gradient CrossDiagonal +menu.title.font: -adobe-helvetica-bold-r-normal--12-* +menu.title.color: Lightblue +menu.title.colorTo: blue +menu.title.textColor: black +menu.title.justify: center + +menu.hilite: Sunken Bevel1 Gradient PipeCross +menu.hilite.color: #7f7f7f +menu.hilite.colorTo: #FFFFFF +menu.hilite.textColor: #000000 + +menu.bullet: Triangle +menu.bullet.position: Right +menu.frame.disableColor: #ffffff + +! Window settings... +window.button.focus: Raised Bevel1 Gradient Elliptic +window.button.focus.color: #9d9d9d +window.button.focus.colorTo: #535353 +window.button.focus.picColor: #000000 + +window.button.unfocus: Flat Gradient Diagonal +window.button.unfocus.color: #5e5e5e +window.button.unfocus.colorTo: #414141 +window.button.unfocus.picColor: #000000 + +window.grip.focus: Raised Bevel2 Gradient Rectangle +window.grip.focus.color: Lightblue +window.grip.focus.colorTo: Lightblue + +window.grip.unfocus: Flat Gradient Vertical +window.grip.unfocus.color: DarkBlue +window.grip.unfocus.colorTo: DarkBlue + +window.handle.focus: Raised Bevel1 Gradient Rectangle +window.handle.focus.color: LightBlue +window.handle.focus.colorTo: Blue + +window.handle.unfocus: Flat Gradient Vertical +window.handle.unfocus.color: DarkBlue +window.handle.unfocus.colorTo: DarkBlue + +window.label.focus: parentrelative +window.label.focus.color: blue +window.label.focus.colorTo: blue +window.label.focus.textColor: black +window.label.focus.justify: Left + +window.font: -adobe-helvetica-bold-r-normal--12-* +window.justify: Left +window.label.unfocus: Sunken Bevel1 Solid Diagonal +window.label.unfocus.color: #70707F +window.label.unfocus.colorTo: #ffffff +window.label.unfocus.textColor: white + +window.title.focus: Raised Bevel1 Gradient CrossDiagonal +window.title.focus.color: Lightblue +window.title.focus.colorTo: blue + +window.title.unfocus: Raised Bevel2 Gradient Vertical +window.title.unfocus.color: #4d4d4d +window.title.unfocus.colorTo: #55484e +! ----------- tab +window.tab.font: -adobe-helvetica-bold-r-normal--10-* +window.tab.justify: Left +window.tab.label.unfocus: Sunken Bevel1 Solid Diagonal +window.tab.label.unfocus.color: DarkBlue +window.tab.label.unfocus.colorTo: black +window.tab.label.unfocus.textColor: Lightblue +window.tab.label.focus: Raised Bevel1 Gradient CrossDiagonal +window.tab.label.focus.color: LightBlue +window.tab.label.focus.colorTo: blue +window.tab.label.focus.textColor: black +window.tab.borderWidth: 1 +window.tab.borderColor: black +! ----------- + + + +window.button.pressed: Raised Bevel2 Gradient Diagonal +window.button.pressed.color: #000000 +window.button.pressed.colorTo: #808080 + +window.frame.focusColor: #4f4f4f +window.frame.unfocusColor: #000000 +handleWidth: 4 +frameWidth: 1 +bevelWidth: 1 +borderWidth: 1 +borderColor: blue + + +rootCommand: bsetroot -gradient flatverticalgradient -from lightblue -to blue + +*Font: -adobe-helvetica-medium-r-normal--12-*
A data/styles/Carbondioxide

@@ -0,0 +1,135 @@

+# carbondioxide. +# A fluxbox theme by skypher. +# 2001. + +toolbar: Raised Gradient Veritcal +toolbar.color: rgb:85/85/85 +toolbar.colorTo: rgb:FF/FF/FF + +toolbar.button: Raised Gradient Horizontal +toolbar.button.color: rgb:85/85/85 +toolbar.button.colorTo: rgb:FF/FF/FF +toolbar.button.picColor: rgb:00/00/00 + +toolbar.button.pressed: Sunken Horizontal +toolbar.button.pressed.color: rgb:70/70/70 + +toolbar.clock: Sunken Gradient Vertical +toolbar.clock.color: rgb:85/85/85 +toolbar.clock.colorTo: rgb:FF/FF/FF +toolbar.clock.textColor: rgb:00/00/00 + +toolbar.label: Sunken Gradient Vertical +toolbar.label.color: rgb:85/85/85 +toolbar.label.colorTo: rgb:FF/FF/FF +toolbar.label.textColor: rgb:10/10/10 + +toolbar.windowLabel: Raised Gradient Vertical +toolbar.windowLabel.color: rgb:85/85/85 +toolbar.windowLabel.colorTo: rgb:FF/FF/FF +toolbar.windowLabel.textColor: rgb:00/00/00 + +toolbar.justify: right + +menu.title: Gradient Horizontal Interlaced +menu.title.color: rgb:FF/FF/FF +menu.title.colorTo: rgb:85/85/85 +menu.title.textColor: rgb:00/00/00 +menu.title.justify: Center + +menu.frame: Sunken Gradient +menu.frame.color: rgb:70/70/70 +menu.frame.colorTo: rgb:FF/FF/FF +menu.frame.textColor: rgb:10/10/10 +menu.frame.justify: Left + +menu.hilite: Gradient +menu.hilite.color: rgb:10/10/10 +menu.hilite.colorTo: rgb:42/42/42 +menu.hilite.textColor: rgb:FF/FF/FF + +menu.bullet: Diamond +menu.bullet.position: Right + +window.title.focus: Raised Gradient Vertical Interlaced +window.title.focus.color: rgb:FF/FF/FF +window.title.focus.colorTo: rgb:85/85/85 +window.title.unfocus: Raised Gradient Vertical Interlaced +window.title.unfocus.color: rgb:70/70/70 +window.title.unfocus.colorTo: rgb:85/85/85 + +window.label.focus: Flat Gradient Vertical Interlaced +window.label.focus.color: rgb:FF/FF/FF +window.label.focus.colorTo: rgb:85/85/85 +window.label.focus.textColor: rgb:00/00/00 +window.label.unfocus: Flat Gradient Vertical Interlaced +window.label.unfocus.color: rgb:70/70/70 +window.label.unfocus.colorTo: rgb:85/85/85 +window.label.unfocus.textColor: rgb:10/10/10 + +# nedan ej klart. +window.button.focus: Raised Gradient Diagonal +window.button.focus.color: rgb:9B/9B/9B +window.button.focus.colorTo: rgb:42/42/42 +window.button.focus.picColor: rgb:E2/E2/E2 +window.button.unfocus: Raised Gradient Diagonal +window.button.unfocus.color: rgb:9B/9B/9B +window.button.unfocus.colorTo: rgb:42/42/42 +window.button.unfocus.picColor: rgb:C1/C1/C1 +window.button.pressed: Sunken Gradient Diagonal +window.button.pressed.color: rgb:9B/9B/9B +window.button.pressed.colorTo: rgb:42/42/42 + +window.frame.focus: Sunken +window.frame.focus.color: rgb:89/89/89 +window.frame.unfocus: Sunken +window.frame.unfocus.color: rgb:68/68/68 + +window.handle.focus: Raised Gradient Diagonal +window.handle.focus.color: rgb:66/66/66 +window.handle.focus.colorTo: rgb:66/66/68 +window.handle.unfocus: Raised Gradient Diagonal +window.handle.unfocus.color: rgb:66/66/66 +window.handle.unfocus.colorTo: rgb:60/60/60 + +window.grip.focus: Raised Gradient Diagonal Interlaced +window.grip.focus.color: rgb:FF/FF/FF +window.grip.focus.colorTo: rgb:85/85/85 +window.grip.unfocus: Raised Gradient Diagonal +window.grip.unfocus.color: rgb:70/70/70 +window.grip.unfocus.colorTo: rgb:85/85/85 + +! ----------- tab - explicit for fluxbox, the best wm out there[tm] (; +window.tab.justify: Left +window.tab.label.unfocus: Flat Gradient Vertical +window.tab.label.unfocus.color: rgb:70/70/70 +window.tab.label.unfocus.colorTo: rgb:85/85/85 +window.tab.label.unfocus.textColor: rgb:15/15/15 +window.tab.label.focus: Flat Gradient Vertical +window.tab.label.focus.color: rgb:FF/FF/FF +window.tab.label.focus.colorTo: rgb:85/85/85 +window.tab.label.focus.textColor: black +window.tab.borderWidth: 1 +window.tab.borderColor: rgb:10/10/10 +! ----------- (fluxbox.sourceforge.net) +window.tab.font: snap + +window.justify: Center + +toolbar.font: snap +window.font: snap +menu.title.font: -*-lucida-medium-r-*-*-*-100-*-*-*-*-*-* +menu.frame.font: -*-lucida-medium-r-*-*-*-100-*-*-*-*-*-* + +#toolbar.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-* +#window.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-* +#menu.title.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-* +#menu.frame.font: -*-lucida-medium-r-*-*-*-100-*-*-*-*-*-* + +borderColor: rgb:00/00/00 + +bevelWidth: 2 +borderWidth: 1 +handleWidth: 3 + +rootCommand: bsetroot -gradient flatverticalgradient -from black -to white
A data/styles/Clean

@@ -0,0 +1,117 @@

+# "Clean" +# A Fluxbox theme by: skypher of perplexity +# 2001 + +toolbar: Interlaced +toolbar.color: rgb:CC/CC/CC + +toolbar.button: Raised +toolbar.button.color: rgb:CC/CC/CC +toolbar.button.picColor: rgb:10/10/10 + +toolbar.button.pressed: Sunken +toolbar.button.pressed.color: rgb:80/80/80 + +toolbar.clock: Raised +toolbar.clock.color: rgb:CC/CC/CC +toolbar.clock.textColor: rgb:10/10/10 + +toolbar.label: Raised +toolbar.label.color: rgb:CC/CC/CC +toolbar.label.textColor: rgb:10/10/10 + +toolbar.windowLabel: Raised +toolbar.windowLabel.color: rgb:CC/CC/CC +toolbar.windowLabel.textColor: rgb:10/10/10 + +toolbar.justify: right + +menu.title: Raised Gradient Horizontal Interlaced +menu.title.color: rgb:90/BB/CC +menu.title.colorTo: rgb:CA/CD/CF +menu.title.textColor: rgb:10/10/10 +menu.title.justify: Right + +menu.frame: Gradient PipeCross +menu.frame.color: rgb:CC/CC/CD +menu.frame.colorTo: rgb:CA/CD/CE +menu.frame.textColor: rgb:10/10/10 +menu.frame.justify: Right + +menu.hilite: Raised +menu.hilite.color: rgb:40/40/40 +menu.hilite.textColor: rgb:CC/CC/CC + +menu.bullet: Diamond +menu.bullet.position: Right + + +window.title.focus: Raised Interlaced +window.title.focus.color: rgb:CC/CC/CD + +window.title.unfocus: Flat Solid +window.title.unfocus.color: rgb:BE/BE/BE + +window.label.focus: Solid Interlaced Flat +window.label.focus.color: rgb:CA/CA/CB +window.label.focus.textColor: rgb:10/10/10 + +window.label.unfocus: Flat Solid +window.label.unfocus.color: rgb:BE/BE/BE +window.label.unfocus.textColor: rgb:09/09/09 + +window.button.focus: Raised Bevel1 Solid +window.button.focus.color: rgb:CC/CC/CC +window.button.focus.picColor: rgb:10/10/10 + +window.button.unfocus: Flat Solid +window.button.unfocus.color: rgb:CA/CA/CA +window.button.unfocus.picColor: rgb:09/09/09 + +window.button.pressed: Sunken Bevel1 Solid +window.button.pressed.color: rgb:80/80/80 + +window.frame.focus: Flat +window.frame.focus.color: rgb:CC/CC/CC +window.frame.unfocus: Flat +window.frame.unfocus.color: rgb:BE/BE/BE + +window.handle.focus: Raised Solid +window.handle.focus.color: rgb:CC/CC/CC +window.handle.unfocus: Flat Solid +window.handle.unfocus.color: rgb:BC/BC/BC + +window.grip.focus: Raised Gradient Diagonal Interlaced +window.grip.focus.color: rgb:9B/9B/9B +window.grip.focus.colorTo: rgb:80/80/80 +window.grip.unfocus: Raised Gradient Diagonal +window.grip.unfocus.color: rgb:9B/9B/9B +window.grip.unfocus.colorTo: rgb:80/80/80 + +! ----------- tab - explicit for fluxbox, the best wm out there[tm] (; +window.tab.justify: Right +window.tab.label.unfocus: Flat Solid +window.tab.label.unfocus.color: rgb:AC/AC/AC +window.tab.label.unfocus.textColor: black +window.tab.label.focus: Raised Solid +window.tab.label.focus.color: rgb:CC/CC/CC +window.tab.label.focus.textColor: black +window.tab.borderWidth: 1 +window.tab.borderColor: rgb:10/10/10 +! ----------- (fluxbox.sourceforge.net) +window.tab.font: -*-lucidatypewriter-medium-r-normal-*-10-100-75-75-m-60-iso8859-1 + +window.justify: Right + +toolbar.font: -*-lucidatypewriter-medium-r-normal-*-10-100-75-75-m-60-iso8859-1 +window.font: -misc-8x8\ system\ font-medium-r-normal--9-90-100-100-m-100-iso8859-1 +menu.title.font: -*-lucidatypewriter-medium-r-normal-*-10-100-75-75-m-60-iso8859-1 +menu.frame.font: -*-lucida-medium-r-normal-*-10-100-*-*-*-*-iso8859-1 + +borderColor: rgb:10/10/10 + +bevelWidth: 1 +borderWidth: 1 +handleWidth: 2 + +rootCommand: bsetroot -solid rgb:9A/9A/90
A data/styles/CleanColor

@@ -0,0 +1,120 @@

+# "Clean Color" +# A Fluxbox theme by: skypher of perplexity +# 2001 + +toolbar: Interlaced +toolbar.color: rgb:CC/CC/CC + +toolbar.button: Raised +toolbar.button.color: rgb:CC/CC/CC +toolbar.button.picColor: rgb:10/10/10 + +toolbar.button.pressed: Sunken +toolbar.button.pressed.color: rgb:80/80/80 + +toolbar.clock: Raised +toolbar.clock.color: rgb:CC/CC/CC +toolbar.clock.textColor: rgb:10/10/10 + +toolbar.label: Raised +toolbar.label.color: rgb:CC/CC/CC +toolbar.label.textColor: rgb:10/10/10 + +toolbar.windowLabel: Raised +toolbar.windowLabel.color: rgb:CC/CC/CC +toolbar.windowLabel.textColor: rgb:10/10/10 + +toolbar.justify: right + +menu.title: Raised Gradient Horizontal Interlaced +menu.title.color: rgb:90/BB/CC +menu.title.colorTo: rgb:CA/CD/CF +menu.title.textColor: rgb:10/10/10 +menu.title.justify: Right + +menu.frame: Gradient PipeCross +menu.frame.color: rgb:CC/CC/CD +menu.frame.colorTo: rgb:CA/CD/CE +menu.frame.textColor: rgb:10/10/10 +menu.frame.justify: Right + +menu.hilite: Raised +menu.hilite.color: rgb:40/40/40 +menu.hilite.textColor: rgb:CC/CC/CC + +menu.bullet: Diamond +menu.bullet.position: Right + + +window.title.focus: Raised Interlaced Gradient Horizontal +window.title.focus.color: rgb:90/BB/CC +window.title.focus.colorTo: rgb:CA/CD/CF + +window.title.unfocus: Flat Solid +window.title.unfocus.color: rgb:BE/BE/BE + +window.label.focus: Gradient Horizontal Flat +window.label.focus.color: rgb:90/BB/CC +window.label.focus.colorTo: rgb:CA/CD/CF +window.label.focus.textColor: rgb:10/10/10 + +window.label.unfocus: Flat Solid +window.label.unfocus.color: rgb:BE/BE/BE +window.label.unfocus.textColor: rgb:09/09/09 + +window.button.focus: Raised Bevel1 Solid +window.button.focus.color: rgb:CC/CC/CC +window.button.focus.picColor: rgb:10/10/10 + +window.button.unfocus: Flat Solid +window.button.unfocus.color: rgb:CA/CA/CA +window.button.unfocus.picColor: rgb:09/09/09 + +window.button.pressed: Sunken Bevel1 Solid +window.button.pressed.color: rgb:80/80/80 + +window.frame.focus: Flat +window.frame.focus.color: rgb:CC/CC/CC +window.frame.unfocus: Flat +window.frame.unfocus.color: rgb:BE/BE/BE + +window.handle.focus: Raised Solid +window.handle.focus.color: rgb:CC/CC/CC +window.handle.unfocus: Flat Solid +window.handle.unfocus.color: rgb:BC/BC/BC + +window.grip.focus: Raised Gradient Diagonal Interlaced +window.grip.focus.color: rgb:9B/9B/9B +window.grip.focus.colorTo: rgb:80/80/80 +window.grip.unfocus: Raised Gradient Diagonal +window.grip.unfocus.color: rgb:9B/9B/9B +window.grip.unfocus.colorTo: rgb:80/80/80 + +! ----------- tab - explicit for fluxbox, the best wm out there[tm] (; +window.tab.justify: Left +window.tab.label.unfocus: Flat Solid +window.tab.label.unfocus.color: rgb:BE/BE/BE +window.tab.label.unfocus.textColor: rgb:20/20/20 +window.tab.label.focus: Gradient Horizontal Flat +window.tab.label.focus.color: rgb:90/BB/CC +window.tab.label.focus.colorTo: rgb:CA/CD/CF +window.tab.label.focus.textColor: rgb:10/10/10 +window.tab.borderWidth: 1 +window.tab.borderColor: rgb:10/10/10 +! ----------- (fluxbox.sourceforge.net) +window.tab.font: -*-lucidatypewriter-medium-r-normal-*-10-100-75-75-m-60-iso8859-1 + +window.justify: Right + +toolbar.font: -*-lucidatypewriter-medium-r-normal-*-10-100-75-75-m-60-iso8859-1 +window.font: -*-lucidatypewriter-medium-r-normal-*-10-100-75-75-m-60-iso8859-1 +menu.title.font: -*-lucidatypewriter-medium-r-normal-*-10-100-75-75-m-60-iso8859-1 +menu.frame.font: -*-lucida-medium-r-normal-*-10-100-*-*-*-*-iso8859-1 + +borderColor: rgb:10/10/10 + +bevelWidth: 1 +borderWidth: 1 +handleWidth: 2 + +rootCommand: bsetroot -mod 4 4 -bg rgb:9A/9A/9A -fg rgb:30/60/90
A data/styles/Cthulhain

@@ -0,0 +1,140 @@

+! Title: cthulhain +! By: cthulhain (http://lordzork.com/blackbox/ +! Email: cthulhain@lordzork.com +! Comment: no comment + +! ***** toolbar ***** +toolbar: raised gradient vertical + toolbar.color: #585858 + toolbar.colorTo: #0f1319 + +toolbar.label: parentrelative + toolbar.label.textColor: #cccccc + +toolbar.windowLabel: sunken gradient crossdiagonal + toolbar.windowLabel.color: #151a22 + toolbar.windowLabel.colorTo: #7a8290 + toolbar.windowLabel.textColor: #ffffff + +toolbar.clock: parentrelative + toolbar.clock.textColor: #cccccc + +toolbar.button: parentrelative + toolbar.button.picColor: #cccccc + +toolbar.button.pressed: flat gradient vertical + toolbar.button.pressed.color: #0f1319 + toolbar.button.pressed.colorTo: #7a8290 + + +! ***** menu ***** +menu.title: raised gradient crossdiagonal + menu.title.color: #151a22 + menu.title.colorTo: #7a8290 + menu.title.textColor: #ffffff + +menu.frame: sunken gradient crossdiagonal + menu.frame.color: #0f1319 + menu.frame.colorTo: gray40 + menu.frame.textColor: #cccccc + +menu.hilite: sunken gradient crossdiagonal + menu.hilite.color: #151a22 + menu.hilite.colorTo: #7a8290 + menu.hilite.textColor: #ffffff + +menu.bullet: triangle + menu.bullet.position: right + + +! ***** window focused ***** +window.title.focus: raised gradient diagonal + window.title.focus.color: gray40 + window.title.focus.colorTo: #0f1319 + +window.label.focus: sunken gradient crossdiagonal + window.label.focus.color: #151a22 + window.label.focus.colorTo: #7a8290 + window.label.focus.textColor: gray90 + +window.button.focus: parentrelative + window.button.focus.picColor: #cccccc + +window.button.pressed: flat gradient vertical + window.button.pressed.color: #0f1319 + window.button.pressed.colorTo: #7a8290 + +window.handle.focus: raised gradient diagonal + window.handle.focus.color: gray50 + window.handle.focus.colorTo: #0f1319 + +window.grip.focus: raised gradient diagonal + window.grip.focus.color: #7a8290 + window.grip.focus.colorTo: #151a22 + +window.frame.focusColor: #858585 +window.frame.focus.color: #858585 + + +! ***** window unfocused ***** +window.title.unfocus: raised gradient diagonal + window.title.unfocus.color: gray40 + window.title.unfocus.colorTo: #0f1319 + +window.label.unfocus: parentrelative + window.label.unfocus.textColor: #808080 + +window.button.unfocus: parentrelative + window.button.unfocus.picColor: #727272 + +window.handle.unfocus: raised gradient diagonal + window.handle.unfocus.color: gray50 + window.handle.unfocus.colorTo: #0f1319 + +window.grip.unfocus: raised gradient diagonal + window.grip.unfocus.color: gray50 + window.grip.unfocus.colorTo: #0f1319 + +window.frame.unfocusColor: #5e6166 +window.frame.unfocus.color: #5e6166 + + +! ***** fonts ***** +*.font: -*-lucida-medium-r-*-*-*-100-*-*-*-*-* + toolbar.justify: center + window.justify: right + menu.title.justify: center + menu.frame.justify: right + +! ***** the rest ***** +borderColor: #202020 +borderWidth: 1 +bevelWidth: 2 +handleWidth: 4 +frameWidth: 0 + +rootCommand: bsetbg -solid "#3a404b" + +! ***** bbpager ***** +bbpager.frame: sunken gradient crossdiagonal + bbpager.frame.color: #151a22 + bbpager.frame.colorTo: #7a8290 + +bbpager.desktop: parentrelative + +bbpager.desktop.focus: flat gradient vertical + bbpager.desktop.focus.color: #0f1319 + bbpager.desktop.focus.colorTo: gray40 + +bbpager.window: raised gradient vertical + bbpager.window.color: gray40 + bbpager.window.colorTo: #0f1319 + +bbpager.window.focus: raised gradient crossdiagonal + bbpager.window.focus.color: #151a22 + bbpager.window.focus.colorTo: #7a8290 + +bbpager.desktop.focusStyle: border +bbpager.active.window.borderColor: #202020 +bbpager.inactive.window.borderColor: #202020 +bbpager.active.desktop.borderColor: #0f1319
A data/styles/Flux

@@ -0,0 +1,91 @@

+toolbar: flat solid +toolbar.color: rgb:6/6/54 +toolbar.button: flat solid +toolbar.button.color: rgb:6/6/54 +toolbar.button.picColor: rgb:2/2/1c +toolbar.label: flat crossdiagonal gradient +toolbar.label.color: rgb:8/8/7 +toolbar.label.colorTo: rgb:f/f/d +toolbar.label.textColor: rgb:2/2/1c +toolbar.windowLabel: flat crossdiagonal gradient +toolbar.windowLabel.color: rgb:8/8/7 +toolbar.windowLabel.colorTo: rgb:f/f/d +toolbar.windowLabel.textColor: rgb:2/2/1c +toolbar.clock: flat crossdiagonal gradient +toolbar.clock.color: rgb:8/8/7 +toolbar.clock.colorTo: rgb:f/f/d +toolbar.clock.textColor: rgb:2/2/1c +toolbar.justify: right +toolbar.font: lucidasans-10 + +menu.title: flat crossdiagonal gradient +menu.title.color: rgb:8/8/7 +menu.title.colorTo: rgb:f/f/d +menu.title.textColor: rgb:2/2/1c +menu.title.font: lucidasans-10 +menu.title.justify: right + +menu.frame: flat solid +menu.frame.color: rgb:6/6/54 +menu.frame.textColor: grey85 +menu.frame.disableColor: rgb:4/4/38 +menu.frame.font: lucidasans-10 +menu.frame.justify: center + +menu.bullet.position: right +menu.bullet: triangle + +menu.hilite: flat solid +menu.hilite.color: rgb:4/4/38 +menu.hilite.textColor: white + +window.title.focus: flat solid +window.title.focus.color: rgb:6/6/54 +window.title.unfocus: flat solid +window.title.unfocus.color: rgb:4/4/38 + +window.label.focus: flat crossdiagonal gradient +window.label.focus.color: rgb:8/8/7 +window.label.focus.colorTo: rgb:f/f/d +window.label.focus.textColor: rgb:2/2/1c +window.label.unfocus: flat solid +window.label.unfocus.color: rgb:4/4/38 +window.label.unfocus.textColor: rgb:2/2/1c + +window.button.focus: flat solid +window.button.focus.color: rgb:6/6/54 +window.button.focus.picColor: rgb:2/2/1c +window.button.unfocus: flat solid +window.button.unfocus.color: rgb:4/4/38 +window.button.unfocus.picColor: rgb:2/2/1c + +window.handle.focus: flat crossdiagonal gradient +window.handle.focus.color: rgb:8/8/7 +window.handle.focus.colorTo: rgb:f/f/d +window.handle.unfocus: flat solid +window.handle.unfocus.color: rgb:4/4/38 + +window.grip.focus: flat solid +window.grip.focus.color: rgb:8/8/7 +window.grip.unfocus: flat solid +window.grip.unfocus.color: rgb:4/4/38 + +window.frame.focusColor: rgb:f/f/d +window.frame.unfocusColor: rgb:6/6/54 + +window.font: lucidasans-10 +window.justify: right + +*button.pressed: flat solid +*button.pressed.color: rgb:a/a/8c + +borderColor: rgb:2/2/1c + +bevelWidth: 2 +borderWidth: 2 +handleWidth: 3 + +*textColor: grey20 +*Font: lucidasans-10 + +rootCommand: bsetroot -solid rgb:4/4/38
A data/styles/Makefile.am

@@ -0,0 +1,12 @@

+# data/styles/Makefile.am for Blackbox 0.61.x - an X11 Window manager + +styledir = $(pkgdatadir)/styles +MAINTAINERCLEANFILES = Makefile.in + +style_DATA = Makro MerleyKay Clean CleanColor Artwiz Cthulhain Flux Minimal Nyz Operation Outcomes Rampage Rancor Results Shade Spiff TDF Twice Blue Carbondioxide qnx-photon +EXTRA_DIST=$(style_DATA) + +uninstall-local: + rmdir $(styledir) +distclean-local: + rm -f *\~
A data/styles/Makefile.in

@@ -0,0 +1,224 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox 0.61.x - an X11 Window manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +styledir = $(pkgdatadir)/styles +MAINTAINERCLEANFILES = Makefile.in + +style_DATA = Makro MerleyKay Clean CleanColor Artwiz Cthulhain Flux Minimal Nyz Operation Outcomes Rampage Rancor Results Shade Spiff TDF Twice Blue Carbondioxide qnx-photon +EXTRA_DIST = $(style_DATA) +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 --include-deps data/styles/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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-local +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 + -rm -f libtool + +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-local uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +uninstall-local: + rmdir $(styledir) +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:
A data/styles/Makro

@@ -0,0 +1,116 @@

+# "Makro" +# A Fluxbox theme by: skypher of perplexity +# 2001 + +toolbar: Gradient Vertical Sunken +toolbar.color: rgb:CC/CC/AA + +toolbar.button: Flat Solid +toolbar.button.color: rgb:AB/90/40 +toolbar.button.picColor: rgb:50/30/10 + +toolbar.button.pressed: Sunken Flat +toolbar.button.pressed.color: rgb:90/70/20 + +toolbar.clock: Flat +toolbar.clock.color: rgb:AB/90/40 +toolbar.clock.textColor: rgb:40/20/05 + +toolbar.label: Flat +toolbar.label.color: rgb:AB/90/40 +toolbar.label.textColor: rgb:40/20/05 + +toolbar.windowLabel: Flat +toolbar.windowLabel.color: rgb:AB/90/40 +toolbar.windowLabel.textColor: rgb:40/20/05 + +toolbar.justify: Left + +menu.title: Raised Flat +menu.title.color: rgb:AB/90/40 +menu.title.textColor: rgb:40/20/05 +menu.title.justify: Left + +menu.frame: Gradient PipeCross +menu.frame.color: rgb:CC/CC/AA +menu.frame.colorTo: rgb:AB/AA/90 +menu.frame.textColor: rgb:10/10/01 +menu.frame.justify: Right + +menu.hilite: Flat +menu.hilite.color: rgb:DF/CF/BF +menu.hilite.textColor: rgb:00/00/00 + +menu.bullet: Square +menu.bullet.position: Right + + +window.title.focus: Gradient Vertical Sunken +window.title.focus.color: rgb:CC/CC/AA + +window.title.unfocus: Gradient Vertical Sunken +window.title.unfocus.color: rgb:AC/AC/90 + +window.label.focus: Solid Flat +window.label.focus.color: rgb:AB/90/40 +window.label.focus.textColor: rgb:40/20/05 + +window.label.unfocus: Flat Solid +window.label.unfocus.color: rgb:AA/80/30 +window.label.unfocus.textColor: rgb:45/25/10 + +window.button.focus: Flat Solid +window.button.focus.color: rgb:AC/99/50 +window.button.focus.picColor: rgb:40/20/05 + +window.button.unfocus: Flat Solid +window.button.unfocus.color: rgb:AA/80/30 +window.button.unfocus.picColor: rgb:45/25/10 + +window.button.pressed: Sunken Solid +window.button.pressed.color: rgb:90/70/20 + +window.frame.focus: Flat +window.frame.focus.color: rgb:00/00/00 +window.frame.unfocus: Flat +window.frame.unfocus.color: rgb:10/10/10 + +window.handle.focus: Sunken Solid +window.handle.focus.color: rgb:AC/99/50 +window.handle.unfocus: Flat Solid +window.handle.unfocus.color: rgb:AA/80/30 + +window.grip.focus: Sunken Gradient Diagonal Interlaced +window.grip.focus.color: rgb:AC/99/50 +window.grip.focus.colorTo: rgb:AA/80/30 +window.grip.unfocus: Raised Gradient Diagonal +window.grip.unfocus.color: rgb:AA/80/30 +window.grip.unfocus.colorTo: rgb:AC/99/50 + +! ----------- tab - explicit for fluxbox, the best wm out there[tm] (; +window.tab.justify: Center +window.tab.label.unfocus: Flat Solid +window.tab.label.unfocus.color: rgb:AA/80/30 +window.tab.label.unfocus.textColor: rgb:45/25/10 +window.tab.label.focus: Solid Flat +window.tab.label.focus.color: rgb:AB/90/40 +window.tab.label.focus.textColor: rgb:40/20/05 +window.tab.borderWidth: 1 +window.tab.borderColor: rgb:10/10/10 +! ----------- (fluxbox.sourceforge.net) +window.tab.font: -*-helvetica-medium-r-*-*-11-*-*-*-*-*-iso8859-1 + +window.justify: Left + +toolbar.font: -*-helvetica-medium-r-*-*-11-*-*-*-*-*-iso8859-1 +window.font: -*-helvetica-bold-r-*-*-11-*-*-*-*-*-iso8859-1 +menu.title.font: -*-helvetica-bold-r-*-*-11-*-*-*-*-*-iso8859-1 +menu.frame.font: -*-helvetica-medium-r-*-*-10-*-*-*-*-*-iso8859-1 + +borderColor: rgb:10/10/10 + +bevelWidth: 2 +borderWidth: 1 +handleWidth: 3 + +rootCommand: bsetroot -solid rgb:9A/9A/90
A data/styles/MerleyKay

@@ -0,0 +1,134 @@

+# Merely Kay +# A Fluxbox theme by: skypher of perplexity +# 2001 +# (Not created from scratch, basicly a modification of "Simple Elegance" +# by Pax, thanks!) +# update: added *.tab.* stuff to make fluxbox look real cool :) + +toolbar: Raised Gradient Veritcal +toolbar.color: rgb:62/70/85 +toolbar.colorTo: rgb:56/66/75 + +toolbar.button: Raised Gradient Horizontal Interlaced +toolbar.button.color: rgb:62/70/85 +toolbar.button.colorTo: rgb:56/66/75 +toolbar.button.picColor: rgb:FF/FF/FF + +toolbar.button.pressed: Sunken Gradient Horizontal +toolbar.button.pressed.color: rgb:42/50/65 +toolbar.button.pressed.colorTo: rgb:36/46/55 + +toolbar.clock: Sunken Gradient Vertical Interlaced +toolbar.clock.color: rgb:62/70/85 +toolbar.clock.colorTo: rgb:56/66/75 +toolbar.clock.textColor: rgb:FF/FF/FF + +toolbar.label: Sunken Gradient Vertical Interlaced +toolbar.label.color: rgb:62/70/85 +toolbar.label.colorTo: rgb:56/66/75 +toolbar.label.textColor: rgb:FF/FF/FF + +toolbar.windowLabel: Raised Gradient Vertical Interlaced +toolbar.windowLabel.color: rgb:62/70/85 +toolbar.windowLabel.colorTo: rgb:56/66/75 +toolbar.windowLabel.textColor: rgb:FF/FF/FF + +toolbar.justify: center + +menu.title: Raised Gradient Horizontal Interlaced +menu.title.color: rgb:62/66/70 +menu.title.colorTo: rgb:56/60/68 +menu.title.textColor: rgb:E9/E9/E9 +menu.title.justify: Center + +menu.frame: Sunken Gradient PipeCross +menu.frame.color: rgb:62/70/85 +menu.frame.colorTo: rgb:56/66/75 +menu.frame.textColor: rgb:E2/E2/E2 +menu.frame.justify: Left + +menu.hilite: Raised Gradient PipeCross +menu.hilite.color: rgb:50/50/50 +menu.hilite.colorTo: rgb:42/42/42 +menu.hilite.textColor: rgb:FF/FF/FF + +menu.bullet: Triangle +menu.bullet.position: Right + +window.title.focus: Raised Gradient Vertical Interlaced +window.title.focus.color: rgb:62/70/85 +window.title.focus.colorTo: rgb:56/66/75 +window.title.unfocus: Raised Gradient Vertical +window.title.unfocus.color: rgb:60/66/70 +window.title.unfocus.colorTo: rgb:54/60/68 + +window.label.focus: Flat Gradient Vertical Interlaced +window.label.focus.color: rgb:62/70/85 +window.label.focus.colorTo: rgb:56/66/75 +window.label.focus.textColor: rgb:FF/FF/FF +window.label.unfocus: Flat Gradient Vertical +window.label.unfocus.color: rgb:60/66/70 +window.label.unfocus.colorTo: rgb:54/60/68 +window.label.unfocus.textColor: rgb:C1/C1/C1 + +window.button.focus: Raised Gradient Diagonal Bevel1 +window.button.focus.color: rgb:9B/9B/9B +window.button.focus.colorTo: rgb:42/42/42 +window.button.focus.picColor: rgb:E2/E2/E2 +window.button.unfocus: Raised Gradient Diagonal Bevel1 +window.button.unfocus.color: rgb:9B/9B/9B +window.button.unfocus.colorTo: rgb:42/42/42 +window.button.unfocus.picColor: rgb:C1/C1/C1 +window.button.pressed: Sunken Gradient Diagonal Bevel1 +window.button.pressed.color: rgb:9B/9B/9B +window.button.pressed.colorTo: rgb:42/42/42 + +window.frame.focus: Sunken +window.frame.focus.color: rgb:87/99/9F +window.frame.unfocus: Sunken +window.frame.unfocus.color: rgb:87/99/9F + +window.handle.focus: Raised Gradient Diagonal +window.handle.focus.color: rgb:62/70/85 +window.handle.focus.colorTo: rgb:56/66/75 +window.handle.unfocus: Raised Gradient Diagonal +window.handle.unfocus.color: rgb:60/66/70 +window.handle.unfocus.colorTo: rgb:54/60/68 + +window.grip.focus: Raised Gradient Diagonal Interlaced +window.grip.focus.color: rgb:9B/9B/9B +window.grip.focus.colorTo: rgb:42/42/42 +window.grip.unfocus: Raised Gradient Diagonal +window.grip.unfocus.color: rgb:9B/9B/9B +window.grip.unfocus.colorTo: rgb:42/42/42 + +! ----------- tab - explicit for fluxbox, the best wm out there[tm] (; +window.tab.justify: Left +window.tab.label.unfocus: Sunken Gradient Vertical +window.tab.label.unfocus.color: rgb:50/50/50 +window.tab.label.unfocus.colorTo: rgb:54/60/68 +window.tab.label.unfocus.textColor: rgb:AA/AA/AA +window.tab.label.focus: Raised Gradient Vertical +window.tab.label.focus.color: rgb:62/70/85 +window.tab.label.focus.colorTo: rgb:556/66/75 +window.tab.label.focus.textColor: #FFFFFF +window.tab.borderWidth: 2 +window.tab.borderColor: black +! ----------- (fluxbox.sourceforge.net) + +window.justify: Center + +window.tab.font: -*-clean-medium-r-*-*-12-*-*-*-*-60-iso8859-* +toolbar.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-* +window.font: -*-helvetica-medium-r-normal-*-12-*-*-*-*-*-iso8859-1 +#menu.title.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-* +menu.title.font: -*-lucida-bold-r-*-*-*-100-*-*-*-*-*-* +menu.frame.font: -*-lucida-medium-r-*-*-*-100-*-*-*-*-*-* + +borderColor: rgb:00/00/00 + +bevelWidth: 2 +borderWidth: 2 +handleWidth: 3 + +rootCommand: bsetroot -mod 5 5 -fg rgb:62/70/85 -bg rgb:52/60/75
A data/styles/Minimal

@@ -0,0 +1,79 @@

+! Minimal (c) 2000 Jeff Raven +! Blackbox window manager resource defaults, with an +! eye towards consuming as little of an 8-bit palette +! as possible. As an additional bonus, with the changes +! as of Blackbox 0.60.3, it should also use very little +! memory. + +toolbar: Flat Solid +toolbar.color: MidnightBlue + +toolbar.clock: ParentRelative +toolbar.label: ParentRelative +toolbar.windowLabel: ParentRelative + +toolbar.button: ParentRelative +toolbar.button.pressed: Flat Solid +toolbar.button.pressed.color: SteelBlue +toolbar.button*picColor: White + +toolbar.textColor: White +toolbar.justify: center + +window.title.focus: Flat Solid +window.title.focus.color: SteelBlue +window.title.unfocus: Flat Solid +window.title.unfocus.color: MidnightBlue + +window.label.focus: ParentRelative +window.label.focus.textColor: White +window.label.unfocus: ParentRelative +window.label.unfocus.textColor: Grey + +window.button.focus: ParentRelative +window.button.focus.picColor: White +window.button.unfocus: ParentRelative +window.button.unfocus.picColor: Grey +window.button.pressed: ParentRelative + +window.handle.focus: Flat Solid +window.handle.focus.color: SteelBlue +window.handle.unfocus: Flat Solid +window.handle.unfocus.color: MidnightBlue + +window.grip.focus: Flat Solid +window.grip.unfocus: Flat Solid +window.grip*color: Grey + +window.frame.focusColor: SteelBlue +window.frame.unfocusColor: MidnightBlue + +window.justify: center + +menu.title: Flat Solid +menu.frame: Flat Solid +menu.hilite: Flat Solid + +menu.title.color: Black +menu.title.textColor: White +menu.title.justify: center + +menu.frame.color: MidnightBlue +menu.frame.textColor: White +menu.frame.justify: left + +menu.hilite.color: White +menu.hilite.textColor: Black + +menu.bullet: Triangle +menu.bullet.position: Right + +borderColor: Black + +bevelWidth: 1 +borderWidth: 1 +handleWidth: 4 + +*Font: -*-helvetica-*-r-*-*-12-*-*-*-*-*-*-* + +rootCommand: bsetroot -solid SlateGrey
A data/styles/Nyz

@@ -0,0 +1,103 @@

+toolbar: flat diagonal gradient +toolbar.color: rgb:6/9/c +toolbar.colorTo: rgb:4/6/8 +toolbar.button: flat diagonal gradient +toolbar.button.color: rgb:3/48/6 +toolbar.button.colorTo: rgb:5/78/a +toolbar.button.picColor: rgb:1/18/2 +toolbar.button.pressed: flat crossdiagonal gradient +toolbar.button.pressed.color: grey40 +toolbar.button.pressed.colorTo: grey20 +toolbar.label: flat crossdiagonal gradient +toolbar.label.color: grey40 +toolbar.label.colorTo: grey20 +toolbar.label.textColor: grey85 +toolbar.windowLabel: flat crossdiagonal gradient +toolbar.windowLabel.color: grey40 +toolbar.windowLabel.colorTo: grey20 +toolbar.windowLabel.textColor: grey85 +toolbar.clock: flat crossdiagonal gradient +toolbar.clock.color: grey40 +toolbar.clock.colorTo: grey20 +toolbar.clock.textColor: grey85 +toolbar.justify: right +toolbar.font: lucidasans-10 + +menu.title: flat crossdiagonal gradient +menu.title.color: rgb:6/9/c +menu.title.colorTo: rgb:3/48/6 +menu.title.textColor: white +menu.title.font: lucidasans-10 +menu.title.justify: right + +menu.frame: flat crossdiagonal gradient +menu.frame.color: grey40 +menu.frame.colorTo: grey20 +menu.frame.textColor: grey85 +menu.frame.disableColor: rgb:4/4/38 +menu.frame.font: lucidasans-10 +menu.frame.justify: center + +menu.bullet.position: right +menu.bullet: triangle + +menu.hilite: flat crossdiagonal gradient +menu.hilite.color: rgb:6/9/c +menu.hilite.colorTo: rgb:3/48/6 +menu.hilite.textColor: white + +window.title.focus: flat diagonal gradient +window.title.focus.color: rgb:6/9/c +window.title.focus.colorTo: rgb:4/6/8 +window.title.unfocus: flat solid +window.title.unfocus.color: grey30 + +window.label.focus: flat crossdiagonal gradient +window.label.focus.color: grey40 +window.label.focus.colorTo: grey20 +window.label.focus.textColor: white +window.label.unfocus: flat crossdiagonal gradient +window.label.unfocus.color: grey30 +window.label.unfocus.colorTo: grey20 +window.label.unfocus.textColor: grey60 + +window.button.focus: flat diagonal gradient +window.button.focus.color: rgb:4/6/8 +window.button.focus.colorTo: rgb:5/78/a +window.button.focus.picColor: rgb:1/18/2 +window.button.unfocus: flat solid +window.button.unfocus.color: grey30 +window.button.unfocus.picColor: grey20 +window.button.pressed: flat crossdiagonal gradient +window.button.pressed.color: grey40 +window.button.pressed.colorTo: grey20 + +window.handle.focus: flat crossdiagonal gradient +window.handle.focus.color: rgb:6/9/c +window.handle.focus.colorTo: rgb:3/48/6 +window.handle.unfocus: flat solid +window.handle.unfocus.color: grey30 + +window.grip.focus: flat crossdiagonal gradient +window.grip.focus.color: grey40 +window.grip.focus.colorTo: grey20 +window.grip.unfocus: flat crossdiagonal gradient +window.grip.unfocus.color: grey30 +window.grip.unfocus.colorTo: grey20 + +window.frame.focusColor: rgb:6/9/c +window.frame.unfocusColor: grey30 + +window.font: lucidasans-10 +window.justify: right + +borderColor: grey10 + +bevelWidth: 1 +borderWidth: 2 +handleWidth: 4 + +*textColor: grey85 +*Font: lucidasans-10 + +rootCommand: bsetroot -solid grey20
A data/styles/Operation

@@ -0,0 +1,91 @@

+toolbar: flat crossdiagonal gradient +toolbar.color: rgb:6/9/c +toolbar.colorTo: rgb:4/6/8 +toolbar.button: parentrelative +toolbar.button.picColor: grey85 +toolbar.button.pressed: flat crossdiagonal gradient +toolbar.button.pressed.color: grey50 +toolbar.button.pressed.colorTo: grey80 +toolbar.label: parentrelative +toolbar.label.textColor: grey85 +toolbar.windowLabel: parentrelative +toolbar.windowLabel.textColor: grey85 +toolbar.clock: parentrelative +toolbar.clock.textColor: grey85 +toolbar.justify: right +toolbar.font: lucidasans-10 + +menu.title: flat crossdiagonal gradient +menu.title.color: rgb:6/9/c +menu.title.colorTo: rgb:3/48/6 +menu.title.textColor: white +menu.title.font: lucidasans-10 +menu.title.justify: right + +menu.frame: flat crossdiagonal gradient +menu.frame.color: grey50 +menu.frame.colorTo: grey80 +menu.frame.textColor: grey20 +menu.frame.disableColor: grey40 +menu.frame.font: lucidasans-10 +menu.frame.justify: center + +menu.bullet.position: right +menu.bullet: triangle + +menu.hilite: flat crossdiagonal gradient +menu.hilite.color: rgb:6/9/c +menu.hilite.colorTo: rgb:3/48/6 +menu.hilite.textColor: white + +window.title.focus: flat crossdiagonal gradient +window.title.focus.color: rgb:6/9/c +window.title.focus.colorTo: rgb:3/48/6 +window.title.unfocus: flat diagonal gradient +window.title.unfocus.color: grey50 +window.title.unfocus.colorTo: grey20 + +window.label.focus: parentrelative +window.label.focus.textColor: white +window.label.unfocus: parentrelative +window.label.unfocus.textColor: grey60 + +window.button.focus: parentrelative +window.button.focus.picColor: grey85 +window.button.unfocus: parentrelative +window.button.unfocus.picColor: grey60 +window.button.pressed: flat crossdiagonal gradient +window.button.pressed.color: grey50 +window.button.pressed.colorTo: grey80 + +window.handle.focus: flat crossdiagonal gradient +window.handle.focus.color: rgb:6/9/c +window.handle.focus.colorTo: rgb:3/48/6 +window.handle.unfocus: flat diagonal gradient +window.handle.unfocus.color: grey50 +window.handle.unfocus.colorTo: grey20 + +window.grip.focus: parentrelative +window.grip.unfocus: parentrelative + +window.frame.focusColor: rgb:6/9/c +window.frame.unfocusColor: grey50 + +window.font: lucidasans-10 +window.justify: right + +borderColor: rgb:2/3/4 + +bevelWidth: 1 +borderWidth: 1 +handleWidth: 4 + +*textColor: grey85 +*Font: lucidasans-10 + +rootCommand: bsetroot -gradient flatcrossdiagonalgradient -from rgb:4/6/8 -to rgb:3/48/6 + +bbpager.desktop.focus: flat interlaced crossdiagonal gradient +bbpager.desktop.focus.color: rgb:6/9/c +bbpager.desktop.focus.colorTo: rgb:3/48/6 +
A data/styles/Outcomes

@@ -0,0 +1,114 @@

+toolbar: raised diagonal gradient bevel1 +toolbar.color: rgb:7/8/8 +toolbar.colorTo: grey20 + +toolbar.button: raised diagonal gradient bevel1 +toolbar.button.color: grey +toolbar.button.colorTo: grey20 +toolbar.button.picColor: black +toolbar.button.pressed: sunken diagonal interlaced gradient bevel1 +toolbar.button.pressed.color: rgb:38/4/4 +toolbar.button.pressed.colorTo: rgb:d/f/f + +toolbar.label: flat interlaced diagonal gradient +toolbar.label.color: grey20 +toolbar.label.colorTo: rgb:7/8/8 +toolbar.label.textColor: grey85 + +toolbar.windowLabel: flat interlaced diagonal gradient +toolbar.windowLabel.color: grey20 +toolbar.windowLabel.colorTo: rgb:7/8/8 +toolbar.windowLabel.textColor: grey85 + +toolbar.clock: flat interlaced diagonal gradient +toolbar.clock.color: grey20 +toolbar.clock.colorTo: rgb:7/8/8 +toolbar.clock.textColor: grey85 + +toolbar.justify: center +toolbar.font: lucidasans-bold-10 + +menu.title: raised diagonal interlaced gradient bevel1 +menu.title.color: grey20 +menu.title.colorTo: rgb:7/8/8 +menu.title.textColor: grey85 +menu.title.font: lucidasans-bold-10 +menu.title.justify: center + +menu.frame: raised diagonal gradient bevel1 +menu.frame.color: rgb:7/8/8 +menu.frame.colorTo: grey10 +menu.frame.textColor: white +menu.frame.disableColor: rgb:38/4/4 +menu.frame.font: lucidasans-10 +menu.frame.justify: center + +menu.bullet: triangle +menu.bullet.position: right + +menu.hilite: raised diagonal gradient bevel1 +menu.hilite.color: grey60 +menu.hilite.colorTo: white +menu.hilite.textColor: grey20 + +window.title.focus: raised diagonal gradient bevel1 +window.title.focus.color: rgb:7/8/8 +window.title.focus.colorTo: grey20 +window.title.unfocus: raised diagonal gradient bevel1 +window.title.unfocus.color: rgb:54/6/6 +window.title.unfocus.colorTo: grey20 + +window.label.focus: interlaced sunken diagonal gradient bevel1 +window.label.focus.color: grey20 +window.label.focus.colorTo: grey +window.label.focus.textColor: white +window.label.unfocus: interlaced flat gradient +window.label.unfocus.color: grey20 +window.label.unfocus.colorTo: rgb:54/6/6 +window.label.unfocus.textColor: grey + +window.handle.focus: raised diagonal gradient bevel1 +window.handle.focus.color: rgb:7/8/8 +window.handle.focus.colorTo: grey20 +window.handle.unfocus: raised diagonal gradient bevel1 +window.handle.unfocus.color: rgb:54/6/6 +window.handle.unfocus.colorTo: grey20 + +window.grip.focus: raised diagonal gradient bevel1 +window.grip.focus.color: grey +window.grip.focus.colorTo: grey20 +window.grip.unfocus: sunken diagonal gradient bevel1 +window.grip.unfocus.color: grey20 +window.grip.unfocus.colorTo: grey + + +window.button.focus: raised diagonal gradient bevel1 +window.button.focus.color: grey +window.button.focus.colorTo: grey20 +window.button.focus.picColor: black +window.button.unfocus: sunken diagonal gradient bevel1 +window.button.unfocus.color: grey20 +window.button.unfocus.colorTo: grey +window.button.unfocus.picColor: grey40 +window.button.pressed: flat diagonal interlaced gradient +window.button.pressed.color: rgb:38/4/4 +window.button.pressed.colorTo: rgb:d/f/f + +window.frame.focusColor: grey85 +window.frame.unfocusColor: rgb:54/6/6 + +window.font: lucidasans-bold-10 +window.justify: center + +! misc... +borderColor: rgb:1c/2/2 + +borderWidth: 1 +bevelWidth: 2 +handleWidth: 4 + +rootCommand: bsetroot -mod 4 4 -fg rgb:54/6/6 -bg grey20 + +! for the bbtools +menuFont: lucidasans-10 +titleFont: lucidasans-bold-10
A data/styles/Rampage

@@ -0,0 +1,102 @@

+ +toolbar: sunken +toolbar.color: grey68 + +toolbar.button: flat +toolbar.button.color: grey68 +toolbar.button.picColor: rgb:0/8/8 +toolbar.button.pressed: sunken +toolbar.button.pressed.color: rgb:c/c/c +toolbar.button.pressed.colorTo: rgb:8/8/8 + +toolbar.label: flat +toolbar.label.color: grey68 +toolbar.label.textColor: black + +toolbar.windowLabel: flat +toolbar.windowLabel.color: grey68 +toolbar.windowLabel.textColor: black + +toolbar.clock: flat +toolbar.clock.color: grey68 +toolbar.clock.textColor: black + +toolbar.justify: Left + +menu.title: Raised Diagonal Gradient Bevel1 +menu.title.color: rgb:b/b/b +menu.title.colorTo: rgb:1/9/9 +menu.title.textColor: black +menu.title.justify: center + +menu.frame: Raised Diagonal Gradient Bevel1 +menu.frame.color: rgb:b/b/b +menu.frame.colorTo: rgb:c/c/c +menu.frame.textColor: black +menu.frame.justify: center + +menu.hilite: Raised diagonal gradient bevel1 +menu.hilite.color: grey77 +menu.hilite.colorTo: grey74 +menu.hilite.textColor: rgb:0/8/8 + +menu.bullet: square +menu.bullet.position: right + +window.title.focus: sunken diagonal gradient bevel1 +window.title.focus.color: rgb:c/c/c +window.title.focus.colorTo: rgb:b/b/b +window.title.unfocus: sunken +window.title.unfocus.color: grey70 + +window.label.focus: Flat pyramid interlaced gradient +window.label.focus.color: rgb:c/c/c +window.label.focus.colorTo: rgb:b/b/b +window.label.focus.textColor: black +window.label.unfocus: flat +window.label.unfocus.color: grey70 +window.label.unfocus.textColor: black + +window.handle.focus: flat diagonal gradient bevel1 +window.handle.focus.color: rgb:c/c/c +window.handle.focus.colorTo: rgb:0/8/8 +window.handle.unfocus: raised pyramid gradient bevel1 +window.handle.unfocus.color: rgb:c/c/c +window.handle.unfocus.colorTo: rgb:0/8/8 + +window.grip.focus: flat diagonal interlaced gradient bevel1 +window.grip.focus.color: grey90 +window.grip.focus.colorTo: grey40 +window.grip.unfocus: flat diagonal gradient bevel1 +window.grip.unfocus.color: grey40 +window.grip.unfocus.colorTo: grey90 + +window.button.focus: sunken diagonal gradient bevel1 +window.button.focus.color: grey90 +window.button.focus.colorTo: grey40 +window.button.focus.picColor: grey20 + +window.button.unfocus: flat +window.button.unfocus.color: grey70 +window.button.unfocus.colorTo: grey70 +window.button.unfocus.picColor: grey70 + +window.button.pressed: sunken interlaced diagonal gradient bevel1 +window.button.pressed.color: rgb:38/4/4 +window.button.pressed.colorTo: rgb:d/f/f + +window.frame.focusColor: grey72 +window.frame.unfocusColor: grey72 + +window.justify: center + +borderColor: rgb:0/0/0 + +borderWidth: 1 +bevelWidth: 2 +handleWidth: 5 + +*font: -b&h-lucida-medium-r-normal-*-*-100-*-*-p-*-iso8859-1 +*textColor: black + +rootCommand: bsetroot -mod 16 8 -bg rgb:0/8/8 -fg rgb:0/9/9
A data/styles/Rancor

@@ -0,0 +1,107 @@

+toolbar: flat solid +toolbar.color: #980806 + +toolbar.button: raised crossdiagonal gradient bevel2 +toolbar.button.color: #a8a6a6 +toolbar.button.colorTo: black +toolbar.button.picColor: white + +toolbar.button.pressed: flat solid +toolbar.button.pressed.color: grey20 + +toolbar.label: raised diagonal gradient bevel2 +toolbar.label.color: #a8a6a6 +toolbar.label.colorTo: black +toolbar.label.textColor: white + +toolbar.windowLabel: raised crossdiagonal gradient bevel2 +toolbar.windowLabel.color: #a8a6a6 +toolbar.windowLabel.colorTo: black +toolbar.windowLabel.textColor: white + +toolbar.clock: raised crossdiagonal gradient bevel2 +toolbar.clock.color: black +toolbar.clock.colorTo: #a8a6a6 +toolbar.clock.textColor: white + +toolbar.justify: center +toolbar.font: lucidasans-10 + +menu.title: raised crossdiagonal gradient +menu.title.color: #980806 +menu.title.colorTo: black +menu.title.textColor: white +menu.title.font: lucidasans-10 +menu.title.justify: right + +menu.frame: flat crossdiagonal gradient bevel2 +menu.frame.color: black +menu.frame.colorTo: #a8a6a6 +menu.frame.textColor: white +menu.frame.disableColor: grey20 +menu.frame.font: lucidasans-10 +menu.frame.justify: left + +menu.bullet.position: right +menu.bullet: round + +menu.hilite: raised crossdiagonal gradient bevel1 +menu.hilite.color: #a8a6a6 +menu.hilite.colorTo: black +menu.hilite.textColor: white + +window.title.focus: flat solid +window.title.focus.color: #980806 + +window.title.unfocus: flat solid +window.title.unfocus.color: black + +window.label.focus: raised crossdiagonal gradient bevel1 +window.label.focus.color: black +window.label.focus.colorTo: #a8a6a6 +window.label.focus.textColor: white + +window.label.unfocus: flat solid +window.label.unfocus.color: black +window.label.unfocus.textColor: grey60 + +window.button.focus: raised crossdiagonal gradient bevel2 +window.button.focus.color: #a8a6a6 +window.button.focus.colorTo: black +window.button.focus.picColor: white + +window.button.unfocus: flat solid +window.button.unfocus.color: black +window.button.unfocus.picColor: black +window.button.pressed: flat crossdiagonal gradient +window.button.pressed.color: grey40 +window.button.pressed.colorTo: grey20 + +window.handle.focus: raised crossdiagonal gradient +window.handle.focus.color: #980806 +window.handle.focus.colorTo: black +window.handle.unfocus: flat solid +window.handle.unfocus.color: black + +window.grip.focus: raised crossdiagonal gradient +window.grip.focus.color: #a8a6a6 +window.grip.focus.colorTo: black +window.grip.unfocus: flat solid +window.grip.unfocus.color: black + +window.frame.focusColor: #980806 +window.frame.unfocusColor: black + +window.font: lucidasans-10 +window.justify: center + +borderColor: black + +bevelWidth: 1 +borderWidth: 1 +handleWidth: 4 + +*textColor: white +*Font: lucidasans-10 + +rootCommand: bsetroot -gradient interlacedflatcrossdiagonalgradient -from rgb:4c/04/03 -to black
A data/styles/Results

@@ -0,0 +1,114 @@

+toolbar: raised diagonal gradient bevel1 +toolbar.color: rgb:8/8/7 +toolbar.colorTo: grey20 + +toolbar.button: raised diagonal gradient bevel1 +toolbar.button.color: grey +toolbar.button.colorTo: grey20 +toolbar.button.picColor: black +toolbar.button.pressed: sunken diagonal interlaced gradient bevel1 +toolbar.button.pressed.color: rgb:4/4/38 +toolbar.button.pressed.colorTo: rgb:f/f/d + +toolbar.label: flat interlaced diagonal gradient +toolbar.label.color: grey20 +toolbar.label.colorTo: rgb:8/8/7 +toolbar.label.textColor: grey85 + +toolbar.windowLabel: flat interlaced diagonal gradient +toolbar.windowLabel.color: grey20 +toolbar.windowLabel.colorTo: rgb:8/8/7 +toolbar.windowLabel.textColor: grey85 + +toolbar.clock: flat interlaced diagonal gradient +toolbar.clock.color: grey20 +toolbar.clock.colorTo: rgb:8/8/7 +toolbar.clock.textColor: grey85 + +toolbar.justify: center +toolbar.font: lucidasans-bold-10 + +menu.title: raised diagonal interlaced gradient bevel1 +menu.title.color: grey20 +menu.title.colorTo: rgb:8/8/7 +menu.title.textColor: grey85 +menu.title.font: lucidasans-bold-10 +menu.title.justify: center + +menu.frame: raised diagonal gradient bevel1 +menu.frame.color: rgb:8/8/7 +menu.frame.colorTo: grey10 +menu.frame.textColor: white +menu.frame.disableColor: rgb:4/4/38 +menu.frame.font: lucidasans-10 +menu.frame.justify: center + +menu.bullet: triangle +menu.bullet.position: right + +menu.hilite: raised diagonal gradient bevel1 +menu.hilite.color: grey60 +menu.hilite.colorTo: white +menu.hilite.textColor: grey20 + +window.title.focus: raised diagonal gradient bevel1 +window.title.focus.color: rgb:8/8/7 +window.title.focus.colorTo: grey20 +window.title.unfocus: raised diagonal gradient bevel1 +window.title.unfocus.color: rgb:6/6/54 +window.title.unfocus.colorTo: grey20 + +window.label.focus: interlaced sunken diagonal gradient bevel1 +window.label.focus.color: grey20 +window.label.focus.colorTo: grey +window.label.focus.textColor: white +window.label.unfocus: interlaced flat gradient +window.label.unfocus.color: grey20 +window.label.unfocus.colorTo: rgb:6/6/54 +window.label.unfocus.textColor: grey + +window.handle.focus: raised diagonal gradient bevel1 +window.handle.focus.color: rgb:8/8/7 +window.handle.focus.colorTo: grey20 +window.handle.unfocus: raised diagonal gradient bevel1 +window.handle.unfocus.color: rgb:6/6/54 +window.handle.unfocus.colorTo: grey20 + +window.grip.focus: raised diagonal gradient bevel1 +window.grip.focus.color: grey +window.grip.focus.colorTo: grey20 +window.grip.unfocus: sunken diagonal gradient bevel1 +window.grip.unfocus.color: grey20 +window.grip.unfocus.colorTo: grey + + +window.button.focus: raised diagonal gradient bevel1 +window.button.focus.color: grey +window.button.focus.colorTo: grey20 +window.button.focus.picColor: black +window.button.unfocus: sunken diagonal gradient bevel1 +window.button.unfocus.color: grey20 +window.button.unfocus.colorTo: grey +window.button.unfocus.picColor: grey40 +window.button.pressed: flat diagonal interlaced gradient +window.button.pressed.color: rgb:4/4/38 +window.button.pressed.colorTo: rgb:f/f/d + +window.frame.focusColor: grey85 +window.frame.unfocusColor: rgb:6/6/54 + +window.font: lucidasans-bold-10 +window.justify: center + +! misc... +borderColor: rgb:2/2/1c + +borderWidth: 1 +bevelWidth: 2 +handleWidth: 4 + +rootCommand: bsetroot -mod 4 4 -fg rgb:6/6/5c -bg grey20 + +! for the bbtools +menuFont: lucidasans-10 +titleFont: lucidasans-bold-10
A data/styles/Shade

@@ -0,0 +1,91 @@

+toolbar: flat solid +toolbar.color: rgb:6/6/6 +toolbar.button: flat solid +toolbar.button.color: rgb:6/6/6 +toolbar.button.picColor: rgb:2/2/2 +toolbar.label: flat crossdiagonal gradient +toolbar.label.color: rgb:8/8/7 +toolbar.label.colorTo: rgb:f/f/d +toolbar.label.textColor: rgb:2/2/1c +toolbar.windowLabel: flat crossdiagonal gradient +toolbar.windowLabel.color: rgb:8/8/7 +toolbar.windowLabel.colorTo: rgb:f/f/d +toolbar.windowLabel.textColor: rgb:2/2/1c +toolbar.clock: flat crossdiagonal gradient +toolbar.clock.color: rgb:8/8/7 +toolbar.clock.colorTo: rgb:f/f/d +toolbar.clock.textColor: rgb:2/2/1c +toolbar.justify: right +toolbar.font: lucidasans-10 + +menu.title: flat crossdiagonal gradient +menu.title.color: rgb:8/8/7 +menu.title.colorTo: rgb:f/f/d +menu.title.textColor: rgb:2/2/1c +menu.title.font: lucidasans-10 +menu.title.justify: right + +menu.frame: flat solid +menu.frame.color: rgb:6/6/6 +menu.frame.textColor: grey85 +menu.frame.disableColor: rgb:4/4/4 +menu.frame.font: lucidasans-10 +menu.frame.justify: center + +menu.bullet.position: right +menu.bullet: triangle + +menu.hilite: flat solid +menu.hilite.color: rgb:4/4/4 +menu.hilite.textColor: white + +window.title.focus: flat solid +window.title.focus.color: rgb:6/6/6 +window.title.unfocus: flat solid +window.title.unfocus.color: rgb:4/4/4 + +window.label.focus: flat crossdiagonal gradient +window.label.focus.color: rgb:8/8/7 +window.label.focus.colorTo: rgb:f/f/d +window.label.focus.textColor: rgb:2/2/1c +window.label.unfocus: flat solid +window.label.unfocus.color: rgb:4/4/4 +window.label.unfocus.textColor: rgb:2/2/2 + +window.button.focus: flat solid +window.button.focus.color: rgb:6/6/6 +window.button.focus.picColor: rgb:2/2/2 +window.button.unfocus: flat solid +window.button.unfocus.color: rgb:4/4/4 +window.button.unfocus.picColor: rgb:2/2/2 + +window.handle.focus: flat crossdiagonal gradient +window.handle.focus.color: rgb:8/8/7 +window.handle.focus.colorTo: rgb:f/f/d +window.handle.unfocus: flat solid +window.handle.unfocus.color: rgb:4/4/4 + +window.grip.focus: flat solid +window.grip.focus.color: rgb:8/8/8 +window.grip.unfocus: flat solid +window.grip.unfocus.color: rgb:4/4/4 + +window.frame.focusColor: rgb:f/f/d +window.frame.unfocusColor: rgb:6/6/6 + +window.font: lucidasans-10 +window.justify: right + +*button.pressed: flat solid +*button.pressed.color: rgb:a/a/8c + +borderColor: rgb:2/2/2 + +bevelWidth: 2 +borderWidth: 2 +handleWidth: 3 + +*textColor: grey20 +*Font: lucidasans-10 + +rootCommand: bsetroot -solid rgb:4/4/4
A data/styles/Spiff

@@ -0,0 +1,109 @@

+toolbar: flat gradient vertical +toolbar.color: rgb:c0/c4/c8 +toolbar.colorTo: rgb:a0/a4/a8 + +toolbar.button: flat gradient vertical +toolbar.button.color: rgb:bc/c0/c4 +toolbar.button.colorTo: rgb:a4/a8/ac +toolbar.button.picColor: black + +toolbar.button.pressed: flat gradient diagonal +toolbar.button.pressed.color: rgb:60/64/68 +toolbar.button.pressed.colorTo: rgb:80/84/88 + +toolbar.clock: flat gradient horizontal interlaced +toolbar.clock.color: black +toolbar.clock.colorTo: rgb:70/70/88 +toolbar.clock.textColor: white + +toolbar.label: flat gradient horizontal interlaced +toolbar.label.color: black +toolbar.label.colorTo: rgb:70/70/88 +toolbar.label.textColor: white + +toolbar.windowLabel: flat gradient horizontal interlaced +toolbar.windowLabel.color: black +toolbar.windowLabel.colorTo: rgb:78/90/94 +toolbar.windowLabel.textColor: white + +toolbar.justify: center + + +menu.title: flat gradient horizontal interlaced +menu.title.color: black +menu.title.colorTo: rgb:78/90/94 +menu.title.textColor: white +menu.title.justify: left + +menu.frame: flat gradient diagonal +menu.frame.color: rgb:c0/c4/c8 +menu.frame.colorTo: rgb:70/74/78 +menu.frame.textColor: rgb:40/44/48 +menu.frame.justify: left + +menu.hilite: flat gradient horizontal interlaced +menu.hilite.color: black +menu.hilite.colorTo: rgb:70/70/88 +menu.hilite.textColor: white + +menu.bullet: empty +menu.bullet.position: left + + +window.title.focus: flat gradient vertical +window.title.focus.color: rgb:c0/c4/c8 +window.title.focus.colorTo: rgb:a0/a4/a8 +window.title.unfocus: flat gradient vertical +window.title.unfocus.color: rgb:a0/a4/a8 +window.title.unfocus.colorTo: rgb:80/84/88 + +window.label.focus: flat gradient horizontal interlaced +window.label.focus.color: black +window.label.focus.colorTo: rgb:78/90/94 +window.label.focus.textColor: white +window.label.unfocus: flat gradient horizontal interlaced +window.label.unfocus.color: black +window.label.unfocus.colorTo: rgb:60/60/78 +window.label.unfocus.textColor: rgb:a0/a4/a8 + +window.button.focus: flat gradient vertical +window.button.focus.color: rgb:bc/c0/c4 +window.button.focus.colorTo: rgb:a4/a8/ac +window.button.focus.picColor: black +window.button.unfocus: flat gradient vertical +window.button.unfocus.color: rgb:9c/a0/a4 +window.button.unfocus.colorTo: rgb:84/88/8c +window.button.unfocus.picColor: rgb:40/44/48 +window.button.pressed: flat gradient diagonal +window.button.pressed.color: rgb:60/64/68 +window.button.pressed.colorTo: rgb:80/84/88 + +window.frame.focusColor: rgb:90/94/98 +window.frame.unfocusColor: rgb:40/48/50 + +window.handle.focus: flat gradient diagonal +window.handle.focus.color: rgb:c0/c4/c8 +window.handle.focus.colorTo: rgb:a0/a4/a8 +window.handle.unfocus: flat gradient diagonal +window.handle.unfocus.color: rgb:a0/a4/a8 +window.handle.unfocus.colorTo: rgb:80/84/88 + +window.grip.focus: flat diagonal gradient +window.grip.focus.color: black +window.grip.focus.colorTo: rgb:78/90/94 +window.grip.unfocus: flat diagonal gradient +window.grip.unfocus.color: black +window.grip.unfocus.colorTo: rgb:60/60/78 + +window.justify: left + + +borderColor: black + +bevelWidth: 1 +borderWidth: 1 +handleWidth: 3 + +rootCommand: bsetroot -mod 2 2 -fg rgb:48/50/68 -bg rgb:50/58/70 + +*Font: lucidasans-10
A data/styles/TDF

@@ -0,0 +1,115 @@

+! TarishedCopper.style +! by The Dixie Flatline. +! root image copyright(c)1999 propaganda.themes.org +! used w/o permission (for non-canned release) +! ---- +! You may only distribute this theme with the original +! root image or with the original blackbox source. +! ---- +! for Blackbox 0.60.x -ONLY- +! missing: slit border color + +toolbar: raised gradient bevel1 +toolbar.color: black +toolbar.colorTo: black +toolbar.label: Raised Gradient pipecross Bevel1 +toolbar.label.color: rgb:4e/38/32 +toolbar.label.colorTo: rgb:af/89/7c +toolbar.label.textColor: black +toolbar.windowLabel: Raised Gradient pyramid Bevel1 +toolbar.windowLabel.color: black +toolbar.windowLabel.colorTo: rgb:af/89/7c +toolbar.windowLabel.textColor: black +toolbar.clock: Raised Gradient pipecross bevel1 +toolbar.clock.color: rgb:4e/38/32 +toolbar.clock.colorTo: rgb:af/89/7c +toolbar.clock.textColor: black +toolbar.button: Raised gradient pipecross bevel1 +toolbar.button.color: rgb:4e/38/32 +toolbar.button.colorTo: rgb:af/89/7c +toolbar.button.picColor: black +toolbar.button.pressed: Flat Gradient Diagonal Bevel1 +toolbar.button.pressed.color: rgb:32/32/32 +toolbar.button.pressed.colorTo: rgb:82/6d/53 +toolbar.justify: center + +menu.title: Raised Gradient pipecross Bevel1 +menu.title.color: rgb:4e/38/32 +menu.title.colorTo: rgb:af/89/7c +menu.title.textColor: black +menu.title.justify: center +menu.frame: raised Gradient elliptic Bevel1 +menu.frame.color: black +menu.frame.colorTo: rgb:af/89/7c +menu.frame.textColor: black +menu.frame.justify: center +menu.hilite: sunken gradient crossdiagonal bevel1 +menu.hilite.color: rgb:4e/38/32 +menu.hilite.colorTo: rgb:af/89/7c +menu.hilite.textColor: rgb:ff/ff/ff +menu.bullet: empty +menu.bullet.position: right + +window.title.focus: Raised Gradient Diagonal bevel1 +window.title.focus.color: black +window.title.focus.colorTo: black +window.title.unfocus: Raised Gradient Diagonal bevel1 +window.title.unfocus.color: black +window.title.unfocus.colorTo: black + +window.label.focus: raised Gradient pyramid Bevel1 +window.label.focus.color: black +window.label.focus.colorTo: rgb:b3/8c/7f +window.label.focus.textColor: black + +window.label.unfocus: raised Gradient pyramid Bevel1 +window.label.unfocus.color: black +window.label.unfocus.colorTo: rgb:6c/54/4c +window.label.unfocus.textColor: black + +window.button.focus: Raised Gradient pipecross Bevel1 +window.button.focus.color: rgb:4e/38/32 +window.button.focus.colorTo: rgb:af/89/7c +window.button.focus.picColor: black +window.button.unfocus: raised gradient pyramid bevel2 +window.button.unfocus.color: black +window.button.unfocus.colorTo: rgb:6c/54/4c +window.button.unfocus.picColor: black +window.button.pressed: Flat Gradient Diagonal Bevel1 +window.button.pressed.color: rgb:32/32/32 +window.button.pressed.colorTo: rgb:82/6d/53 + +window.frame.focusColor: rgb:4e/38/32 +window.frame.unfocusColor: rgb:4c/36/30 + +window.handle.focus: raised Gradient pyramid Bevel2 +window.handle.focus.color: black +window.handle.focus.colorTo: rgb:af/89/7c +window.handle.unfocus: raised Gradient pyramid Bevel2 +window.handle.unfocus.color: black +window.handle.unfocus.colorTo: rgb:6c/54/4c + +window.grip.focus: raised gradient pipecross bevel1 +window.grip.focus.color: rgb:4e/38/32 +window.grip.focus.colorTo: rgb:af/89/7c +window.grip.unfocus: raised gradient pyramid bevel1 +window.grip.unfocus.color: black +window.grip.unfocus.colorTo: rgb:6c/54/4c + +borderWidth: 1 +bevelWidth: 1 +handleWidth: 5 +window.justify: CenterJustify + +toolbar.font: lucidasans-10 +menu.title.Font: lucidasans-10 +menu.frame.font: lucidasans-10 +window.font: lucidasans-10 +menuFont: lucidasans-10 +titleFont: lucidasans-10 + +borderColor: rgb:00/00/00 +rootCommand: bsetroot -gradient flatcrossdiagonalgradient -from black -to rgb:af/89/7c + +! fin +
A data/styles/Twice

@@ -0,0 +1,103 @@

+toolbar: flat diagonal gradient +toolbar.color: rgb:c/6/6 +toolbar.colorTo: rgb:8/4/4 +toolbar.button: flat diagonal gradient +toolbar.button.color: rgb:6/3/3 +toolbar.button.colorTo: rgb:a/5/5 +toolbar.button.picColor: rgb:4/2/2 +toolbar.button.pressed: flat crossdiagonal gradient +toolbar.button.pressed.color: grey40 +toolbar.button.pressed.colorTo: grey20 +toolbar.label: flat crossdiagonal gradient +toolbar.label.color: grey40 +toolbar.label.colorTo: grey20 +toolbar.label.textColor: grey85 +toolbar.windowLabel: flat crossdiagonal gradient +toolbar.windowLabel.color: grey40 +toolbar.windowLabel.colorTo: grey20 +toolbar.windowLabel.textColor: grey85 +toolbar.clock: flat crossdiagonal gradient +toolbar.clock.color: grey40 +toolbar.clock.colorTo: grey20 +toolbar.clock.textColor: grey85 +toolbar.justify: right +toolbar.font: lucidasans-10 + +menu.title: flat crossdiagonal gradient +menu.title.color: rgb:c/6/6 +menu.title.colorTo: rgb:6/3/3 +menu.title.textColor: white +menu.title.font: lucidasans-10 +menu.title.justify: right + +menu.frame: flat crossdiagonal gradient +menu.frame.color: grey40 +menu.frame.colorTo: grey20 +menu.frame.textColor: grey85 +menu.frame.disableColor: rgb:4/2/2 +menu.frame.font: lucidasans-10 +menu.frame.justify: center + +menu.bullet.position: right +menu.bullet: triangle + +menu.hilite: flat crossdiagonal gradient +menu.hilite.color: rgb:c/6/6 +menu.hilite.colorTo: rgb:6/3/3 +menu.hilite.textColor: white + +window.title.focus: flat diagonal gradient +window.title.focus.color: rgb:c/6/6 +window.title.focus.colorTo: rgb:8/4/4 +window.title.unfocus: flat solid +window.title.unfocus.color: grey30 + +window.label.focus: flat crossdiagonal gradient +window.label.focus.color: grey40 +window.label.focus.colorTo: grey20 +window.label.focus.textColor: white +window.label.unfocus: flat crossdiagonal gradient +window.label.unfocus.color: grey30 +window.label.unfocus.colorTo: grey20 +window.label.unfocus.textColor: grey60 + +window.button.focus: flat diagonal gradient +window.button.focus.color: rgb:8/4/4 +window.button.focus.colorTo: rgb:a/5/5 +window.button.focus.picColor: rgb:4/2/2 +window.button.unfocus: flat solid +window.button.unfocus.color: grey30 +window.button.unfocus.picColor: grey20 +window.button.pressed: flat crossdiagonal gradient +window.button.pressed.color: grey40 +window.button.pressed.colorTo: grey20 + +window.handle.focus: flat crossdiagonal gradient +window.handle.focus.color: rgb:c/6/6 +window.handle.focus.colorTo: rgb:6/3/3 +window.handle.unfocus: flat solid +window.handle.unfocus.color: grey30 + +window.grip.focus: flat crossdiagonal gradient +window.grip.focus.color: grey40 +window.grip.focus.colorTo: grey20 +window.grip.unfocus: flat crossdiagonal gradient +window.grip.unfocus.color: grey30 +window.grip.unfocus.colorTo: grey20 + +window.frame.focusColor: rgb:c/6/6 +window.frame.unfocusColor: grey30 + +window.font: lucidasans-10 +window.justify: right + +borderColor: grey10 + +bevelWidth: 1 +borderWidth: 2 +handleWidth: 4 + +*textColor: grey85 +*Font: lucidasans-10 + +rootCommand: bsetroot -solid grey20
A data/styles/qnx-photon

@@ -0,0 +1,138 @@

+# photon-qnx +# theme for fluxbox +# 2001 (c) skypher + +toolbar: raised gradient vertical + toolbar.color: rgb:DB/DA/DB + toolbar.colorTo: rgb:D4/CE/D2 + +toolbar.label: flat gradient vertical + toolbar.label.color: rgb:DB/DA/DB + toolbar.label.colorTo: rgb:D4/CE/D2 + toolbar.label.textColor: rgb:45/45/45 + +toolbar.windowLabel: sunken solid + toolbar.windowLabel.color: rgb:FC/F9/DF + toolbar.windowLabel.textColor: rgb:45/45/45 + +toolbar.clock: flat gradient vertical + toolbar.clock.color: rgb:DB/DA/DB + toolbar.clock.colorTo: rgb:D4/CE/D2 + toolbar.clock.textColor: rgb:45/45/45 + +toolbar.button: solid flat + toolbar.button.color: rgb:EB/EB/EB + toolbar.button.picColor: rgb:15/15/15 + +toolbar.button.pressed: sunken flat + toolbar.button.pressed.color: rgb:AB/AB/AB + +menu.title: raised gradient vertical + menu.title.color: rgb:68/95/E3 + menu.title.colorTo: rgb:31/59/9C + menu.title.textColor: white + +menu.frame: sunken gradient vertical + menu.frame.color: rgb:DB/DA/DB + menu.frame.colorTo: rgb:D4/CE/D2 + menu.frame.textColor: rgb:45/45/45 + +menu.hilite: flat solid + menu.hilite.color: rgb:91/A3/9E + menu.hilite.textColor: white + +menu.bullet: triangle + menu.bullet.position: right + +! win focus +window.title.focus: flat gradient vertical + window.title.focus.color: rgb:D9/D9/D9 + window.title.focus.colorTo: white + +window.label.focus: raised gradient vertical + window.label.focus.color: rgb:68/95/E3 + window.label.focus.colorTo: rgb:31/59/9C + window.label.focus.textColor: white + +window.button.focus: raised gradient vertical + window.button.focus.color: rgb:EA/EA/EA + window.button.focus.colorTo: rgb:94/9B/99 + window.button.focus.picColor: rgb:35/35/35 + +window.button.pressed: sunken solid + window.button.pressed.color: rgb:94/9B/99 + +window.handle.focus: raised solid + window.handle.focus.color: rgb:EA/EA/EA + +window.grip.focus: Raised Gradient vertical + window.grip.focus.color: rgb:68/95/E3 + window.grip.focus.colorTo: rgb:31/59/9C + +window.frame.focusColor: black + + +! unfocused win +window.title.unfocus: flat gradient vertical + window.title.unfocus.color: rgb:D9/D9/D9 + window.title.unfocus.colorTo: white + + +window.label.unfocus: raised gradient vertical + window.label.unfocus.color: rgb:C6/C5/C6 + window.label.unfocus.colorTo: rgb:A7/A6/A7 + window.label.unfocus.textColor: white + +window.button.unfocus: raised gradient vertical + window.button.unfocus.color: rgb:EA/EA/EA + window.button.unfocus.colorTo: rgb:94/9B/99 + window.button.unfocus.picColor: rgb:35/35/35 + +window.handle.unfocus: raised solid + window.handle.unfocus.color: rgb:EA/EA/EA + +window.grip.unfocus: raised solid + window.grip.unfocus.color: rgb:EA/EA/EA + +window.frame.unfocusColor: black + +! ----------- tab - explicit for fluxbox, the best wm out there[tm] (; +window.tab.justify: left + +window.tab.label.unfocus: raised gradient vertical +window.tab.label.unfocus.color: rgb:C6/C5/C6 +window.tab.label.unfocus.colorTo: rgb:A7/A6/A7 +window.tab.label.unfocus.textColor: white + +window.tab.label.focus: raised gradient vertical +window.tab.label.focus.color: rgb:68/95/E3 +window.tab.label.focus.colorTo: rgb:31/59/9C +window.tab.label.focus.textColor: white + +window.tab.borderWidth: 1 +window.tab.borderColor: black +! ----------- (fluxbox.sourceforge.net) + +! fonts +window.tab.font: -*-gamow-medium-r-*-*-7-*-*-*-*-60-*-* +! ^ change this to lucidasans-10 if you don't have gamow + +toolbar.font: lucidasans-10 + toolbar.justify: left + +window.font: lucidasans-10 + window.justify: left + +menu.title.Font: lucidasans-10 + menu.title.justify: left + +menu.frame.font: lucidasans-10 + menu.frame.justify: left + +! borders n stuff +borderColor: black +borderWidth: 1 +bevelWidth: 2 +handleWidth: 4 +frameWidth: 0 +rootCommand: bsetbg -solid white
A data/titlebar

@@ -0,0 +1,2 @@

+Right: minimize maximize close +Left: sticky
A doc/Coding_style

@@ -0,0 +1,45 @@

+The coding style is almost the same as i blackbox. +Instead of 2 spaces there is tab. +It might look strange now in some places, that is because +the code hasnt been "translated" to tab 100% yet. +Use a tab size of 2 and you will be fine. + +note if-statement: + + if ( stuff ) + function(stuff, more stuff, + more, even more); + else + morefunction( stuff, more stuff + stuff, + stuff, + stuff); + +if the functionline needs to be split up, like above, right after a if-statement +use { and }, so its clear when the if-statement ends. +It should look like this + + if ( stuff ) { + function(stuff, more stuff, + more, even more); + } else { + morefunction( stuff, more stuff + stuff, + stuff, + stuff); + } + +The includeguards: +_FILENAME_HH_ + + +Function comments: +//------------ function name -------- +// This do that and that +// Returns this on success else +// this on failure. +// TODO: if there is something to do. +//----------------------------------- +type classname::function(...) { + +}
A doc/Makefile.am

@@ -0,0 +1,11 @@

+# doc/Makefile.am for Blackbox 0.61.x - an X11 Window manager + +CLEANFILES = fluxbox.1 +MAINTAINERCLEANFILES = Makefile.in +man_MANS = fluxbox.1 bsetroot.1 +EXTRA_DIST=fluxbox.1.in bsetroot.1 Coding_style +distclean-local: + rm -f *\~ + +fluxbox.1: fluxbox.1.in + @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," fluxbox.1.in > fluxbox.1
A doc/Makefile.in

@@ -0,0 +1,246 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox 0.61.x - an X11 Window manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +CLEANFILES = fluxbox.1 +MAINTAINERCLEANFILES = Makefile.in +man_MANS = fluxbox.1 bsetroot.1 +EXTRA_DIST = fluxbox.1.in bsetroot.1 Coding_style +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 --include-deps doc/Makefile + +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 +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = doc + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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-man +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-man +uninstall: uninstall-am +all-am: Makefile $(MANS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(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-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am distclean-local + -rm -f libtool + +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: install-man1 uninstall-man1 install-man uninstall-man 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 *\~ + +fluxbox.1: fluxbox.1.in + @regex_cmd@ -e "s,@pkgdatadir@,$(pkgdatadir)," fluxbox.1.in > fluxbox.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:
A doc/bsetroot.1

@@ -0,0 +1,89 @@

+.\" +.\" Man page for Bsetroot +.\" +.\" Copyright (c) 2000 by Wilbert Berendsen <wbsoft@xs4all.nl> +.\" +.TH bsetroot 1 "June 16th, 2000" "0.60.3" +.SH NAME +bsetroot \- blackbox utility to change root window appearance +.SH SYNOPSIS +.BR bsetroot " \-help" +.br +.B bsetroot +.RI "[ \-display " display " ] \-solid " color +.br +.B bsetroot +.RI "[ \-display " display " ] \-mod " "x y" " \-fg " color " \-bg " color +.br +.B bsetroot +.RI "[ \-display " display " ] \-gradient " texture " \-from " color " \-to " color +.SH DESCRIPTION +Bsetroot is a utility that can control the appearance of the root window in +three ways: Either give it a solid color, or write a two color modula pattern +to it, or render a gradient texture, based on two different colors. +.PP +Bsetroot resembles +.IR xsetroot (1) +in this functionality but it supports multiple screen displays, and gradient +textures the same way as Blackbox does. +It doesn't handle cursors etc. +Bsetroot is part of the Blackbox package. +.SH OPTIONS +Bsetroot operates in three ways, you must choose one of the first 3 options: +.TP +.BI \-solid " color" +Sets the root window to specified color. +.TP +.BI \-mod " x y" +Creates a modula pattern. You must specify +.BR \-bg " and " \-fg +colors. +.TP +.BI \-gradient " texturestring" +Renders the specified texture string to the root window. +For possible texture strings, please refer to +.IR blackbox (1). +You must also specify both a +.BR \-from " and a " \-to +color. +.TP +.BI \-display " display" +Tells Bsetroot to connect to the specified display. +.TP +.BI "\-bg, \-background " color +Background color. +Needed for +.B \-mod +patterns. +.TP +.BI "\-fg, \-foreground " color +Foreground color. +Needed for +.B \-mod +patterns. +.TP +.BI \-from " color" +Start color for rendering textures. +Needed for +.B \-gradient +operation mode. +.TP +.BI \-to " color" +Ending color for rendering textures. +Needed for +.B \-gradient +operation mode. +.TP +.B \-help +Prints version info and short help text. +.SH AUTHOR +Bsetroot is written and maintained by Brad Hughes +.nh \" hyphenation off +(blackbox@alug.org) +.hy \" on again +and Jeff Raven +.nh +(jraven@psu.edu). +.hy +.SH SEE ALSO +.IR blackbox (1)
A doc/fluxbox.1.in

@@ -0,0 +1,805 @@

+.\" +.\" Man page for Blackbox +.\" +.\" Copyright (c) 2000 by Wilbert Berendsen <wbsoft@xs4all.nl> +.\" +.\" This manual page may be freely distributed and modified. +.\" Parts of the text are taken from website and several README's +.\" by His Great Hughesness himself. Why reinvent wheels? +.\" +.\" Created with NEdit, tested with ``man'' and ``tkman.'' +.\" This manpage uses only standard groff and tmac.an macros. +.\" To all translators who didn't do manpages earlier (like me ;-): +.\" Read the Man-Page-Mini-HOWTO and the LDP manpage ``man 7 man'' +.\" There's all I needed to know about these macros. +.\" +.\" Updated for bb 0.61 at Sat Sep 9 06:56:04 CEST 2000 +.\" +.\" Changed to fluxbox by Henrik Kinnunen (fluxgen@linuxmail.org) +.\" +.\" ..define sort of <blockquote><pre> macro +.de EX +.ne 5 +.if n .sp 1 +.if t .sp .5 +.nf +.in +.5i +.. +.de EE +.fi +.in -.5i +.if n .sp 1 +.if t .sp .5 +.. +.TH blackbox 1 "October 4th, 2000" "0.61.1" +.SH NAME +blackbox \- a window manager for X11 +.SH SYNOPSIS +.BR blackbox " \-help | \-version" +.br +.B blackbox +.RI "[ \-rc" " rcfile " "] [ \-display" " display " ] +.SH DESCRIPTION +.\" +.\" Phirst Phew ParagraPhs taken from blackbox.alug.org +.\" +Blackbox is yet another addition to the list of window managers for the Open +Group's X Window System, Version 11 Release 6 and above. +Blackbox is built with C++, sharing no common code with any other window +manager (even though the graphics implementation is similar to that of Window +Maker). +.PP +From the time the first line of code was written, Blackbox has evolved around +one premise, minimalism. +It's not meant to be Eye Candy, nor the most Featureful, nor the most Adorned +for modelling the Widely acclaimed NeXT interface. +It is just meant to be +.BR fast . +.PP +Blackbox provides configurable window decorations, a root menu to launch +applications and a toolbar that shows the current workspace name, the focused +application name and the current time. +There is also a workspace menu to add or remove workspaces. The `slit' can be +used to dock small applications, e.g. most of the bbtools can use the slit. +.PP +Blackbox features a special kind of icon handling: When you minimize a window, +no icon appears; instead you can view all minimized applications in the `Icons' +submenu of the workspace menu. +Your desktop will never get cluttered with icons. As an alternative to icons +shaded windows are provided: A double click on the titlebar of a window will +shade it (i.e. the window will disappear, only the titlebar stays visible.) +.PP +Blackbox uses its own graphics class to render its images on the fly. +By using style files, you can determine at a great level how your desktop looks +like. +Currently KDE WM hints are not supported, but Blackbox is already prepared to +support the new window manager specification that is now being developed for +both Gnome and KDE2.0. +.SH OPTIONS +Blackbox supports the following commandline options: +.TP +.B \-help +Display command line options and compiled-in features, then exit. +.TP +.B \-version +Display version info and exit. +.TP +.BI \-rc \ rcfile +Use another rcfile than the default +.IR "~/.blackboxrc" . +.TP +.BI \-display \ display +Start Blackbox on the specified display. +Programs started by Blackbox will have the +.B DISPLAY +environment variable set to this value, too. +.SH RUNNING BLACKBOX +This program is usually started by the user's startup script, most times called +.IR ~/.xinitrc . +To run blackbox, modify the script by adding +.EX 0 +exec blackbox +.EE +as the last executed command of the script. +When Blackbox terminates, the X session will terminate too. +.PP +When started, Blackbox will try to find a default menufile in +.IR @pkgdatadir@/menu . +You can provide a system-wide menu for your users here. +.PP +On exit or restart, Blackbox will save user defaults in the file +.I ~/.blackboxrc +in the user's home directory. +Some resources in this file can be edited by hand. +.SH USING BLACKBOX +From version 0.60.x, Blackbox does no keyboard handling by itself; instead it +relies on an external program +.IR bbkeys (1) +for this. +So in this section we will discuss all mouse commands. +.SS Root window (background): +Right click (button 3) will pop up the root menu. +With this you can launch your applications. +You can customize this menu for your needs. +A middle click (button 2) pops up the workspace menu. +You can add or remove a workspace, view +applications running on all workspace, inspect your icons, and jump directly to +any workspace or application. +.PP +Left clicking (button 1) on an application in the Workspaces menu will bring +you to that workspace and raise/focus that application; +middle clicking (button 2) will warp the application to the current workspace. +.SS Toolbar: +The toolbar consists of three fields: a workspace name, window name of the +window that has currently focus, and a clock. +A left click on the toolbar will bring it to the foreground, a +middle click will hide it behind other windows (if AlwaysOnTop is not set), and +the right button brings up a little menu. +.PP +Using this menu you can enter a name for the current workspace (when finished, +press Enter). +Also you can choose the toolbar's position, whether or not it +should be always on top (i.e. it cannot be obscured by other windows), +and whether it should hide itself when the mouse moves away. +.PP +Note: In Blackbox versions below 0.60.0, a right click on the toolbar +immediately enters workspace name edit mode. +.SS Window Titlebar and Borders: +A left click on any place of the window's border, will raise it. +Dragging then moves the window. +Dragging the resize grips at the left-bottom and right-bottom +corners resizes the window. +Middle clicking on any place will immediately lower the window. +Right clicking on border or titlebar pops up the window menu, +containing these commands: +.TP +.B Send To... +Send window to another workspace. +When you select the workspace with the middle button, Blackbox will +send you along with the application to the selected workspace +.TP +.B Shade +Shade the window (display titlebar only) +.TP +.B Iconify +Iconify window. +The `icon' can be found in the `Icons' submenu of the workspace menu +.TP +.B Maximize +(Un)Maximize window. +When you click the middle button on this item, the +window will maximize only vertically +.TP +.B Raise +Raise window +.TP +.B Lower +Lower window +.TP +.B Stick +(Un)Stick window. +A stuck window will always be displayed in the current workspace +.TP +.B Kill Client +Kill (-SIGKILL) owner of window +.TP +.B Close +Close the application cleanly +.PP +When you doubleclick on the titlebar of a window, it will `shade', so +that only the titlebar stays visible. +Another double click will redisplay the window contents. +.SS Window Buttons: +The button at the left upper corner of a window is the Minimize button. +Clicking with any button causes the window to be iconified. +The rightmost button (with the X) closes the application. +The other button on the right (if present) maximizes the window in three ways: +Button 1 causes full screen maximization, button 2 maximizes the window only +vertically, and button 3 only horizontally. +.SS Any menu: +Clicking button 3 in a menu will popdown the menu. +Clicking button 1 on the titlebar of any (sub)menu and then dragging it somewhere +else will cause the menu to stay visible and not disappear when you click on +a menu item. +.SS Miscellaneous: +When you want to drag a window, but cannot see either the bottom handle or its +titlebar, you can press Alt + button 1 anywhere in the window and then +drag it around. +You can also use Alt + button 1 to raise a partially visible window. +Finally, Alt + button 2 lowers a window, and Alt + button 3 resizes the window. +.SH MENU FILE +A default menu file is installed in +.IR @pkgdatadir@/menu . +Of course this system-wide menu can be customized for all users at once. +But it is also possible to create a personal menu. +It is a convention to create a directory +.IR "~/.blackbox/" " (or " "~/blackbox/" ")" +in your home directory, and to create a menu file, e.g. +.I menu +in this directory, or copy the system-wide menu file to this location. +Next, we have to tell Blackbox to load our menu file instead of the default. +This is accomplished by adding (or changing) a resource value in the +.I ~/.blackboxrc +file e.g.: +.EX +session.menuFile: ~/.blackbox/menu +.EE +For this change to take effect, Blackbox has to be restarted. +Be sure that your menu is usable, then choose `Restart' from the default +Blackbox root menu. +.SS Menu syntax +The menu syntax is very simple and very effective. +There are upto three fields in a menu line. +They are of the form: +.EX +[tag] (label or filename) {command or filename} +.EE +The supported tags are as follows: +.TP +.B [begin] (label for root menu) +This tells Blackbox to start parsing the menu file. +This tag is required for Blackbox to parse your menu file. +If it cannot find it, the system default menu is used instead. +.TP +.B [end] +This tells Blackbox that it is at the end of a menu. +This can either be a submenu or the main root menu. +There must be at least one of these tags in your menu to correspond to the +required [begin] tag. +.TP +.B [exec] (label for command) {shell command} +Inserts a command item into the menu. +When you select the menu item from the menu, Blackbox runs `shell command.' +.TP +.B [exit] (label for exit) +Inserts an item that shuts down and exits Blackbox. +Any open windows are reparented to the root window before Blackbox exits. +.TP +.B [include] (filename) +Parses the file specified by +.I filename +inline with the +current menu. The filename can be the full path to a file or it can begin with +.IR ~/ , +which will be expanded into your home directory (e.g. +.EX +[include] (~/blackbox/stylesmenu) +.EE +will include +.I /home/bhughes/blackbox/stylesmenu +in my menu). +.TP +.B [nop] (label - optional) +Insert a non-operational item into the current menu. +This can be used to help format the menu into blocks or sections +if so desired. +.B [nop] +does accept a label, but it is not required, and a blank item will be used +if none is supplied. +.TP +.B [style] (label) {filename} +This tells Blackbox to insert an item that, when selected, reads style file +named +.I filename +and apply the new textures, colors and fonts to the current +running session. +.TP +.B [stylesdir] (directory name) +Reads all filenames from the specified directory, assuming that they are all +valid style files (directories are ignored), and creates menu items in the +current menu for every filename, that, when selected by the user, apply the +selected style file to the current session. +The labels that are created in the menu are the filenames of the style files. +.TP +.B [stylesmenu] (label) {directory name} +Creates a submenu entry with +.I label +(that is also the title of the new submenu), and inserts in that submenu all +filenames in the specified directory, assuming that they are all valid style +files (directories are ignored) in the same way as the +.B [stylesdir] +command does. +.IP +.RB Both\ [stylesdir] \ and\ [stylesmenu] +commands make it possible to install style files without editing your menu file. +.TP +.B [submenu] (label) {title for menu - optional} +This tells Blackbox to create and parse a new menu. +This menu is inserted as a submenu into the parent menu. +These menus are parsed recursively, so there is no limit to the number of levels +or nested submenus you can have. +The title for the new menu is optional, if none is supplied, +the new menu's title is the same as the item label. +An +.B [end] +tag is required to end the submenu. +.TP +.B [reconfig] (label) +When selected, this item rereads the current style and menu files and +apply any changes. +This is useful for creating a new style or theme, as you don't have to +constantly restart Blackbox every time you save your style. +However, Blackbox automagically rereads the menu whenever it changes. +.TP +.B [restart] (label) {shell command - optional} +This tells Blackbox to restart. +If `shell command' is supplied, it shuts down and runs the command (which is +commonly the name of another window manager). +If the command is omitted, Blackbox restarts itself. +.TP +.B [config] (label) +Inserts a Blackbox native submenu item, containing numerous configuration +options concerning window placement, focus style, window moving style etc. +.TP +.B [workspaces] (label) +This tells Blackbox to insert a link to the workspaces menu directly +into your menu. +This is handy for those users who can't access the +workspace menu directly (e.g. if you don't have a 3 button mouse, it's +rather hard to middle click to show the workspace menu). +.PP +Any line that starts with a `#' is considered a comment and ignored by Blackbox. +Also, in the labels/commands/filenames fields, +you can escape any character like so: +.EX +[exec] (\\(my cool\\) \\{XTERM\\}) {xterm -T \\"cool XTERM\\"} +.EE +Using `\\\\' inserts a literal back-slash into the label/command/filename field. +.SS Menu example +Now let's put together some things. +Here is a short example of a menu file: +.PP +.nf +# Blackbox menu file +[begin] (Blackbox 0.60.3) + [exec] (rxvt) {rxvt -ls} + [exec] (netscape) {netscape -install} + [exec] (The GIMP) {gimp} + [exec] (XV) {xv} + [submenu] (pine) + [exec] (inbox) {rxvt -name pine -e pine -i} + [exec] (new message) {rxvt -name pine -e pine ""} + [end] + [submenu] (Window Manager) + [exec] (Edit Menus) {nedit .blackbox/Menu} + [submenu] (Style) {Which Style?} + [stylesdir] (~/.blackbox/styles) + [stylesmenu] (Blackbox Styles) {@pkgdatadir@/styles} + [end] + [config] (Config Options) + [reconfig] (Reconfigure) + [restart] (Restart) + [end] + [exit] (Log Out) +[end] +# end of menu file +.fi +.SH STYLES +Blackbox enables you to use specialized files that contain +.IR X (1) +resources to specify colors, textures and fonts, and thus +the overall look of your window borders, menus and the toolbar. +.PP +The default installation of Blackbox provides some of these style files. +Usually they are put in +.IR @pkgdatadir@/styles . +You can study or edit these files to grasp how the Blackbox style mechanism +works. +You can use the +.BR [style] ", " [stylesdir] " and " [stylesmenu] +menu commands in your menu file to be able to select and change between styles +on the fly. +.PP +But you can also create a directory named +.I ~/.blackbox/styles +in your homedirectory and put your own style files here. +Of course you may choose any name for this directory, but many downloadable +themes will rely on the name +.I styles +(following the bb.themes.org naming scheme). +.PP +To understand how the style mechanism works, you should have a little knowledge +of how X resources work. +.PP +X resources consist of a key and a value. +The key is constructed of several smaller keys (sometimes referred to as +children), delimited by a period (`.'). +Keys may also contain a star (`*') to serve as a wildcard, which means that one +line of typed text will match several keys. +This is useful for styles that are based on one or two colors. +.PP +Blackbox allows you to configure it's three main components: the toolbar, the +menus and the window decorations. +.PP +The little window that shows the x-y position while dragging windows, borrows +ite style from the window's titlebar. +.PP +Here are some quick examples: +.EX +toolbar.clock.color: green +.EE +This sets the color resource of the toolbar clock to `green.' Another example: +.EX +menu*color: rgb:3/4/5 +.EE +This sets the color resource of the menu +.I and all of its `children' +to `rgb:3/4/5'. +(For a description of color names, see +.IR X (1).) +So this one also applies to +.IR menu.title.color " and " menu.frame.color . +And with +.EX +*font: -b&h-lucida-medium-r-normal-*-*-140-* +.EE +you set the font resource for all keys to this font name all at once. +(For information about the fonts installed on your system, you can use a program like +.IR xfontsel "(1), " gtkfontsel ", or " xlsfonts "(1).)" +.PP +Now, what makes Blackbox just so spectacular, is its ability to render textures +on the fly. +Texture descriptions are specified directly to the key that they +should apply to, e.g.: +.ta \w'toolbar.clock.colorTo:\ 'u +.EX +toolbar.clock: Raised Gradient Diagonal Bevel1 +toolbar.clock.color: rgb:8/6/4 +toolbar.clock.colorTo: rgb:4/3/2 +.EE +Don't worry, we will explain right now! +A texture description consists of up to five fields, which are as follows: +.TP +.B Flat / Raised / Sunken +gives the component either a flat, raised or sunken appearance. +.TP +.B Gradient / Solid +tells Blackbox to draw either a solid color or a gradiented texture. +.TP +.B Horizontal / Vertical / Diagonal / Crossdiagonal / Pipecross / Elliptic / Rectangle / Pyramid +Select one of these texture types. They only work when also +.B Gradient +is specified! +.TP +.B Interlaced +tells Blackbox to interlace the texture (darken every other line). +This option is most commonly used with gradiented textures, but from Blackbox +version 0.60.3 on, it also works in solid textures. +.TP +.B Bevel1 / Bevel2 +tells Blackbox which type of bevel to use. +Bevel1 is the default bevel. +The shading is placed on the edge of the image. +Bevel2 is an alternative. +The shading is placed one pixel in from the edge of the image. +.PP +Instead of a texture description, also the option +.B ParentRelative +is available, which makes the component appear as a part of its parent, e.g. +totally transparant. +.PP +All gradiented textures are composed of two color values: the +.IR color " and " colorTo " resources." +When +.B Interlaced +is used in +.B Solid +mode, the +.I colorTo +resource is used to find the interlacing color. +.PP +Well, here is the complete component list, also all components together with +which kind of value they can contain. +Comments are preceded with an exclamation sign (!), which is also used for +comments in Blackbox style c.q. X resource files. +.PP +.ta \w'window.button.unfocus.picColor:\ 'u +.nf +.\" +.\" The comments also to be translated! +.\" +! The toolbar itself +toolbar: Texture +toolbar.color: Color +toolbar.colorTo: Color + +! The buttons on the toolbar +toolbar.button: Texture or \fIParentRelative\fR +toolbar.button.color: Color +toolbar.button.colorTo: Color + +! Color of the button arrows +toolbar.button.picColor: Color + +! Buttons in pressed state +toolbar.button.pressed: Texture \fI(e.g. Sunken)\fR or \fIParentRelative\fR +toolbar.button.pressed.color: Color +toolbar.button.pressed.colorTo: Color + +! Color of pressed button arrows +toolbar.button.pressed.picColor: Color + +! The toolbar workspace label +toolbar.label: Texture or \fIParentRelative\fR +toolbar.label.color: Color +toolbar.label.colorTo: Color +toolbar.label.textColor: Color + +! The toolbar window label +toolbar.windowLabel: Texture or \fIParentRelative\fR +toolbar.windowLabel.color: Color +toolbar.windowLabel.colorTo: Color +toolbar.windowLabel.textColor: Color + +! The toolbar clock +toolbar.clock: Texture or \fIParentRelative\fR +toolbar.clock.color: Color +toolbar.clock.colorTo: Color +toolbar.clock.textColor: Color + +! How the toolbar's text should be justified. +toolbar.justify: \fIcenter\fR, \fIleft\fR, or \fIright\fR + +! Font to be used for all toolbar components +toolbar.font: Font \fI(e.g. -*-helvetica-medium-r-normal-*-*-100-*)\fR + +! The menu titlebar +menu.title: Texture +menu.title.color: Color +menu.title.colorTo: Color +menu.title.textColor: Color +menu.title.font: Font +menu.title.justify: \fIcenter\fR, \fIleft\fR, or \fIright\fR + +! The menu frame +menu.frame: Texture +menu.frame.color: Color +menu.frame.colorTo: Color +menu.frame.textColor: Color +menu.frame.disableColor: Color +menu.frame.font: Font +menu.frame.justify: \fIcenter\fR, \fIleft\fR, or \fIright\fR + +! Bullets for submenu items +menu.bullet: \fIempty\fR, \fItriangle\fR, \fIsquare\fR, or \fIdiamond\fR +menu.bullet.position: \fIright\fR or \fIleft\fR + +! The highlighted menu item +menu.hilite: Texture (e.g. \fIRaised\fR) +menu.hilite.color: Color +menu.hilite.colorTo: Color +menu.hilite.textColor: Color + +! A focused window +window.title.focus: Texture +window.title.focus.color: Color +window.title.focus.colorTo: Color + +! An unfocused window +window.title.unfocus: Texture +window.title.unfocus.color: Color +window.title.unfocus.colorTo: Color + +! Window label +window.label.focus: Texture or \fIParentRelative\fR +window.label.focus.color: Color +window.label.focus.colorTo: Color +window.label.focus.textColor: Color + +window.label.unfocus: Texture or \fIParentRelative\fR +window.label.unfocus.color: Color +window.label.unfocus.colorTo: Color +window.label.unfocus.textColor: Color + +! Handlebar +window.handle.focus: Texture +window.handle.focus.color: Color +window.handle.focus.colorTo: Color + +window.handle.unfocus: Texture +window.handle.unfocus.color: Color +window.handle.unfocus.colorTo: Color + +! Resize grips +window.grip.focus: Texture +window.grip.focus.color: Color +window.grip.focus.colorTo: Color + +window.grip.unfocus: Texture +window.grip.unfocus.color: Color +window.grip.unfocus.colorTo: Color + +! Window buttons +window.button.focus: Texture or \fIParentRelative\fR +window.button.focus.color: Color +window.button.focus.colorTo: Color +window.button.focus.picColor: Color + +window.button.unfocus: Texture or \fIParentRelative\fR +window.button.unfocus.color: Color +window.button.unfocus.colorTo: Color +window.button.unfocus.picColor: Color + +window.button.pressed: Texture (e.g. \fISunken\fR) +window.button.pressed.color: Color +window.button.pressed.colorTo: Color + +! Frame around window +window.frame.focusColor: Color +window.frame.unfocusColor: Color + +! Font and justification for window labels +window.font: Font +window.justify: \fIcenter\fR, \fIleft\fR, or \fIright\fR + +! Miscellaneous resources + +! A border can be drawn round all components +borderWidth: a number of pixels, e.g. \fI1\fR +borderColor: Color + +bevelWidth: a number of pixels > 0 +handleWidth: a number of pixels > 0 + +! Width of the window frame (from version 0.61 on) +! When not specified, frameWidth defaults to the value of bevelWidth +frameWidth: a number of pixels >= 0 + + +! This command is executed whenever this style is selected. +! Typically it sets the root window to a nice picture. +rootCommand: Shell command, e.g. \fIbsetroot -mod 4 4 -fg rgb: 5/6/6 -bg grey20\fR + +! Some of the bbtools read these old 0.51 resources +menuFont: Font +titleFont: Font +.fi +.PP +Now, this seems a long list, but remember, when you create your own style, you +can easily set lots of keys with a single command, e.g. +.EX +.ta \w'*unfocus.textColor:\ 'u +*color: slategrey +*colorTo: darkslategrey +*unfocus.color: darkslategrey +*unfocus.colorTo: black +*textColor: white +*unfocus.textColor: lightgrey +*font: lucidasans-10 +.EE +This sets already nice defaults for many components. +.SH THE SLIT +The slit is a special Blackbox window frame that can contain dockable +applications, e.g. the `bbtools.' +When applications are run in the slit they have no window borders of their own; +instead they are framed in the slit, and they are always visible in the current +workspace. +You can click button 3 on the edge of the slit window to get a menu to +determine its position, whether its contained applications should be grouped +horizontally or vertically and whether the slit should hide itself when the +mouse moves away. +.PP +Most dockable applications use the +.B -w +option to run in the slit. +For example, you could put in your +.IR ~/.xinitrc : +.EX +bbmail -w & +bbpager -w & +exec blackbox +.EE +Of course to use the slit you must have slit support compiled in. +.SH RESOURCE FILE +Usually the +.I ~/.blackboxrc +resource file is created and maintained bij Blackbox itself. +All options from the +.B [config] +menu (from 0.60.x on), the last selected style file, your workspace names and +so on are saved into this file. +However, there are some resources in it you might want to edit yourself: +.TP +.B session.menuFile: +This tells Blackbox where to look for its menu file. +.TP +.B session.screen0.toolbar.widthPercent: +This determines the amount (in %) of space the toolbar will take. +Default value is: +.IR 66 . +.TP +.B session.screen0.strftimeFormat: +This adjusts the way the current time is displayed in the toolbar. +The +.IR strftime (3) +format is used. +The default value is: +.IR "%I:%M %p" . +.TP +.B session.autoRaiseDelay: +Adjusts the delay (in ms) before focused windows will raise when using the +Autoraise option. +The default value is: +.IR 250 . +.TP +.B session.doubleClickInterval: +Adjust the delay (in ms) between mouse clicks for Blackbox to consider a double click. +Default value is: +.IR 250 . +.TP +.B session.screen0.edgeSnapThreshold: +When moving a window across your screen, Blackbox is able to have it `snap' to +the edges of the screen for easy placement. +This variable tells Blackbox the distance (in pixels) at which the window will +jump to the egde. +Default value is: +.IR 0 . +.TP +.B session.cacheMax: +This tells Blackbox how much memory (in Kb) it may use to store cached pixmaps on +the X server. +If your machine runs short of memory, you may lower this value. +Default value is +.IR 200 . +.TP +.B session.cacheLife: +This tells Blackbox how long (in minutes) unused pixmaps may stay in the X +server's memory. +Default value is +.IR 5 . +.TP +.B session.colorsPerChannel: +This tells Blackbox how many colors to take from the X server on pseudocolor +displays. A channel would be red, green, or blue. +Blackbox will allocate this variable ^ 3 colors and make them always available. +Value must be between 2 and 6. +When you run Blackbox on an 8-bit display, you must set this resource to 4. +Default value is +.IR 4. +.PP +When running Blackbox in a multiple desktop environment the +.B screen0 +key can also be +.B screen1, 2 +etc. for any appropriate desktop. +.SH ENVIRONMENT +.TP +.B HOME +Blackbox uses +.RB $ HOME +to find its +.I .blackboxrc +file, and to resolve stylefile and \-directory names. +.TP +.B DISPLAY +When no other display was given on the command line, Blackbox will start on the +display specified by this variable. +.SH AUTHOR and CREDITS +All of the code is written and maintained by Brad Hughes +.nh \" hyphenation off +(blackbox@alug.org) +.hy \" on again +and Jeff Raven +.nh +(jraven@psu.edu), +.hy +with contributions and patches merged from +many individuals around the world. +.PP +The Official Blackbox website: +.nh +.B http://blackbox.alug.org/ +.hy +.br +Many themes and other contributions: +.nh +.B http://bb.themes.org/ +.hy +.PP +This manpage was put together by Wilbert Berendsen +.nh +(wbsoft@xs4all.nl). +.hy +Numerous other languages will be available. +.SH SEE ALSO +.IR bsetroot (1), \ bbkeys (1) \" not there, yet ;-(
A install-sh

@@ -0,0 +1,250 @@

+#!/bin/sh +# +# install - install a program, script, or datafile +# This comes from X11R5 (mit/util/scripts/install.sh). +# +# Copyright 1991 by the Massachusetts Institute of Technology +# +# Permission to use, copy, modify, distribute, and sell this software and its +# documentation for any purpose is hereby granted without fee, provided that +# the above copyright notice appear in all copies and that both that +# copyright notice and this permission notice appear in supporting +# documentation, and that the name of M.I.T. not be used in advertising or +# publicity pertaining to distribution of the software without specific, +# written prior permission. M.I.T. makes no representations about the +# suitability of this software for any purpose. It is provided "as is" +# without express or implied warranty. +# +# Calling this script install-sh is preferred over install.sh, to prevent +# `make' implicit rules from creating a file called install from it +# when there is no Makefile. +# +# This script is compatible with the BSD install script, but was written +# from scratch. It can only install one file at a time, a restriction +# shared with many OS's install programs. + + +# set DOITPROG to echo to test this script + +# Don't use :- since 4.3BSD and earlier shells don't like it. +doit="${DOITPROG-}" + + +# put in absolute paths if you don't have them in your path; or use env. vars. + +mvprog="${MVPROG-mv}" +cpprog="${CPPROG-cp}" +chmodprog="${CHMODPROG-chmod}" +chownprog="${CHOWNPROG-chown}" +chgrpprog="${CHGRPPROG-chgrp}" +stripprog="${STRIPPROG-strip}" +rmprog="${RMPROG-rm}" +mkdirprog="${MKDIRPROG-mkdir}" + +transformbasename="" +transform_arg="" +instcmd="$mvprog" +chmodcmd="$chmodprog 0755" +chowncmd="" +chgrpcmd="" +stripcmd="" +rmcmd="$rmprog -f" +mvcmd="$mvprog" +src="" +dst="" +dir_arg="" + +while [ x"$1" != x ]; do + case $1 in + -c) instcmd="$cpprog" + shift + continue;; + + -d) dir_arg=true + shift + continue;; + + -m) chmodcmd="$chmodprog $2" + shift + shift + continue;; + + -o) chowncmd="$chownprog $2" + shift + shift + continue;; + + -g) chgrpcmd="$chgrpprog $2" + shift + shift + continue;; + + -s) stripcmd="$stripprog" + shift + continue;; + + -t=*) transformarg=`echo $1 | sed 's/-t=//'` + shift + continue;; + + -b=*) transformbasename=`echo $1 | sed 's/-b=//'` + shift + continue;; + + *) if [ x"$src" = x ] + then + src=$1 + else + # this colon is to work around a 386BSD /bin/sh bug + : + dst=$1 + fi + shift + continue;; + esac +done + +if [ x"$src" = x ] +then + echo "install: no input file specified" + exit 1 +else + true +fi + +if [ x"$dir_arg" != x ]; then + dst=$src + src="" + + if [ -d $dst ]; then + instcmd=: + else + instcmd=mkdir + fi +else + +# Waiting for this to be detected by the "$instcmd $src $dsttmp" command +# might cause directories to be created, which would be especially bad +# if $src (and thus $dsttmp) contains '*'. + + if [ -f $src -o -d $src ] + then + true + else + echo "install: $src does not exist" + exit 1 + fi + + if [ x"$dst" = x ] + then + echo "install: no destination specified" + exit 1 + else + true + fi + +# If destination is a directory, append the input filename; if your system +# does not like double slashes in filenames, you may need to add some logic + + if [ -d $dst ] + then + dst="$dst"/`basename $src` + else + true + fi +fi + +## this sed command emulates the dirname command +dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` + +# Make sure that the destination directory exists. +# this part is taken from Noah Friedman's mkinstalldirs script + +# Skip lots of stat calls in the usual case. +if [ ! -d "$dstdir" ]; then +defaultIFS=' +' +IFS="${IFS-${defaultIFS}}" + +oIFS="${IFS}" +# Some sh's can't handle IFS=/ for some reason. +IFS='%' +set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` +IFS="${oIFS}" + +pathcomp='' + +while [ $# -ne 0 ] ; do + pathcomp="${pathcomp}${1}" + shift + + if [ ! -d "${pathcomp}" ] ; + then + $mkdirprog "${pathcomp}" + else + true + fi + + pathcomp="${pathcomp}/" +done +fi + +if [ x"$dir_arg" != x ] +then + $doit $instcmd $dst && + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi +else + +# If we're going to rename the final executable, determine the name now. + + if [ x"$transformarg" = x ] + then + dstfile=`basename $dst` + else + dstfile=`basename $dst $transformbasename | + sed $transformarg`$transformbasename + fi + +# don't allow the sed command to completely eliminate the filename + + if [ x"$dstfile" = x ] + then + dstfile=`basename $dst` + else + true + fi + +# Make a temp file name in the proper directory. + + dsttmp=$dstdir/#inst.$$# + +# Move or copy the file name to the temp name + + $doit $instcmd $src $dsttmp && + + trap "rm -f ${dsttmp}" 0 && + +# and set any options; do chmod last to preserve setuid bits + +# If any of these fail, we abort the whole thing. If we want to +# ignore errors from any of these, just make sure not to ignore +# errors from the above "$doit $instcmd $src $dsttmp" command. + + if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && + if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && + if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && + if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && + +# Now rename the file to the real destination. + + $doit $rmcmd -f $dstdir/$dstfile && + $doit $mvcmd $dsttmp $dstdir/$dstfile + +fi && + + +exit 0
A ltconfig

@@ -0,0 +1,3114 @@

+#! /bin/sh + +# ltconfig - Create a system-specific libtool. +# Copyright (C) 1996-1999 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This file is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# A lot of this script is taken from autoconf-2.10. + +# Check that we are running under the correct shell. +SHELL=${CONFIG_SHELL-/bin/sh} +echo=echo +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell. + exec "$SHELL" "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<EOF +$* +EOF + exit 0 +fi + +# Find the correct PATH separator. Usually this is `:', but +# DJGPP uses `;' like DOS. +if test "X${PATH_SEPARATOR+set}" != Xset; then + UNAME=${UNAME-`uname 2>/dev/null`} + case X$UNAME in + *-DOS) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; + esac +fi + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +if test "X${echo_test_string+set}" != Xset; then + # find a string as large as possible, as long as the shell can cope with it + for cmd in 'sed 50q "$0"' 'sed 20q "$0"' 'sed 10q "$0"' 'sed 2q "$0"' 'echo test'; do + # expected sizes: less than 2Kb, 1Kb, 512 bytes, 16 bytes, ... + if (echo_test_string="`eval $cmd`") 2>/dev/null && + echo_test_string="`eval $cmd`" && + (test "X$echo_test_string" = "X$echo_test_string") 2>/dev/null; then + break + fi + done +fi + +if test "X`($echo '\t') 2>/dev/null`" != 'X\t' || + test "X`($echo "$echo_test_string") 2>/dev/null`" != X"$echo_test_string"; then + # The Solaris, AIX, and Digital Unix default echo programs unquote + # backslashes. This makes it impossible to quote backslashes using + # echo "$something" | sed 's/\\/\\\\/g' + # + # So, first we look for a working echo in the user's PATH. + + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH /usr/ucb; do + if (test -f $dir/echo || test -f $dir/echo$ac_exeext) && + test "X`($dir/echo '\t') 2>/dev/null`" = 'X\t' && + test "X`($dir/echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + echo="$dir/echo" + break + fi + done + IFS="$save_ifs" + + if test "X$echo" = Xecho; then + # We didn't find a better echo, so look for alternatives. + if test "X`(print -r '\t') 2>/dev/null`" = 'X\t' && + test "X`(print -r "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + # This shell has a builtin print -r that does the trick. + echo='print -r' + elif (test -f /bin/ksh || test -f /bin/ksh$ac_exeext) && + test "X$CONFIG_SHELL" != X/bin/ksh; then + # If we have ksh, try running ltconfig again with it. + ORIGINAL_CONFIG_SHELL="${CONFIG_SHELL-/bin/sh}" + export ORIGINAL_CONFIG_SHELL + CONFIG_SHELL=/bin/ksh + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" --no-reexec ${1+"$@"} + else + # Try using printf. + echo='printf "%s\n"' + if test "X`($echo '\t') 2>/dev/null`" = 'X\t' && + test "X`($echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + # Cool, printf works + : + elif test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && + test "X`("$ORIGINAL_CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + CONFIG_SHELL="$ORIGINAL_CONFIG_SHELL" + export CONFIG_SHELL + SHELL="$CONFIG_SHELL" + export SHELL + echo="$CONFIG_SHELL $0 --fallback-echo" + elif test "X`("$CONFIG_SHELL" "$0" --fallback-echo '\t') 2>/dev/null`" = 'X\t' && + test "X`("$CONFIG_SHELL" "$0" --fallback-echo "$echo_test_string") 2>/dev/null`" = X"$echo_test_string"; then + echo="$CONFIG_SHELL $0 --fallback-echo" + else + # maybe with a smaller string... + prev=: + + for cmd in 'echo test' 'sed 2q "$0"' 'sed 10q "$0"' 'sed 20q "$0"' 'sed 50q "$0"'; do + if (test "X$echo_test_string" = "X`eval $cmd`") 2>/dev/null; then + break + fi + prev="$cmd" + done + + if test "$prev" != 'sed 50q "$0"'; then + echo_test_string=`eval $prev` + export echo_test_string + exec "${ORIGINAL_CONFIG_SHELL}" "$0" ${1+"$@"} + else + # Oops. We lost completely, so just stick with echo. + echo=echo + fi + fi + fi + fi +fi + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e s/^X//' +sed_quote_subst='s/\([\\"\\`$\\\\]\)/\\\1/g' + +# Same as above, but do not quote variable references. +double_quote_subst='s/\([\\"\\`\\\\]\)/\\\1/g' + +# Sed substitution to delay expansion of an escaped shell variable in a +# double_quote_subst'ed string. +delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' + +# The name of this program. +progname=`$echo "X$0" | $Xsed -e 's%^.*/%%'` + +# Constants: +PROGRAM=ltconfig +PACKAGE=libtool +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" +ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' +ac_link='${CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' +rm="rm -f" + +help="Try \`$progname --help' for more information." + +# Global variables: +default_ofile=libtool +can_build_shared=yes +enable_shared=yes +# All known linkers require a `.a' archive for static linking (except M$VC, +# which needs '.lib'). +enable_static=yes +enable_fast_install=yes +enable_dlopen=unknown +enable_win32_dll=no +ltmain= +silent= +srcdir= +ac_config_guess= +ac_config_sub= +host= +nonopt= +ofile="$default_ofile" +verify_host=yes +with_gcc=no +with_gnu_ld=no +need_locks=yes +ac_ext=c +objext=o +libext=a +exeext= +cache_file= + +old_AR="$AR" +old_CC="$CC" +old_CFLAGS="$CFLAGS" +old_CPPFLAGS="$CPPFLAGS" +old_LDFLAGS="$LDFLAGS" +old_LD="$LD" +old_LN_S="$LN_S" +old_LIBS="$LIBS" +old_NM="$NM" +old_RANLIB="$RANLIB" +old_DLLTOOL="$DLLTOOL" +old_OBJDUMP="$OBJDUMP" +old_AS="$AS" + +# Parse the command line options. +args= +prev= +for option +do + case "$option" in + -*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + eval "$prev=\$option" + prev= + continue + fi + + case "$option" in + --help) cat <<EOM +Usage: $progname [OPTION]... [HOST [LTMAIN]] + +Generate a system-specific libtool script. + + --debug enable verbose shell tracing + --disable-shared do not build shared libraries + --disable-static do not build static libraries + --disable-fast-install do not optimize for fast installation + --enable-dlopen enable dlopen support + --enable-win32-dll enable building dlls on win32 hosts + --help display this help and exit + --no-verify do not verify that HOST is a valid host type +-o, --output=FILE specify the output file [default=$default_ofile] + --quiet same as \`--silent' + --silent do not print informational messages + --srcdir=DIR find \`config.guess' in DIR + --version output version information and exit + --with-gcc assume that the GNU C compiler will be used + --with-gnu-ld assume that the C compiler uses the GNU linker + --disable-lock disable file locking + --cache-file=FILE configure cache file + +LTMAIN is the \`ltmain.sh' shell script fragment or \`ltmain.c' program +that provides basic libtool functionality. + +HOST is the canonical host system name [default=guessed]. +EOM + exit 0 + ;; + + --debug) + echo "$progname: enabling shell trace mode" + set -x + ;; + + --disable-shared) enable_shared=no ;; + + --disable-static) enable_static=no ;; + + --disable-fast-install) enable_fast_install=no ;; + + --enable-dlopen) enable_dlopen=yes ;; + + --enable-win32-dll) enable_win32_dll=yes ;; + + --quiet | --silent) silent=yes ;; + + --srcdir) prev=srcdir ;; + --srcdir=*) srcdir="$optarg" ;; + + --no-verify) verify_host=no ;; + + --output | -o) prev=ofile ;; + --output=*) ofile="$optarg" ;; + + --version) echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP"; exit 0 ;; + + --with-gcc) with_gcc=yes ;; + --with-gnu-ld) with_gnu_ld=yes ;; + + --disable-lock) need_locks=no ;; + + --cache-file=*) cache_file="$optarg" ;; + + -*) + echo "$progname: unrecognized option \`$option'" 1>&2 + echo "$help" 1>&2 + exit 1 + ;; + + *) + if test -z "$ltmain"; then + ltmain="$option" + elif test -z "$host"; then +# This generates an unnecessary warning for sparc-sun-solaris4.1.3_U1 +# if test -n "`echo $option| sed 's/[-a-z0-9.]//g'`"; then +# echo "$progname: warning \`$option' is not a valid host type" 1>&2 +# fi + host="$option" + else + echo "$progname: too many arguments" 1>&2 + echo "$help" 1>&2 + exit 1 + fi ;; + esac +done + +if test -z "$ltmain"; then + echo "$progname: you must specify a LTMAIN file" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +if test ! -f "$ltmain"; then + echo "$progname: \`$ltmain' does not exist" 1>&2 + echo "$help" 1>&2 + exit 1 +fi + +# Quote any args containing shell metacharacters. +ltconfig_args= +for arg +do + case "$arg" in + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) + ltconfig_args="$ltconfig_args '$arg'" ;; + *) ltconfig_args="$ltconfig_args $arg" ;; + esac +done + +# A relevant subset of AC_INIT. + +# 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 +# 5 compiler messages saved in config.log +# 6 checking for... messages and results +if test "$silent" = yes; then + exec 6>/dev/null +else + exec 6>&1 +fi +exec 5>>./config.log + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +if test "X${LC_ALL+set}" = Xset; then LC_ALL=C; export LC_ALL; fi +if test "X${LANG+set}" = Xset; then LANG=C; export LANG; fi + +if test -n "$cache_file" && test -r "$cache_file"; then + echo "loading cache $cache_file within ltconfig" + . $cache_file +fi + +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 + +if test -z "$srcdir"; then + # Assume the source directory is the same one as the path to LTMAIN. + srcdir=`$echo "X$ltmain" | $Xsed -e 's%/[^/]*$%%'` + test "$srcdir" = "$ltmain" && srcdir=. +fi + +trap "$rm conftest*; exit 1" 1 2 15 +if test "$verify_host" = yes; then + # Check for config.guess and config.sub. + ac_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do + if test -f $ac_dir/config.guess; then + ac_aux_dir=$ac_dir + break + fi + done + if test -z "$ac_aux_dir"; then + echo "$progname: cannot find config.guess in $srcdir $srcdir/.. $srcdir/../.." 1>&2 + echo "$help" 1>&2 + exit 1 + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + + # Make sure we can run config.sub. + if $SHELL $ac_config_sub sun4 >/dev/null 2>&1; then : + else + echo "$progname: cannot run $ac_config_sub" 1>&2 + echo "$help" 1>&2 + exit 1 + fi + + echo $ac_n "checking host system type""... $ac_c" 1>&6 + + host_alias=$host + case "$host_alias" in + "") + if host_alias=`$SHELL $ac_config_guess`; then : + else + echo "$progname: cannot guess host type; you must specify one" 1>&2 + echo "$help" 1>&2 + exit 1 + fi ;; + esac + host=`$SHELL $ac_config_sub $host_alias` + echo "$ac_t$host" 1>&6 + + # Make sure the host verified. + test -z "$host" && exit 1 + +elif test -z "$host"; then + echo "$progname: you must specify a host type if you use \`--no-verify'" 1>&2 + echo "$help" 1>&2 + exit 1 +else + host_alias=$host +fi + +# Transform linux* to *-*-linux-gnu*, to support old configure scripts. +case "$host_os" in +linux-gnu*) ;; +linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` +esac + +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` + +case "$host_os" in +aix3*) + # AIX sometimes has problems with the GCC collect2 program. For some + # reason, if we set the COLLECT_NAMES environment variable, the problems + # vanish in a puff of smoke. + if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES + fi + ;; +esac + +# Determine commands to create old-style static archives. +old_archive_cmds='$AR cru $oldlib$oldobjs' +old_postinstall_cmds='chmod 644 $oldlib' +old_postuninstall_cmds= + +# Set a sane default for `AR'. +test -z "$AR" && AR=ar + +# Set a sane default for `OBJDUMP'. +test -z "$OBJDUMP" && OBJDUMP=objdump + +# If RANLIB is not set, then run the test. +if test "${RANLIB+set}" != "set"; then + result=no + + echo $ac_n "checking for ranlib... $ac_c" 1>&6 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/ranlib || test -f $dir/ranlib$ac_exeext; then + RANLIB="ranlib" + result="ranlib" + break + fi + done + IFS="$save_ifs" + + echo "$ac_t$result" 1>&6 +fi + +if test -n "$RANLIB"; then + old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib" + old_postinstall_cmds="\$RANLIB \$oldlib~$old_postinstall_cmds" +fi + +# Set sane defaults for `DLLTOOL', `OBJDUMP', and `AS', used on cygwin. +test -z "$DLLTOOL" && DLLTOOL=dlltool +test -z "$OBJDUMP" && OBJDUMP=objdump +test -z "$AS" && AS=as + +# Check to see if we are using GCC. +if test "$with_gcc" != yes || test -z "$CC"; then + # If CC is not set, then try to find GCC or a usable CC. + if test -z "$CC"; then + echo $ac_n "checking for gcc... $ac_c" 1>&6 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/gcc || test -f $dir/gcc$ac_exeext; then + CC="gcc" + break + fi + done + IFS="$save_ifs" + + if test -n "$CC"; then + echo "$ac_t$CC" 1>&6 + else + echo "$ac_t"no 1>&6 + fi + fi + + # Not "gcc", so try "cc", rejecting "/usr/ucb/cc". + if test -z "$CC"; then + echo $ac_n "checking for cc... $ac_c" 1>&6 + IFS="${IFS= }"; save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + cc_rejected=no + for dir in $PATH; do + test -z "$dir" && dir=. + if test -f $dir/cc || test -f $dir/cc$ac_exeext; then + if test "$dir/cc" = "/usr/ucb/cc"; then + cc_rejected=yes + continue + fi + CC="cc" + break + fi + done + IFS="$save_ifs" + if test $cc_rejected = yes; then + # We found a bogon in the path, so make sure we never use it. + set dummy $CC + shift + if test $# -gt 0; then + # We chose a different compiler from the bogus one. + # However, it has the same name, so the bogon will be chosen + # first if we set CC to just the name; use the full file name. + shift + set dummy "$dir/cc" "$@" + shift + CC="$@" + fi + fi + + if test -n "$CC"; then + echo "$ac_t$CC" 1>&6 + else + echo "$ac_t"no 1>&6 + fi + + if test -z "$CC"; then + echo "$progname: error: no acceptable cc found in \$PATH" 1>&2 + exit 1 + fi + fi + + # Now see if the compiler is really GCC. + with_gcc=no + echo $ac_n "checking whether we are using GNU C... $ac_c" 1>&6 + echo "$progname:581: checking whether we are using GNU C" >&5 + + $rm conftest.c + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF + if { ac_try='${CC-cc} -E conftest.c'; { (eval echo $progname:589: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + with_gcc=yes + fi + $rm conftest.c + echo "$ac_t$with_gcc" 1>&6 +fi + +# Allow CC to be a program name with arguments. +set dummy $CC +compiler="$2" + +echo $ac_n "checking for object suffix... $ac_c" 1>&6 +$rm conftest* +echo 'int i = 1;' > conftest.c +echo "$progname:603: checking for object suffix" >& 5 +if { (eval echo $progname:604: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; }; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; + *) objext=`echo $ac_file | sed -e s/conftest.//` ;; + esac + done +else + cat conftest.err 1>&5 + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 +fi +$rm conftest* +echo "$ac_t$objext" 1>&6 + +echo $ac_n "checking for executable suffix... $ac_c" 1>&6 +if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_exeext="no" + $rm conftest* + echo 'main () { return 0; }' > conftest.c + echo "$progname:629: checking for executable suffix" >& 5 + if { (eval echo $progname:630: \"$ac_link\") 1>&5; (eval $ac_link) 2>conftest.err; }; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + for ac_file in conftest.*; do + case $ac_file in + *.c | *.err | *.$objext ) ;; + *) ac_cv_exeext=.`echo $ac_file | sed -e s/conftest.//` ;; + esac + done + else + cat conftest.err 1>&5 + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + $rm conftest* +fi +if test "X$ac_cv_exeext" = Xno; then + exeext="" +else + exeext="$ac_cv_exeext" +fi +echo "$ac_t$ac_cv_exeext" 1>&6 + +echo $ac_n "checking for $compiler option to produce PIC... $ac_c" 1>&6 +pic_flag= +special_shlib_compile_flags= +wl= +link_static_flag= +no_builtin_flag= + +if test "$with_gcc" = yes; then + wl='-Wl,' + link_static_flag='-static' + + case "$host_os" in + beos* | irix5* | irix6* | osf3* | osf4* | osf5*) + # PIC is the default for these OSes. + ;; + aix*) + # Below there is a dirty hack to force normal static linking with -ldl + # The problem is because libdl dynamically linked with both libc and + # libC (AIX C++ library), which obviously doesn't included in libraries + # list by gcc. This cause undefined symbols with -static flags. + # This hack allows C programs to be linked with "-static -ldl", but + # we not sure about C++ programs. + link_static_flag="$link_static_flag ${wl}-lC" + ;; + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + amigaos*) + # FIXME: we need at least 68020 code to build shared libraries, but + # adding the `-m68020' flag to GCC prevents building anything better, + # like `-m68040'. + pic_flag='-m68020 -resident32 -malways-restore-a4' + ;; + sysv4*MP*) + if test -d /usr/nec; then + pic_flag=-Kconform_pic + fi + ;; + *) + pic_flag='-fPIC' + ;; + esac +else + # PORTME Check for PIC flags for the system compiler. + case "$host_os" in + aix3* | aix4*) + # All AIX code is PIC. + link_static_flag='-bnso -bI:/lib/syscalls.exp' + ;; + + hpux9* | hpux10* | hpux11*) + # Is there a better link_static_flag that works with the bundled CC? + wl='-Wl,' + link_static_flag="${wl}-a ${wl}archive" + pic_flag='+Z' + ;; + + irix5* | irix6*) + wl='-Wl,' + link_static_flag='-non_shared' + # PIC (with -KPIC) is the default. + ;; + + cygwin* | mingw* | os2*) + # We can build DLLs from non-PIC. + ;; + + osf3* | osf4* | osf5*) + # All OSF/1 code is PIC. + wl='-Wl,' + link_static_flag='-non_shared' + ;; + + sco3.2v5*) + pic_flag='-Kpic' + link_static_flag='-dn' + special_shlib_compile_flags='-belf' + ;; + + solaris*) + pic_flag='-KPIC' + link_static_flag='-Bstatic' + wl='-Wl,' + ;; + + sunos4*) + pic_flag='-PIC' + link_static_flag='-Bstatic' + wl='-Qoption ld ' + ;; + + sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + pic_flag='-KPIC' + link_static_flag='-Bstatic' + wl='-Wl,' + ;; + + uts4*) + pic_flag='-pic' + link_static_flag='-Bstatic' + ;; + sysv4*MP*) + if test -d /usr/nec ;then + pic_flag='-Kconform_pic' + link_static_flag='-Bstatic' + fi + ;; + *) + can_build_shared=no + ;; + esac +fi + +if test -n "$pic_flag"; then + echo "$ac_t$pic_flag" 1>&6 + + # Check to make sure the pic_flag actually works. + echo $ac_n "checking if $compiler PIC flag $pic_flag works... $ac_c" 1>&6 + $rm conftest* + echo "int some_variable = 0;" > conftest.c + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $pic_flag -DPIC" + echo "$progname:776: checking if $compiler PIC flag $pic_flag works" >&5 + if { (eval echo $progname:777: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.$objext; then + # Append any warnings to the config.log. + cat conftest.err 1>&5 + + case "$host_os" in + hpux9* | hpux10* | hpux11*) + # On HP-UX, both CC and GCC only warn that PIC is supported... then they + # create non-PIC objects. So, if there were any warnings, we assume that + # PIC is not supported. + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + can_build_shared=no + pic_flag= + else + echo "$ac_t"yes 1>&6 + pic_flag=" $pic_flag" + fi + ;; + *) + echo "$ac_t"yes 1>&6 + pic_flag=" $pic_flag" + ;; + esac + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + can_build_shared=no + pic_flag= + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* +else + echo "$ac_t"none 1>&6 +fi + +# Check to see if options -o and -c are simultaneously supported by compiler +echo $ac_n "checking if $compiler supports -c -o file.o... $ac_c" 1>&6 +$rm -r conftest 2>/dev/null +mkdir conftest +cd conftest +$rm conftest* +echo "int some_variable = 0;" > conftest.c +mkdir out +# According to Tom Tromey, Ian Lance Taylor reported there are C compilers +# that will create temporary files in the current directory regardless of +# the output directory. Thus, making CWD read-only will cause this test +# to fail, enabling locking or at least warning the user not to do parallel +# builds. +chmod -w . +save_CFLAGS="$CFLAGS" +CFLAGS="$CFLAGS -o out/conftest2.o" +echo "$progname:829: checking if $compiler supports -c -o file.o" >&5 +if { (eval echo $progname:830: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.o; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s out/conftest.err; then + echo "$ac_t"no 1>&6 + compiler_c_o=no + else + echo "$ac_t"yes 1>&6 + compiler_c_o=yes + fi +else + # Append any errors to the config.log. + cat out/conftest.err 1>&5 + compiler_c_o=no + echo "$ac_t"no 1>&6 +fi +CFLAGS="$save_CFLAGS" +chmod u+w . +$rm conftest* out/* +rmdir out +cd .. +rmdir conftest +$rm -r conftest 2>/dev/null + +if test x"$compiler_c_o" = x"yes"; then + # Check to see if we can write to a .lo + echo $ac_n "checking if $compiler supports -c -o file.lo... $ac_c" 1>&6 + $rm conftest* + echo "int some_variable = 0;" > conftest.c + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -c -o conftest.lo" + echo "$progname:862: checking if $compiler supports -c -o file.lo" >&5 +if { (eval echo $progname:863: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.lo; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + compiler_o_lo=no + else + echo "$ac_t"yes 1>&6 + compiler_o_lo=yes + fi + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + compiler_o_lo=no + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* +else + compiler_o_lo=no +fi + +# Check to see if we can do hard links to lock some files if needed +hard_links="nottested" +if test "$compiler_c_o" = no && test "$need_locks" != no; then + # do not overwrite the value of need_locks provided by the user + echo $ac_n "checking if we can lock with hard links... $ac_c" 1>&6 + hard_links=yes + $rm conftest* + ln conftest.a conftest.b 2>/dev/null && hard_links=no + touch conftest.a + ln conftest.a conftest.b 2>&5 || hard_links=no + ln conftest.a conftest.b 2>/dev/null && hard_links=no + echo "$ac_t$hard_links" 1>&6 + $rm conftest* + if test "$hard_links" = no; then + echo "*** WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2 + need_locks=warn + fi +else + need_locks=no +fi + +if test "$with_gcc" = yes; then + # Check to see if options -fno-rtti -fno-exceptions are supported by compiler + echo $ac_n "checking if $compiler supports -fno-rtti -fno-exceptions ... $ac_c" 1>&6 + $rm conftest* + echo "int some_variable = 0;" > conftest.c + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-rtti -fno-exceptions -c conftest.c" + echo "$progname:914: checking if $compiler supports -fno-rtti -fno-exceptions" >&5 + if { (eval echo $progname:915: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>conftest.err; } && test -s conftest.o; then + + # The compiler can only warn and ignore the option if not recognized + # So say no if there are warnings + if test -s conftest.err; then + echo "$ac_t"no 1>&6 + compiler_rtti_exceptions=no + else + echo "$ac_t"yes 1>&6 + compiler_rtti_exceptions=yes + fi + else + # Append any errors to the config.log. + cat conftest.err 1>&5 + compiler_rtti_exceptions=no + echo "$ac_t"no 1>&6 + fi + CFLAGS="$save_CFLAGS" + $rm conftest* + + if test "$compiler_rtti_exceptions" = "yes"; then + no_builtin_flag=' -fno-builtin -fno-rtti -fno-exceptions' + else + no_builtin_flag=' -fno-builtin' + fi + +fi + +# Check for any special shared library compilation flags. +if test -n "$special_shlib_compile_flags"; then + echo "$progname: warning: \`$CC' requires \`$special_shlib_compile_flags' to build shared libraries" 1>&2 + if echo "$old_CC $old_CFLAGS " | egrep -e "[ ]$special_shlib_compile_flags[ ]" >/dev/null; then : + else + echo "$progname: add \`$special_shlib_compile_flags' to the CC or CFLAGS env variable and reconfigure" 1>&2 + can_build_shared=no + fi +fi + +echo $ac_n "checking if $compiler static flag $link_static_flag works... $ac_c" 1>&6 +$rm conftest* +echo 'main(){return(0);}' > conftest.c +save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS $link_static_flag" +echo "$progname:958: checking if $compiler static flag $link_static_flag works" >&5 +if { (eval echo $progname:959: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + echo "$ac_t$link_static_flag" 1>&6 +else + echo "$ac_t"none 1>&6 + link_static_flag= +fi +LDFLAGS="$save_LDFLAGS" +$rm conftest* + +if test -z "$LN_S"; then + # Check to see if we can use ln -s, or we need hard links. + echo $ac_n "checking whether ln -s works... $ac_c" 1>&6 + $rm conftest.dat + if ln -s X conftest.dat 2>/dev/null; then + $rm conftest.dat + LN_S="ln -s" + else + LN_S=ln + fi + if test "$LN_S" = "ln -s"; then + echo "$ac_t"yes 1>&6 + else + echo "$ac_t"no 1>&6 + fi +fi + +# Make sure LD is an absolute path. +if test -z "$LD"; then + ac_prog=ld + if test "$with_gcc" = yes; then + # Check if gcc -print-prog-name=ld gives a path. + echo $ac_n "checking for ld used by GCC... $ac_c" 1>&6 + echo "$progname:991: checking for ld used by GCC" >&5 + ac_prog=`($CC -print-prog-name=ld) 2>&5` + case "$ac_prog" in + # Accept absolute paths. + [\\/]* | [A-Za-z]:[\\/]*) + re_direlt='/[^/][^/]*/\.\./' + # Canonicalize the path of ld + ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` + while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do + ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` + done + test -z "$LD" && LD="$ac_prog" + ;; + "") + # If it fails, then pretend we are not using GCC. + ac_prog=ld + ;; + *) + # If it is relative, then search for the first ld in PATH. + with_gnu_ld=unknown + ;; + esac + elif test "$with_gnu_ld" = yes; then + echo $ac_n "checking for GNU ld... $ac_c" 1>&6 + echo "$progname:1015: checking for GNU ld" >&5 + else + echo $ac_n "checking for non-GNU ld""... $ac_c" 1>&6 + echo "$progname:1018: checking for non-GNU ld" >&5 + fi + + if test -z "$LD"; then + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then + LD="$ac_dir/$ac_prog" + # Check to see if the program is GNU ld. I'd rather use --version, + # but apparently some GNU ld's only accept -v. + # Break only if it was the GNU/non-GNU ld that we prefer. + if "$LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then + test "$with_gnu_ld" != no && break + else + test "$with_gnu_ld" != yes && break + fi + fi + done + IFS="$ac_save_ifs" + fi + + if test -n "$LD"; then + echo "$ac_t$LD" 1>&6 + else + echo "$ac_t"no 1>&6 + fi + + if test -z "$LD"; then + echo "$progname: error: no acceptable ld found in \$PATH" 1>&2 + exit 1 + fi +fi + +# Check to see if it really is or is not GNU ld. +echo $ac_n "checking if the linker ($LD) is GNU ld... $ac_c" 1>&6 +# I'd rather use --version here, but apparently some GNU ld's only accept -v. +if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then + with_gnu_ld=yes +else + with_gnu_ld=no +fi +echo "$ac_t$with_gnu_ld" 1>&6 + +# See if the linker supports building shared libraries. +echo $ac_n "checking whether the linker ($LD) supports shared libraries... $ac_c" 1>&6 + +allow_undefined_flag= +no_undefined_flag= +need_lib_prefix=unknown +need_version=unknown +# when you set need_version to no, make sure it does not cause -set_version +# flags to be left without arguments +archive_cmds= +archive_expsym_cmds= +old_archive_from_new_cmds= +export_dynamic_flag_spec= +whole_archive_flag_spec= +thread_safe_flag_spec= +hardcode_libdir_flag_spec= +hardcode_libdir_separator= +hardcode_direct=no +hardcode_minus_L=no +hardcode_shlibpath_var=unsupported +runpath_var= +always_export_symbols=no +export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | sed '\''s/.* //'\'' | sort | uniq > $export_symbols' +# include_expsyms should be a list of space-separated symbols to be *always* +# included in the symbol list +include_expsyms= +# exclude_expsyms can be an egrep regular expression of symbols to exclude +# it will be wrapped by ` (' and `)$', so one must not match beginning or +# end of line. Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc', +# as well as any symbol that contains `d'. +exclude_expsyms="_GLOBAL_OFFSET_TABLE_" +# Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out +# platforms (ab)use it in PIC code, but their linkers get confused if +# the symbol is explicitly referenced. Since portable code cannot +# rely on this symbol name, it's probably fine to never include it in +# preloaded symbol tables. + +case "$host_os" in +cygwin* | mingw*) + # FIXME: the MSVC++ port hasn't been tested in a loooong time + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + if test "$with_gcc" != yes; then + with_gnu_ld=no + fi + ;; + +esac + +ld_shlibs=yes +if test "$with_gnu_ld" = yes; then + # If archive_cmds runs LD, not CC, wlarc should be empty + wlarc='${wl}' + + # See if GNU ld supports shared libraries. + case "$host_os" in + aix3* | aix4*) + # On AIX, the GNU linker is very broken + ld_shlibs=no + cat <<EOF 1>&2 + +*** Warning: the GNU linker, at least up to release 2.9.1, is reported +*** to be unable to reliably create shared libraries on AIX. +*** Therefore, libtool is disabling shared libraries support. If you +*** really care for shared libraries, you may want to modify your PATH +*** so that a non-GNU linker is found, and then restart. + +EOF + ;; + + amigaos*) + archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + + # Samuel A. Falvo II <kc5tja@dolphin.openprojects.net> reports + # that the semantics of dynamic libraries on AmigaOS, at least up + # to version 4, is to share data among multiple programs linked + # with the same dynamic library. Since this doesn't match the + # behavior of shared libraries on other platforms, we can use + # them. + ld_shlibs=no + ;; + + beos*) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + allow_undefined_flag=unsupported + # Joseph Beckenbach <jrb3@best.com> says some releases of gcc + # support --undefined. This deserves some investigation. FIXME + archive_cmds='$CC -nostart $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + else + ld_shlibs=no + fi + ;; + + cygwin* | mingw*) + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec='-L$libdir' + allow_undefined_flag=unsupported + always_export_symbols=yes + + # Extract the symbol export list from an `--export-all' def file, + # then regenerate the def file from the symbol export list, so that + # the compiled dll only exports the symbol export list. + # Be careful not to strip the DATA tag left by newer dlltools. + export_symbols_cmds='test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ + $DLLTOOL --export-all --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --output-def $objdir/$soname-def $objdir/$soname-ltdll.$objext $libobjs $convenience~ + sed -e "1,/EXPORTS/d" -e "s/ @ [0-9]*//" -e "s/ *;.*$//" < $objdir/$soname-def > $export_symbols' + + # If DATA tags from a recent dlltool are present, honour them! + archive_expsym_cmds='echo EXPORTS > $objdir/$soname-def~ + _lt_hint=1; + cat $export_symbols | while read symbol; do + set dummy \$symbol; + case \$# in + 2) echo " \$2 @ \$_lt_hint ; " >> $objdir/$soname-def;; + *) echo " \$2 @ \$_lt_hint \$3 ; " >> $objdir/$soname-def;; + esac; + _lt_hint=`expr 1 + \$_lt_hint`; + done~ + test -f $objdir/$soname-ltdll.c || sed -e "/^# \/\* ltdll\.c starts here \*\//,/^# \/\* ltdll.c ends here \*\// { s/^# //; p; }" -e d < $0 > $objdir/$soname-ltdll.c~ + test -f $objdir/$soname-ltdll.$objext || (cd $objdir && $CC -c $soname-ltdll.c)~ + $CC -Wl,--base-file,$objdir/$soname-base -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ + $CC -Wl,--base-file,$objdir/$soname-base $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts~ + $DLLTOOL --as=$AS --dllname $soname --exclude-symbols DllMain@12,_cygwin_dll_entry@12,_cygwin_noncygwin_dll_entry@12 --def $objdir/$soname-def --base-file $objdir/$soname-base --output-exp $objdir/$soname-exp~ + $CC $objdir/$soname-exp -Wl,--dll -nostartfiles -Wl,-e,__cygwin_dll_entry@12 -o $lib $objdir/$soname-ltdll.$objext $libobjs $deplibs $linkopts' + + old_archive_from_new_cmds='$DLLTOOL --as=$AS --dllname $soname --def $objdir/$soname-def --output-lib $objdir/$libname.a' + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + archive_cmds='$LD -Bshareable $libobjs $deplibs $linkopts -o $lib' + # can we support soname and/or expsyms with a.out? -oliva + fi + ;; + + solaris* | sysv5*) + if $LD -v 2>&1 | egrep 'BFD 2\.8' > /dev/null; then + ld_shlibs=no + cat <<EOF 1>&2 + +*** Warning: The releases 2.8.* of the GNU linker cannot reliably +*** create shared libraries on Solaris systems. Therefore, libtool +*** is disabling shared libraries support. We urge you to upgrade GNU +*** binutils to release 2.9.1 or newer. Another option is to modify +*** your PATH or compiler configuration so that the native linker is +*** used, and then restart. + +EOF + elif $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linkopts' + wlarc= + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + *) + if $LD --help 2>&1 | egrep ': supported targets:.* elf' > /dev/null; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname -o $lib' + archive_expsym_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + else + ld_shlibs=no + fi + ;; + esac + + if test "$ld_shlibs" = yes; then + runpath_var=LD_RUN_PATH + hardcode_libdir_flag_spec='${wl}--rpath ${wl}$libdir' + export_dynamic_flag_spec='${wl}--export-dynamic' + case $host_os in + cygwin* | mingw*) + # dlltool doesn't understand --whole-archive et. al. + whole_archive_flag_spec= + ;; + *) + # ancient GNU ld didn't support --whole-archive et. al. + if $LD --help 2>&1 | egrep 'no-whole-archive' > /dev/null; then + whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive' + else + whole_archive_flag_spec= + fi + ;; + esac + fi +else + # PORTME fill in a description of your system's linker (not GNU ld) + case "$host_os" in + aix3*) + allow_undefined_flag=unsupported + always_export_symbols=yes + archive_expsym_cmds='$LD -o $objdir/$soname $libobjs $deplibs $linkopts -bE:$export_symbols -T512 -H512 -bM:SRE~$AR cru $lib $objdir/$soname' + # Note: this linker hardcodes the directories in LIBPATH if there + # are no directories specified by -L. + hardcode_minus_L=yes + if test "$with_gcc" = yes && test -z "$link_static_flag"; then + # Neither direct hardcoding nor static linking is supported with a + # broken collect2. + hardcode_direct=unsupported + fi + ;; + + aix4*) + hardcode_libdir_flag_spec='${wl}-b ${wl}nolibpath ${wl}-b ${wl}libpath:$libdir:/usr/lib:/lib' + hardcode_libdir_separator=':' + if test "$with_gcc" = yes; then + collect2name=`${CC} -print-prog-name=collect2` + if test -f "$collect2name" && \ + strings "$collect2name" | grep resolve_lib_name >/dev/null + then + # We have reworked collect2 + hardcode_direct=yes + else + # We have old collect2 + hardcode_direct=unsupported + # It fails to find uninstalled libraries when the uninstalled + # path is not listed in the libpath. Setting hardcode_minus_L + # to unsupported forces relinking + hardcode_minus_L=yes + hardcode_libdir_flag_spec='-L$libdir' + hardcode_libdir_separator= + fi + shared_flag='-shared' + else + shared_flag='${wl}-bM:SRE' + hardcode_direct=yes + fi + allow_undefined_flag=' ${wl}-berok' + archive_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bexpall ${wl}-bnoentry${allow_undefined_flag}' + archive_expsym_cmds="\$CC $shared_flag"' -o $objdir/$soname $libobjs $deplibs $linkopts ${wl}-bE:$export_symbols ${wl}-bnoentry${allow_undefined_flag}' + case "$host_os" in aix4.[01]|aix4.[01].*) + # According to Greg Wooledge, -bexpall is only supported from AIX 4.2 on + always_export_symbols=yes ;; + esac + ;; + + amigaos*) + archive_cmds='$rm $objdir/a2ixlibrary.data~$echo "#define NAME $libname" > $objdir/a2ixlibrary.data~$echo "#define LIBRARY_ID 1" >> $objdir/a2ixlibrary.data~$echo "#define VERSION $major" >> $objdir/a2ixlibrary.data~$echo "#define REVISION $revision" >> $objdir/a2ixlibrary.data~$AR cru $lib $libobjs~$RANLIB $lib~(cd $objdir && a2ixlibrary -32)' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + # see comment about different semantics on the GNU ld section + ld_shlibs=no + ;; + + cygwin* | mingw*) + # When not using gcc, we currently assume that we are using + # Microsoft Visual C++. + # hardcode_libdir_flag_spec is actually meaningless, as there is + # no search path for DLLs. + hardcode_libdir_flag_spec=' ' + allow_undefined_flag=unsupported + # Tell ltmain to make .lib files, not .a files. + libext=lib + # FIXME: Setting linknames here is a bad hack. + archive_cmds='$CC -o $lib $libobjs $linkopts `echo "$deplibs" | sed -e '\''s/ -lc$//'\''` -link -dll~linknames=' + # The linker will automatically build a .lib file if we build a DLL. + old_archive_from_new_cmds='true' + # FIXME: Should let the user specify the lib program. + old_archive_cmds='lib /OUT:$oldlib$oldobjs' + fix_srcfile_path='`cygpath -w $srcfile`' + ;; + + freebsd1*) + ld_shlibs=no + ;; + + # FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor + # support. Future versions do this automatically, but an explicit c++rt0.o + # does not break anything, and helps significantly (at the cost of a little + # extra space). + freebsd2.2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts /usr/lib/c++rt0.o' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + # Unfortunately, older versions of FreeBSD 2 do not have this feature. + freebsd2*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + # FreeBSD 3 and greater uses gcc -shared to do shared libraries. + freebsd*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + hpux9* | hpux10* | hpux11*) + case "$host_os" in + hpux9*) archive_cmds='$rm $objdir/$soname~$LD -b +b $install_libdir -o $objdir/$soname $libobjs $deplibs $linkopts~test $objdir/$soname = $lib || mv $objdir/$soname $lib' ;; + *) archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linkopts' ;; + esac + hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir' + hardcode_libdir_separator=: + hardcode_direct=yes + hardcode_minus_L=yes # Not in the search PATH, but as the default + # location of the library. + export_dynamic_flag_spec='${wl}-E' + ;; + + irix5* | irix6*) + if test "$with_gcc" = yes; then + archive_cmds='$CC -shared $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + archive_cmds='$LD -shared $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + netbsd*) + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' # a.out + else + archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linkopts' # ELF + fi + hardcode_libdir_flag_spec='${wl}-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + openbsd*) + archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + os2*) + hardcode_libdir_flag_spec='-L$libdir' + hardcode_minus_L=yes + allow_undefined_flag=unsupported + archive_cmds='$echo "LIBRARY $libname INITINSTANCE" > $objdir/$libname.def~$echo "DESCRIPTION \"$libname\"" >> $objdir/$libname.def~$echo DATA >> $objdir/$libname.def~$echo " SINGLE NONSHARED" >> $objdir/$libname.def~$echo EXPORTS >> $objdir/$libname.def~emxexp $libobjs >> $objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $linkopts $objdir/$libname.def' + old_archive_from_new_cmds='emximp -o $objdir/$libname.a $objdir/$libname.def' + ;; + + osf3*) + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + + osf4* | osf5*) # As osf3* with the addition of the -msym flag + if test "$with_gcc" = yes; then + allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*' + archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $linkopts ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && echo ${wl}-set_version ${wl}$verstring` ${wl}-update_registry ${wl}${objdir}/so_locations -o $lib' + else + allow_undefined_flag=' -expect_unresolved \*' + archive_cmds='$LD -shared${allow_undefined_flag} $libobjs $deplibs $linkopts -msym -soname $soname `test -n "$verstring" && echo -set_version $verstring` -update_registry ${objdir}/so_locations -o $lib' + fi + hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' + hardcode_libdir_separator=: + ;; + rhapsody*) + archive_cmds='$CC -bundle -undefined suppress -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flags_spec='-L$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + + sco3.2v5*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ;; + + solaris*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_shlibpath_var=no + case "$host_os" in + solaris2.[0-5] | solaris2.[0-5].*) ;; + *) # Supported since Solaris 2.6 (maybe 2.5.1?) + whole_archive_flag_spec='-z allextract$convenience -z defaultextract' ;; + esac + ;; + + sunos4*) + archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_direct=yes + hardcode_minus_L=yes + hardcode_shlibpath_var=no + ;; + + sysv4) + if test "x$host_vendor" = xsequent; then + # Use $CC to link under sequent, because it throws in some extra .o + # files that make .init and .fini sections work. + archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $linkopts' + else + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + fi + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + hardcode_direct=no #Motorola manual says yes, but my tests say they lie + ;; + + sysv4.3*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + export_dynamic_flag_spec='-Bexport' + ;; + + sysv5*) + no_undefined_flag=' -z text' + # $CC -shared without GNU ld will not create a library from C++ + # object files and a static libstdc++, better avoid it by now + archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linkopts' + archive_expsym_cmds='$echo "{ global:" > $lib.exp~cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $lib.exp~$echo "local: *; };" >> $lib.exp~ + $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linkopts~$rm $lib.exp' + hardcode_libdir_flag_spec= + hardcode_shlibpath_var=no + runpath_var='LD_RUN_PATH' + ;; + + uts4*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + dgux*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_libdir_flag_spec='-L$libdir' + hardcode_shlibpath_var=no + ;; + + sysv4*MP*) + if test -d /usr/nec; then + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + hardcode_shlibpath_var=no + runpath_var=LD_RUN_PATH + hardcode_runpath_var=yes + ld_shlibs=yes + fi + ;; + + sysv4.2uw2*) + archive_cmds='$LD -G -o $lib $libobjs $deplibs $linkopts' + hardcode_direct=yes + hardcode_minus_L=no + hardcode_shlibpath_var=no + hardcode_runpath_var=yes + runpath_var=LD_RUN_PATH + ;; + + unixware7*) + archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linkopts' + runpath_var='LD_RUN_PATH' + hardcode_shlibpath_var=no + ;; + + *) + ld_shlibs=no + ;; + esac +fi +echo "$ac_t$ld_shlibs" 1>&6 +test "$ld_shlibs" = no && can_build_shared=no + +if test -z "$NM"; then + echo $ac_n "checking for BSD-compatible nm... $ac_c" 1>&6 + case "$NM" in + [\\/]* | [A-Za-z]:[\\/]*) ;; # Let the user override the test with a path. + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" + for ac_dir in $PATH /usr/ucb /usr/ccs/bin /bin; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext; then + # Check to see if the nm accepts a BSD-compat flag. + # Adding the `sed 1q' prevents false positives on HP-UX, which says: + # nm: unknown option "B" ignored + if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + NM="$ac_dir/nm -B" + break + elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then + NM="$ac_dir/nm -p" + break + else + NM=${NM="$ac_dir/nm"} # keep the first match, but + continue # so that we can try to find one that supports BSD flags + fi + fi + done + IFS="$ac_save_ifs" + test -z "$NM" && NM=nm + ;; + esac + echo "$ac_t$NM" 1>&6 +fi + +# Check for command to grab the raw symbol name followed by C symbol from nm. +echo $ac_n "checking command to parse $NM output... $ac_c" 1>&6 + +# These are sane defaults that work on at least a few old systems. +# [They come from Ultrix. What could be older than Ultrix?!! ;)] + +# Character class describing NM global symbol codes. +symcode='[BCDEGRST]' + +# Regexp to match symbols that can be accessed directly from C. +sympat='\([_A-Za-z][_A-Za-z0-9]*\)' + +# Transform the above into a raw symbol and a C symbol. +symxfrm='\1 \2\3 \3' + +# Transform an extracted symbol line into a proper C declaration +global_symbol_to_cdecl="sed -n -e 's/^. .* \(.*\)$/extern char \1;/p'" + +# Define system-specific variables. +case "$host_os" in +aix*) + symcode='[BCDT]' + ;; +cygwin* | mingw*) + symcode='[ABCDGISTW]' + ;; +hpux*) # Its linker distinguishes data from code symbols + global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern char \1();/p' -e 's/^. .* \(.*\)$/extern char \1;/p'" + ;; +irix*) + symcode='[BCDEGRST]' + ;; +solaris*) + symcode='[BDT]' + ;; +sysv4) + symcode='[DFNSTU]' + ;; +esac + +# If we're using GNU nm, then use its standard symbol codes. +if $NM -V 2>&1 | egrep '(GNU|with BFD)' > /dev/null; then + symcode='[ABCDGISTW]' +fi + +# Try without a prefix undercore, then with it. +for ac_symprfx in "" "_"; do + + # Write the raw and C identifiers. + global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode\)[ ][ ]*\($ac_symprfx\)$sympat$/$symxfrm/p'" + + # Check to see that the pipe works correctly. + pipe_works=no + $rm conftest* + cat > conftest.c <<EOF +#ifdef __cplusplus +extern "C" { +#endif +char nm_test_var; +void nm_test_func(){} +#ifdef __cplusplus +} +#endif +main(){nm_test_var='a';nm_test_func();return(0);} +EOF + + echo "$progname:1653: checking if global_symbol_pipe works" >&5 + if { (eval echo $progname:1654: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; } && test -s conftest.$objext; then + # Now try to grab the symbols. + nlist=conftest.nm + if { echo "$progname:1657: eval \"$NM conftest.$objext | $global_symbol_pipe > $nlist\"" >&5; eval "$NM conftest.$objext | $global_symbol_pipe > $nlist 2>&5"; } && test -s "$nlist"; then + + # Try sorting and uniquifying the output. + if sort "$nlist" | uniq > "$nlist"T; then + mv -f "$nlist"T "$nlist" + else + rm -f "$nlist"T + fi + + # Make sure that we snagged all the symbols we need. + if egrep ' nm_test_var$' "$nlist" >/dev/null; then + if egrep ' nm_test_func$' "$nlist" >/dev/null; then + cat <<EOF > conftest.c +#ifdef __cplusplus +extern "C" { +#endif + +EOF + # Now generate the symbol file. + eval "$global_symbol_to_cdecl"' < "$nlist" >> conftest.c' + + cat <<EOF >> conftest.c +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{ +EOF + sed 's/^. \(.*\) \(.*\)$/ {"\2", (lt_ptr_t) \&\2},/' < "$nlist" >> conftest.c + cat <<\EOF >> conftest.c + {0, (lt_ptr_t) 0} +}; + +#ifdef __cplusplus +} +#endif +EOF + # Now try linking the two files. + mv conftest.$objext conftstm.$objext + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="conftstm.$objext" + CFLAGS="$CFLAGS$no_builtin_flag" + if { (eval echo $progname:1709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + pipe_works=yes + else + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + LIBS="$save_LIBS" + else + echo "cannot find nm_test_func in $nlist" >&5 + fi + else + echo "cannot find nm_test_var in $nlist" >&5 + fi + else + echo "cannot run $global_symbol_pipe" >&5 + fi + else + echo "$progname: failed program was:" >&5 + cat conftest.c >&5 + fi + $rm conftest* conftst* + + # Do not use the global_symbol_pipe unless it works. + if test "$pipe_works" = yes; then + break + else + global_symbol_pipe= + fi +done +if test "$pipe_works" = yes; then + echo "${ac_t}ok" 1>&6 +else + echo "${ac_t}failed" 1>&6 +fi + +if test -z "$global_symbol_pipe"; then + global_symbol_to_cdecl= +fi + +# Check hardcoding attributes. +echo $ac_n "checking how to hardcode library paths into programs... $ac_c" 1>&6 +hardcode_action= +if test -n "$hardcode_libdir_flag_spec" || \ + test -n "$runpath_var"; then + + # We can hardcode non-existant directories. + if test "$hardcode_direct" != no && + # If the only mechanism to avoid hardcoding is shlibpath_var, we + # have to relink, otherwise we might link with an installed library + # when we should be linking with a yet-to-be-installed one + ## test "$hardcode_shlibpath_var" != no && + test "$hardcode_minus_L" != no; then + # Linking always hardcodes the temporary library directory. + hardcode_action=relink + else + # We can link without hardcoding, and we can hardcode nonexisting dirs. + hardcode_action=immediate + fi +else + # We cannot hardcode anything, or else we can only hardcode existing + # directories. + hardcode_action=unsupported +fi +echo "$ac_t$hardcode_action" 1>&6 + + +reload_flag= +reload_cmds='$LD$reload_flag -o $output$reload_objs' +echo $ac_n "checking for $LD option to reload object files... $ac_c" 1>&6 +# PORTME Some linkers may need a different reload flag. +reload_flag='-r' +echo "$ac_t$reload_flag" 1>&6 +test -n "$reload_flag" && reload_flag=" $reload_flag" + +# PORTME Fill in your ld.so characteristics +library_names_spec= +libname_spec='lib$name' +soname_spec= +postinstall_cmds= +postuninstall_cmds= +finish_cmds= +finish_eval= +shlibpath_var= +shlibpath_overrides_runpath=unknown +version_type=none +dynamic_linker="$host_os ld.so" +sys_lib_dlsearch_path_spec="/lib /usr/lib" +sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib" +file_magic_cmd= +file_magic_test_file= +deplibs_check_method='unknown' +# Need to set the preceding variable on all platforms that support +# interlibrary dependencies. +# 'none' -- dependencies not supported. +# `unknown' -- same as none, but documents that we really don't know. +# 'pass_all' -- all dependencies passed with no checks. +# 'test_compile' -- check by making test program. +# 'file_magic [regex]' -- check by looking for files in library path +# which responds to the $file_magic_cmd with a given egrep regex. +# If you have `file' or equivalent on your system and you're not sure +# whether `pass_all' will *always* work, you probably want this one. +echo $ac_n "checking dynamic linker characteristics... $ac_c" 1>&6 +case "$host_os" in +aix3*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix $libname.a' + shlibpath_var=LIBPATH + + # AIX has no versioning support, so we append a major version to the name. + soname_spec='${libname}${release}.so$major' + ;; + +aix4*) + version_type=linux + # AIX has no versioning support, so currently we can not hardcode correct + # soname into executable. Probably we can add versioning support to + # collect2, so additional links can be useful in future. + # We preserve .a as extension for shared libraries though AIX4.2 + # and later linker supports .so + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.a' + shlibpath_var=LIBPATH + deplibs_check_method=pass_all + ;; + +amigaos*) + library_names_spec='$libname.ixlibrary $libname.a' + # Create ${libname}_ixlibrary.a entries in /sys/libs. + finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`$echo "X$lib" | $Xsed -e '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $rm /sys/libs/${libname}_ixlibrary.a; $show "(cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a)"; (cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a) || exit 1; done' + ;; + +beos*) + library_names_spec='${libname}.so' + dynamic_linker="$host_os ld.so" + shlibpath_var=LIBRARY_PATH + deplibs_check_method=pass_all + lt_cv_dlopen="load_add_on" + lt_cv_dlopen_libs= + lt_cv_dlopen_self=yes + ;; + +bsdi4*) + version_type=linux + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/shlib/libc.so + sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib" + sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib" + export_dynamic_flag_spec=-rdynamic + # the default ld.so.conf also contains /usr/contrib/lib and + # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow + # libtool to hard-code these into programs + ;; + +cygwin* | mingw*) + version_type=windows + need_version=no + need_lib_prefix=no + if test "$with_gcc" = yes; then + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.a' + else + library_names_spec='${libname}`echo ${release} | sed -e 's/[.]/-/g'`${versuffix}.dll $libname.lib' + fi + dynamic_linker='Win32 ld.exe' + deplibs_check_method='file_magic file format pei*-i386(.*architecture: i386)?' + file_magic_cmd='${OBJDUMP} -f' + # FIXME: first we should search . and the directory the executable is in + shlibpath_var=PATH + lt_cv_dlopen="LoadLibrary" + lt_cv_dlopen_libs= + ;; + +freebsd1*) + dynamic_linker=no + ;; + +freebsd*) + objformat=`test -x /usr/bin/objformat && /usr/bin/objformat || echo aout` + version_type=freebsd-$objformat + case "$version_type" in + freebsd-elf*) + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB shared object' + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /usr/lib/libc.so*` + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + need_version=no + need_lib_prefix=no + ;; + freebsd-*) + deplibs_check_method=unknown + library_names_spec='${libname}${release}.so$versuffix $libname.so$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + case "$host_os" in + freebsd2* | freebsd3.[01]* | freebsdelf3.[01]*) + shlibpath_overrides_runpath=yes + ;; + *) # from 3.2 on + shlibpath_overrides_runpath=no + ;; + esac + ;; + +gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so${major} ${libname}.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +hpux9* | hpux10* | hpux11*) + # Give a soname corresponding to the major version so that dld.sl refuses to + # link against other versions. + dynamic_linker="$host_os dld.sl" + version_type=sunos + need_lib_prefix=no + need_version=no + shlibpath_var=SHLIB_PATH + shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH + library_names_spec='${libname}${release}.sl$versuffix ${libname}${release}.sl$major $libname.sl' + soname_spec='${libname}${release}.sl$major' + # HP-UX runs *really* slowly unless shared libraries are mode 555. + postinstall_cmds='chmod 555 $lib' + case "$host_os" in + hpux10.20*) + # TODO: Does this work for hpux-11 too? + deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/usr/lib/libc.sl + ;; + esac + ;; + +irix5* | irix6*) + version_type=irix + need_lib_prefix=no + need_version=no + soname_spec='${libname}${release}.so.$major' + library_names_spec='${libname}${release}.so.$versuffix ${libname}${release}.so.$major ${libname}${release}.so $libname.so' + case "$host_os" in + irix5*) + libsuff= shlibsuff= + # this will be overridden with pass_all, but let us keep it just in case + deplibs_check_method="file_magic ELF 32-bit MSB dynamic lib MIPS - version 1" + ;; + *) + case "$LD" in # libtool.m4 will add one of these switches to LD + *-32|*"-32 ") libsuff= shlibsuff= libmagic=32-bit;; + *-n32|*"-n32 ") libsuff=32 shlibsuff=N32 libmagic=N32;; + *-64|*"-64 ") libsuff=64 shlibsuff=64 libmagic=64-bit;; + *) libsuff= shlibsuff= libmagic=never-match;; + esac + ;; + esac + shlibpath_var=LD_LIBRARY${shlibsuff}_PATH + shlibpath_overrides_runpath=no + sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}" + sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}" + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /lib${libsuff}/libc.so*` + deplibs_check_method='pass_all' + ;; + +# No shared lib support for Linux oldld, aout, or coff. +linux-gnuoldld* | linux-gnuaout* | linux-gnucoff*) + dynamic_linker=no + ;; + +# This must be Linux ELF. +linux-gnu*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=no + deplibs_check_method=pass_all + + if test -f /lib/ld.so.1; then + dynamic_linker='GNU ld.so' + else + # Only the GNU ld.so supports shared libraries on MkLinux. + case "$host_cpu" in + powerpc*) dynamic_linker=no ;; + *) dynamic_linker='Linux ld.so' ;; + esac + fi + ;; + +netbsd*) + version_type=sunos + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + dynamic_linker='NetBSD (a.out) ld.so' + else + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major ${libname}${release}.so ${libname}.so' + soname_spec='${libname}${release}.so$major' + dynamic_linker='NetBSD ld.elf_so' + fi + shlibpath_var=LD_LIBRARY_PATH + ;; + +openbsd*) + version_type=sunos + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + need_version=no + fi + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir' + shlibpath_var=LD_LIBRARY_PATH + ;; + +os2*) + libname_spec='$name' + need_lib_prefix=no + library_names_spec='$libname.dll $libname.a' + dynamic_linker='OS/2 ld.exe' + shlibpath_var=LIBPATH + ;; + +osf3* | osf4* | osf5*) + version_type=osf + need_version=no + soname_spec='${libname}${release}.so' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so $libname.so' + shlibpath_var=LD_LIBRARY_PATH + # this will be overridden with pass_all, but let us keep it just in case + deplibs_check_method='file_magic COFF format alpha shared library' + file_magic_cmd=/usr/bin/file + file_magic_test_file=/shlib/libc.so + deplibs_check_method='pass_all' + sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib" + sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec" + ;; + +rhapsody*) + version_type=sunos + library_names_spec='${libname}.so' + soname_spec='${libname}.so' + shlibpath_var=DYLD_LIBRARY_PATH + deplibs_check_method=pass_all + ;; + +sco3.2v5*) + version_type=osf + soname_spec='${libname}${release}.so$major' + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + shlibpath_var=LD_LIBRARY_PATH + ;; + +solaris*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + # ldd complains unless libraries are executable + postinstall_cmds='chmod +x $lib' + deplibs_check_method="file_magic ELF [0-9][0-9]-bit [LM]SB dynamic lib" + file_magic_cmd=/usr/bin/file + file_magic_test_file=/lib/libc.so + ;; + +sunos4*) + version_type=sunos + library_names_spec='${libname}${release}.so$versuffix ${libname}.so$versuffix' + finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir' + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + if test "$with_gnu_ld" = yes; then + need_lib_prefix=no + fi + need_version=yes + ;; + +sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + case "$host_vendor" in + sequent) + file_magic_cmd='/bin/file' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )' + ;; + ncr) + deplibs_check_method='pass_all' + ;; + motorola) + need_lib_prefix=no + need_version=no + shlibpath_overrides_runpath=no + sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib' + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]' + file_magic_cmd=/usr/bin/file + file_magic_test_file=`echo /usr/lib/libc.so*` + ;; + esac + ;; + +uts4*) + version_type=linux + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +dgux*) + version_type=linux + need_lib_prefix=no + need_version=no + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so' + soname_spec='${libname}${release}.so$major' + shlibpath_var=LD_LIBRARY_PATH + ;; + +sysv4*MP*) + if test -d /usr/nec ;then + version_type=linux + library_names_spec='$libname.so.$versuffix $libname.so.$major $libname.so' + soname_spec='$libname.so.$major' + shlibpath_var=LD_LIBRARY_PATH + fi + ;; + +*) + dynamic_linker=no + ;; +esac +echo "$ac_t$dynamic_linker" 1>&6 +test "$dynamic_linker" = no && can_build_shared=no + +# Report the final consequences. +echo "checking if libtool supports shared libraries... $can_build_shared" 1>&6 + +# Only try to build win32 dlls if AC_LIBTOOL_WIN32_DLL was used in +# configure.in, otherwise build static only libraries. +case "$host_os" in +cygwin* | mingw* | os2*) + if test x$can_build_shared = xyes; then + test x$enable_win32_dll = xno && can_build_shared=no + echo "checking if package supports dlls... $can_build_shared" 1>&6 + fi +;; +esac + +if test -n "$file_magic_test_file" && test -n "$file_magic_cmd"; then + case "$deplibs_check_method" in + "file_magic "*) + file_magic_regex="`expr \"$deplibs_check_method\" : \"file_magic \(.*\)\"`" + if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null | + egrep "$file_magic_regex" > /dev/null; then + : + else + cat <<EOF 1>&2 + +*** Warning: the command libtool uses to detect shared libraries, +*** $file_magic_cmd, produces output that libtool cannot recognize. +*** The result is that libtool may fail to recognize shared libraries +*** as such. This will affect the creation of libtool libraries that +*** depend on shared libraries, but programs linked with such libtool +*** libraries will work regardless of this problem. Nevertheless, you +*** may want to report the problem to your system manager and/or to +*** bug-libtool@gnu.org + +EOF + fi ;; + esac +fi + +echo $ac_n "checking whether to build shared libraries... $ac_c" 1>&6 +test "$can_build_shared" = "no" && enable_shared=no + +# On AIX, shared libraries and static libraries use the same namespace, and +# are all built from PIC. +case "$host_os" in +aix3*) + test "$enable_shared" = yes && enable_static=no + if test -n "$RANLIB"; then + archive_cmds="$archive_cmds~\$RANLIB \$lib" + postinstall_cmds='$RANLIB $lib' + fi + ;; + +aix4*) + test "$enable_shared" = yes && enable_static=no + ;; +esac + +echo "$ac_t$enable_shared" 1>&6 + +# Make sure either enable_shared or enable_static is yes. +test "$enable_shared" = yes || enable_static=yes + +echo "checking whether to build static libraries... $enable_static" 1>&6 + +if test "$hardcode_action" = relink; then + # Fast installation is not supported + enable_fast_install=no +elif test "$shlibpath_overrides_runpath" = yes || + test "$enable_shared" = no; then + # Fast installation is not necessary + enable_fast_install=needless +fi + +echo $ac_n "checking for objdir... $ac_c" 1>&6 +rm -f .libs 2>/dev/null +mkdir .libs 2>/dev/null +if test -d .libs; then + objdir=.libs +else + # MS-DOS does not allow filenames that begin with a dot. + objdir=_libs +fi +rmdir .libs 2>/dev/null +echo "$ac_t$objdir" 1>&6 + +if test "x$enable_dlopen" != xyes; then + enable_dlopen=unknown + enable_dlopen_self=unknown + enable_dlopen_self_static=unknown +else +if eval "test \"`echo '$''{'lt_cv_dlopen'+set}'`\" != set"; then + lt_cv_dlopen=no lt_cv_dlopen_libs= +echo $ac_n "checking for dlopen in -ldl""... $ac_c" 1>&6 +echo "$progname:2248: checking for dlopen in -ldl" >&5 +ac_lib_var=`echo dl'_'dlopen | 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="-ldl $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2256 "ltconfig" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen(); + +int main() { +dlopen() +; return 0; } +EOF +if { (eval echo $progname:2269: \"$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 "$progname: 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 + lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dlopen""... $ac_c" 1>&6 +echo "$progname:2288: checking for dlopen" >&5 +if eval "test \"`echo '$''{'ac_cv_func_dlopen'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2293 "ltconfig" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char dlopen(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dlopen(); + +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_dlopen) || defined (__stub___dlopen) +choke me +#else +dlopen(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:2318: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_dlopen=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_dlopen=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_func_'dlopen`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="dlopen" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for dld_link in -ldld""... $ac_c" 1>&6 +echo "$progname:2335: checking for dld_link in -ldld" >&5 +ac_lib_var=`echo dld'_'dld_link | 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="-ldld $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2343 "ltconfig" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char dld_link(); + +int main() { +dld_link() +; return 0; } +EOF +if { (eval echo $progname:2356: \"$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 "$progname: 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 + lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load""... $ac_c" 1>&6 +echo "$progname:2375: checking for shl_load" >&5 +if eval "test \"`echo '$''{'ac_cv_func_shl_load'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2380 "ltconfig" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char shl_load(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load(); + +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_shl_load) || defined (__stub___shl_load) +choke me +#else +shl_load(); +#endif + +; return 0; } +EOF +if { (eval echo $progname:2405: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_shl_load=yes" +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_shl_load=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'shl_load`\" = yes"; then + echo "$ac_t""yes" 1>&6 + lt_cv_dlopen="shl_load" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for shl_load in -ldld""... $ac_c" 1>&6 +echo "$progname:2423: checking for shl_load in -ldld" >&5 +ac_lib_var=`echo dld'_'shl_load | 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="-ldld $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2431 "ltconfig" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char shl_load(); + +int main() { +shl_load() +; return 0; } +EOF +if { (eval echo $progname:2445: \"$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 "$progname: 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 + lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld" +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +fi + + +fi + + +fi + +fi + + if test "x$lt_cv_dlopen" != xno; then + enable_dlopen=yes + fi + + case "$lt_cv_dlopen" in + dlopen) +for ac_hdr in dlfcn.h; do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "$progname:2488: 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 +#line 2493 "ltconfig" +#include <$ac_hdr> +int fnord = 0; +EOF +ac_try="$ac_compile >/dev/null 2>conftest.out" +{ (eval echo $progname:2498: \"$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 "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi +done + + if test "x$ac_cv_header_dlfcn_h" = xyes; then + CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H" + fi + eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\" + LIBS="$lt_cv_dlopen_libs $LIBS" + + echo $ac_n "checking whether a program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:2526: checking whether a program can dlopen itself" >&5 +if test "${lt_cv_dlopen_self+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self=cross + else + cat > conftest.c <<EOF +#line 2534 "ltconfig" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +fnord() { int i=42;} +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + +EOF +if { (eval echo $progname:2580: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self" 1>&6 + + if test "$lt_cv_dlopen_self" = yes; then + LDFLAGS="$LDFLAGS $link_static_flag" + echo $ac_n "checking whether a statically linked program can dlopen itself""... $ac_c" 1>&6 +echo "$progname:2599: checking whether a statically linked program can dlopen itself" >&5 +if test "${lt_cv_dlopen_self_static+set}" = set; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + lt_cv_dlopen_self_static=cross + else + cat > conftest.c <<EOF +#line 2607 "ltconfig" + +#if HAVE_DLFCN_H +#include <dlfcn.h> +#endif + +#include <stdio.h> + +#ifdef RTLD_GLOBAL +# define LTDL_GLOBAL RTLD_GLOBAL +#else +# ifdef DL_GLOBAL +# define LTDL_GLOBAL DL_GLOBAL +# else +# define LTDL_GLOBAL 0 +# endif +#endif + +/* We may have to define LTDL_LAZY_OR_NOW in the command line if we + find out it does not work in some platform. */ +#ifndef LTDL_LAZY_OR_NOW +# ifdef RTLD_LAZY +# define LTDL_LAZY_OR_NOW RTLD_LAZY +# else +# ifdef DL_LAZY +# define LTDL_LAZY_OR_NOW DL_LAZY +# else +# ifdef RTLD_NOW +# define LTDL_LAZY_OR_NOW RTLD_NOW +# else +# ifdef DL_NOW +# define LTDL_LAZY_OR_NOW DL_NOW +# else +# define LTDL_LAZY_OR_NOW 0 +# endif +# endif +# endif +# endif +#endif + +fnord() { int i=42;} +main() { void *self, *ptr1, *ptr2; self=dlopen(0,LTDL_GLOBAL|LTDL_LAZY_OR_NOW); + if(self) { ptr1=dlsym(self,"fnord"); ptr2=dlsym(self,"_fnord"); + if(ptr1 || ptr2) { dlclose(self); exit(0); } } exit(1); } + +EOF +if { (eval echo $progname:2653: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest && (./conftest; exit) 2>/dev/null +then + lt_cv_dlopen_self_static=yes +else + echo "$progname: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + lt_cv_dlopen_self_static=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$lt_cv_dlopen_self_static" 1>&6 +fi + ;; + esac + + case "$lt_cv_dlopen_self" in + yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;; + *) enable_dlopen_self=unknown ;; + esac + + case "$lt_cv_dlopen_self_static" in + yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;; + *) enable_dlopen_self_static=unknown ;; + esac +fi + +# Copy echo and quote the copy, instead of the original, because it is +# used later. +ltecho="$echo" +if test "X$ltecho" = "X$CONFIG_SHELL $0 --fallback-echo"; then + ltecho="$CONFIG_SHELL \$0 --fallback-echo" +fi +LTSHELL="$SHELL" + +LTCONFIG_VERSION="$VERSION" + +# Only quote variables if we're using ltmain.sh. +case "$ltmain" in +*.sh) + # Now quote all the things that may contain metacharacters. + for var in ltecho old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS \ + AR CC LD LN_S NM LTSHELL LTCONFIG_VERSION \ + reload_flag reload_cmds wl \ + pic_flag link_static_flag no_builtin_flag export_dynamic_flag_spec \ + thread_safe_flag_spec whole_archive_flag_spec libname_spec \ + library_names_spec soname_spec \ + RANLIB old_archive_cmds old_archive_from_new_cmds old_postinstall_cmds \ + old_postuninstall_cmds archive_cmds archive_expsym_cmds postinstall_cmds postuninstall_cmds \ + file_magic_cmd export_symbols_cmds deplibs_check_method allow_undefined_flag no_undefined_flag \ + finish_cmds finish_eval global_symbol_pipe global_symbol_to_cdecl \ + hardcode_libdir_flag_spec hardcode_libdir_separator \ + sys_lib_search_path_spec sys_lib_dlsearch_path_spec \ + compiler_c_o compiler_o_lo need_locks exclude_expsyms include_expsyms; do + + case "$var" in + reload_cmds | old_archive_cmds | old_archive_from_new_cmds | \ + old_postinstall_cmds | old_postuninstall_cmds | \ + export_symbols_cmds | archive_cmds | archive_expsym_cmds | \ + postinstall_cmds | postuninstall_cmds | \ + finish_cmds | sys_lib_search_path_spec | sys_lib_dlsearch_path_spec) + # Double-quote double-evaled strings. + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$double_quote_subst\" -e \"\$sed_quote_subst\" -e \"\$delay_variable_subst\"\`\\\"" + ;; + *) + eval "$var=\\\"\`\$echo \"X\$$var\" | \$Xsed -e \"\$sed_quote_subst\"\`\\\"" + ;; + esac + done + + case "$ltecho" in + *'\$0 --fallback-echo"') + ltecho=`$echo "X$ltecho" | $Xsed -e 's/\\\\\\\$0 --fallback-echo"$/$0 --fallback-echo"/'` + ;; + esac + + trap "$rm \"$ofile\"; exit 1" 1 2 15 + echo "creating $ofile" + $rm "$ofile" + cat <<EOF > "$ofile" +#! $SHELL + +# `$echo "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +# NOTE: Changes made to this file will be lost: look at ltconfig or ltmain.sh. +# +# Copyright (C) 1996-1999 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Sed that helps us avoid accidentally triggering echo(1) options like -n. +Xsed="sed -e s/^X//" + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test "X\${CDPATH+set}" = Xset; then CDPATH=:; export CDPATH; fi + +### BEGIN LIBTOOL CONFIG +EOF + cfgfile="$ofile" + ;; + +*) + # Double-quote the variables that need it (for aesthetics). + for var in old_CC old_CFLAGS old_CPPFLAGS \ + old_LD old_LDFLAGS old_LIBS \ + old_NM old_RANLIB old_LN_S old_DLLTOOL old_OBJDUMP old_AS; do + eval "$var=\\\"\$var\\\"" + done + + # Just create a config file. + cfgfile="$ofile.cfg" + trap "$rm \"$cfgfile\"; exit 1" 1 2 15 + echo "creating $cfgfile" + $rm "$cfgfile" + cat <<EOF > "$cfgfile" +# `$echo "$cfgfile" | sed 's%^.*/%%'` - Libtool configuration file. +# Generated automatically by $PROGRAM (GNU $PACKAGE $VERSION$TIMESTAMP) +EOF + ;; +esac + +cat <<EOF >> "$cfgfile" +# Libtool was configured as follows, on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# CC=$old_CC CFLAGS=$old_CFLAGS CPPFLAGS=$old_CPPFLAGS \\ +# LD=$old_LD LDFLAGS=$old_LDFLAGS LIBS=$old_LIBS \\ +# NM=$old_NM RANLIB=$old_RANLIB LN_S=$old_LN_S \\ +# DLLTOOL=$old_DLLTOOL OBJDUMP=$old_OBJDUMP AS=$old_AS \\ +# $0$ltconfig_args +# +# Compiler and other test output produced by $progname, useful for +# debugging $progname, is in ./config.log if it exists. + +# The version of $progname that generated this script. +LTCONFIG_VERSION=$LTCONFIG_VERSION + +# Shell to use when invoking shell scripts. +SHELL=$LTSHELL + +# Whether or not to build shared libraries. +build_libtool_libs=$enable_shared + +# Whether or not to build static libraries. +build_old_libs=$enable_static + +# Whether or not to optimize for fast installation. +fast_install=$enable_fast_install + +# The host system. +host_alias=$host_alias +host=$host + +# An echo program that does not interpret backslashes. +echo=$ltecho + +# The archiver. +AR=$AR + +# The default C compiler. +CC=$CC + +# The linker used to build libraries. +LD=$LD + +# Whether we need hard or soft links. +LN_S=$LN_S + +# A BSD-compatible nm program. +NM=$NM + +# Used on cygwin: DLL creation program. +DLLTOOL="$DLLTOOL" + +# Used on cygwin: object dumper. +OBJDUMP="$OBJDUMP" + +# Used on cygwin: assembler. +AS="$AS" + +# The name of the directory that contains temporary libtool files. +objdir=$objdir + +# How to create reloadable object files. +reload_flag=$reload_flag +reload_cmds=$reload_cmds + +# How to pass a linker flag through the compiler. +wl=$wl + +# Object file suffix (normally "o"). +objext="$objext" + +# Old archive suffix (normally "a"). +libext="$libext" + +# Executable file suffix (normally ""). +exeext="$exeext" + +# Additional compiler flags for building library objects. +pic_flag=$pic_flag + +# Does compiler simultaneously support -c and -o options? +compiler_c_o=$compiler_c_o + +# Can we write directly to a .lo ? +compiler_o_lo=$compiler_o_lo + +# Must we lock files when doing compilation ? +need_locks=$need_locks + +# Do we need the lib prefix for modules? +need_lib_prefix=$need_lib_prefix + +# Do we need a version for libraries? +need_version=$need_version + +# Whether dlopen is supported. +dlopen=$enable_dlopen + +# Whether dlopen of programs is supported. +dlopen_self=$enable_dlopen_self + +# Whether dlopen of statically linked programs is supported. +dlopen_self_static=$enable_dlopen_self_static + +# Compiler flag to prevent dynamic linking. +link_static_flag=$link_static_flag + +# Compiler flag to turn off builtin functions. +no_builtin_flag=$no_builtin_flag + +# Compiler flag to allow reflexive dlopens. +export_dynamic_flag_spec=$export_dynamic_flag_spec + +# Compiler flag to generate shared objects directly from archives. +whole_archive_flag_spec=$whole_archive_flag_spec + +# Compiler flag to generate thread-safe objects. +thread_safe_flag_spec=$thread_safe_flag_spec + +# Library versioning type. +version_type=$version_type + +# Format of library name prefix. +libname_spec=$libname_spec + +# List of archive names. First name is the real one, the rest are links. +# The last name is the one that the linker finds with -lNAME. +library_names_spec=$library_names_spec + +# The coded name of the library, if different from the real name. +soname_spec=$soname_spec + +# Commands used to build and install an old-style archive. +RANLIB=$RANLIB +old_archive_cmds=$old_archive_cmds +old_postinstall_cmds=$old_postinstall_cmds +old_postuninstall_cmds=$old_postuninstall_cmds + +# Create an old-style archive from a shared archive. +old_archive_from_new_cmds=$old_archive_from_new_cmds + +# Commands used to build and install a shared archive. +archive_cmds=$archive_cmds +archive_expsym_cmds=$archive_expsym_cmds +postinstall_cmds=$postinstall_cmds +postuninstall_cmds=$postuninstall_cmds + +# Method to check whether dependent libraries are shared objects. +deplibs_check_method=$deplibs_check_method + +# Command to use when deplibs_check_method == file_magic. +file_magic_cmd=$file_magic_cmd + +# Flag that allows shared libraries with undefined symbols to be built. +allow_undefined_flag=$allow_undefined_flag + +# Flag that forces no undefined symbols. +no_undefined_flag=$no_undefined_flag + +# Commands used to finish a libtool library installation in a directory. +finish_cmds=$finish_cmds + +# Same as above, but a single script fragment to be evaled but not shown. +finish_eval=$finish_eval + +# Take the output of nm and produce a listing of raw symbols and C names. +global_symbol_pipe=$global_symbol_pipe + +# Transform the output of nm in a proper C declaration +global_symbol_to_cdecl=$global_symbol_to_cdecl + +# This is the shared library runtime path variable. +runpath_var=$runpath_var + +# This is the shared library path variable. +shlibpath_var=$shlibpath_var + +# Is shlibpath searched before the hard-coded library search path? +shlibpath_overrides_runpath=$shlibpath_overrides_runpath + +# How to hardcode a shared library path into an executable. +hardcode_action=$hardcode_action + +# Flag to hardcode \$libdir into a binary during linking. +# This must work even if \$libdir does not exist. +hardcode_libdir_flag_spec=$hardcode_libdir_flag_spec + +# Whether we need a single -rpath flag with a separated argument. +hardcode_libdir_separator=$hardcode_libdir_separator + +# Set to yes if using DIR/libNAME.so during linking hardcodes DIR into the +# resulting binary. +hardcode_direct=$hardcode_direct + +# Set to yes if using the -LDIR flag during linking hardcodes DIR into the +# resulting binary. +hardcode_minus_L=$hardcode_minus_L + +# Set to yes if using SHLIBPATH_VAR=DIR during linking hardcodes DIR into +# the resulting binary. +hardcode_shlibpath_var=$hardcode_shlibpath_var + +# Compile-time system search path for libraries +sys_lib_search_path_spec=$sys_lib_search_path_spec + +# Run-time system search path for libraries +sys_lib_dlsearch_path_spec=$sys_lib_dlsearch_path_spec + +# Fix the shell variable \$srcfile for the compiler. +fix_srcfile_path="$fix_srcfile_path" + +# Set to yes if exported symbols are required. +always_export_symbols=$always_export_symbols + +# The commands to list exported symbols. +export_symbols_cmds=$export_symbols_cmds + +# Symbols that should not be listed in the preloaded symbols. +exclude_expsyms=$exclude_expsyms + +# Symbols that must always be exported. +include_expsyms=$include_expsyms + +EOF + +case "$ltmain" in +*.sh) + echo '### END LIBTOOL CONFIG' >> "$ofile" + echo >> "$ofile" + case "$host_os" in + aix3*) + cat <<\EOF >> "$ofile" + +# AIX sometimes has problems with the GCC collect2 program. For some +# reason, if we set the COLLECT_NAMES environment variable, the problems +# vanish in a puff of smoke. +if test "X${COLLECT_NAMES+set}" != Xset; then + COLLECT_NAMES= + export COLLECT_NAMES +fi +EOF + ;; + esac + + # Append the ltmain.sh script. + sed '$q' "$ltmain" >> "$ofile" || (rm -f "$ofile"; exit 1) + # We use sed instead of cat because bash on DJGPP gets confused if + # if finds mixed CR/LF and LF-only lines. Since sed operates in + # text mode, it properly converts lines to CR/LF. This bash problem + # is reportedly fixed, but why not run on old versions too? + + chmod +x "$ofile" + ;; + +*) + # Compile the libtool program. + echo "FIXME: would compile $ltmain" + ;; +esac + +test -n "$cache_file" || exit 0 + +# AC_CACHE_SAVE +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. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# 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. +# +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 \ + -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 + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +exit 0 + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End:
A ltmain.sh

@@ -0,0 +1,4024 @@

+# ltmain.sh - Provide generalized library-building support services. +# NOTE: Changing this file will not affect anything until you rerun ltconfig. +# +# Copyright (C) 1996-1999 Free Software Foundation, Inc. +# Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# Check that we have a working $echo. +if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift +elif test "X$1" = X--fallback-echo; then + # Avoid inline document here, it may be left over + : +elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then + # Yippee, $echo works! + : +else + # Restart under the correct shell, and then maybe $echo will work. + exec $SHELL "$0" --no-reexec ${1+"$@"} +fi + +if test "X$1" = X--fallback-echo; then + # used as fallback echo + shift + cat <<EOF +$* +EOF + exit 0 +fi + +# The name of this program. +progname=`$echo "$0" | sed 's%^.*/%%'` +modename="$progname" + +# Constants. +PROGRAM=ltmain.sh +PACKAGE=libtool +VERSION=1.3.5 +TIMESTAMP=" (1.385.2.206 2000/05/27 11:12:27)" + +default_mode= +help="Try \`$progname --help' for more information." +magic="%%%MAGIC variable%%%" +mkdir="mkdir" +mv="mv -f" +rm="rm -f" + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' +SP2NL='tr \040 \012' +NL2SP='tr \015\012 \040\040' + +# NLS nuisances. +# Only set LANG and LC_ALL to C if already set. +# These must not be set unconditionally because not all systems understand +# e.g. LANG=C (notably SCO). +# We save the old values to restore during execute mode. +if test "${LC_ALL+set}" = set; then + save_LC_ALL="$LC_ALL"; LC_ALL=C; export LC_ALL +fi +if test "${LANG+set}" = set; then + save_LANG="$LANG"; LANG=C; export LANG +fi + +if test "$LTCONFIG_VERSION" != "$VERSION"; then + echo "$modename: ltconfig version \`$LTCONFIG_VERSION' does not match $PROGRAM version \`$VERSION'" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 +fi + +if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then + echo "$modename: not configured to build any kind of library" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 +fi + +# Global variables. +mode=$default_mode +nonopt= +prev= +prevopt= +run= +show="$echo" +show_help= +execute_dlfiles= +lo2o="s/\\.lo\$/.${objext}/" +o2lo="s/\\.${objext}\$/.lo/" + +# Parse our command line options once, thoroughly. +while test $# -gt 0 +do + arg="$1" + shift + + case "$arg" in + -*=*) optarg=`$echo "X$arg" | $Xsed -e 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case "$prev" in + execute_dlfiles) + eval "$prev=\"\$$prev \$arg\"" + ;; + *) + eval "$prev=\$arg" + ;; + esac + + prev= + prevopt= + continue + fi + + # Have we seen a non-optional argument yet? + case "$arg" in + --help) + show_help=yes + ;; + + --version) + echo "$PROGRAM (GNU $PACKAGE) $VERSION$TIMESTAMP" + exit 0 + ;; + + --config) + sed -e '1,/^### BEGIN LIBTOOL CONFIG/d' -e '/^### END LIBTOOL CONFIG/,$d' $0 + exit 0 + ;; + + --debug) + echo "$progname: enabling shell trace mode" + set -x + ;; + + --dry-run | -n) + run=: + ;; + + --features) + echo "host: $host" + if test "$build_libtool_libs" = yes; then + echo "enable shared libraries" + else + echo "disable shared libraries" + fi + if test "$build_old_libs" = yes; then + echo "enable static libraries" + else + echo "disable static libraries" + fi + exit 0 + ;; + + --finish) mode="finish" ;; + + --mode) prevopt="--mode" prev=mode ;; + --mode=*) mode="$optarg" ;; + + --quiet | --silent) + show=: + ;; + + -dlopen) + prevopt="-dlopen" + prev=execute_dlfiles + ;; + + -*) + $echo "$modename: unrecognized option \`$arg'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + + *) + nonopt="$arg" + break + ;; + esac +done + +if test -n "$prevopt"; then + $echo "$modename: option \`$prevopt' requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 +fi + +if test -z "$show_help"; then + + # Infer the operation mode. + if test -z "$mode"; then + case "$nonopt" in + *cc | *++ | gcc* | *-gcc*) + mode=link + for arg + do + case "$arg" in + -c) + mode=compile + break + ;; + esac + done + ;; + *db | *dbx | *strace | *truss) + mode=execute + ;; + *install*|cp|mv) + mode=install + ;; + *rm) + mode=uninstall + ;; + *) + # If we have no mode, but dlfiles were specified, then do execute mode. + test -n "$execute_dlfiles" && mode=execute + + # Just use the default operation mode. + if test -z "$mode"; then + if test -n "$nonopt"; then + $echo "$modename: warning: cannot infer operation mode from \`$nonopt'" 1>&2 + else + $echo "$modename: warning: cannot infer operation mode without MODE-ARGS" 1>&2 + fi + fi + ;; + esac + fi + + # Only execute mode is allowed to have -dlopen flags. + if test -n "$execute_dlfiles" && test "$mode" != execute; then + $echo "$modename: unrecognized option \`-dlopen'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Change the help message to a mode-specific one. + generic_help="$help" + help="Try \`$modename --help --mode=$mode' for more information." + + # These modes are in order of execution frequency so that they run quickly. + case "$mode" in + # libtool compile mode + compile) + modename="$modename: compile" + # Get the compilation command and the source file. + base_compile= + lastarg= + srcfile="$nonopt" + suppress_output= + + user_target=no + for arg + do + # Accept any command-line options. + case "$arg" in + -o) + if test "$user_target" != "no"; then + $echo "$modename: you cannot specify \`-o' more than once" 1>&2 + exit 1 + fi + user_target=next + ;; + + -static) + build_old_libs=yes + continue + ;; + esac + + case "$user_target" in + next) + # The next one is the -o target name + user_target=yes + continue + ;; + yes) + # We got the output file + user_target=set + libobj="$arg" + continue + ;; + esac + + # Accept the current argument as the source file. + lastarg="$srcfile" + srcfile="$arg" + + # Aesthetically quote the previous argument. + + # Backslashify any backslashes, double quotes, and dollar signs. + # These are the only characters that are still specially + # interpreted inside of double-quoted scrings. + lastarg=`$echo "X$lastarg" | $Xsed -e "$sed_quote_subst"` + + # Double-quote args containing other shell metacharacters. + # Many Bourne shells cannot handle close brackets correctly in scan + # sets, so we specify it separately. + case "$lastarg" in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + lastarg="\"$lastarg\"" + ;; + esac + + # Add the previous argument to base_compile. + if test -z "$base_compile"; then + base_compile="$lastarg" + else + base_compile="$base_compile $lastarg" + fi + done + + case "$user_target" in + set) + ;; + no) + # Get the name of the library object. + libobj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%'` + ;; + *) + $echo "$modename: you must specify a target with \`-o'" 1>&2 + exit 1 + ;; + esac + + # Recognize several different file suffixes. + # If the user specifies -o file.o, it is replaced with file.lo + xform='[cCFSfmso]' + case "$libobj" in + *.ada) xform=ada ;; + *.adb) xform=adb ;; + *.ads) xform=ads ;; + *.asm) xform=asm ;; + *.c++) xform=c++ ;; + *.cc) xform=cc ;; + *.cpp) xform=cpp ;; + *.cxx) xform=cxx ;; + *.f90) xform=f90 ;; + *.for) xform=for ;; + esac + + libobj=`$echo "X$libobj" | $Xsed -e "s/\.$xform$/.lo/"` + + case "$libobj" in + *.lo) obj=`$echo "X$libobj" | $Xsed -e "$lo2o"` ;; + *) + $echo "$modename: cannot determine name of library object from \`$libobj'" 1>&2 + exit 1 + ;; + esac + + if test -z "$base_compile"; then + $echo "$modename: you must specify a compilation command" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Delete any leftover library objects. + if test "$build_old_libs" = yes; then + removelist="$obj $libobj" + else + removelist="$libobj" + fi + + $run $rm $removelist + trap "$run $rm $removelist; exit 1" 1 2 15 + + # Calculate the filename of the output object if compiler does + # not support -o with -c + if test "$compiler_c_o" = no; then + output_obj=`$echo "X$srcfile" | $Xsed -e 's%^.*/%%' -e 's%\..*$%%'`.${objext} + lockfile="$output_obj.lock" + removelist="$removelist $output_obj $lockfile" + trap "$run $rm $removelist; exit 1" 1 2 15 + else + need_locks=no + lockfile= + fi + + # Lock this critical section if it is needed + # We use this script file to make the link, it avoids creating a new file + if test "$need_locks" = yes; then + until ln "$0" "$lockfile" 2>/dev/null; do + $show "Waiting for $lockfile to be removed" + sleep 2 + done + elif test "$need_locks" = warn; then + if test -f "$lockfile"; then + echo "\ +*** ERROR, $lockfile exists and contains: +`cat $lockfile 2>/dev/null` + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + echo $srcfile > "$lockfile" + fi + + if test -n "$fix_srcfile_path"; then + eval srcfile=\"$fix_srcfile_path\" + fi + + # Only build a PIC object if we are building libtool libraries. + if test "$build_libtool_libs" = yes; then + # Without this assignment, base_compile gets emptied. + fbsd_hideous_sh_bug=$base_compile + + # All platforms use -DPIC, to notify preprocessed assembler code. + command="$base_compile $srcfile $pic_flag -DPIC" + if test "$build_old_libs" = yes; then + lo_libobj="$libobj" + dir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$libobj"; then + dir="$objdir" + else + dir="$dir/$objdir" + fi + libobj="$dir/"`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + + if test -d "$dir"; then + $show "$rm $libobj" + $run $rm $libobj + else + $show "$mkdir $dir" + $run $mkdir $dir + status=$? + if test $status -ne 0 && test ! -d $dir; then + exit $status + fi + fi + fi + if test "$compiler_o_lo" = yes; then + output_obj="$libobj" + command="$command -o $output_obj" + elif test "$compiler_c_o" = yes; then + output_obj="$obj" + command="$command -o $output_obj" + fi + + $run $rm "$output_obj" + $show "$command" + if $run eval "$command"; then : + else + test -n "$output_obj" && $run $rm $removelist + exit 1 + fi + + if test "$need_locks" = warn && + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed, then go on to compile the next one + if test x"$output_obj" != x"$libobj"; then + $show "$mv $output_obj $libobj" + if $run $mv $output_obj $libobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # If we have no pic_flag, then copy the object into place and finish. + if test -z "$pic_flag" && test "$build_old_libs" = yes; then + # Rename the .lo from within objdir to obj + if test -f $obj; then + $show $rm $obj + $run $rm $obj + fi + + $show "$mv $libobj $obj" + if $run $mv $libobj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e "s%.*/%%"` + libobj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + # Now arrange that obj and lo_libobj become the same file + $show "(cd $xdir && $LN_S $baseobj $libobj)" + if $run eval '(cd $xdir && $LN_S $baseobj $libobj)'; then + exit 0 + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Allow error messages only from the first compilation. + suppress_output=' >/dev/null 2>&1' + fi + + # Only build a position-dependent object if we build old libraries. + if test "$build_old_libs" = yes; then + command="$base_compile $srcfile" + if test "$compiler_c_o" = yes; then + command="$command -o $obj" + output_obj="$obj" + fi + + # Suppress compiler output if we already did a PIC compilation. + command="$command$suppress_output" + $run $rm "$output_obj" + $show "$command" + if $run eval "$command"; then : + else + $run $rm $removelist + exit 1 + fi + + if test "$need_locks" = warn && + test x"`cat $lockfile 2>/dev/null`" != x"$srcfile"; then + echo "\ +*** ERROR, $lockfile contains: +`cat $lockfile 2>/dev/null` + +but it should contain: +$srcfile + +This indicates that another process is trying to use the same +temporary object file, and libtool could not work around it because +your compiler does not support \`-c' and \`-o' together. If you +repeat this compilation, it may succeed, by chance, but you had better +avoid parallel builds (make -j) in this platform, or get a better +compiler." + + $run $rm $removelist + exit 1 + fi + + # Just move the object if needed + if test x"$output_obj" != x"$obj"; then + $show "$mv $output_obj $obj" + if $run $mv $output_obj $obj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + + # Create an invalid libtool object if no PIC, so that we do not + # accidentally link it into a program. + if test "$build_libtool_libs" != yes; then + $show "echo timestamp > $libobj" + $run eval "echo timestamp > \$libobj" || exit $? + else + # Move the .lo from within objdir + $show "$mv $libobj $lo_libobj" + if $run $mv $libobj $lo_libobj; then : + else + error=$? + $run $rm $removelist + exit $error + fi + fi + fi + + # Unlock the critical section if it was locked + if test "$need_locks" != no; then + $rm "$lockfile" + fi + + exit 0 + ;; + + # libtool link mode + link) + modename="$modename: link" + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2*) + # It is impossible to link a dll without this setting, and + # we shouldn't force the makefile maintainer to figure out + # which system we are compiling for in order to pass an extra + # flag for every libtool invokation. + # allow_undefined=no + + # FIXME: Unfortunately, there are problems with the above when trying + # to make a dll which has undefined symbols, in which case not + # even a static library is built. For now, we need to specify + # -no-undefined on the libtool link line when we can be certain + # that all symbols are satisfied, otherwise we get a static library. + allow_undefined=yes + + # This is a source program that is used to create dlls on Windows + # Don't remove nor modify the starting and closing comments +# /* ltdll.c starts here */ +# #define WIN32_LEAN_AND_MEAN +# #include <windows.h> +# #undef WIN32_LEAN_AND_MEAN +# #include <stdio.h> +# +# #ifndef __CYGWIN__ +# # ifdef __CYGWIN32__ +# # define __CYGWIN__ __CYGWIN32__ +# # endif +# #endif +# +# #ifdef __cplusplus +# extern "C" { +# #endif +# BOOL APIENTRY DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved); +# #ifdef __cplusplus +# } +# #endif +# +# #ifdef __CYGWIN__ +# #include <cygwin/cygwin_dll.h> +# DECLARE_CYGWIN_DLL( DllMain ); +# #endif +# HINSTANCE __hDllInstance_base; +# +# BOOL APIENTRY +# DllMain (HINSTANCE hInst, DWORD reason, LPVOID reserved) +# { +# __hDllInstance_base = hInst; +# return TRUE; +# } +# /* ltdll.c ends here */ + # This is a source program that is used to create import libraries + # on Windows for dlls which lack them. Don't remove nor modify the + # starting and closing comments +# /* impgen.c starts here */ +# /* Copyright (C) 1999 Free Software Foundation, Inc. +# +# This file is part of GNU libtool. +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# */ +# +# #include <stdio.h> /* for printf() */ +# #include <unistd.h> /* for open(), lseek(), read() */ +# #include <fcntl.h> /* for O_RDONLY, O_BINARY */ +# #include <string.h> /* for strdup() */ +# +# static unsigned int +# pe_get16 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[2]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 2); +# return b[0] + (b[1]<<8); +# } +# +# static unsigned int +# pe_get32 (fd, offset) +# int fd; +# int offset; +# { +# unsigned char b[4]; +# lseek (fd, offset, SEEK_SET); +# read (fd, b, 4); +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# static unsigned int +# pe_as32 (ptr) +# void *ptr; +# { +# unsigned char *b = ptr; +# return b[0] + (b[1]<<8) + (b[2]<<16) + (b[3]<<24); +# } +# +# int +# main (argc, argv) +# int argc; +# char *argv[]; +# { +# int dll; +# unsigned long pe_header_offset, opthdr_ofs, num_entries, i; +# unsigned long export_rva, export_size, nsections, secptr, expptr; +# unsigned long name_rvas, nexp; +# unsigned char *expdata, *erva; +# char *filename, *dll_name; +# +# filename = argv[1]; +# +# dll = open(filename, O_RDONLY|O_BINARY); +# if (!dll) +# return 1; +# +# dll_name = filename; +# +# for (i=0; filename[i]; i++) +# if (filename[i] == '/' || filename[i] == '\\' || filename[i] == ':') +# dll_name = filename + i +1; +# +# pe_header_offset = pe_get32 (dll, 0x3c); +# opthdr_ofs = pe_header_offset + 4 + 20; +# num_entries = pe_get32 (dll, opthdr_ofs + 92); +# +# if (num_entries < 1) /* no exports */ +# return 1; +# +# export_rva = pe_get32 (dll, opthdr_ofs + 96); +# export_size = pe_get32 (dll, opthdr_ofs + 100); +# nsections = pe_get16 (dll, pe_header_offset + 4 +2); +# secptr = (pe_header_offset + 4 + 20 + +# pe_get16 (dll, pe_header_offset + 4 + 16)); +# +# expptr = 0; +# for (i = 0; i < nsections; i++) +# { +# char sname[8]; +# unsigned long secptr1 = secptr + 40 * i; +# unsigned long vaddr = pe_get32 (dll, secptr1 + 12); +# unsigned long vsize = pe_get32 (dll, secptr1 + 16); +# unsigned long fptr = pe_get32 (dll, secptr1 + 20); +# lseek(dll, secptr1, SEEK_SET); +# read(dll, sname, 8); +# if (vaddr <= export_rva && vaddr+vsize > export_rva) +# { +# expptr = fptr + (export_rva - vaddr); +# if (export_rva + export_size > vaddr + vsize) +# export_size = vsize - (export_rva - vaddr); +# break; +# } +# } +# +# expdata = (unsigned char*)malloc(export_size); +# lseek (dll, expptr, SEEK_SET); +# read (dll, expdata, export_size); +# erva = expdata - export_rva; +# +# nexp = pe_as32 (expdata+24); +# name_rvas = pe_as32 (expdata+32); +# +# printf ("EXPORTS\n"); +# for (i = 0; i<nexp; i++) +# { +# unsigned long name_rva = pe_as32 (erva+name_rvas+i*4); +# printf ("\t%s @ %ld ;\n", erva+name_rva, 1+ i); +# } +# +# return 0; +# } +# /* impgen.c ends here */ + ;; + *) + allow_undefined=yes + ;; + esac + compile_command="$nonopt" + finalize_command="$nonopt" + + compile_rpath= + finalize_rpath= + compile_shlibpath= + finalize_shlibpath= + convenience= + old_convenience= + deplibs= + linkopts= + + if test -n "$shlibpath_var"; then + # get the directories listed in $shlibpath_var + eval lib_search_path=\`\$echo \"X \${$shlibpath_var}\" \| \$Xsed -e \'s/:/ /g\'\` + else + lib_search_path= + fi + # now prepend the system-specific ones + eval lib_search_path=\"$sys_lib_search_path_spec\$lib_search_path\" + eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\" + + avoid_version=no + dlfiles= + dlprefiles= + dlself=no + export_dynamic=no + export_symbols= + export_symbols_regex= + generated= + libobjs= + link_against_libtool_libs= + ltlibs= + module=no + objs= + prefer_static_libs=no + preload=no + prev= + prevarg= + release= + rpath= + xrpath= + perm_rpath= + temp_rpath= + thread_safe=no + vinfo= + + # We need to know -static, to get the right output filenames. + for arg + do + case "$arg" in + -all-static | -static) + if test "X$arg" = "X-all-static"; then + if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then + $echo "$modename: warning: complete static linking is impossible in this configuration" 1>&2 + fi + if test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + else + if test -z "$pic_flag" && test -n "$link_static_flag"; then + dlopen_self=$dlopen_self_static + fi + fi + build_libtool_libs=no + build_old_libs=yes + prefer_static_libs=yes + break + ;; + esac + done + + # See if our shared archives depend on static archives. + test -n "$old_archive_from_new_cmds" && build_old_libs=yes + + # Go through the arguments, transforming them on the way. + while test $# -gt 0; do + arg="$1" + shift + + # If the previous option needs an argument, assign it. + if test -n "$prev"; then + case "$prev" in + output) + compile_command="$compile_command @OUTPUT@" + finalize_command="$finalize_command @OUTPUT@" + ;; + esac + + case "$prev" in + dlfiles|dlprefiles) + if test "$preload" = no; then + # Add the symbol object into the linking commands. + compile_command="$compile_command @SYMFILE@" + finalize_command="$finalize_command @SYMFILE@" + preload=yes + fi + case "$arg" in + *.la | *.lo) ;; # We handle these cases below. + force) + if test "$dlself" = no; then + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + self) + if test "$prev" = dlprefiles; then + dlself=yes + elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then + dlself=yes + else + dlself=needless + export_dynamic=yes + fi + prev= + continue + ;; + *) + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + else + dlprefiles="$dlprefiles $arg" + fi + prev= + ;; + esac + ;; + expsyms) + export_symbols="$arg" + if test ! -f "$arg"; then + $echo "$modename: symbol file \`$arg' does not exist" + exit 1 + fi + prev= + continue + ;; + expsyms_regex) + export_symbols_regex="$arg" + prev= + continue + ;; + release) + release="-$arg" + prev= + continue + ;; + rpath | xrpath) + # We need an absolute path. + case "$arg" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + if test "$prev" = rpath; then + case "$rpath " in + *" $arg "*) ;; + *) rpath="$rpath $arg" ;; + esac + else + case "$xrpath " in + *" $arg "*) ;; + *) xrpath="$xrpath $arg" ;; + esac + fi + prev= + continue + ;; + *) + eval "$prev=\"\$arg\"" + prev= + continue + ;; + esac + fi + + prevarg="$arg" + + case "$arg" in + -all-static) + if test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -allow-undefined) + # FIXME: remove this flag sometime in the future. + $echo "$modename: \`-allow-undefined' is deprecated because it is the default" 1>&2 + continue + ;; + + -avoid-version) + avoid_version=yes + continue + ;; + + -dlopen) + prev=dlfiles + continue + ;; + + -dlpreopen) + prev=dlprefiles + continue + ;; + + -export-dynamic) + export_dynamic=yes + continue + ;; + + -export-symbols | -export-symbols-regex) + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: not more than one -exported-symbols argument allowed" + exit 1 + fi + if test "X$arg" = "X-export-symbols"; then + prev=expsyms + else + prev=expsyms_regex + fi + continue + ;; + + -L*) + dir=`$echo "X$arg" | $Xsed -e 's/^-L//'` + # We need an absolute path. + case "$dir" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + absdir="$dir" + fi + dir="$absdir" + ;; + esac + case " $deplibs " in + *" $arg "*) ;; + *) deplibs="$deplibs $arg";; + esac + case " $lib_search_path " in + *" $dir "*) ;; + *) lib_search_path="$lib_search_path $dir";; + esac + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2*) + dllsearchdir=`cd "$dir" && pwd || echo "$dir"` + case ":$dllsearchpath:" in + ::) dllsearchpath="$dllsearchdir";; + *":$dllsearchdir:"*) ;; + *) dllsearchpath="$dllsearchpath:$dllsearchdir";; + esac + ;; + esac + ;; + + -l*) + if test "$arg" = "-lc"; then + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) + # These systems don't actually have c library (as such) + continue + ;; + esac + elif test "$arg" = "-lm"; then + case "$host" in + *-*-cygwin* | *-*-beos*) + # These systems don't actually have math library (as such) + continue + ;; + esac + fi + deplibs="$deplibs $arg" + ;; + + -module) + module=yes + continue + ;; + + -no-undefined) + allow_undefined=no + continue + ;; + + -o) prev=output ;; + + -release) + prev=release + continue + ;; + + -rpath) + prev=rpath + continue + ;; + + -R) + prev=xrpath + continue + ;; + + -R*) + dir=`$echo "X$arg" | $Xsed -e 's/^-R//'` + # We need an absolute path. + case "$dir" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + $echo "$modename: only absolute run-paths are allowed" 1>&2 + exit 1 + ;; + esac + case "$xrpath " in + *" $dir "*) ;; + *) xrpath="$xrpath $dir" ;; + esac + continue + ;; + + -static) + # If we have no pic_flag, then this is the same as -all-static. + if test -z "$pic_flag" && test -n "$link_static_flag"; then + compile_command="$compile_command $link_static_flag" + finalize_command="$finalize_command $link_static_flag" + fi + continue + ;; + + -thread-safe) + thread_safe=yes + continue + ;; + + -version-info) + prev=vinfo + continue + ;; + + # Some other compiler flag. + -* | +*) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case "$arg" in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + ;; + + *.o | *.obj | *.a | *.lib) + # A standard object. + objs="$objs $arg" + ;; + + *.lo) + # A library object. + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + if test "$build_libtool_libs" = yes && test "$dlopen" = yes; then + prev= + continue + else + # If libtool objects are unsupported, then we need to preload. + prev=dlprefiles + fi + fi + + if test "$prev" = dlprefiles; then + # Preload the old-style object. + dlprefiles="$dlprefiles "`$echo "X$arg" | $Xsed -e "$lo2o"` + prev= + fi + libobjs="$libobjs $arg" + ;; + + *.la) + # A libtool-controlled library. + + dlname= + libdir= + library_names= + old_library= + + # Check to see that this really is a libtool archive. + if (sed -e '2q' $arg | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$arg' is not a valid libtool archive" 1>&2 + exit 1 + fi + + # If the library was installed with an old release of libtool, + # it will not redefine variable installed. + installed=yes + + # Read the .la file + # If there is no directory component, then add one. + case "$arg" in + */* | *\\*) . $arg ;; + *) . ./$arg ;; + esac + + # Get the name of the library we link against. + linklib= + for l in $old_library $library_names; do + linklib="$l" + done + + if test -z "$linklib"; then + $echo "$modename: cannot find name of link library for \`$arg'" 1>&2 + exit 1 + fi + + # Find the relevant object directory and library name. + name=`$echo "X$arg" | $Xsed -e 's%^.*/%%' -e 's/\.la$//' -e 's/^lib//'` + + if test "X$installed" = Xyes; then + dir="$libdir" + else + dir=`$echo "X$arg" | $Xsed -e 's%/[^/]*$%%'` + if test "X$dir" = "X$arg"; then + dir="$objdir" + else + dir="$dir/$objdir" + fi + fi + + if test -n "$dependency_libs"; then + # Extract -R and -L from dependency_libs + temp_deplibs= + for deplib in $dependency_libs; do + case "$deplib" in + -R*) temp_xrpath=`$echo "X$deplib" | $Xsed -e 's/^-R//'` + case " $rpath $xrpath " in + *" $temp_xrpath "*) ;; + *) xrpath="$xrpath $temp_xrpath";; + esac;; + -L*) case "$compile_command $temp_deplibs " in + *" $deplib "*) ;; + *) temp_deplibs="$temp_deplibs $deplib";; + esac + temp_dir=`$echo "X$deplib" | $Xsed -e 's/^-L//'` + case " $lib_search_path " in + *" $temp_dir "*) ;; + *) lib_search_path="$lib_search_path $temp_dir";; + esac + ;; + *) temp_deplibs="$temp_deplibs $deplib";; + esac + done + dependency_libs="$temp_deplibs" + fi + + if test -z "$libdir"; then + # It is a libtool convenience library, so add in its objects. + convenience="$convenience $dir/$old_library" + old_convenience="$old_convenience $dir/$old_library" + deplibs="$deplibs$dependency_libs" + compile_command="$compile_command $dir/$old_library$dependency_libs" + finalize_command="$finalize_command $dir/$old_library$dependency_libs" + continue + fi + + # This library was specified with -dlopen. + if test "$prev" = dlfiles; then + dlfiles="$dlfiles $arg" + if test -z "$dlname" || test "$dlopen" != yes || test "$build_libtool_libs" = no; then + # If there is no dlname, no dlopen support or we're linking statically, + # we need to preload. + prev=dlprefiles + else + # We should not create a dependency on this library, but we + # may need any libraries it requires. + compile_command="$compile_command$dependency_libs" + finalize_command="$finalize_command$dependency_libs" + prev= + continue + fi + fi + + # The library was specified with -dlpreopen. + if test "$prev" = dlprefiles; then + # Prefer using a static library (so that no silly _DYNAMIC symbols + # are required to link). + if test -n "$old_library"; then + dlprefiles="$dlprefiles $dir/$old_library" + else + dlprefiles="$dlprefiles $dir/$linklib" + fi + prev= + fi + + if test -n "$library_names" && + { test "$prefer_static_libs" = no || test -z "$old_library"; }; then + link_against_libtool_libs="$link_against_libtool_libs $arg" + if test -n "$shlibpath_var"; then + # Make sure the rpath contains only unique directories. + case "$temp_rpath " in + *" $dir "*) ;; + *) temp_rpath="$temp_rpath $dir" ;; + esac + fi + + # We need an absolute path. + case "$dir" in + [\\/] | [A-Za-z]:[\\/]*) absdir="$dir" ;; + *) + absdir=`cd "$dir" && pwd` + if test -z "$absdir"; then + $echo "$modename: warning: cannot determine absolute directory name of \`$dir'" 1>&2 + $echo "$modename: passing it literally to the linker, although it might fail" 1>&2 + absdir="$dir" + fi + ;; + esac + + # This is the magic to use -rpath. + # Skip directories that are in the system default run-time + # search path, unless they have been requested with -R. + case " $sys_lib_dlsearch_path " in + *" $absdir "*) ;; + *) + case "$compile_rpath " in + *" $absdir "*) ;; + *) compile_rpath="$compile_rpath $absdir" + esac + ;; + esac + + case " $sys_lib_dlsearch_path " in + *" $libdir "*) ;; + *) + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" + esac + ;; + esac + + lib_linked=yes + case "$hardcode_action" in + immediate | unsupported) + if test "$hardcode_direct" = no; then + compile_command="$compile_command $dir/$linklib" + deplibs="$deplibs $dir/$linklib" + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2*) + dllsearchdir=`cd "$dir" && pwd || echo "$dir"` + if test -n "$dllsearchpath"; then + dllsearchpath="$dllsearchpath:$dllsearchdir" + else + dllsearchpath="$dllsearchdir" + fi + ;; + esac + elif test "$hardcode_minus_L" = no; then + case "$host" in + *-*-sunos*) + compile_shlibpath="$compile_shlibpath$dir:" + ;; + esac + case "$compile_command " in + *" -L$dir "*) ;; + *) compile_command="$compile_command -L$dir";; + esac + compile_command="$compile_command -l$name" + deplibs="$deplibs -L$dir -l$name" + elif test "$hardcode_shlibpath_var" = no; then + case ":$compile_shlibpath:" in + *":$dir:"*) ;; + *) compile_shlibpath="$compile_shlibpath$dir:";; + esac + compile_command="$compile_command -l$name" + deplibs="$deplibs -l$name" + else + lib_linked=no + fi + ;; + + relink) + if test "$hardcode_direct" = yes; then + compile_command="$compile_command $absdir/$linklib" + deplibs="$deplibs $absdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + case "$compile_command " in + *" -L$absdir "*) ;; + *) compile_command="$compile_command -L$absdir";; + esac + compile_command="$compile_command -l$name" + deplibs="$deplibs -L$absdir -l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case ":$compile_shlibpath:" in + *":$absdir:"*) ;; + *) compile_shlibpath="$compile_shlibpath$absdir:";; + esac + compile_command="$compile_command -l$name" + deplibs="$deplibs -l$name" + else + lib_linked=no + fi + ;; + + *) + lib_linked=no + ;; + esac + + if test "$lib_linked" != yes; then + $echo "$modename: configuration error: unsupported hardcode properties" + exit 1 + fi + + # Finalize command for both is simple: just hardcode it. + if test "$hardcode_direct" = yes; then + finalize_command="$finalize_command $libdir/$linklib" + elif test "$hardcode_minus_L" = yes; then + case "$finalize_command " in + *" -L$libdir "*) ;; + *) finalize_command="$finalize_command -L$libdir";; + esac + finalize_command="$finalize_command -l$name" + elif test "$hardcode_shlibpath_var" = yes; then + case ":$finalize_shlibpath:" in + *":$libdir:"*) ;; + *) finalize_shlibpath="$finalize_shlibpath$libdir:";; + esac + finalize_command="$finalize_command -l$name" + else + # We cannot seem to hardcode it, guess we'll fake it. + case "$finalize_command " in + *" -L$dir "*) ;; + *) finalize_command="$finalize_command -L$libdir";; + esac + finalize_command="$finalize_command -l$name" + fi + else + # Transform directly to old archives if we don't build new libraries. + if test -n "$pic_flag" && test -z "$old_library"; then + $echo "$modename: cannot find static library for \`$arg'" 1>&2 + exit 1 + fi + + # Here we assume that one of hardcode_direct or hardcode_minus_L + # is not unsupported. This is valid on all known static and + # shared platforms. + if test "$hardcode_direct" != unsupported; then + test -n "$old_library" && linklib="$old_library" + compile_command="$compile_command $dir/$linklib" + finalize_command="$finalize_command $dir/$linklib" + else + case "$compile_command " in + *" -L$dir "*) ;; + *) compile_command="$compile_command -L$dir";; + esac + compile_command="$compile_command -l$name" + case "$finalize_command " in + *" -L$dir "*) ;; + *) finalize_command="$finalize_command -L$dir";; + esac + finalize_command="$finalize_command -l$name" + fi + fi + + # Add in any libraries that this one depends upon. + compile_command="$compile_command$dependency_libs" + finalize_command="$finalize_command$dependency_libs" + continue + ;; + + # Some other compiler argument. + *) + # Unknown arguments in both finalize_command and compile_command need + # to be aesthetically quoted because they are evaled later. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case "$arg" in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + ;; + esac + + # Now actually substitute the argument into the commands. + if test -n "$arg"; then + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + done + + if test -n "$prev"; then + $echo "$modename: the \`$prevarg' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then + eval arg=\"$export_dynamic_flag_spec\" + compile_command="$compile_command $arg" + finalize_command="$finalize_command $arg" + fi + + oldlibs= + # calculate the name of the file, without its directory + outputname=`$echo "X$output" | $Xsed -e 's%^.*/%%'` + libobjs_save="$libobjs" + + case "$output" in + "") + $echo "$modename: you must specify an output file" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + + *.a | *.lib) + if test -n "$link_against_libtool_libs"; then + $echo "$modename: error: cannot link libtool libraries into archives" 1>&2 + exit 1 + fi + + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for archives" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for archives" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for archives" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for archives" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for archives" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for archives" 1>&2 + fi + + if test -n "$export_symbols" || test -n "$export_symbols_regex"; then + $echo "$modename: warning: \`-export-symbols' is ignored for archives" 1>&2 + fi + + # Now set the variables for building old libraries. + build_libtool_libs=no + oldlibs="$output" + ;; + + *.la) + # Make sure we only generate libraries of the form `libNAME.la'. + case "$outputname" in + lib*) + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//' -e 's/^lib//'` + eval libname=\"$libname_spec\" + ;; + *) + if test "$module" = no; then + $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + if test "$need_lib_prefix" != no; then + # Add the "lib" prefix for modules if required + name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + eval libname=\"$libname_spec\" + else + libname=`$echo "X$outputname" | $Xsed -e 's/\.la$//'` + fi + ;; + esac + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + + if test -n "$objs"; then + $echo "$modename: cannot build libtool library \`$output' from non-libtool objects:$objs" 2>&1 + exit 1 + fi + + # How the heck are we supposed to write a wrapper for a shared library? + if test -n "$link_against_libtool_libs"; then + $echo "$modename: error: cannot link shared libraries into libtool libraries" 1>&2 + exit 1 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for libtool libraries" 1>&2 + fi + + set dummy $rpath + if test $# -gt 2; then + $echo "$modename: warning: ignoring multiple \`-rpath's for a libtool library" 1>&2 + fi + install_libdir="$2" + + oldlibs= + if test -z "$rpath"; then + if test "$build_libtool_libs" = yes; then + # Building a libtool convenience library. + libext=al + oldlibs="$output_objdir/$libname.$libext $oldlibs" + build_libtool_libs=convenience + build_old_libs=yes + fi + dependency_libs="$deplibs" + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for convenience libraries" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for convenience libraries" 1>&2 + fi + else + + # Parse the version information argument. + IFS="${IFS= }"; save_ifs="$IFS"; IFS=':' + set dummy $vinfo 0 0 0 + IFS="$save_ifs" + + if test -n "$8"; then + $echo "$modename: too many parameters to \`-version-info'" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + current="$2" + revision="$3" + age="$4" + + # Check that each of the things are valid numbers. + case "$current" in + 0 | [1-9] | [1-9][0-9]*) ;; + *) + $echo "$modename: CURRENT \`$current' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case "$revision" in + 0 | [1-9] | [1-9][0-9]*) ;; + *) + $echo "$modename: REVISION \`$revision' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + case "$age" in + 0 | [1-9] | [1-9][0-9]*) ;; + *) + $echo "$modename: AGE \`$age' is not a nonnegative integer" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + ;; + esac + + if test $age -gt $current; then + $echo "$modename: AGE \`$age' is greater than the current interface number \`$current'" 1>&2 + $echo "$modename: \`$vinfo' is not valid version information" 1>&2 + exit 1 + fi + + # Calculate the version variables. + major= + versuffix= + verstring= + case "$version_type" in + none) ;; + + irix) + major=`expr $current - $age + 1` + versuffix="$major.$revision" + verstring="sgi$major.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$revision + while test $loop != 0; do + iface=`expr $revision - $loop` + loop=`expr $loop - 1` + verstring="sgi$major.$iface:$verstring" + done + ;; + + linux) + major=.`expr $current - $age` + versuffix="$major.$age.$revision" + ;; + + osf) + major=`expr $current - $age` + versuffix=".$current.$age.$revision" + verstring="$current.$age.$revision" + + # Add in all the interfaces that we are compatible with. + loop=$age + while test $loop != 0; do + iface=`expr $current - $loop` + loop=`expr $loop - 1` + verstring="$verstring:${iface}.0" + done + + # Make executables depend on our current version. + verstring="$verstring:${current}.0" + ;; + + sunos) + major=".$current" + versuffix=".$current.$revision" + ;; + + freebsd-aout) + major=".$current" + versuffix=".$current.$revision"; + ;; + + freebsd-elf) + major=".$current" + versuffix=".$current"; + ;; + + windows) + # Like Linux, but with '-' rather than '.', since we only + # want one extension on Windows 95. + major=`expr $current - $age` + versuffix="-$major-$age-$revision" + ;; + + *) + $echo "$modename: unknown library version type \`$version_type'" 1>&2 + echo "Fatal configuration error. See the $PACKAGE docs for more information." 1>&2 + exit 1 + ;; + esac + + # Clear the version info if we defaulted, and they specified a release. + if test -z "$vinfo" && test -n "$release"; then + major= + verstring="0.0" + if test "$need_version" = no; then + versuffix= + else + versuffix=".0.0" + fi + fi + + # Remove version info from name if versioning should be avoided + if test "$avoid_version" = yes && test "$need_version" = no; then + major= + versuffix= + verstring="" + fi + + # Check to see if the archive will have undefined symbols. + if test "$allow_undefined" = yes; then + if test "$allow_undefined_flag" = unsupported; then + $echo "$modename: warning: undefined symbols not allowed in $host shared libraries" 1>&2 + build_libtool_libs=no + build_old_libs=yes + fi + else + # Don't allow undefined symbols. + allow_undefined_flag="$no_undefined_flag" + fi + + dependency_libs="$deplibs" + case "$host" in + *-*-cygwin* | *-*-mingw* | *-*-os2* | *-*-beos*) + # these systems don't actually have a c library (as such)! + ;; + *-*-rhapsody*) + # rhapsody is a little odd... + deplibs="$deplibs -framework System" + ;; + *) + # Add libc to deplibs on all other systems. + deplibs="$deplibs -lc" + ;; + esac + fi + + # Create the output directory, or remove our outputs if we need to. + if test -d $output_objdir; then + $show "${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.*" + $run ${rm}r $output_objdir/$outputname $output_objdir/$libname.* $output_objdir/${libname}${release}.* + else + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $output_objdir; then + exit $status + fi + fi + + # Now set the variables for building old libraries. + if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then + oldlibs="$oldlibs $output_objdir/$libname.$libext" + + # Transform .lo files to .o files. + oldobjs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e "$lo2o" | $NL2SP` + fi + + if test "$build_libtool_libs" = yes; then + # Transform deplibs into only deplibs that can be linked in shared. + name_save=$name + libname_save=$libname + release_save=$release + versuffix_save=$versuffix + major_save=$major + # I'm not sure if I'm treating the release correctly. I think + # release should show up in the -l (ie -lgmp5) so we don't want to + # add it in twice. Is that correct? + release="" + versuffix="" + major="" + newdeplibs= + droppeddeps=no + case "$deplibs_check_method" in + pass_all) + # Don't check for shared/static. Everything works. + # This might be a little naive. We might want to check + # whether the library exists or not. But this is on + # osf3 & osf4 and I'm not really sure... Just + # implementing what was already the behaviour. + newdeplibs=$deplibs + ;; + test_compile) + # This code stresses the "libraries are programs" paradigm to its + # limits. Maybe even breaks it. We compile a program, linking it + # against the deplibs as a proxy for the library. Then we can check + # whether they linked in statically or dynamically with ldd. + $rm conftest.c + cat > conftest.c <<EOF + int main() { return 0; } +EOF + $rm conftest + $CC -o conftest conftest.c $deplibs + if test $? -eq 0 ; then + ldd_output=`ldd conftest` + for i in $deplibs; do + name="`expr $i : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test "$name" != "" ; then + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + newdeplibs="$newdeplibs $i" + fi + done + else + # Error occured in the first compile. Let's try to salvage the situation: + # Compile a seperate program for each library. + for i in $deplibs; do + name="`expr $i : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test "$name" != "" ; then + $rm conftest + $CC -o conftest conftest.c $i + # Did it work? + if test $? -eq 0 ; then + ldd_output=`ldd conftest` + libname=`eval \\$echo \"$libname_spec\"` + deplib_matches=`eval \\$echo \"$library_names_spec\"` + set dummy $deplib_matches + deplib_match=$2 + if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then + newdeplibs="$newdeplibs $i" + else + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $i." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + droppeddeps=yes + echo + echo "*** Warning! Library $i is needed by this library but I was not able to" + echo "*** make it link in! You will probably need to install it or some" + echo "*** library that it depends on before this library will be fully" + echo "*** functional. Installing it before continuing would be even better." + fi + else + newdeplibs="$newdeplibs $i" + fi + done + fi + ;; + file_magic*) + set dummy $deplibs_check_method + file_magic_regex="`expr \"$deplibs_check_method\" : \"$2 \(.*\)\"`" + for a_deplib in $deplibs; do + name="`expr $a_deplib : '-l\(.*\)'`" + # If $name is empty we are operating on a -L argument. + if test "$name" != "" ; then + libname=`eval \\$echo \"$libname_spec\"` + for i in $lib_search_path; do + potential_libs=`ls $i/$libname[.-]* 2>/dev/null` + for potent_lib in $potential_libs; do + # Follow soft links. + if ls -lLd "$potent_lib" 2>/dev/null \ + | grep " -> " >/dev/null; then + continue + fi + # The statement above tries to avoid entering an + # endless loop below, in case of cyclic links. + # We might still enter an endless loop, since a link + # loop can be closed while we follow links, + # but so what? + potlib="$potent_lib" + while test -h "$potlib" 2>/dev/null; do + potliblink=`ls -ld $potlib | sed 's/.* -> //'` + case "$potliblink" in + [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";; + *) potlib=`$echo "X$potlib" | $Xsed -e 's,[^/]*$,,'`"$potliblink";; + esac + done + if eval $file_magic_cmd \"\$potlib\" 2>/dev/null \ + | sed 10q \ + | egrep "$file_magic_regex" > /dev/null; then + newdeplibs="$newdeplibs $a_deplib" + a_deplib="" + break 2 + fi + done + done + if test -n "$a_deplib" ; then + droppeddeps=yes + echo + echo "*** Warning: This library needs some functionality provided by $a_deplib." + echo "*** I have the capability to make that library automatically link in when" + echo "*** you link to this library. But I can only do this if you have a" + echo "*** shared version of the library, which you do not appear to have." + fi + else + # Add a -L argument. + newdeplibs="$newdeplibs $a_deplib" + fi + done # Gone through all deplibs. + ;; + none | unknown | *) + newdeplibs="" + if $echo "X $deplibs" | $Xsed -e 's/ -lc$//' \ + -e 's/ -[LR][^ ]*//g' -e 's/[ ]//g' | + grep . >/dev/null; then + echo + if test "X$deplibs_check_method" = "Xnone"; then + echo "*** Warning: inter-library dependencies are not supported in this platform." + else + echo "*** Warning: inter-library dependencies are not known to be supported." + fi + echo "*** All declared inter-library dependencies are being dropped." + droppeddeps=yes + fi + ;; + esac + versuffix=$versuffix_save + major=$major_save + release=$release_save + libname=$libname_save + name=$name_save + + if test "$droppeddeps" = yes; then + if test "$module" = yes; then + echo + echo "*** Warning: libtool could not satisfy all declared inter-library" + echo "*** dependencies of module $libname. Therefore, libtool will create" + echo "*** a static module, that should work as long as the dlopening" + echo "*** application is linked with the -dlopen flag." + if test -z "$global_symbol_pipe"; then + echo + echo "*** However, this would only work if libtool was able to extract symbol" + echo "*** lists from a program, using \`nm' or equivalent, but libtool could" + echo "*** not find such a program. So, this module is probably useless." + echo "*** \`nm' from GNU binutils and a full rebuild may help." + fi + if test "$build_old_libs" = no; then + oldlibs="$output_objdir/$libname.$libext" + build_libtool_libs=module + build_old_libs=yes + else + build_libtool_libs=no + fi + else + echo "*** The inter-library dependencies that have been dropped here will be" + echo "*** automatically added whenever a program is linked with this library" + echo "*** or is declared to -dlopen it." + fi + fi + # Done checking deplibs! + deplibs=$newdeplibs + fi + + # All the library-specific variables (install_libdir is set above). + library_names= + old_library= + dlname= + + # Test again, we may have decided not to build it any more + if test "$build_libtool_libs" = yes; then + # Get the real and link names of the library. + eval library_names=\"$library_names_spec\" + set dummy $library_names + realname="$2" + shift; shift + + if test -n "$soname_spec"; then + eval soname=\"$soname_spec\" + else + soname="$realname" + fi + + lib="$output_objdir/$realname" + for link + do + linknames="$linknames $link" + done + + # Ensure that we have .o objects for linkers which dislike .lo + # (e.g. aix) in case we are running --disable-static + for obj in $libobjs; do + xdir=`$echo "X$obj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$obj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$obj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + if test ! -f $xdir/$oldobj; then + $show "(cd $xdir && ${LN_S} $baseobj $oldobj)" + $run eval '(cd $xdir && ${LN_S} $baseobj $oldobj)' || exit $? + fi + done + + # Use standard objects if they are pic + test -z "$pic_flag" && libobjs=`$echo "X$libobjs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then + $show "generating symbol list for \`$libname.la'" + export_symbols="$output_objdir/$libname.exp" + $run $rm $export_symbols + eval cmds=\"$export_symbols_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + if test -n "$export_symbols_regex"; then + $show "egrep -e \"$export_symbols_regex\" \"$export_symbols\" > \"${export_symbols}T\"" + $run eval 'egrep -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"' + $show "$mv \"${export_symbols}T\" \"$export_symbols\"" + $run eval '$mv "${export_symbols}T" "$export_symbols"' + fi + fi + fi + + if test -n "$export_symbols" && test -n "$include_expsyms"; then + $run eval '$echo "X$include_expsyms" | $SP2NL >> "$export_symbols"' + fi + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval libobjs=\"\$libobjs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + libobjs="$libobjs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then + eval flag=\"$thread_safe_flag_spec\" + linkopts="$linkopts $flag" + fi + + # Do each of the archive commands. + if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then + eval cmds=\"$archive_expsym_cmds\" + else + eval cmds=\"$archive_cmds\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Create links to the real library. + for linkname in $linknames; do + if test "$realname" != "$linkname"; then + $show "(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval '(cd $output_objdir && $rm $linkname && $LN_S $realname $linkname)' || exit $? + fi + done + + # If -module or -export-dynamic was specified, set the dlname. + if test "$module" = yes || test "$export_dynamic" = yes; then + # On all known operating systems, these are identical. + dlname="$soname" + fi + fi + ;; + + *.lo | *.o | *.obj) + if test -n "$link_against_libtool_libs"; then + $echo "$modename: error: cannot link libtool libraries into objects" 1>&2 + exit 1 + fi + + if test -n "$deplibs"; then + $echo "$modename: warning: \`-l' and \`-L' are ignored for objects" 1>&2 + fi + + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + $echo "$modename: warning: \`-dlopen' is ignored for objects" 1>&2 + fi + + if test -n "$rpath"; then + $echo "$modename: warning: \`-rpath' is ignored for objects" 1>&2 + fi + + if test -n "$xrpath"; then + $echo "$modename: warning: \`-R' is ignored for objects" 1>&2 + fi + + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for objects" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for objects" 1>&2 + fi + + case "$output" in + *.lo) + if test -n "$objs"; then + $echo "$modename: cannot build library object \`$output' from non-libtool objects" 1>&2 + exit 1 + fi + libobj="$output" + obj=`$echo "X$output" | $Xsed -e "$lo2o"` + ;; + *) + libobj= + obj="$output" + ;; + esac + + # Delete the old objects. + $run $rm $obj $libobj + + # Objects from convenience libraries. This assumes + # single-version convenience libraries. Whenever we create + # different ones for PIC/non-PIC, this we'll have to duplicate + # the extraction. + reload_conv_objs= + gentop= + # reload_cmds runs $LD directly, so let us get rid of + # -Wl from whole_archive_flag_spec + wl= + + if test -n "$convenience"; then + if test -n "$whole_archive_flag_spec"; then + eval reload_conv_objs=\"\$reload_objs $whole_archive_flag_spec\" + else + gentop="$output_objdir/${obj}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + for xlib in $convenience; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + reload_conv_objs="$reload_objs "`find $xdir -name \*.o -print -o -name \*.lo -print | $NL2SP` + done + fi + fi + + # Create the old-style object. + reload_objs="$objs "`$echo "X$libobjs" | $SP2NL | $Xsed -e '/\.'${libext}$'/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP`" $reload_conv_objs" + + output="$obj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + + # Exit if we aren't doing a library object file. + if test -z "$libobj"; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + fi + + if test "$build_libtool_libs" != yes; then + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + # Create an invalid libtool object if no PIC, so that we don't + # accidentally link it into a program. + $show "echo timestamp > $libobj" + $run eval "echo timestamp > $libobj" || exit $? + exit 0 + fi + + if test -n "$pic_flag"; then + # Only do commands if we really have different PIC objects. + reload_objs="$libobjs $reload_conv_objs" + output="$libobj" + eval cmds=\"$reload_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + else + # Just create a symlink. + $show $rm $libobj + $run $rm $libobj + xdir=`$echo "X$libobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$libobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$libobj" | $Xsed -e 's%^.*/%%'` + oldobj=`$echo "X$baseobj" | $Xsed -e "$lo2o"` + $show "(cd $xdir && $LN_S $oldobj $baseobj)" + $run eval '(cd $xdir && $LN_S $oldobj $baseobj)' || exit $? + fi + + if test -n "$gentop"; then + $show "${rm}r $gentop" + $run ${rm}r $gentop + fi + + exit 0 + ;; + + # Anything else should be a program. + *) + if test -n "$vinfo"; then + $echo "$modename: warning: \`-version-info' is ignored for programs" 1>&2 + fi + + if test -n "$release"; then + $echo "$modename: warning: \`-release' is ignored for programs" 1>&2 + fi + + if test "$preload" = yes; then + if test "$dlopen" = unknown && test "$dlopen_self" = unknown && + test "$dlopen_self_static" = unknown; then + $echo "$modename: warning: \`AC_LIBTOOL_DLOPEN' not used. Assuming no dlopen support." + fi + fi + + if test -n "$rpath$xrpath"; then + # If the user specified any rpath flags, then add them. + for libdir in $rpath $xrpath; do + # This is the magic to use -rpath. + case "$compile_rpath " in + *" $libdir "*) ;; + *) compile_rpath="$compile_rpath $libdir" ;; + esac + case "$finalize_rpath " in + *" $libdir "*) ;; + *) finalize_rpath="$finalize_rpath $libdir" ;; + esac + done + fi + + # Now hardcode the library paths + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$perm_rpath " in + *" $libdir "*) ;; + *) perm_rpath="$perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + compile_rpath="$rpath" + + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then + hardcode_libdirs="$libdir" + else + # Just accumulate the unique libdirs. + case "$hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator" in + *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*) + ;; + *) + hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir" + ;; + esac + fi + else + eval flag=\"$hardcode_libdir_flag_spec\" + rpath="$rpath $flag" + fi + elif test -n "$runpath_var"; then + case "$finalize_perm_rpath " in + *" $libdir "*) ;; + *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;; + esac + fi + done + # Substitute the hardcoded libdirs into the rpath. + if test -n "$hardcode_libdir_separator" && + test -n "$hardcode_libdirs"; then + libdir="$hardcode_libdirs" + eval rpath=\" $hardcode_libdir_flag_spec\" + fi + finalize_rpath="$rpath" + + output_objdir=`$echo "X$output" | $Xsed -e 's%/[^/]*$%%'` + if test "X$output_objdir" = "X$output"; then + output_objdir="$objdir" + else + output_objdir="$output_objdir/$objdir" + fi + + # Create the binary in the object directory, then wrap it. + if test ! -d $output_objdir; then + $show "$mkdir $output_objdir" + $run $mkdir $output_objdir + status=$? + if test $status -ne 0 && test ! -d $output_objdir; then + exit $status + fi + fi + + if test -n "$libobjs" && test "$build_old_libs" = yes; then + # Transform all the library objects into standard objects. + compile_command=`$echo "X$compile_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + finalize_command=`$echo "X$finalize_command" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + fi + + dlsyms= + if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then + if test -n "$NM" && test -n "$global_symbol_pipe"; then + dlsyms="${outputname}S.c" + else + $echo "$modename: not configured to extract global symbols from dlpreopened files" 1>&2 + fi + fi + + if test -n "$dlsyms"; then + case "$dlsyms" in + "") ;; + *.c) + # Discover the nlist of each of the dlfiles. + nlist="$output_objdir/${outputname}.nm" + + $show "$rm $nlist ${nlist}S ${nlist}T" + $run $rm "$nlist" "${nlist}S" "${nlist}T" + + # Parse the name list into a source file. + $show "creating $output_objdir/$dlsyms" + + test -z "$run" && $echo > "$output_objdir/$dlsyms" "\ +/* $dlsyms - symbol resolution table for \`$outputname' dlsym emulation. */ +/* Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP */ + +#ifdef __cplusplus +extern \"C\" { +#endif + +/* Prevent the only kind of declaration conflicts we can make. */ +#define lt_preloaded_symbols some_other_symbol + +/* External symbol declarations for the compiler. */\ +" + + if test "$dlself" = yes; then + $show "generating symbol list for \`$output'" + + test -z "$run" && $echo ': @PROGRAM@ ' > "$nlist" + + # Add our own program objects to the symbol list. + progfiles=`$echo "X$objs" | $SP2NL | $Xsed -e "$lo2o" | $NL2SP` + for arg in $progfiles; do + $show "extracting global C symbols from \`$arg'" + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -n "$exclude_expsyms"; then + $run eval 'egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + if test -n "$export_symbols_regex"; then + $run eval 'egrep -e "$export_symbols_regex" "$nlist" > "$nlist"T' + $run eval '$mv "$nlist"T "$nlist"' + fi + + # Prepare the list of exported symbols + if test -z "$export_symbols"; then + export_symbols="$output_objdir/$output.exp" + $run $rm $export_symbols + $run eval "sed -n -e '/^: @PROGRAM@$/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"' + else + $run eval "sed -e 's/\([][.*^$]\)/\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$output.exp"' + $run eval 'grep -f "$output_objdir/$output.exp" < "$nlist" > "$nlist"T' + $run eval 'mv "$nlist"T "$nlist"' + fi + fi + + for arg in $dlprefiles; do + $show "extracting global C symbols from \`$arg'" + name=`echo "$arg" | sed -e 's%^.*/%%'` + $run eval 'echo ": $name " >> "$nlist"' + $run eval "$NM $arg | $global_symbol_pipe >> '$nlist'" + done + + if test -z "$run"; then + # Make sure we have at least an empty file. + test -f "$nlist" || : > "$nlist" + + if test -n "$exclude_expsyms"; then + egrep -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T + $mv "$nlist"T "$nlist" + fi + + # Try sorting and uniquifying the output. + if grep -v "^: " < "$nlist" | sort +2 | uniq > "$nlist"S; then + : + else + grep -v "^: " < "$nlist" > "$nlist"S + fi + + if test -f "$nlist"S; then + eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$dlsyms"' + else + echo '/* NONE */' >> "$output_objdir/$dlsyms" + fi + + $echo >> "$output_objdir/$dlsyms" "\ + +#undef lt_preloaded_symbols + +#if defined (__STDC__) && __STDC__ +# define lt_ptr_t void * +#else +# define lt_ptr_t char * +# define const +#endif + +/* The mapping between symbol names and symbols. */ +const struct { + const char *name; + lt_ptr_t address; +} +lt_preloaded_symbols[] = +{\ +" + + sed -n -e 's/^: \([^ ]*\) $/ {\"\1\", (lt_ptr_t) 0},/p' \ + -e 's/^. \([^ ]*\) \([^ ]*\)$/ {"\2", (lt_ptr_t) \&\2},/p' \ + < "$nlist" >> "$output_objdir/$dlsyms" + + $echo >> "$output_objdir/$dlsyms" "\ + {0, (lt_ptr_t) 0} +}; + +/* This works around a problem in FreeBSD linker */ +#ifdef FREEBSD_WORKAROUND +static const void *lt_preloaded_setup() { + return lt_preloaded_symbols; +} +#endif + +#ifdef __cplusplus +} +#endif\ +" + fi + + pic_flag_for_symtable= + case "$host" in + # compiling the symbol table file with pic_flag works around + # a FreeBSD bug that causes programs to crash when -lm is + # linked before any other PIC object. But we must not use + # pic_flag when linking with -static. The problem exists in + # FreeBSD 2.2.6 and is fixed in FreeBSD 3.1. + *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC -DFREEBSD_WORKAROUND";; + esac;; + *-*-hpux*) + case "$compile_command " in + *" -static "*) ;; + *) pic_flag_for_symtable=" $pic_flag -DPIC";; + esac + esac + + # Now compile the dynamic symbol file. + $show "(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable \"$dlsyms\")" + $run eval '(cd $output_objdir && $CC -c$no_builtin_flag$pic_flag_for_symtable "$dlsyms")' || exit $? + + # Clean up the generated files. + $show "$rm $output_objdir/$dlsyms $nlist ${nlist}S ${nlist}T" + $run $rm "$output_objdir/$dlsyms" "$nlist" "${nlist}S" "${nlist}T" + + # Transform the symbol file into the correct name. + compile_command=`$echo "X$compile_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s%@SYMFILE@%$output_objdir/${outputname}S.${objext}%"` + ;; + *) + $echo "$modename: unknown suffix for \`$dlsyms'" 1>&2 + exit 1 + ;; + esac + else + # We keep going just in case the user didn't refer to + # lt_preloaded_symbols. The linker will fail if global_symbol_pipe + # really was required. + + # Nullify the symbol file. + compile_command=`$echo "X$compile_command" | $Xsed -e "s% @SYMFILE@%%"` + finalize_command=`$echo "X$finalize_command" | $Xsed -e "s% @SYMFILE@%%"` + fi + + if test -z "$link_against_libtool_libs" || test "$build_libtool_libs" != yes; then + # Replace the output file specification. + compile_command=`$echo "X$compile_command" | $Xsed -e 's%@OUTPUT@%'"$output"'%g'` + link_command="$compile_command$compile_rpath" + + # We have no uninstalled library dependencies, so finalize right now. + $show "$link_command" + $run eval "$link_command" + status=$? + + # Delete the generated files. + if test -n "$dlsyms"; then + $show "$rm $output_objdir/${outputname}S.${objext}" + $run $rm "$output_objdir/${outputname}S.${objext}" + fi + + exit $status + fi + + if test -n "$shlibpath_var"; then + # We should set the shlibpath_var + rpath= + for dir in $temp_rpath; do + case "$dir" in + [\\/]* | [A-Za-z]:[\\/]*) + # Absolute path. + rpath="$rpath$dir:" + ;; + *) + # Relative path: add a thisdir entry. + rpath="$rpath\$thisdir/$dir:" + ;; + esac + done + temp_rpath="$rpath" + fi + + if test -n "$compile_shlibpath$finalize_shlibpath"; then + compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command" + fi + if test -n "$finalize_shlibpath"; then + finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command" + fi + + compile_var= + finalize_var= + if test -n "$runpath_var"; then + if test -n "$perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $perm_rpath; do + rpath="$rpath$dir:" + done + compile_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + if test -n "$finalize_perm_rpath"; then + # We should set the runpath_var. + rpath= + for dir in $finalize_perm_rpath; do + rpath="$rpath$dir:" + done + finalize_var="$runpath_var=\"$rpath\$$runpath_var\" " + fi + fi + + if test "$hardcode_action" = relink; then + # Fast installation is not supported + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + + $echo "$modename: warning: this platform does not like uninstalled shared libraries" 1>&2 + $echo "$modename: \`$output' will be relinked during installation" 1>&2 + else + if test "$fast_install" != no; then + link_command="$finalize_var$compile_command$finalize_rpath" + if test "$fast_install" = yes; then + relink_command=`$echo "X$compile_var$compile_command$compile_rpath" | $Xsed -e 's%@OUTPUT@%\$progdir/\$file%g'` + else + # fast_install is set to needless + relink_command= + fi + else + link_command="$compile_var$compile_command$compile_rpath" + relink_command="$finalize_var$finalize_command$finalize_rpath" + fi + fi + + # Replace the output file specification. + link_command=`$echo "X$link_command" | $Xsed -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'` + + # Delete the old output files. + $run $rm $output $output_objdir/$outputname $output_objdir/lt-$outputname + + $show "$link_command" + $run eval "$link_command" || exit $? + + # Now create the wrapper script. + $show "creating $output" + + # Quote the relink command for shipping. + if test -n "$relink_command"; then + relink_command=`$echo "X$relink_command" | $Xsed -e "$sed_quote_subst"` + fi + + # Quote $echo for shipping. + if test "X$echo" = "X$SHELL $0 --fallback-echo"; then + case "$0" in + [\\/]* | [A-Za-z]:[\\/]*) qecho="$SHELL $0 --fallback-echo";; + *) qecho="$SHELL `pwd`/$0 --fallback-echo";; + esac + qecho=`$echo "X$qecho" | $Xsed -e "$sed_quote_subst"` + else + qecho=`$echo "X$echo" | $Xsed -e "$sed_quote_subst"` + fi + + # Only actually do things if our run command is non-null. + if test -z "$run"; then + # win32 will think the script is a binary if it has + # a .exe suffix, so we strip it off here. + case $output in + *.exe) output=`echo $output|sed 's,.exe$,,'` ;; + esac + $rm $output + trap "$rm $output; exit 1" 1 2 15 + + $echo > $output "\ +#! $SHELL + +# $output - temporary wrapper script for $objdir/$outputname +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# The $output program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='sed -e 1s/^X//' +sed_quote_subst='$sed_quote_subst' + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +if test \"\${CDPATH+set}\" = set; then CDPATH=:; export CDPATH; fi + +relink_command=\"$relink_command\" + +# This environment variable determines our operation mode. +if test \"\$libtool_install_magic\" = \"$magic\"; then + # install mode needs the following variable: + link_against_libtool_libs='$link_against_libtool_libs' +else + # When we are sourced in execute mode, \$file and \$echo are already set. + if test \"\$libtool_execute_magic\" != \"$magic\"; then + echo=\"$qecho\" + file=\"\$0\" + # Make sure echo works. + if test \"X\$1\" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test \"X\`(\$echo '\t') 2>/dev/null\`\" = 'X\t'; then + # Yippee, \$echo works! + : + else + # Restart under the correct shell, and then maybe \$echo will work. + exec $SHELL \"\$0\" --no-reexec \${1+\"\$@\"} + fi + fi\ +" + $echo >> $output "\ + + # Find the directory that this script lives in. + thisdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*$%%'\` + test \"x\$thisdir\" = \"x\$file\" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=\`ls -ld \"\$file\" | sed -n 's/.*-> //p'\` + while test -n \"\$file\"; do + destdir=\`\$echo \"X\$file\" | \$Xsed -e 's%/[^/]*\$%%'\` + + # If there was a directory component, then change thisdir. + if test \"x\$destdir\" != \"x\$file\"; then + case \"\$destdir\" in + [\\/]* | [A-Za-z]:[\\/]*) thisdir=\"\$destdir\" ;; + *) thisdir=\"\$thisdir/\$destdir\" ;; + esac + fi + + file=\`\$echo \"X\$file\" | \$Xsed -e 's%^.*/%%'\` + file=\`ls -ld \"\$thisdir/\$file\" | sed -n 's/.*-> //p'\` + done + + # Try to get the absolute directory name. + absdir=\`cd \"\$thisdir\" && pwd\` + test -n \"\$absdir\" && thisdir=\"\$absdir\" +" + + if test "$fast_install" = yes; then + echo >> $output "\ + program=lt-'$outputname' + progdir=\"\$thisdir/$objdir\" + + if test ! -f \"\$progdir/\$program\" || \\ + { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | sed 1q\`; \\ + test \"X\$file\" != \"X\$progdir/\$program\"; }; then + + file=\"\$\$-\$program\" + + if test ! -d \"\$progdir\"; then + $mkdir \"\$progdir\" + else + $rm \"\$progdir/\$file\" + fi" + + echo >> $output "\ + + # relink executable if necessary + if test -n \"\$relink_command\"; then + if (cd \"\$thisdir\" && eval \$relink_command); then : + else + $rm \"\$progdir/\$file\" + exit 1 + fi + fi + + $mv \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null || + { $rm \"\$progdir/\$program\"; + $mv \"\$progdir/\$file\" \"\$progdir/\$program\"; } + $rm \"\$progdir/\$file\" + fi" + else + echo >> $output "\ + program='$outputname' + progdir=\"\$thisdir/$objdir\" +" + fi + + echo >> $output "\ + + if test -f \"\$progdir/\$program\"; then" + + # Export our shlibpath_var if we have one. + if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then + $echo >> $output "\ + # Add our own library path to $shlibpath_var + $shlibpath_var=\"$temp_rpath\$$shlibpath_var\" + + # Some systems cannot cope with colon-terminated $shlibpath_var + # The second colon is a workaround for a bug in BeOS R4 sed + $shlibpath_var=\`\$echo \"X\$$shlibpath_var\" | \$Xsed -e 's/::*\$//'\` + + export $shlibpath_var +" + fi + + # fixup the dll searchpath if we need to. + if test -n "$dllsearchpath"; then + $echo >> $output "\ + # Add the dll search path components to the executable PATH + PATH=$dllsearchpath:\$PATH +" + fi + + $echo >> $output "\ + if test \"\$libtool_execute_magic\" != \"$magic\"; then + # Run the actual program with our arguments. +" + case $host in + # win32 systems need to use the prog path for dll + # lookup to work + *-*-cygwin*) + $echo >> $output "\ + exec \$progdir/\$program \${1+\"\$@\"} +" + ;; + + # Backslashes separate directories on plain windows + *-*-mingw | *-*-os2*) + $echo >> $output "\ + exec \$progdir\\\\\$program \${1+\"\$@\"} +" + ;; + + *) + $echo >> $output "\ + # Export the path to the program. + PATH=\"\$progdir:\$PATH\" + export PATH + + exec \$program \${1+\"\$@\"} +" + ;; + esac + $echo >> $output "\ + \$echo \"\$0: cannot exec \$program \${1+\"\$@\"}\" + exit 1 + fi + else + # The program doesn't exist. + \$echo \"\$0: error: \$progdir/\$program does not exist\" 1>&2 + \$echo \"This script is just a wrapper for \$program.\" 1>&2 + echo \"See the $PACKAGE documentation for more information.\" 1>&2 + exit 1 + fi +fi\ +" + chmod +x $output + fi + exit 0 + ;; + esac + + # See if we need to build an old-fashioned archive. + for oldlib in $oldlibs; do + + if test "$build_libtool_libs" = convenience; then + oldobjs="$libobjs_save" + addlibs="$convenience" + build_libtool_libs=no + else + if test "$build_libtool_libs" = module; then + oldobjs="$libobjs_save" + build_libtool_libs=no + else + oldobjs="$objs "`$echo "X$libobjs_save" | $SP2NL | $Xsed -e '/\.'${libext}'$/d' -e '/\.lib$/d' -e "$lo2o" | $NL2SP` + fi + addlibs="$old_convenience" + fi + + if test -n "$addlibs"; then + gentop="$output_objdir/${outputname}x" + $show "${rm}r $gentop" + $run ${rm}r "$gentop" + $show "mkdir $gentop" + $run mkdir "$gentop" + status=$? + if test $status -ne 0 && test ! -d "$gentop"; then + exit $status + fi + generated="$generated $gentop" + + # Add in members from convenience archives. + for xlib in $addlibs; do + # Extract the objects. + case "$xlib" in + [\\/]* | [A-Za-z]:[\\/]*) xabs="$xlib" ;; + *) xabs=`pwd`"/$xlib" ;; + esac + xlib=`$echo "X$xlib" | $Xsed -e 's%^.*/%%'` + xdir="$gentop/$xlib" + + $show "${rm}r $xdir" + $run ${rm}r "$xdir" + $show "mkdir $xdir" + $run mkdir "$xdir" + status=$? + if test $status -ne 0 && test ! -d "$xdir"; then + exit $status + fi + $show "(cd $xdir && $AR x $xabs)" + $run eval "(cd \$xdir && $AR x \$xabs)" || exit $? + + oldobjs="$oldobjs "`find $xdir -name \*.${objext} -print -o -name \*.lo -print | $NL2SP` + done + fi + + # Do each command in the archive commands. + if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then + eval cmds=\"$old_archive_from_new_cmds\" + else + # Ensure that we have .o objects in place in case we decided + # not to build a shared library, and have fallen back to building + # static libs even though --disable-static was passed! + for oldobj in $oldobjs; do + if test ! -f $oldobj; then + xdir=`$echo "X$oldobj" | $Xsed -e 's%/[^/]*$%%'` + if test "X$xdir" = "X$oldobj"; then + xdir="." + else + xdir="$xdir" + fi + baseobj=`$echo "X$oldobj" | $Xsed -e 's%^.*/%%'` + obj=`$echo "X$baseobj" | $Xsed -e "$o2lo"` + $show "(cd $xdir && ${LN_S} $obj $baseobj)" + $run eval '(cd $xdir && ${LN_S} $obj $baseobj)' || exit $? + fi + done + + eval cmds=\"$old_archive_cmds\" + fi + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$generated"; then + $show "${rm}r$generated" + $run ${rm}r$generated + fi + + # Now create the libtool archive. + case "$output" in + *.la) + old_library= + test "$build_old_libs" = yes && old_library="$libname.$libext" + $show "creating $output" + + if test -n "$xrpath"; then + temp_xrpath= + for libdir in $xrpath; do + temp_xrpath="$temp_xrpath -R$libdir" + done + dependency_libs="$temp_xrpath $dependency_libs" + fi + + # Only create the output if not a dry run. + if test -z "$run"; then + for installed in no yes; do + if test "$installed" = yes; then + if test -z "$install_libdir"; then + break + fi + output="$output_objdir/$outputname"i + fi + $rm $output + $echo > $output "\ +# $outputname - a libtool library file +# Generated by $PROGRAM - GNU $PACKAGE $VERSION$TIMESTAMP +# +# Please DO NOT delete this file! +# It is necessary for linking the library. + +# The name that we can dlopen(3). +dlname='$dlname' + +# Names of this library. +library_names='$library_names' + +# The name of the static archive. +old_library='$old_library' + +# Libraries that this one depends upon. +dependency_libs='$dependency_libs' + +# Version information for $libname. +current=$current +age=$age +revision=$revision + +# Is this an already installed library? +installed=$installed + +# Directory that this library needs to be installed in: +libdir='$install_libdir'\ +" + done + fi + + # Do a symbolic link so that the libtool archive can be found in + # LD_LIBRARY_PATH before the program is installed. + $show "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" + $run eval "(cd $output_objdir && $rm $outputname && $LN_S ../$outputname $outputname)" || exit $? + ;; + esac + exit 0 + ;; + + # libtool install mode + install) + modename="$modename: install" + + # There may be an optional sh(1) argument at the beginning of + # install_prog (especially on Windows NT). + if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh; then + # Aesthetically quote it. + arg=`$echo "X$nonopt" | $Xsed -e "$sed_quote_subst"` + case "$arg" in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$arg " + arg="$1" + shift + else + install_prog= + arg="$nonopt" + fi + + # The real first argument should be the name of the installation program. + # Aesthetically quote it. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case "$arg" in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog$arg" + + # We need to accept at least all the BSD install flags. + dest= + files= + opts= + prev= + install_type= + isdir=no + stripme= + for arg + do + if test -n "$dest"; then + files="$files $dest" + dest="$arg" + continue + fi + + case "$arg" in + -d) isdir=yes ;; + -f) prev="-f" ;; + -g) prev="-g" ;; + -m) prev="-m" ;; + -o) prev="-o" ;; + -s) + stripme=" -s" + continue + ;; + -*) ;; + + *) + # If the previous option needed an argument, then skip it. + if test -n "$prev"; then + prev= + else + dest="$arg" + continue + fi + ;; + esac + + # Aesthetically quote the argument. + arg=`$echo "X$arg" | $Xsed -e "$sed_quote_subst"` + case "$arg" in + *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \ ]*|*]*) + arg="\"$arg\"" + ;; + esac + install_prog="$install_prog $arg" + done + + if test -z "$install_prog"; then + $echo "$modename: you must specify an install program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -n "$prev"; then + $echo "$modename: the \`$prev' option requires an argument" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + if test -z "$files"; then + if test -z "$dest"; then + $echo "$modename: no file or destination specified" 1>&2 + else + $echo "$modename: you must specify a destination" 1>&2 + fi + $echo "$help" 1>&2 + exit 1 + fi + + # Strip any trailing slash from the destination. + dest=`$echo "X$dest" | $Xsed -e 's%/$%%'` + + # Check to see that the destination is a directory. + test -d "$dest" && isdir=yes + if test "$isdir" = yes; then + destdir="$dest" + destname= + else + destdir=`$echo "X$dest" | $Xsed -e 's%/[^/]*$%%'` + test "X$destdir" = "X$dest" && destdir=. + destname=`$echo "X$dest" | $Xsed -e 's%^.*/%%'` + + # Not a directory, so check to see that there is only one file specified. + set dummy $files + if test $# -gt 2; then + $echo "$modename: \`$dest' is not a directory" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + fi + case "$destdir" in + [\\/]* | [A-Za-z]:[\\/]*) ;; + *) + for file in $files; do + case "$file" in + *.lo) ;; + *) + $echo "$modename: \`$destdir' must be an absolute directory name" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + done + ;; + esac + + # This variable tells wrapper scripts just to set variables rather + # than running their programs. + libtool_install_magic="$magic" + + staticlibs= + future_libdirs= + current_libdirs= + for file in $files; do + + # Do each installation. + case "$file" in + *.a | *.lib) + # Do the static libraries later. + staticlibs="$staticlibs $file" + ;; + + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$file' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + library_names= + old_library= + # If there is no directory component, then add one. + case "$file" in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Add the libdir to current_libdirs if it is the destination. + if test "X$destdir" = "X$libdir"; then + case "$current_libdirs " in + *" $libdir "*) ;; + *) current_libdirs="$current_libdirs $libdir" ;; + esac + else + # Note the libdir as a future libdir. + case "$future_libdirs " in + *" $libdir "*) ;; + *) future_libdirs="$future_libdirs $libdir" ;; + esac + fi + + dir="`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'`/" + test "X$dir" = "X$file/" && dir= + dir="$dir$objdir" + + # See the names of the shared library. + set dummy $library_names + if test -n "$2"; then + realname="$2" + shift + shift + + # Install the shared library and build the symlinks. + $show "$install_prog $dir/$realname $destdir/$realname" + $run eval "$install_prog $dir/$realname $destdir/$realname" || exit $? + + if test $# -gt 0; then + # Delete the old symlinks, and create new ones. + for linkname + do + if test "$linkname" != "$realname"; then + $show "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + $run eval "(cd $destdir && $rm $linkname && $LN_S $realname $linkname)" + fi + done + fi + + # Do each command in the postinstall commands. + lib="$destdir/$realname" + eval cmds=\"$postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + fi + + # Install the pseudo-library for information purposes. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + instname="$dir/$name"i + $show "$install_prog $instname $destdir/$name" + $run eval "$install_prog $instname $destdir/$name" || exit $? + + # Maybe install the static library, too. + test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library" + ;; + + *.lo) + # Install (i.e. copy) a libtool object. + + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Deduce the name of the destination old-style object file. + case "$destfile" in + *.lo) + staticdest=`$echo "X$destfile" | $Xsed -e "$lo2o"` + ;; + *.o | *.obj) + staticdest="$destfile" + destfile= + ;; + *) + $echo "$modename: cannot copy a libtool object to \`$destfile'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; + esac + + # Install the libtool object if requested. + if test -n "$destfile"; then + $show "$install_prog $file $destfile" + $run eval "$install_prog $file $destfile" || exit $? + fi + + # Install the old object if enabled. + if test "$build_old_libs" = yes; then + # Deduce the name of the old-style object file. + staticobj=`$echo "X$file" | $Xsed -e "$lo2o"` + + $show "$install_prog $staticobj $staticdest" + $run eval "$install_prog \$staticobj \$staticdest" || exit $? + fi + exit 0 + ;; + + *) + # Figure out destination file name, if it wasn't already specified. + if test -n "$destname"; then + destfile="$destdir/$destname" + else + destfile=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + destfile="$destdir/$destfile" + fi + + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + link_against_libtool_libs= + relink_command= + + # If there is no directory component, then add one. + case "$file" in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Check the variables that should have been set. + if test -z "$link_against_libtool_libs"; then + $echo "$modename: invalid libtool wrapper script \`$file'" 1>&2 + exit 1 + fi + + finalize=yes + for lib in $link_against_libtool_libs; do + # Check to see that each library is installed. + libdir= + if test -f "$lib"; then + # If there is no directory component, then add one. + case "$lib" in + */* | *\\*) . $lib ;; + *) . ./$lib ;; + esac + fi + libfile="$libdir/`$echo "X$lib" | $Xsed -e 's%^.*/%%g'`" + if test -n "$libdir" && test ! -f "$libfile"; then + $echo "$modename: warning: \`$lib' has not been installed in \`$libdir'" 1>&2 + finalize=no + fi + done + + outputname= + if test "$fast_install" = no && test -n "$relink_command"; then + if test "$finalize" = yes && test -z "$run"; then + tmpdir="/tmp" + test -n "$TMPDIR" && tmpdir="$TMPDIR" + tmpdir="$tmpdir/libtool-$$" + if $mkdir -p "$tmpdir" && chmod 700 "$tmpdir"; then : + else + $echo "$modename: error: cannot create temporary directory \`$tmpdir'" 1>&2 + continue + fi + outputname="$tmpdir/$file" + # Replace the output file specification. + relink_command=`$echo "X$relink_command" | $Xsed -e 's%@OUTPUT@%'"$outputname"'%g'` + + $show "$relink_command" + if $run eval "$relink_command"; then : + else + $echo "$modename: error: relink \`$file' with the above command before installing it" 1>&2 + ${rm}r "$tmpdir" + continue + fi + file="$outputname" + else + $echo "$modename: warning: cannot relink \`$file'" 1>&2 + fi + else + # Install the binary that we compiled earlier. + file=`$echo "X$file" | $Xsed -e "s%\([^/]*\)$%$objdir/\1%"` + fi + fi + + $show "$install_prog$stripme $file $destfile" + $run eval "$install_prog\$stripme \$file \$destfile" || exit $? + test -n "$outputname" && ${rm}r "$tmpdir" + ;; + esac + done + + for file in $staticlibs; do + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + # Set up the ranlib parameters. + oldlib="$destdir/$name" + + $show "$install_prog $file $oldlib" + $run eval "$install_prog \$file \$oldlib" || exit $? + + # Do each command in the postinstall commands. + eval cmds=\"$old_postinstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || exit $? + done + IFS="$save_ifs" + done + + if test -n "$future_libdirs"; then + $echo "$modename: warning: remember to run \`$progname --finish$future_libdirs'" 1>&2 + fi + + if test -n "$current_libdirs"; then + # Maybe just do a dry run. + test -n "$run" && current_libdirs=" -n$current_libdirs" + exec $SHELL $0 --finish$current_libdirs + exit 1 + fi + + exit 0 + ;; + + # libtool finish mode + finish) + modename="$modename: finish" + libdirs="$nonopt" + admincmds= + + if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then + for dir + do + libdirs="$libdirs $dir" + done + + for libdir in $libdirs; do + if test -n "$finish_cmds"; then + # Do each command in the finish commands. + eval cmds=\"$finish_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" || admincmds="$admincmds + $cmd" + done + IFS="$save_ifs" + fi + if test -n "$finish_eval"; then + # Do the single finish_eval. + eval cmds=\"$finish_eval\" + $run eval "$cmds" || admincmds="$admincmds + $cmds" + fi + done + fi + + # Exit here if they wanted silent mode. + test "$show" = : && exit 0 + + echo "----------------------------------------------------------------------" + echo "Libraries have been installed in:" + for libdir in $libdirs; do + echo " $libdir" + done + echo + echo "If you ever happen to want to link against installed libraries" + echo "in a given directory, LIBDIR, you must either use libtool, and" + echo "specify the full pathname of the library, or use \`-LLIBDIR'" + echo "flag during linking and do at least one of the following:" + if test -n "$shlibpath_var"; then + echo " - add LIBDIR to the \`$shlibpath_var' environment variable" + echo " during execution" + fi + if test -n "$runpath_var"; then + echo " - add LIBDIR to the \`$runpath_var' environment variable" + echo " during linking" + fi + if test -n "$hardcode_libdir_flag_spec"; then + libdir=LIBDIR + eval flag=\"$hardcode_libdir_flag_spec\" + + echo " - use the \`$flag' linker flag" + fi + if test -n "$admincmds"; then + echo " - have your system administrator run these commands:$admincmds" + fi + if test -f /etc/ld.so.conf; then + echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'" + fi + echo + echo "See any operating system documentation about shared libraries for" + echo "more information, such as the ld(1) and ld.so(8) manual pages." + echo "----------------------------------------------------------------------" + exit 0 + ;; + + # libtool execute mode + execute) + modename="$modename: execute" + + # The first argument is the command name. + cmd="$nonopt" + if test -z "$cmd"; then + $echo "$modename: you must specify a COMMAND" 1>&2 + $echo "$help" + exit 1 + fi + + # Handle -dlopen flags immediately. + for file in $execute_dlfiles; do + if test ! -f "$file"; then + $echo "$modename: \`$file' is not a file" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + dir= + case "$file" in + *.la) + # Check to see that this really is a libtool archive. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then : + else + $echo "$modename: \`$lib' is not a valid libtool archive" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + # Read the libtool library. + dlname= + library_names= + + # If there is no directory component, then add one. + case "$file" in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Skip this library if it cannot be dlopened. + if test -z "$dlname"; then + # Warn if it was a shared library. + test -n "$library_names" && $echo "$modename: warning: \`$file' was not linked with \`-export-dynamic'" + continue + fi + + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + + if test -f "$dir/$objdir/$dlname"; then + dir="$dir/$objdir" + else + $echo "$modename: cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'" 1>&2 + exit 1 + fi + ;; + + *.lo) + # Just add the directory containing the .lo file. + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + ;; + + *) + $echo "$modename: warning \`-dlopen' is ignored for non-libtool libraries and objects" 1>&2 + continue + ;; + esac + + # Get the absolute pathname. + absdir=`cd "$dir" && pwd` + test -n "$absdir" && dir="$absdir" + + # Now add the directory to shlibpath_var. + if eval "test -z \"\$$shlibpath_var\""; then + eval "$shlibpath_var=\"\$dir\"" + else + eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\"" + fi + done + + # This variable tells wrapper scripts just to set shlibpath_var + # rather than running their programs. + libtool_execute_magic="$magic" + + # Check if any of the arguments is a wrapper script. + args= + for file + do + case "$file" in + -*) ;; + *) + # Do a test to see if this is really a libtool program. + if (sed -e '4q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + # If there is no directory component, then add one. + case "$file" in + */* | *\\*) . $file ;; + *) . ./$file ;; + esac + + # Transform arg to wrapped name. + file="$progdir/$program" + fi + ;; + esac + # Quote arguments (to preserve shell metacharacters). + file=`$echo "X$file" | $Xsed -e "$sed_quote_subst"` + args="$args \"$file\"" + done + + if test -z "$run"; then + if test -n "$shlibpath_var"; then + # Export the shlibpath_var. + eval "export $shlibpath_var" + fi + + # Restore saved enviroment variables + if test "${save_LC_ALL+set}" = set; then + LC_ALL="$save_LC_ALL"; export LC_ALL + fi + if test "${save_LANG+set}" = set; then + LANG="$save_LANG"; export LANG + fi + + # Now actually exec the command. + eval "exec \$cmd$args" + + $echo "$modename: cannot exec \$cmd$args" + exit 1 + else + # Display what would be done. + if test -n "$shlibpath_var"; then + eval "\$echo \"\$shlibpath_var=\$$shlibpath_var\"" + $echo "export $shlibpath_var" + fi + $echo "$cmd$args" + exit 0 + fi + ;; + + # libtool uninstall mode + uninstall) + modename="$modename: uninstall" + rm="$nonopt" + files= + + for arg + do + case "$arg" in + -*) rm="$rm $arg" ;; + *) files="$files $arg" ;; + esac + done + + if test -z "$rm"; then + $echo "$modename: you must specify an RM program" 1>&2 + $echo "$help" 1>&2 + exit 1 + fi + + for file in $files; do + dir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "X$dir" = "X$file" && dir=. + name=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + + rmfiles="$file" + + case "$name" in + *.la) + # Possibly a libtool archive, so verify it. + if (sed -e '2q' $file | egrep "^# Generated by .*$PACKAGE") >/dev/null 2>&1; then + . $dir/$name + + # Delete the libtool libraries and symlinks. + for n in $library_names; do + rmfiles="$rmfiles $dir/$n" + done + test -n "$old_library" && rmfiles="$rmfiles $dir/$old_library" + + $show "$rm $rmfiles" + $run $rm $rmfiles + + if test -n "$library_names"; then + # Do each command in the postuninstall commands. + eval cmds=\"$postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + done + IFS="$save_ifs" + fi + + if test -n "$old_library"; then + # Do each command in the old_postuninstall commands. + eval cmds=\"$old_postuninstall_cmds\" + IFS="${IFS= }"; save_ifs="$IFS"; IFS='~' + for cmd in $cmds; do + IFS="$save_ifs" + $show "$cmd" + $run eval "$cmd" + done + IFS="$save_ifs" + fi + + # FIXME: should reinstall the best remaining shared library. + fi + ;; + + *.lo) + if test "$build_old_libs" = yes; then + oldobj=`$echo "X$name" | $Xsed -e "$lo2o"` + rmfiles="$rmfiles $dir/$oldobj" + fi + $show "$rm $rmfiles" + $run $rm $rmfiles + ;; + + *) + $show "$rm $rmfiles" + $run $rm $rmfiles + ;; + esac + done + exit 0 + ;; + + "") + $echo "$modename: you must specify a MODE" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 + ;; + esac + + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$generic_help" 1>&2 + exit 1 +fi # test -z "$show_help" + +# We need to display help for each of the modes. +case "$mode" in +"") $echo \ +"Usage: $modename [OPTION]... [MODE-ARG]... + +Provide generalized library-building support services. + + --config show all configuration variables + --debug enable verbose shell tracing +-n, --dry-run display commands without modifying any files + --features display basic configuration information and exit + --finish same as \`--mode=finish' + --help display this help message and exit + --mode=MODE use operation mode MODE [default=inferred from MODE-ARGS] + --quiet same as \`--silent' + --silent don't print informational messages + --version print version information + +MODE must be one of the following: + + compile compile a source file into a libtool object + execute automatically set library path, then run a program + finish complete the installation of libtool libraries + install install libraries or executables + link create a library or an executable + uninstall remove libraries from an installed directory + +MODE-ARGS vary depending on the MODE. Try \`$modename --help --mode=MODE' for +a more detailed description of MODE." + exit 0 + ;; + +compile) + $echo \ +"Usage: $modename [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE + +Compile a source file into a libtool library object. + +This mode accepts the following additional options: + + -o OUTPUT-FILE set the output file name to OUTPUT-FILE + -static always build a \`.o' file suitable for static linking + +COMPILE-COMMAND is a command to be used in creating a \`standard' object file +from the given SOURCEFILE. + +The output file name is determined by removing the directory component from +SOURCEFILE, then substituting the C source code suffix \`.c' with the +library object suffix, \`.lo'." + ;; + +execute) + $echo \ +"Usage: $modename [OPTION]... --mode=execute COMMAND [ARGS]... + +Automatically set library path, then run a program. + +This mode accepts the following additional options: + + -dlopen FILE add the directory containing FILE to the library path + +This mode sets the library path environment variable according to \`-dlopen' +flags. + +If any of the ARGS are libtool executable wrappers, then they are translated +into their corresponding uninstalled binary, and any of their required library +directories are added to the library path. + +Then, COMMAND is executed, with ARGS as arguments." + ;; + +finish) + $echo \ +"Usage: $modename [OPTION]... --mode=finish [LIBDIR]... + +Complete the installation of libtool libraries. + +Each LIBDIR is a directory that contains libtool libraries. + +The commands that this mode executes may require superuser privileges. Use +the \`--dry-run' option if you just want to see what would be executed." + ;; + +install) + $echo \ +"Usage: $modename [OPTION]... --mode=install INSTALL-COMMAND... + +Install executables or libraries. + +INSTALL-COMMAND is the installation command. The first component should be +either the \`install' or \`cp' program. + +The rest of the components are interpreted as arguments to that command (only +BSD-compatible install options are recognized)." + ;; + +link) + $echo \ +"Usage: $modename [OPTION]... --mode=link LINK-COMMAND... + +Link object files or libraries together to form another library, or to +create an executable program. + +LINK-COMMAND is a command using the C compiler that you would use to create +a program from several object files. + +The following components of LINK-COMMAND are treated specially: + + -all-static do not do any dynamic linking at all + -avoid-version do not add a version suffix if possible + -dlopen FILE \`-dlpreopen' FILE if it cannot be dlopened at runtime + -dlpreopen FILE link in FILE and add its symbols to lt_preloaded_symbols + -export-dynamic allow symbols from OUTPUT-FILE to be resolved with dlsym(3) + -export-symbols SYMFILE + try to export only the symbols listed in SYMFILE + -export-symbols-regex REGEX + try to export only the symbols matching REGEX + -LLIBDIR search LIBDIR for required installed libraries + -lNAME OUTPUT-FILE requires the installed library libNAME + -module build a library that can dlopened + -no-undefined declare that a library does not refer to external symbols + -o OUTPUT-FILE create OUTPUT-FILE from the specified objects + -release RELEASE specify package release information + -rpath LIBDIR the created library will eventually be installed in LIBDIR + -R[ ]LIBDIR add LIBDIR to the runtime path of programs and libraries + -static do not do any dynamic linking of libtool libraries + -version-info CURRENT[:REVISION[:AGE]] + specify library version info [each variable defaults to 0] + +All other options (arguments beginning with \`-') are ignored. + +Every other argument is treated as a filename. Files ending in \`.la' are +treated as uninstalled libtool libraries, other files are standard or library +object files. + +If the OUTPUT-FILE ends in \`.la', then a libtool library is created, +only library objects (\`.lo' files) may be specified, and \`-rpath' is +required, except when creating a convenience library. + +If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created +using \`ar' and \`ranlib', or on Windows using \`lib'. + +If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file +is created, otherwise an executable program is created." + ;; + +uninstall) + $echo \ +"Usage: $modename [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE... + +Remove libraries from an installation directory. + +RM is the name of the program to use to delete files associated with each FILE +(typically \`/bin/rm'). RM-OPTIONS are options (such as \`-f') to be passed +to RM. + +If FILE is a libtool library, all the files associated with it are deleted. +Otherwise, only FILE itself is deleted using RM." + ;; + +*) + $echo "$modename: invalid operation mode \`$mode'" 1>&2 + $echo "$help" 1>&2 + exit 1 + ;; +esac + +echo +$echo "Try \`$modename --help' for more information about other modes." + +exit 0 + +# Local Variables: +# mode:shell-script +# sh-indentation:2 +# End:
A missing

@@ -0,0 +1,188 @@

+#! /bin/sh +# Common stub for a few missing GNU programs while installing. +# Copyright (C) 1996, 1997 Free Software Foundation, Inc. +# Franc,ois Pinard <pinard@iro.umontreal.ca>, 1996. + +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. + +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. + +if test $# -eq 0; then + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 +fi + +case "$1" in + + -h|--h|--he|--hel|--help) + echo "\ +$0 [OPTION]... PROGRAM [ARGUMENT]... + +Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an +error status if there is no known handling for PROGRAM. + +Options: + -h, --help display this help and exit + -v, --version output version information and exit + +Supported PROGRAM values: + aclocal touch file \`aclocal.m4' + autoconf touch file \`configure' + autoheader touch file \`config.h.in' + automake touch all \`Makefile.in' files + bison create \`y.tab.[ch]', if possible, from existing .[ch] + flex create \`lex.yy.c', if possible, from existing .c + lex create \`lex.yy.c', if possible, from existing .c + makeinfo touch the output file + yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + ;; + + -v|--v|--ve|--ver|--vers|--versi|--versio|--version) + echo "missing - GNU libit 0.0" + ;; + + -*) + echo 1>&2 "$0: Unknown \`$1' option" + echo 1>&2 "Try \`$0 --help' for more information" + exit 1 + ;; + + aclocal) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acinclude.m4' or \`configure.in'. You might want + to install the \`Automake' and \`Perl' packages. Grab them from + any GNU archive site." + touch aclocal.m4 + ;; + + autoconf) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`configure.in'. You might want to install the + \`Autoconf' and \`GNU m4' packages. Grab them from any GNU + archive site." + touch configure + ;; + + autoheader) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`acconfig.h' or \`configure.in'. You might want + to install the \`Autoconf' and \`GNU m4' packages. Grab them + from any GNU archive site." + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER([^):]*:\([^)]*\)).*/\1/p' configure.in` + if test -z "$files"; then + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^):]*\)).*/\1/p' configure.in` + test -z "$files" || files="$files.in" + else + files=`echo "$files" | sed -e 's/:/ /g'` + fi + test -z "$files" && files="config.h.in" + touch $files + ;; + + automake) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. + You might want to install the \`Automake' and \`Perl' packages. + Grab them from any GNU archive site." + find . -type f -name Makefile.am -print \ + | sed 's/^\(.*\).am$/touch \1.in/' \ + | sh + ;; + + bison|yacc) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.y' file. You may need the \`Bison' package + in order for those modifications to take effect. You can get + \`Bison' from any GNU archive site." + rm -f y.tab.c y.tab.h + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if [ ! -f y.tab.h ]; then + echo >y.tab.h + fi + if [ ! -f y.tab.c ]; then + echo 'main() { return 0; }' >y.tab.c + fi + ;; + + lex|flex) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.l' file. You may need the \`Flex' package + in order for those modifications to take effect. You can get + \`Flex' from any GNU archive site." + rm -f lex.yy.c + if [ $# -ne 1 ]; then + eval LASTARG="\${$#}" + case "$LASTARG" in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if [ -f "$SRCFILE" ]; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if [ ! -f lex.yy.c ]; then + echo 'main() { return 0; }' >lex.yy.c + fi + ;; + + makeinfo) + echo 1>&2 "\ +WARNING: \`$1' is missing on your system. You should only need it if + you modified a \`.texi' or \`.texinfo' file, or any other file + indirectly affecting the aspect of the manual. The spurious + call might also be the consequence of using a buggy \`make' (AIX, + DU, IRIX). You might want to install the \`Texinfo' package or + the \`GNU make' package. Grab either from any GNU archive site." + file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` + if test -z "$file"; then + file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` + fi + touch $file + ;; + + *) + echo 1>&2 "\ +WARNING: \`$1' is needed, and you do not seem to have it handy on your + system. You might have modified some files without having the + proper tools for further handling them. Check the \`README' file, + it often tells you about the needed prerequirements for installing + this package. You may also peek at any GNU archive site, in case + some other package would contain this missing \`$1' program." + exit 1 + ;; +esac + +exit 0
A mkinstalldirs

@@ -0,0 +1,40 @@

+#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 2001/12/11 20:47:26 fluxgen Exp $ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" 1>&2 + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here
A nls/C/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: X error: %s(%d) opcodes %d/%d\n resource 0x%lx\n +$ #SignalCaught +# %s: signal %d caught\n +$ #ShuttingDown +# shutting down\n +$ #Aborting +# aborting... dumping core\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: connection to X server failed.\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: couldn't mark display connection as close-on-exec\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): removing bad window from event queue\n
A nls/C/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Blackbox Menu
A nls/C/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Config Options +$ #FocusModel +# Focus Model +$ #WindowPlacement +# Window Placement +$ #ImageDithering +# Image Dithering +$ #OpaqueMove +# Opaque Window Moving +$ #FullMax +# Full Maximization +$ #FocusNew +# Focus New Windows +$ #FocusLast +# Focus Window on Workspace Change +$ #ClickToFocus +# Click to Focus +$ #SloppyFocus +# Sloppy Focus +$ #AutoRaise +# Auto Raise +$ #SmartRows +# Smart Placement (Rows) +$ #SmartCols +# Smart Placement (Columns) +$ #Cascade +# Cascade Placement +$ #LeftRight +# Left to Right +$ #RightLeft +# Right to Left +$ #TopBottom +# Top to Bottom +$ #BottomTop +# Bottom to Top +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabPlacement +# Tab Placement +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/C/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Icons
A nls/C/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: error creating pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: error creating XImage\n +$ #UnsupVisual +# BImage::renderXImage: unsupported visual\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: error creating pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: invalid colormap size %d (%d/%d/%d) - reducing\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: error allocating colormap\n +$ #ColorAllocFail +# BImageControl::BImageControl: failed to alloc color %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: pixmap cache - releasing %d pixmaps\n +$ #PixmapCacheLarge +# BImageControl::renderImage: cache is large, forcing cleanout\n +$ #ColorParseError +# BImageControl::getColor: color parse error: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: color alloc error: '%s'\n
A nls/C/Makefile.am

@@ -0,0 +1,46 @@

+# nls/C/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST= $(MFILES) +all-local: blackbox.cat +install-data-local: blackbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/C"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/C; \ + $(INSTALL_DATA) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/C; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/US_ASCII; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/US_ASCII; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/POSIX; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/POSIX; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en_US; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/en_US; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/en; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/C/blackbox.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=../blackbox-nls.hh which is passed to awk... we +# only need to generate it once. + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk header=../blackbox-nls.hh \ + output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/C/Makefile.in

@@ -0,0 +1,237 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/C/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/C"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/C; \ + $(INSTALL_DATA) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/C; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/US_ASCII; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/US_ASCII; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/POSIX; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/POSIX; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en_US; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/en_US; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/en; \ + ln -fs C $(DESTDIR)$(pkgdatadir)/nls/en; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/C/blackbox.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=../blackbox-nls.hh which is passed to awk... we +# only need to generate it once. + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk header=../blackbox-nls.hh \ + output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/C/Screen.m

@@ -0,0 +1,54 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: an error occured while querying the X server.\n \ +another window manager is already running on display %s.\n +$ #ManagingScreen +# BScreen::BScreen: managing screen %d using visual 0x%lx, depth %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): couldn't load font '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): couldn't load default font.\n +$ #EmptyMenuFile +# %s: empty menu file\n +$ #xterm +# xterm +$ #Restart +# Restart +$ #Exit +# Exit +$ #EXECError +# BScreen::parseMenuFile: [exec] error, no menu label and/or command defined\n +$ #EXITError +# BScreen::parseMenuFile: [exit] error, no menu label defined\n +$ #STYLEError +# BScreen::parseMenuFile: [style] error, no menu label and/or filename \ +defined\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] error, no menu label defined\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] error, no filename defined\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] error, '%s' is not a regular file\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] error, no menu label defined\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] error, no menu label defined\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] error, no menu label defined\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, no directory defined\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, '%s' is not a \ +directory\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, '%s' does not exist\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] error, no menu label defined\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d +
A nls/C/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Slit Direction +$ #SlitPlacement +# Slit Placement
A nls/C/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Toolbar +$ #EditWkspcName +# Edit current workspace name +$ #ToolbarPlacement +# Toolbar Placement
A nls/C/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: creating 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: XGetWindowAttributres failed\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: cannot find screen for root window 0x%lx\n +$ #Unnamed +# Unnamed +$ #MapRequest +# BlackboxWindow::mapRequestEvent() for 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() for 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: reparent 0x%lx to root\n
A nls/C/Windowmenu.m

@@ -0,0 +1,22 @@

+$set 10 #Windowmenu + +$ #SendTo +# Send To ... +$ #SendGroupTo +# Send Group To ... +$ #Shade +# Shade +$ #Iconify +# Iconify +$ #Maximize +# Maximize +$ #Raise +# Raise +$ #Lower +# Lower +$ #Stick +# Stick +$ #KillClient +# Kill Client +$ #Close +# Close
A nls/C/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Workspace %d
A nls/C/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Workspaces +$ #NewWorkspace +# New Workspace +$ #RemoveLast +# Remove Last
A nls/C/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: no managable screens found, aborting\n +$ #MapRequest +# Blackbox::process_event: MapRequest for 0x%lx\n
A nls/C/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: error: must specify one of: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> display connection\n\ + -mod <x> <y> modula pattern\n\ + -foreground, -fg <color> modula foreground color\n\ + -background, -bg <color> modula background color\n\n\ + -gradient <texture> gradient texture\n\ + -from <color> gradient start color\n\ + -to <color> gradient end color\n\n\ + -solid <color> solid color\n\n\ + -help print this help text and exit\n +
A nls/C/common.m

@@ -0,0 +1,57 @@

+$set 15 #Common + +$ #Yes +# Yes +$ #No +# No + +$ #DirectionTitle +# Direction +$ #DirectionHoriz +# Horizontal +$ #DirectionVert +# Vertical + +$ #AlwaysOnTop +# Always on top + +$ #PlacementTitle +# Placement +$ #PlacementTopLeft +# Top Left +$ #PlacementCenterLeft +# Center Left +$ #PlacementBottomLeft +# Bottom Left +$ #PlacementTopCenter +# Top Center +$ #PlacementBottomCenter +# BottomCenter +$ #PlacementTopRight +# Top Right +$ #PlacementCenterRight +# Center Right +$ #PlacementBottomRight +# Bottom Right +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #PlacementRightCenter +# Right Center +$ #PlacementRightBottom +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative +$ #AutoHide +# Auto hide
A nls/C/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# error: '-rc' requires an argument\n +$ #DISPLAYRequiresArg +# error: '-display' requires an argument\n +$ #WarnDisplaySet +# warning: could not set environment variable 'DISPLAY'\n +$ #Usage +# Fluxkbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string>\t\tuse display connection.\n\ + -rc <string>\t\t\tuse alternate resource file.\n\ + -version\t\t\tdisplay version and exit.\n\ + -help\t\t\t\tdisplay this help text and exit.\n\n +$ #CompileOptions +# Compile time options:\n\ + Debugging\t\t\t%s\n\ + Interlacing:\t\t\t%s\n\ + Shape:\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + 8bpp Ordered Dithering:\t%s\n\n
A nls/Makefile.am

@@ -0,0 +1,13 @@

+# nls/Makefile.am for Blackbox 0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +SUBDIRS = C da_DK es_ES et_EE fr_FR pt_BR ru_RU sv_SE tr_TR it_IT +MAINTAINERCLEANFILES = Makefile.in blackbox-nls.hh +EXTRA_DIST=blackbox-nls.hh convert.awk + +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rmdir $(DESTDIR)$(pkgdatadir)/nls; \ + fi +distclean-local: + rm -f *\~
A nls/Makefile.in

@@ -0,0 +1,308 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox 0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +SUBDIRS = C da_DK es_ES et_EE fr_FR pt_BR ru_RU sv_SE tr_TR it_IT +MAINTAINERCLEANFILES = Makefile.in blackbox-nls.hh +EXTRA_DIST = blackbox-nls.hh convert.awk +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 --include-deps nls/Makefile + +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; \ + 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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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:
A nls/blackbox-nls.hh

@@ -0,0 +1,167 @@

+#define BaseDisplaySet 0x1 +#define BaseDisplayXError 0x1 +#define BaseDisplaySignalCaught 0x2 +#define BaseDisplayShuttingDown 0x3 +#define BaseDisplayAborting 0x4 +#define BaseDisplayXConnectFail 0x5 +#define BaseDisplayCloseOnExecFail 0x6 +#define BaseDisplayBadWindowRemove 0x7 + +#define BasemenuSet 0x2 +#define BasemenuBlackboxMenu 0x1 + +#define ConfigmenuSet 0x3 +#define ConfigmenuConfigOptions 0x1 +#define ConfigmenuFocusModel 0x2 +#define ConfigmenuWindowPlacement 0x3 +#define ConfigmenuImageDithering 0x4 +#define ConfigmenuOpaqueMove 0x5 +#define ConfigmenuFullMax 0x6 +#define ConfigmenuFocusNew 0x7 +#define ConfigmenuFocusLast 0x8 +#define ConfigmenuClickToFocus 0x9 +#define ConfigmenuSloppyFocus 0xa +#define ConfigmenuAutoRaise 0xb +#define ConfigmenuSmartRows 0xc +#define ConfigmenuSmartCols 0xd +#define ConfigmenuCascade 0xe +#define ConfigmenuLeftRight 0xf +#define ConfigmenuRightLeft 0x10 +#define ConfigmenuTopBottom 0x11 +#define ConfigmenuBottomTop 0x12 +#define ConfigmenuTabs 0x13 +#define ConfigmenuIcons 0x14 +#define ConfigmenuTabPlacement 0x15 +#define ConfigmenuTabRotateVertical 0x16 +#define ConfigmenuSemiSloppyFocus 0x17 + +#define IconSet 0x4 +#define IconIcons 0x1 + +#define ImageSet 0x5 +#define ImageErrorCreatingSolidPixmap 0x1 +#define ImageErrorCreatingXImage 0x2 +#define ImageUnsupVisual 0x3 +#define ImageErrorCreatingPixmap 0x4 +#define ImageInvalidColormapSize 0x5 +#define ImageErrorAllocatingColormap 0x6 +#define ImageColorAllocFail 0x7 +#define ImagePixmapRelease 0x8 +#define ImagePixmapCacheLarge 0x9 +#define ImageColorParseError 0xa +#define ImageColorAllocError 0xb + +#define ScreenSet 0x6 +#define ScreenAnotherWMRunning 0x1 +#define ScreenManagingScreen 0x2 +#define ScreenFontLoadFail 0x3 +#define ScreenDefaultFontLoadFail 0x4 +#define ScreenEmptyMenuFile 0x5 +#define Screenxterm 0x6 +#define ScreenRestart 0x7 +#define ScreenExit 0x8 +#define ScreenEXECError 0x9 +#define ScreenEXITError 0xa +#define ScreenSTYLEError 0xb +#define ScreenCONFIGError 0xc +#define ScreenINCLUDEError 0xd +#define ScreenINCLUDEErrorReg 0xe +#define ScreenSUBMENUError 0xf +#define ScreenRESTARTError 0x10 +#define ScreenRECONFIGError 0x11 +#define ScreenSTYLESDIRError 0x12 +#define ScreenSTYLESDIRErrorNotDir 0x13 +#define ScreenSTYLESDIRErrorNoExist 0x14 +#define ScreenWORKSPACESError 0x15 +#define ScreenPositionLength 0x16 +#define ScreenPositionFormat 0x17 +#define ScreenGeometryFormat 0x18 + +#define SlitSet 0x7 +#define SlitSlitTitle 0x1 +#define SlitSlitDirection 0x2 +#define SlitSlitPlacement 0x3 + +#define ToolbarSet 0x8 +#define ToolbarNoStrftimeLength 0x1 +#define ToolbarNoStrftimeDateFormat 0x2 +#define ToolbarNoStrftimeDateFormatEu 0x3 +#define ToolbarNoStrftimeTimeFormat24 0x4 +#define ToolbarNoStrftimeTimeFormat12 0x5 +#define ToolbarNoStrftimeTimeFormatP 0x6 +#define ToolbarNoStrftimeTimeFormatA 0x7 +#define ToolbarToolbarTitle 0x8 +#define ToolbarEditWkspcName 0x9 +#define ToolbarToolbarPlacement 0xa + +#define WindowSet 0x9 +#define WindowCreating 0x1 +#define WindowXGetWindowAttributesFail 0x2 +#define WindowCannotFindScreen 0x3 +#define WindowUnnamed 0x4 +#define WindowMapRequest 0x5 +#define WindowUnmapNotify 0x6 +#define WindowUnmapNotifyReparent 0x7 + +#define WindowmenuSet 0xa +#define WindowmenuSendTo 0x1 +#define WindowmenuSendGroupTo 0x2 +#define WindowmenuShade 0x3 +#define WindowmenuIconify 0x4 +#define WindowmenuMaximize 0x5 +#define WindowmenuRaise 0x6 +#define WindowmenuLower 0x7 +#define WindowmenuStick 0x8 +#define WindowmenuKillClient 0x9 +#define WindowmenuClose 0xa + +#define WorkspaceSet 0xb +#define WorkspaceDefaultNameFormat 0x1 + +#define WorkspacemenuSet 0xc +#define WorkspacemenuWorkspacesTitle 0x1 +#define WorkspacemenuNewWorkspace 0x2 +#define WorkspacemenuRemoveLast 0x3 + +#define blackboxSet 0xd +#define blackboxNoManagableScreens 0x1 +#define blackboxMapRequest 0x2 + +#define CommonSet 0xe +#define CommonYes 0x1 +#define CommonNo 0x2 +#define CommonDirectionTitle 0x3 +#define CommonDirectionHoriz 0x4 +#define CommonDirectionVert 0x5 +#define CommonAlwaysOnTop 0x6 +#define CommonPlacementTitle 0x7 +#define CommonPlacementTopLeft 0x8 +#define CommonPlacementCenterLeft 0x9 +#define CommonPlacementBottomLeft 0xa +#define CommonPlacementTopCenter 0xb +#define CommonPlacementBottomCenter 0xc +#define CommonPlacementTopRight 0xd +#define CommonPlacementCenterRight 0xe +#define CommonPlacementBottomRight 0xf +#define CommonPlacementLeftTop 0x10 +#define CommonPlacementLeftCenter 0x11 +#define CommonPlacementLeftBottom 0x12 +#define CommonPlacementRightTop 0x13 +#define CommonPlacementRightCenter 0x14 +#define CommonPlacementRightBottom 0x15 +#define CommonPlacementTopRelative 0x16 +#define CommonPlacementBottomRelative 0x17 +#define CommonPlacementLeftRelative 0x18 +#define CommonPlacementRightRelative 0x19 +#define CommonAutoHide 0x1a + +#define mainSet 0xf +#define mainRCRequiresArg 0x1 +#define mainDISPLAYRequiresArg 0x2 +#define mainWarnDisplaySet 0x3 +#define mainUsage 0x4 +#define mainCompileOptions 0x5 + +#define bsetrootSet 0x10 +#define bsetrootMustSpecify 0x1 +#define bsetrootUsage 0x2
A nls/convert.awk

@@ -0,0 +1,32 @@

+/^\$set/ { + major++ + minor = 0 + + if (major > 1) + printf "\n" > output + printf "$set %d %s\n", major, $3 > output + + if (header) { + majorName = substr($3, 2) + if (major > 1) + printf "\n" > header + printf "#define %sSet %#x\n", majorName, major > header + } +} + +/^\$ #/ { + minor++ + + if (header) { + minorName = substr($2, 2) + printf "#define %s%s %#x\n", majorName, minorName, minor > header + } +} + +/^#/ { + text = substr($0, 3) + printf "%d %s\n", minor, text > output +} + +! /^(\$|#)/ { print > output } +
A nls/da_DK/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: X fejl: %s(%d) kode %d/%d\n resource 0x%lx\n +$ #SignalCaught +# %s: signal %d fanget\n +$ #ShuttingDown +# lukker ned\n +$ #Aborting +# Avbryder... dumper kernen\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: tilslutning til X server mislykkedes.\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: kunne ikke markere skærmtilslutning som luk-ved-afslut\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): fjerner dårligt vindue fra hændelseskøen\n
A nls/da_DK/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Blackboxmenu
A nls/da_DK/Configmenu.m

@@ -0,0 +1,46 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Indstillinger +$ #FocusModel +# Fokus Model +$ #WindowPlacement +# Vindueplacering +$ #ImageDithering +# Billede Dithering +$ #OpaqueMove +# Uklar vinduesflytning +$ #FullMax +# Fuld maximering +$ #FocusNew +# Fokus nyt vindue +$ #FocusLast +# Fokus vindue ved skrivebords ændring +$ #ClickToFocus +# Klik for fokus +$ #SloppyFocus +# Dovent fokus +$ #AutoRaise +# Hæv automatisk +$ #SmartRows +# Intelligent placering (Rækker) +$ #SmartCols +# Intelligent placering (Søjler) +$ #Cascade +# Kaskade placering +$ #LeftRight +# Fra venstre mod højre +$ #RightLeft +# Fra højre mod venstre +$ #TopBottom +# Oppefra +$ #BottomTop +# Nedefra +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/da_DK/Icon.m

@@ -0,0 +1,6 @@

+$set 4 #Icon + +$ #Icons +# Ikoner +$ #Unnamed +# Intet navn
A nls/da_DK/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: fejl ved skabelse af pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: fejl ved skabelse af XImage\n +$ #UnsupVisual +# BImage::renderXImage: ikke support for farvedybden\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: fejl ved skabelse af pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: ugyldigt farvekort størrelse %d (%d/%d/%d) - reducing\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: fejl ved allokering af farvekort\n +$ #ColorAllocFail +# BImageControl::BImageControl: fejl ved allokering af farve %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: pixmap cache - sletter %d pixmaps\n +$ #PixmapCacheLarge +# BImageControl::renderImage: cache er for stor, gennemtvinger rensning\n +$ #ColorParseError +# BImageControl::getColor: farvefejl: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: farveallokeringsfejl: '%s'\n
A nls/da_DK/Makefile.am

@@ -0,0 +1,29 @@

+# nls/da_DK/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST= $(MFILES) +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/da_DK/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/da_DK/Makefile.in

@@ -0,0 +1,220 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/da_DK/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/da_DK/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/da_DK/Screen.m

@@ -0,0 +1,53 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: fejl ved forespørgsel til X server.\n \ +en anden window manager er allerede kørende på display %s.\n +$ #ManagingScreen +# BScreen::BScreen: håndterer skærm %d med visuel 0x%lx, farvedybde %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): kunne ikke hente font '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): kunne ikke hente standardfonten.\n +$ #EmptyMenuFile +# %s: tom menu fil\n +$ #xterm +# xterm +$ #Restart +# Genstart +$ #Exit +# Afslut +$ #EXECError +# BScreen::parseMenuFile: [exec] fejl, ingen menu etikette og/eller kommando defineret\n +$ #EXITError +# BScreen::parseMenuFile: [exit] fejl, ingen menu etikette defineret\n +$ #STYLEError +# BScreen::parseMenuFile: [style] fejl, ingen menu etikette og/eller filnavn \ +defineret\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] fejl, ingen menu etikette defineret\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] fejl, intet filnavn defineret\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] fejl, '%s' er ikke en normal fil\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] fejl, ingen menu etikette defineret\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] fejl, ingen menu etikette defineret\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] fejl, ingen menu etikette defineret\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] fejl, intet katalog defineret\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] fejl, '%s' er ikke et katalog\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] fejl, '%s' eksisterer ikke\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] fejl, ingen menu etikette defineret\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d +
A nls/da_DK/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Slit retning +$ #SlitPlacement +# Slit placering
A nls/da_DK/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Værktøjsbjælke +$ #EditWkspcName +# Andring af skrivebordets navn +$ #ToolbarPlacement +# Værktøjsbjælkens placering
A nls/da_DK/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: skaber 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: XGetWindowAttributres fejlede\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: kunne ikke finde skærm til hovedvinduet 0x%lx\n +$ #Unnamed +# Intet navn +$ #MapRequest +# BlackboxWindow::mapRequestEvent() for 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() for 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: sætter 0x%lx til hovedvinduet\n
A nls/da_DK/Windowmenu.m

@@ -0,0 +1,20 @@

+$set 10 #Windowmenu + +$ #SendTo +# Send til ... +$ #Shade +# Skygge +$ #Iconify +# Iconificeret +$ #Maximize +# Maksimer +$ #Raise +# Hæv +$ #Lower +# Sænk +$ #Stick +# Klæbrig +$ #KillClient +# Dræb klient +$ #Close +# Luk
A nls/da_DK/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Skrivebord %d
A nls/da_DK/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Skriveborde +$ #NewWorkspace +# Nyt skrivebord +$ #RemoveLast +# Fjern sidste
A nls/da_DK/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: ingen håndterbare skærme fundet, afslutter\n +$ #MapRequest +# Blackbox::process_event: MapRequest for 0x%lx\n
A nls/da_DK/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: fejl: specificér en af følgende: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> skærmtilslutning\n\ + -mod <x> <y> modula mønster\n\ + -foreground, -fg <color> modula foregrundsfarve\n\ + -background, -bg <color> modula baggrundsfarve\n\n\ + -gradient <texture> gradient tekstur\n\ + -from <color> gradient start farve\n\ + -to <color> gradient slut farve\n\n\ + -solid <color> fast farve\n\n\ + -help hvis denne hjælp og afslut\n +
A nls/da_DK/common.m

@@ -0,0 +1,57 @@

+$set 15 #Common + +$ #Yes +# Ja +$ #No +# Nej + +$ #DirectionTitle +# Retning +$ #DirectionHoriz +# Horisontal +$ #DirectionVert +# Vertikal + +$ #AlwaysOnTop +# Altid øverst + +$ #PlacementTitle +# Placering +$ #PlacementTopLeft +# Øverste venstre hjørne +$ #PlacementCenterLeft +# Venstre i midten +$ #PlacementBottomLeft +# Bunden til venstre +$ #PlacementTopCenter +# Toppen i midten +$ #PlacementBottomCenter +# Bunden i midten +$ #PlacementTopRight +# Øverst til højre +$ #PlacementCenterRight +# Til højre i midten +$ #PlacementBottomRight +# Til højre i bunden +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #PlacementRightCenter +# Right Center +$ #PlacementRightBottom +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative +$ #AutoHide +# Gem automatisk
A nls/da_DK/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# fejl: '-rc' kræver et argument\n +$ #DISPLAYRequiresArg +# fjel: '-display' kræver et argument\n +$ #WarnDisplaySet +# advarsel: kunne ikke sætte variablen 'DISPLAY'\n +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string>\t\tbrug skærm tilslutning.\n\ + -rc <string>\t\t\tbrug alternativ resource fil.\n\ + -version\t\t\tvis versionsnummer og afslut.\n\ + -help\t\t\t\tvis denne hjælp og afslut.\n\n +$ #CompileOptions +# Kompileret med:\n\ + Debugging\t\t\t%s\n\ + Interlacing:\t\t\t%s\n\ + Shape:\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + 8bpp Ordered Dithering:\t%s\n\n
A nls/es_ES/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: Un error de X: %s(%d) clave de operación %d/%d\n recurso 0x%lx\n +$ #SignalCaught +# %s: señal %d capturada\n +$ #ShuttingDown +# cerrando\n +$ #Aborting +# cancelando... generando 'core'\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: la conexión al servidor de X falló.\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: no se pude marcar la conexión de despliegue como close-on-exec\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): quitando la ventana errónea de la cola de eventos\n
A nls/es_ES/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Menú de Blackbox
A nls/es_ES/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Opciones de configuración +$ #FocusModel +# Modelo de enfoque +$ #WindowPlacement +# Ubicación de ventanas +$ #ImageDithering +# Simulación de colores en imágenes +$ #OpaqueMove +# Movimiento opaco de ventanas +$ #FullMax +# Maximización total +$ #FocusNew +# Enfocar ventanas nuevas +$ #FocusLast +# Enfocar la última ventana en el escritorio +$ #ClickToFocus +# Seleccionar para enfocar +$ #SloppyFocus +# Enfocar sin forma estricta +$ #AutoRaise +# Elevar automáticamente las ventanas +$ #SmartRows +# Ubicación inteligente (filas) +$ #SmartCols +# Ubicación inteligente (columnas) +$ #Cascade +# Ubicación en cascada +$ #LeftRight +# De izquierda a derecha +$ #RightLeft +# De derecha a izquierda +$ #TopBottom +# De arriba hacia abajo +$ #BottomTop +# De abajo hacia arriba +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabPlacement +# Tab Placement +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/es_ES/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Iconos
A nls/es_ES/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: error creando el pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: error creando el XImage\n +$ #UnsupVisual +# BImage::renderXImage: visual no soportado\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: error creando el pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: mapa no válido de colores tamaño %d (%d/%d/%d) - reduciendo\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: error en la asignación del mapa de colores\n +$ #ColorAllocFail +# BImageControl::BImageControl: no se puede asignar el color %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: reserva de pixmaps - liberando %d pixmaps\n +$ #PixmapCacheLarge +# BImageControl::renderImage: reserva de pixmaps grande, forzando limpieza\n +$ #ColorParseError +# BImageControl::getColor: error evaluando el color: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: error asignando el color: '%s'\n
A nls/es_ES/Makefile.am

@@ -0,0 +1,32 @@

+# nls/es_ES/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST=$(MFILES) +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/es_ES; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/es; \ + ln -fs es_ES $(DESTDIR)$(pkgdatadir)/nls/es; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/es_ES/blackbox.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 ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/es_ES/Makefile.in

@@ -0,0 +1,223 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/es_ES/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/es_ES; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/es; \ + ln -fs es_ES $(DESTDIR)$(pkgdatadir)/nls/es; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/es_ES/blackbox.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 ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/es_ES/Screen.m

@@ -0,0 +1,51 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: un error ocurrió mientras cuestionaba el servidor X.\n otro gestor de ventanas se está ejecutando en conexión de despliegue %s.\n +$ #ManagingScreen +# BScreen::BScreen: gestionando la pantalla %d usando visual 0x%lx, profundidad %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): no se puede cargar el tipo de letra '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): no se puede cargar el tipo de letra por omisión.\n +$ #EmptyMenuFile +# %s: archivo de menú vacío\n +$ #xterm +# xterm +$ #Restart +# Reiniciar +$ #Exit +# Salir +$ #EXECError +# BScreen::parseMenuFile: [exec] error, no hay etiqueta de menú ni comando definido\n +$ #EXITError +# BScreen::parseMenuFile: [exit] error, no hay etiqueta de menú definida\n +$ #STYLEError +# BScreen::parseMenuFile: [style] error, no hay etiqueta de menú ni archivo \ +definido\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] error, no hay etiqueta de menú definida\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] error, no hay nombre de archivo definido\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] error, '%s' no es un archivo regular\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] error, no hay etiqueta de menú definida\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] error, no hay etiqueta de menú definida\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] error, no hay etiqueta de menú definida\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, no hay directorio definido\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, '%s' no es un directorio\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, '%s' no existe\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] error, no hay etiqueta de menú definida\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d
A nls/es_ES/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Dirección de slit +$ #SlitPlacement +# Ubicación de slit
A nls/es_ES/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Escritorio +$ #EditWkspcName +# Cambiar el nombre del escritorio actual +$ #ToolbarPlacement +# Ubicación de la barra de herramientas
A nls/es_ES/Window.m

@@ -0,0 +1,18 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: creando 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: XGetWindowAttributres falló\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: no se puede encontrar la pantalla para la ventana \ + raíz 0x%lx\n +$ #Unnamed +# Sin nombre +$ #MapRequest +# BlackboxWindow::mapRequestEvent() para 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() para 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: el padre nuevo para 0x%lx es la raíz\n
A nls/es_ES/Windowmenu.m

@@ -0,0 +1,20 @@

+$set 10 #Windowmenu + +$ #SendTo +# Enviar a ... +$ #Shade +# Enrollar +$ #Iconify +# Convertir en icono +$ #Maximize +# Maximizar +$ #Raise +# Elevar +$ #Lower +# Bajar +$ #Stick +# Fijar +$ #KillClient +# Matar al cliente +$ #Close +# Cerrar
A nls/es_ES/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Escritorio %d
A nls/es_ES/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Escritorios +$ #NewWorkspace +# Escritorio nuevo +$ #RemoveLast +# Quitar el último escritorio
A nls/es_ES/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: no encontré pantallas manejables, cerrando\n +$ #MapRequest +# Blackbox::process_event: MapRequest para 0x%lx\n
A nls/es_ES/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: error: es necesario especifiar uno de: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> conexión de despliegue\n\ + -mod <x> <y> diseño de modula \n\ + -foreground, -fg <color> color del primer plano de modula\n\ + -background, -bg <color> color del fondo de modula\n\n\ + -gradient <texture> textura de la pendiente\n\ + -from <color> color inicial de la pendiente\n\ + -to <color> color final de la pendiente\n\n\ + -solid <color> color sólido\n\n\ + -help mostrar este texto de ayuda y salir\n +
A nls/es_ES/common.m

@@ -0,0 +1,58 @@

+$set 15 #Common + +$ #Yes +# Sí +$ #No +# No + +$ #DirectionTitle +# Dirección +$ #DirectionHoriz +# Horizontal +$ #DirectionVert +# Vertical + +$ #AlwaysOnTop +# Siempre encima/arriba + +$ #PlacementTitle +# Ubicación +$ #PlacementTopLeft +# Arriba a la izquierda +$ #PlacementCenterLeft +# Centro a la izquierda +$ #PlacementBottomLeft +# Abajo a la izquierda +$ #PlacementTopCenter +# Arriba al centro +$ #PlacementBottomCenter +# Abajo al centro +$ #PlacementTopRight +# Arriba a la derecha +$ #PlacementCenterRight +# Centro a la derecha +$ #PlacementBottomRight +# Abajo a la derecha +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #PlacementRightCenter +# Right Center +$ #PlacementRightBottom +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative + +$ #AutoHide +# Auto hide
A nls/es_ES/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# error: '-rc' requiere un argumento +$ #DISPLAYRequiresArg +# error: '-display' requiere un argumento +$ #WarnDisplaySet +# cuidado: no se puede establecer la variable de ambiente 'DISPLAY' +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string> conexión de despliegue.\n\ + -rc <string> archivo alternativo de recuros.\n\ + -version mostrar la versión y cerrar.\n\ + -help mostrar este texto de ayuda y cerrar.\n\n +$ #CompileOptions +# Opciones durante la compilación:\n\ + Información extra para depuración: %s\n\ + Entrelazado: %s\n\ + Forma: %s\n\ + Slit: %s\n\ + 8bpp simulación ordenada de colores en imágenes: %s\n\n
A nls/et_EE/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: X'i viga: %s(%d) opkood %d/%d\n resurss 0x%lx\n +$ #SignalCaught +# %s: signaal %d püütud\n +$ #ShuttingDown +# lõpetame\n +$ #Aborting +# katkestame... mälupilt tehtud\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: ühenduse saamine X serveriga ebaõnnestus.\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: ühenduse märgistamine 'close-on-exec' ebaõnnestus\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): eemaldame vigase akna tominigute reast\n
A nls/et_EE/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Blackbox'i Menüü
A nls/et_EE/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Konfiguratsioon +$ #FocusModel +# Fookusmood +$ #WindowPlacement +# Akende paigutamine +$ #ImageDithering +# Piltide teravustamine +$ #OpaqueMove +# Nähtav akende liigutamine +$ #FullMax +# Üle-ekraani suurendus +$ #FocusNew +# Fookus uutele akendele +$ #FocusLast +# Fokusseeri viimane aken +$ #ClickToFocus +# Klikka fookuse saamiseks +$ #SloppyFocus +# Kaasaskäiv fookus +$ #AutoRaise +# Akende esiletoomine +$ #SmartRows +# Arukas paigutus (read) +$ #SmartCols +# Arukas paigutus (tulbad) +$ #Cascade +# Kaskaadis +$ #LeftRight +# Vasakult paremale +$ #RightLeft +# Paremalt vasakule +$ #TopBottom +# Ülevalt alla +$ #BottomTop +# Alt ülesse +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabPlacement +# Tab Placement +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/et_EE/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Ikoonid
A nls/et_EE/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: viga pixmapi loomisel\n +$ #ErrorCreatingXImage +# BImage::renderXImage: viga XImage loomisel\n +$ #UnsupVisual +# BImage::renderXImage: toeta visuaal\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: viga pixmapi loomisel\n +$ #InvalidColormapSize +# BImageControl::BImageControl: vale värvipaletti suurus %d (%d/%d/%d) - vähendame\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: viga värvipaletti määramisel \n +$ #ColorAllocFail +# BImageControl::BImageControl: ei õnnestunud värvi määrata %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: pixmap cache - vabastame %d pixmappi\n +$ #PixmapCacheLarge +# BImageControl::renderImage: cache on liiga suur, sundpuhastus\n +$ #ColorParseError +# BImageControl::getColor: viga värvi analüüsimisel: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: viga värvi määramisel: '%s'\n
A nls/et_EE/Makefile.am

@@ -0,0 +1,29 @@

+# nls/et_EE/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST=$(MFILES) +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/et_EE; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/et_EE/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/et_EE; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/et_EE/Makefile.in

@@ -0,0 +1,220 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/et_EE/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/et_EE; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/et_EE/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/et_EE; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/et_EE/Screen.m

@@ -0,0 +1,53 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: viga X serveri küsitlemisel.\n \ +teine akahaldur juba töötab displeil %s.\n +$ #ManagingScreen +# BScreen::BScreen: haldame displeid %d reolutsioonis 0x%lx, vörvisügavusel %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): ei saanud laadida fonti '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): ei saanud laadida vaikimisi määratud fonti.\n +$ #EmptyMenuFile +# %s: tühi menüüfail\n +$ #xterm +# xterm +$ #Restart +# Restart +$ #Exit +# Välju +$ #EXECError +# BScreen::parseMenuFile: [exec] viga, menüü pealkirja ja/või käsku pole määratud\n +$ #EXITError +# BScreen::parseMenuFile: [exit] viga, menüü pealkirja pole määratud\n +$ #STYLEError +# BScreen::parseMenuFile: [style] viga, menüü pealkirja ja/või failinime \ +pole määratud\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] viga, menüü pealkirja pole määratud\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] viga, failinime pole määratud\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] viga, '%s' ei ole tavaline fail\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] viga, menüü pealkirja pole määratud\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] viga, menüü pealkirja pole määratud\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] viga, menüü pealkirja pole määratud\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] viga, kataloogi pole määratud\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] viga, '%s' pole kataloog\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] viga, '%s' pole olemas\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] viga, menüü pealkirja pole määratud\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d +
A nls/et_EE/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Pragu +$ #SlitDirection +# Prao suund +$ #SlitPlacement +# Prao asukoht
A nls/et_EE/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Tegumiriba +$ #EditWkspcName +# Muuda töölaua nime +$ #ToolbarPlacement +# Tegumiriba asukoht
A nls/et_EE/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: loome 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: XGetWindowAttributres ebaõnnestus\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: ei leidnud displeid juuraknale 0x%lx\n +$ #Unnamed +# Nimeta +$ #MapRequest +# BlackboxWindow::mapRequestEvent() 0x%lx'le\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() 0x%lx'le\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: 0x%lx juurele\n
A nls/et_EE/Windowmenu.m

@@ -0,0 +1,20 @@

+$set 10 #Windowmenu + +$ #SendTo +# Saada... +$ #Shade +# Varjuta +$ #Iconify +# Ikoniseeri +$ #Maximize +# Suurenda +$ #Raise +# Esiplaanile +$ #Lower +# Tahaplaanile +$ #Stick +# Kleebi +$ #KillClient +# Killi klient +$ #Close +# Sulge
A nls/et_EE/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Töölaud %d
A nls/et_EE/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Töölauad +$ #NewWorkspace +# Uus töölaud +$ #RemoveLast +# Eemalda viimane
A nls/et_EE/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: ei leidnud hallatavaid displeisid, katkestame\n +$ #MapRequest +# Blackbox::process_event: MapRequest 0x%lx'le\n
A nls/et_EE/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: viga: pead määratlema ühe järgnevaist: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> displei ühendus\n\ + -mod <x> <y> moodula tapeet\n\ + -foreground, -fg <color> esiplaani värvi moodula\n\ + -background, -bg <color> tausta värvi moodula\n\n\ + -gradient <texture> gradientne tekstuur\n\ + -from <color> gradiendi algusvärv\n\ + -to <color> gradiendi lõpuvärv\n\n\ + -solid <color> ühtne värv\n\n\ + -help näida seda abiteksti ja välju\n +
A nls/et_EE/common.m

@@ -0,0 +1,58 @@

+$set 15 #Common + +$ #Yes +# Jah +$ #No +# Ei + +$ #DirectionTitle +# Suund +$ #DirectionHoriz +# Horisontaalne +$ #DirectionVert +# Vertikaalne + +$ #AlwaysOnTop +# Alati esiplaanil + +$ #PlacementTitle +# Asetus +$ #PlacementTopLeft +# Üleval vasakul +$ #PlacementCenterLeft +# Keskel vasakul +$ #PlacementBottomLeft +# All vasakul +$ #PlacementTopCenter +# Üleval keskel +$ #PlacementBottomCenter +# All keskel +$ #PlacementTopRight +# Üleval paremal +$ #PlacementCenterRight +# Keskel paremal +$ #PlacementBottomRight +# All paremal +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #Placement +# Right Center +$ #Placement +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative + +$ #AutoHide +# Auto hide
A nls/et_EE/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# viga: '-rc' vajab argumenti\n +$ #DISPLAYRequiresArg +# viga: '-display' vajab argumenti\n +$ #WarnDisplaySet +# hoiatus: ei saanud määrata keskonna muutujat 'DISPLAY'\n +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string>\t\tkasuta displei ühendust.\n\ + -rc <string>\t\t\tkasuta alternatiivseid resursse.\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 +# Kompileerimisoptsioonid:\n\ + Debuggimine\t\t\t%s\n\ + Põimimine:\t\t\t%s\n\ + Kuju:\t\t\t%s\n\ + Pragu:\t\t\t\t%s\n\ + 8bpp määratud teravustamine:\t%s\n\n
A nls/fr_FR/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: Erreur de X %s(%d) opcodes %d/%d\n ressource 0x%lx\n +$ #SignalCaught +# %s: signal %d capturé\n +$ #ShuttingDown +# arrêt du programme\n +$ #Aborting +# annulation... ponte du fichier core\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: échec de la connexion à X\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: impossible d'attribuer close-on-exec à l'affichage\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): suppression d'une mauvaise fenêtre de la queue\n
A nls/fr_FR/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Menu de Blackbox
A nls/fr_FR/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Options de configuration +$ #FocusModel +# Mode de convergence +$ #WindowPlacement +# Disposition des fenêtres +$ #ImageDithering +# Lissage d'images +$ #OpaqueMove +# Déplacement opaque des fenêtres +$ #FullMax +# Maximization complète +$ #FocusNew +# Convergence de la nouvelle fenêtre +$ #FocusLast +# Convergence de la dernière fenêtre +$ #ClickToFocus +# Cliquer pour converger +$ #SloppyFocus +# Convergence souple +$ #AutoRaise +# Premier plan automatique +$ #SmartRows +# Disposition futée (Lignes) +$ #SmartCols +# Disposition futée (Colonnes) +$ #Cascade +# Disposition en cascade +$ #LeftRight +# De gauche à droite +$ #RightLeft +# De droite à gauche +$ #TopBottom +# De haut en bas +$ #BottomTop +# De bas en haut +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabPlacement +# Tab Placement +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/fr_FR/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Icones
A nls/fr_FR/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: Erreur de création de pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: Erreur de création de XImage\n +$ #UnsupVisual +# BImage::renderXImage: Image non endossée\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: Erreur de création de pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: Taille des couleurs parentes invalide%d (%d/%d/%d) - coupe\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: Erreur d'allocation des couleurs parentes\n +$ #ColorAllocFail +# BImageControl::BImageControl: Echec d'allocation de couleur %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: Cache pixmap - abandon %d pixmaps\n +$ #PixmapCacheLarge +# BImageControl::renderImage: Cache important, nettoyage conséquent\n +$ #ColorParseError +# BImageControl::getColor: Erreur de lecture de couleur: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: Erreur d'allocation,couleur: '%s'\n
A nls/fr_FR/Makefile.am

@@ -0,0 +1,33 @@

+# nls/fr_FR/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST=$(MFILES) + +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/fr_FR; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/fr; \ + ln -fs fr_FR $(DESTDIR)$(pkgdatadir)/nls/fr; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/fr_FR/blackbox.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 ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/fr_FR/Makefile.in

@@ -0,0 +1,224 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/fr_FR/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/fr_FR; \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/fr; \ + ln -fs fr_FR $(DESTDIR)$(pkgdatadir)/nls/fr; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/fr_FR/blackbox.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 ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/fr_FR/Screen.m

@@ -0,0 +1,54 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: Occurence d'une erreur pendant une requête vers X.\n \ +Un autre gestionnaire de fenêtres est déjà lancé %s.\n +$ #ManagingScreen +# BScreen::BScreen: Gestion de l'écran %d avec le visuel 0x%lx, profondeur %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): Impossible de charger la police de caractère '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): Impossible de charger la police de caractère initiale.\n +$ #EmptyMenuFile +# %s: Fichier de menu vide\n +$ #xterm +# xterm +$ #Restart +# Redémarrer +$ #Exit +# Sortie +$ #EXECError +# BScreen::parseMenuFile: [exec] Erreur, pas d'indication de menu &/ou de commande definie\n +$ #EXITError +# BScreen::parseMenuFile: [exit] Erreur, aucune indication de menu définie\n +$ #STYLEError +# BScreen::parseMenuFile: [style] Erreur, pas d'indication de menu &/ou de nom de fichier\ +defini\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] Erreur, aucune indication de menu définie\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] Erreur, aucun nom de fichier défini\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] Erreur, '%s' est un fichier invalide\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] Erreur, aucune indication de menu définie\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] Erreur, aucune indication de menu définie\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] Erreur, aucune indication de menu définie\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] Erreur, aucun répertoire défini\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] Erreur, '%s' est un répertoire \ +invalide\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] Erreur, '%s' est inexistant\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] Erreur, aucune indication de menu définie\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# L: %4d x H: %4d +
A nls/fr_FR/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Orientation du Slit +$ #SlitPlacement +# Disposition du Slit
A nls/fr_FR/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Barre d'outils +$ #EditWkspcName +# Bâptème du bureau courant +$ #ToolbarPlacement +# Disposition de la barre d'outils
A nls/fr_FR/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: Génération 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: Echec de XGetWindowAttributres\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: Impossible de trouver l'écran de la fenêtre racine0x%lx\n +$ #Unnamed +# Inconnu +$ #MapRequest +# BlackboxWindow::mapRequestEvent() pour 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() pour 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: réattribue 0x%lx à la fenêtre principale\n
A nls/fr_FR/Windowmenu.m

@@ -0,0 +1,20 @@

+$set 10 #Windowmenu + +$ #SendTo +# Redirige vers... +$ #Shade +# Ombrage +$ #Iconify +# Iconifie +$ #Maximize +# Maximize +$ #Raise +# Résurrection +$ #Lower +# Réduit +$ #Stick +# Epingle +$ #KillClient +# Massacre +$ #Close +# Ferme
A nls/fr_FR/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Bureau %d
A nls/fr_FR/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Bureaux +$ #NewWorkspace +# Nouveau bureau +$ #RemoveLast +# Supprimer le dernier
A nls/fr_FR/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: Aucun écran exploitable n'a été trouvé, annulation\n +$ #MapRequest +# Blackbox::process_event: MapRequest pour 0x%lx\n
A nls/fr_FR/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: Erreur: il faut préciser: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <chaîne> connexion à l'écran\n\ + -mod <x> <y> schéma\n\ + -foreground, -fg <couleur> couleur au premier plan\n\ + -background, -bg <couleur> couleur au second plan\n\n\ + -gradient <texture> texture du dégradé\n\ + -from <couleur> couleur de départ du dégradé\n\ + -to <couleur> couleur d'arrivé du dégradé\n\n\ + -solid <couleur> couleur pleine\n\n\ + -help affiche ce texte d'aide et quitte\n +
A nls/fr_FR/common.m

@@ -0,0 +1,58 @@

+$set 15 #Common + +$ #Yes +# Oui +$ #No +# Non + +$ #DirectionTitle +# Orientation +$ #DirectionHoriz +# Horizontal +$ #DirectionVert +# Vertical + +$ #AlwaysOnTop +# Toujours au-dessus + +$ #PlacementTitle +# Disposition +$ #PlacementTopLeft +# En haut à gauche +$ #PlacementCenterLeft +# Au centre à gauche +$ #PlacementBottomLeft +# En bas à gauche +$ #PlacementTopCenter +# En haut au centre +$ #PlacementBottomCenter +# En bas au centre +$ #PlacementTopRight +# En haut à droite +$ #PlacementCenterRight +# Au centre à droite +$ #PlacementBottomRight +# En bas à droite +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #PlacementRightCenter +# Right Center +$ #PlacementRightBottom +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative + +$ #AutoHide +# Auto hide
A nls/fr_FR/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# Erreur: '-rc' nécessite un argument\n +$ #DISPLAYRequiresArg +# Erreur: '-display' nécessite un argument\n +$ #WarnDisplaySet +# Attention: impossible d'attribuer la variable d'environnement 'DISPLAY'\n +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <chaîne>\t\tutilise la connexion à l'affichage.\n\ + -rc <chaîne>\t\t\tutilise un autre fichier de configuration.\n\ + -version\t\t\taffiche la version et quitte.\n\ + -help\t\t\t\taffiche ce texte d'aide et quitte.\n\n +$ #CompileOptions +# Options de compilation:\n\ + Debugging\t\t\t%s\n\ + Interlacing:\t\t\t%s\n\ + Shape:\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + 8bpp Ordered Dithering:\t%s\n\n
A nls/it_IT/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: Errore di X: %s(%d) opcodes %d/%d\n resource 0x%lx\n +$ #SignalCaught +# %s: intercettato segnale %d\n +$ #ShuttingDown +# sto uscendo\n +$ #Aborting +# abortito... sto generando un core dump\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: Connessione al server X sbagliata\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: non posso marcare la connesione al display come close-on-exec\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): sto rimuovendo la finestra sbagliata dalla coda degli eventi\n
A nls/it_IT/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Fluxbox Menu
A nls/it_IT/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Configurazione +$ #FocusModel +# Tipo Di Focus +$ #WindowPlacement +# Posizionamento delle finestre +$ #ImageDithering +# Dithering Delle Immagini +$ #OpaqueMove +# Movimento Delle Finestre Opaco +$ #FullMax +# Massimizzazione Completa +$ #FocusNew +# Dai Il Focus Alle Nuove Finestre +$ #FocusLast +# Dai Il Focus Alla Finestra Al Cambio di Workspace +$ #ClickToFocus +# Clicca Per Il Focus +$ #SloppyFocus +# Sloppy Focus +$ #AutoRaise +# Auto Raise +$ #SmartRows +# Posizionamento Intelligente (Righe) +$ #SmartCols +# Posizionamento Intelligente (Colonne) +$ #Cascade +# Posizionamento A Cascata +$ #LeftRight +# Da Sinistra A Destra +$ #RightLeft +# Da Destra A Sinistra +$ #TopBottom +# Da Sopra A Sotto +$ #BottomTop +# Da Sotto A Sopra +$ #Tabs +# Usa I Tabs +$ #Icons +# Usa Le Icone +$ #TabPlacement +# Posizionamento Del Tab +$ #TabRotateVertical +# Routa Verticalmente I Tab +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/it_IT/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Icone
A nls/it_IT/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: errore creando la pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: errore creando XImage\n +$ #UnsupVisual +# BImage::renderXImage: visuale non supportata\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: errore creando la pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: colormap non valida dimensione %d (%d/%d/%d) - riducendo\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: error allocando la colormap\n +$ #ColorAllocFail +# BImageControl::BImageControl: Fallimento nell'allocare il colore %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: pixmap cache - rilasciando %d pixmaps\n +$ #PixmapCacheLarge +# BImageControl::renderImage: cache e' grande, forzando pulizia\n +$ #ColorParseError +# BImageControl::getColor: errore nel parsing del colore: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: errore nella allocazione del colore: '%s'\n
A nls/it_IT/Makefile.am

@@ -0,0 +1,30 @@

+# nls/it_IT/Makefile.am for Fluxbox - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST= $(MFILES) + +all-local: blackbox.cat +install-data-local: blackbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/it_IT"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + $(INSTALL_DATA) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/it_IT; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/it_IT/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/it_IT; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/it_IT/Makefile.in

@@ -0,0 +1,221 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Fluxbox - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/it_IT/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.cat + @if test x$(NLSTEST) = "x-DNLS"; then \ + echo "Installing catalog in $(DESTDIR)$(pkgdatadir)/nls/it_IT"; \ + $(mkinstalldirs) $(DESTDIR)$(pkgdatadir)/nls/da_DK; \ + $(INSTALL_DATA) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/it_IT; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/it_IT/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/it_IT; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/it_IT/Screen.m

@@ -0,0 +1,54 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: e' accaduto un errore nella interrogazione del server X.\n \ +un altro window manager e' gia' attivo per il display %s.\n +$ #ManagingScreen +# BScreen::BScreen: usando schermo %d usando visuale 0x%lx, profondita' %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): non posso caricare il font '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): non posso caricare il font predefinito.\n +$ #EmptyMenuFile +# %s: file del menu vuoto\n +$ #xterm +# xterm +$ #Restart +# Restart +$ #Exit +# Exit +$ #EXECError +# BScreen::parseMenuFile: [exec] errore, etichetta/comando di menu' non specificato\n +$ #EXITError +# BScreen::parseMenuFile: [exit] errore, nessuna etichetta di menu' definita\n +$ #STYLEError +# BScreen::parseMenuFile: [style] errore, nessuna etichetta di menu' e/o nome di file \ +specificato\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] error, nessuna etichetta di menu' specificata\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] error, nessun nome di file specificato\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] error, '%s' non e' un file regolare\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] error, nessuna etichetta di menu' specificata\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] error, nessuna etichetta di menu' specificata\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] error, nessuna etichetta di menu' specificata\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, nessuna directory specificata\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, '%s' non e' una \ +directory\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] error, '%s' non esiste\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] error, nessuna etichetta di menu' specificata\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d +
A nls/it_IT/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Direzione Della Slit +$ #SlitPlacement +# Posizionamento Della Slit
A nls/it_IT/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Toolbar +$ #EditWkspcName +# Cambia il nome del workspace corrente +$ #ToolbarPlacement +# Posizionamento della Toolbar
A nls/it_IT/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: creando 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: XGetWindowAttributres fallito\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: non riesco a trovare lo schermo per la root window 0x%lx\n +$ #Unnamed +# Senza nome +$ #MapRequest +# BlackboxWindow::mapRequestEvent() per 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() per 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: reparent 0x%lx alla root\n
A nls/it_IT/Windowmenu.m

@@ -0,0 +1,22 @@

+$set 10 #Windowmenu + +$ #SendTo +# Manda A ... +$ #SendGroupTo +# Manda Gruppo A ... +$ #Shade +# Riduci A Barra +$ #Iconify +# Iconifica +$ #Maximize +# Massimizza +$ #Raise +# In Primo Piano +$ #Lower +# In Secondo Piano +$ #Stick +# Stick +$ #KillClient +# Killa Il Client +$ #Close +# Chiudi
A nls/it_IT/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Workspace %d
A nls/it_IT/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Workspaces +$ #NewWorkspace +# New Workspace +$ #RemoveLast +# Rimuovi L'ultimo
A nls/it_IT/blackbox.m

@@ -0,0 +1,7 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: no managable screens found, aborting\n +# Blackbox::Blackbox: nessun schermo gestibile, uscendo\n +$ #MapRequest +# Blackbox::process_event: MapRequest per 0x%lx\n
A nls/it_IT/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: errore: specicare una delle opzioni : -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> conneessione al display\n\ + -mod <x> <y> modula pattern\n\ + -foreground, -fg <color> colore del primo piano\n\ + -background, -bg <color> colore dello sfondo\n\n\ + -gradient <texture> texture del gradiente\n\ + -from <color> colore di partenza del gradiente\n\ + -to <color> colore finale del gradiente\n\n\ + -solid <color> colore solido\n\n\ + -help mostra questo messaggio ed esci\n +
A nls/it_IT/common.m

@@ -0,0 +1,57 @@

+$set 15 #Common + +$ #Yes +# Si +$ #No +# No + +$ #DirectionTitle +# Direzione +$ #DirectionHoriz +# Orizzontale +$ #DirectionVert +# Verticale + +$ #AlwaysOnTop +# Sempre In Primo Piano + +$ #PlacementTitle +# Posizionamento +$ #PlacementTopLeft +# Alto A Sinistra +$ #PlacementCenterLeft +# Centro A Sinistra +$ #PlacementBottomLeft +# Basso A Sinistra +$ #PlacementTopCenter +# Alto Al Centro +$ #PlacementBottomCenter +# Basso Al Centro +$ #PlacementTopRight +# Alto A Destra +$ #PlacementCenterRight +# Centro A Destra +$ #PlacementBottomRight +# Basso A Destra +$ #PlacementLeftTop +# Sinistra In Alto +$ #PlacementLeftCenter +# Sinistra Al Centro +$ #PlacementLeftBottom +# Sinistra In Basso +$ #PlacementRightTop +# Destra In Alto +$ #PlacementRightCenter +# Destra Al Centro +$ #PlacementRightBottom +# Destra In Basso +$ #PlacementTopRelative +# Relativo In Alto +$ #PlacementBottomRelative +# Relativo In Basso +$ #PlacementLeftRelative +# Relativo A Sinistra +$ #PlacementRightRelative +# Relativo A Destra +$ #AutoHide +# Nascondi Automaticamente
A nls/it_IT/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# errore: '-rc' richiede un argomento\n +$ #DISPLAYRequiresArg +# error: '-display' richiede un argomento\n +$ #WarnDisplaySet +# warning: non posso settare la variabile di ambiente 'DISPLAY'\n +$ #Usage +# Fluxkbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string>\t\tusa la connesione al display.\n\ + -rc <string>\t\t\tusa file di risorse alternativo.\n\ + -version\t\t\tmostra la versione ed esci.\n\ + -help\t\t\t\tmostra questo messaggio di aiuto ed esci.\n\n +$ #CompileOptions +# Opzioni Di Compilazione:\n\ + Debugging\t\t\t%s\n\ + Interlacing:\t\t\t%s\n\ + Shape:\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + 8bpp Ordered Dithering:\t%s\n\n
A nls/pt_BR/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: X erro: %s(%d) opcodes %d/%d\n recurso 0x%lx\n +$ #SignalCaught +# %s: recebeido sinal %d\n +$ #ShuttingDown +# desligando\n +$ #Aborting +# abortando... gerando arquivo core\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: conecção ao servidor X falhou.\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: impossivel marcar a conexão ao display como close-on-exec\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): removendo má janela da trilha de eventos\n
A nls/pt_BR/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Menu Blackbox
A nls/pt_BR/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Configurações +$ #FocusModel +# Modelo de Foco +$ #WindowPlacement +# Posicionamento das Janelas +$ #ImageDithering +# Simulação de Cores em Imagens +$ #OpaqueMove +# Movimento Opaco de Janelas +$ #FullMax +# Maximização Total +$ #FocusNew +# Foco em Novas Janelas +$ #FocusLast +# Foco na Ultima Janela Da Area de Trabalho +$ #ClickToFocus +# Foco na Janela Quando Clicada +$ #SloppyFocus +# Foco na Janela Quando Apontada +$ #AutoRaise +# Sobrepor Janela Quando Ativa +$ #SmartRows +# Posicionamento em Fila +$ #SmartCols +# Posicionamento em Coluna +$ #Cascade +# Posicionamento em Cascata +$ #LeftRight +# Esquerda para Direita +$ #RightLeft +# Direita para Esquerda +$ #TopBottom +# Cima para Baixo +$ #BottomTop +# Baixo para Cima +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabPlacement +# Tab Placement +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/pt_BR/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Icones
A nls/pt_BR/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: erro criando pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: erro criando XImage\n +$ #UnsupVisual +# BImage::renderXImage: visual não suportado\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: erro criando pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: mapa de cores de tamanho invalido %d (%d/%d/%d) - reduzindo\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: erro localizando mapa de cores\n +$ #ColorAllocFail +# BImageControl::BImageControl: falha localizando cor %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: reserva de pixmap cheia - liberando %d pixmaps\n +$ #PixmapCacheLarge +# BImageControl::renderImage: reserva cheia, forçando limpeza\n +$ #ColorParseError +# BImageControl::getColor: color parse error: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: erro localizando cor: '%s'\n
A nls/pt_BR/Makefile.am

@@ -0,0 +1,29 @@

+# nls/pt_BR/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST=$(MFILES) +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/pt_BR; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/pt_BR/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/pt_BR; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/pt_BR/Makefile.in

@@ -0,0 +1,220 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/pt_BR/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/pt_BR; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/pt_BR/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/pt_BR; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/pt_BR/Screen.m

@@ -0,0 +1,52 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: um erro occorreu enquanto chamando o servidor X.\n \ +existe outro window menager rodando no display. %s.\n +$ #ManagingScreen +# BScreen::BScreen: managing screen %d using visual 0x%lx, depth %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): impossivel carregar fonte '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): impossivel carregar fonte padrão.\n +$ #EmptyMenuFile +# %s: arquivo de menu vazio\n +$ #xterm +# xterm +$ #Restart +# Reiniciar +$ #Exit +# Sair +$ #EXECError +# BScreen::parseMenuFile: [exec] erro, não há indicação definida no menu e/ou comando definido\n +$ #EXITError +# BScreen::parseMenuFile: [exit] erro, não há indicação definida no menu\n +$ #STYLEError +# BScreen::parseMenuFile: [style] erro, não há indicação de menu e/ou nome de arquivo difinido\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] erro, não há indicação definida no menu\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] erro, nome de arquivo não definido\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] error, '%s' não é um arquivo regular\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] erro, não há indicação definida no menu\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] erro, não há indicação definida no menu\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] erro, não há indicação definida no menu\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] erro, não há diretorio difinido\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] erro, '%s' não é um diretorio\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] erro, '%s' não existe\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] erro, não há indicação definida no menu\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d +
A nls/pt_BR/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Direção +$ #SlitPlacement +# Posicionamento
A nls/pt_BR/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Toolbar +$ #EditWkspcName +# Renomear Area de Trabalho +$ #ToolbarPlacement +# Posicionamento
A nls/pt_BR/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: criando 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: XGetWindowAttributres falhou\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: impossivel encontrar tela para janela 0x%lx\n +$ #Unnamed +# Sem Nome +$ #MapRequest +# BlackboxWindow::mapRequestEvent() para 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() para 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: reparent 0x%lx to root\n
A nls/pt_BR/Windowmenu.m

@@ -0,0 +1,20 @@

+$set 10 #Windowmenu + +$ #SendTo +# Enviar Para ... +$ #Shade +# Encolher +$ #Iconify +# Minimizar +$ #Maximize +# Maximizar +$ #Raise +# Focalizar +$ #Lower +# Desfocalizar +$ #Stick +# Sempre Visivel +$ #KillClient +# Kill Cliente +$ #Close +# Fechar
A nls/pt_BR/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Area de Trabalho %d
A nls/pt_BR/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Areas de Trabalho +$ #NewWorkspace +# Nova Area de Trabalho +$ #RemoveLast +# Remover Ultima
A nls/pt_BR/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: não foram encontradas telas administraveis, abortando..\n +$ #MapRequest +# Blackbox::process_event: MapRequest para 0x%lx\n
A nls/pt_BR/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: erro: necessario especificar um dos seguintes argumentos: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> conexão com display\n\ + -mod <x> <y> modula pattern\n\ + -foreground, -fg <color> modula foreground color\n\ + -background, -bg <color> modula background color\n\n\ + -gradient <texture> textura gradiente\n\ + -from <color> cor de inicio do gradiente\n\ + -to <color> com do fim do gradiente\n\n\ + -solid <color> cor solida\n\n\ + -help mostra essa ajuda e sai\n +
A nls/pt_BR/common.m

@@ -0,0 +1,58 @@

+$set 15 #Common + +$ #Yes +# Sim +$ #No +# Não + +$ #DirectionTitle +# Direção +$ #DirectionHoriz +# Horizontal +$ #DirectionVert +# Vertical + +$ #AlwaysOnTop +# Sempre Visivel + +$ #PlacementTitle +# Posicionamento +$ #PlacementTopLeft +# No Alto a Esquerda +$ #PlacementCenterLeft +# No Centro a Esquerda +$ #PlacementBottomLeft +# Em Baixo a Esquerda +$ #PlacementTopCenter +# No Alto e no Centro +$ #PlacementBottomCenter +# Em Baixo e no Centro +$ #PlacementTopRight +# No Alto a Direita +$ #PlacementCenterRight +# No Meio a Direita +$ #PlacementBottomRight +# Em Baixo a Direita +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #PlacementRightCenter +# Right Center +$ #PlacementRightBottom +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative + +$ #AutoHide +# Auto hide
A nls/pt_BR/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# erro: '-rc' requer um argumento\n +$ #DISPLAYRequiresArg +# erro: '-display' requer um argumento\n +$ #WarnDisplaySet +# aviso: não foi possivel setar a variavel de ambiente 'DISPLAY'\n +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string>\t\tusar conexão com o display.\n\ + -rc <string>\t\t\tusar arquivo alternativo de recursos.\n\ + -version\t\t\tmostrar versao e sair.\n\ + -help\t\t\t\tmostrar esta ajuda e sair.\n\n +$ #CompileOptions +# Opções em tempo de compilação:\n\ + Informações extras para problemas:\t\t\t%s\n\ + Interlacing:\t\t\t%s\n\ + Forma:\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + 8bpp Simulação ordenada de cores em imagens:\t%s\n\n
A nls/ru_RU/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: ÏÛÉÂËÁ X ÓÅÒ×ÅÒÁ: %s(%d) ÚÎÁÞÅÎÉÑ %d/%d\n ÒÅÓÕÒÓ 0x%lx\n +$ #SignalCaught +# %s: ÐÏÌÕÞÅÎ ÓÉÇÎÁÌ %d \n +$ #ShuttingDown +# ÏÔËÌÀÞÅÎÉÅ\n +$ #Aborting +# ïÔÍÅÎÁ... ÓÏÚÄÁÅÔÓÑ ÄÁÍÐ core\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: ÓÏÅÄÉÎÅÎÉÅ Ó X ÓÅÒ×ÅÒÏÍ ÐÒÏ×ÁÌÅÎÏ.\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: ÎÅÔ ×ÏÚÍÏÖÎÏÓÔÉ ÐÏÍÅÔÉÔØ ÁËÔÉ×ÎÙÊ ÄÉÓÐÌÅÊ ËÁË "ÚÁËÒÙÔÙÊ-ÎÁ-ÉÓÐÏÌÎÅÎÉÅ"\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): ÐÌÏÈÏÅ ÏËÎÏ ÕÄÁÌÑÅÔÓÑ ÉÚ ÏÞÅÒÅÄÉ ÓÏÂÙÔÉÊ\n
A nls/ru_RU/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# íÅÎÀ BlackBox
A nls/ru_RU/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# ëÏÎÆÉÇÕÒÁÃÉÑ +$ #FocusModel +# íÏÄÅÌØ ÆÏËÕÓÉÒÏ×ËÉ +$ #WindowPlacement +# ðÏÌÏÖÅÎÉÅ ÏËÎÁ +$ #ImageDithering +# Image Dithering +$ #OpaqueMove +# ðÅÒÅÍÅÝÅÎÉÅ ÚÁÐÏÌÎÅÎÎÙÈ ÏËÏÎ +$ #FullMax +# ðÏÌÎÁÑ ÍÁËÓÉÍÉÚÁÃÉÑ +$ #FocusNew +# ðÅÒÅÍÅÝÁÔØ ÆÏËÕÓ ÎÁ ÎÏ×ÙÅ ÏËÎÁ +$ #FocusLast +# æÏËÕÓ ÎÁ ÐÏÓÌÅÄÎÅÅ ÏËÎÏ ÒÁÂÏÞÅÇÏ ÓÔÏÌÁ +$ #ClickToFocus +# æÏËÕÓ ÐÏ ÝÅÌÞËÕ +$ #SloppyFocus +# æÏËÕÓ ÐÏ ÐÅÒÅÍÅÝÅÎÉÀ +$ #AutoRaise +# á×ÔÏ×ÓÐÌÙÔÉÅ +$ #SmartRows +# "õÍÎÏÅ" ÒÁÓÐÏÌÏÖÅÎÉÅ (ÐÏ ÇÏÒÉÚÏÎÔÁÌÉ) +$ #SmartCols +# "õÍÎÏÅ" ÒÁÓÐÏÌÏÖÅÎÉÅ (ÐÏ ×ÅÒÔÉËÁÌÉ) +$ #Cascade +# ëÁÓËÁÄÏÍ +$ #LeftRight +# óÌÅ×Á ÎÁÐÒÁ×Ï +$ #RightLeft +# óÐÒÁ×Á ÎÁÌÅ×Ï +$ #TopBottom +# ó×ÅÒÈÕ ×ÎÉÚ +$ #BottomTop +# óÎÉÚÕ ××ÅÒÈ +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabPlacement +# Tab Placement +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/ru_RU/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# ó×ÅÒÎÕÔÙÅ\nÏËÎÁ
A nls/ru_RU/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: ÏÛÉÂËÁ ÓÏÚÄÁÎÉÑ pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: ÏÛÉÂËÁ ÓÏÚÄÁÎÉÑ XImage\n +$ #UnsupVisual +# BImage::renderXImage: ÎÅÐÏÄÄÅÒÖÉ×ÁÅÍÙÊ ÔÉÐ ×ÉÚÕÁÌÉÚÁÃÉÉ\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: ÏÛÉÂËÁ ÓÏÚÄÁÎÉÑ pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: ÎÅ×ÅÒÎÙÊ ÒÁÚÍÅÒ ÔÁÂÌÉÃÙ Ã×ÅÔÏ× %d (%d/%d/%d) - ÕÄÁÌÑÅÔÓÑ\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: ÏÛÉÂËÁ ÒÁÚÍÅÝÅÎÉÑ ÔÁÂÌÉÃÙ Ã×ÅÔÏ×\n +$ #ColorAllocFail +# BImageControl::BImageControl: ÎÅ×ÏÚÍÏÖÎÏ ÒÁÚÍÅÓÔÉÔØ Ã×ÅÔ %d/%d/%d × ÐÁÍÑÔÉ\n +$ #PixmapRelease +# BImageControl::~BImageControl: ËÜÛ ÔÏÞÅÞÎÙÈ ÉÚÏÂÒÁÖÅÎÉÊ - ÏÓ×ÏÂÏÖÄÁÅÔÓÑ %d ÂÌÏËÏ×\n +$ #PixmapCacheLarge +# BImageControl::renderImage: ÐÅÒÅÐÏÌÎÅÎÉÅ ËÜÛÁ, ÐÒÏÉÚ×ÏÄÉÔÓÑ ÂÙÓÔÒÁÑ ÏÞÉÓÔËÁ\n +$ #ColorParseError +# BImageControl::getColor: ÏÛÉÂËÁ ÒÁÚÂÏÒÁ ÓÔÒÏËÉ, ÏÐÉÓÙ×ÁÀÝÅÊ Ã×ÅÔ: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: ÏÛÉÂËÁ ÒÁÚÍÅÝÅÎÉÑ Ã×ÅÔÁ × ÐÁÍÑÔÉ: '%s'\n
A nls/ru_RU/Makefile.am

@@ -0,0 +1,29 @@

+# nls/ru_RU/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST=$(MFILES) +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/ru_RU; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/ru_RU/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/ru_RU; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/ru_RU/Makefile.in

@@ -0,0 +1,220 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/ru_RU/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/ru_RU; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/ru_RU/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/ru_RU; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/ru_RU/Screen.m

@@ -0,0 +1,52 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: ÐÒÏÉÚÏÛÌÁ ÏÛÉÂËÁ ÐÒÉ ÏÂÒÁÝÅÎÉÉ Ë X ÓÅÒ×ÅÒÕ.\n \ +ÄÒÕÇÏÊ ÍÅÎÅÄÖÅÒ ÏËÏÎ ÕÖÅ ÚÁÐÕÝÅÎ ÎÁ ÄÉÓÐÌÅÅ %s.\n +$ #ManagingScreen +# BScreen::BScreen: ÏÂÓÌÕÖÉ×ÁÅÔÓÑ ÜËÒÁÎ %d, ÉÓÐÏÌØÚÕÅÍÙÊ ÔÉÐ ×ÉÚÕÁÌÉÚÁÃÉÉ 0x%lx, ÇÌÕÂÉÎÁ Ã×ÅÔÁ %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): ÎÅÔ ×ÏÚÍÏÖÎÏÓÔÉ ÚÁÇÒÕÚÉÔØ ÛÒÉÆÔ '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): ÎÅÔ ×ÏÚÍÏÖÎÏÓÔÉ ÚÁÇÒÕÚÉÔØ ÐÒÅÄÏÐÒÅÄÅÌÅÎÎÙÊ ÛÒÉÆÔ.\n +$ #EmptyMenuFile +# %s: ÐÕÓÔÏÊ ÆÁÊÌ ÍÅÎÀ\n +$ #xterm +# Xterm +$ #Restart +# ðÅÒÅÚÁÐÕÓË +$ #Exit +# ÷ÙÈÏÄ +$ #EXECError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [exec], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ É/ÉÌÉ ÎÁÚ×ÁÎÉÅ ËÏÍÍÁÎÄÙ\n +$ #EXITError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [exit], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ\n +$ #STYLEError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [style], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ É/ÉÌÉ ÉÍÑ ÆÁÊÌÁ\n +$ #CONFIGError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [config], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ\n +$ #INCLUDEError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [include], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÉÍÑ ÆÁÊÌÁ\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: ÏÛÉÂËÁ [include], '%s' ÎÅ ÏÂÙÞÎÙÊ ÆÁÊÌ\n +$ #SUBMENUError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [submenu], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ\n +$ #RESTARTError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [restart], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ\n +$ #RECONFIGError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [reconfig], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ\n +$ #STYLESDIRError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [stylesdir/stylesmenu], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÉÍÑ ÄÉÒÅËÔÏÒÉÉ\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: ÏÛÉÂËÁ [stylesdir/stylesmenu], '%s' ÎÅ ÄÉÒÅËÔÏÒÉÑ\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: ÏÛÉÂËÁ [stylesdir/stylesmenu], '%s' ÎÅ ÓÕÝÅÓÔ×ÕÅÔ\n +$ #WORKSPACESError +# BScreen::parseMenuFile: ÏÛÉÂËÁ [workspaces], ÎÅ ÏÐÒÅÄÅÌÅÎÏ ÎÁÚ×ÁÎÉÅ ÐÕÎËÔÁ ÍÅÎÀ\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d +
A nls/ru_RU/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# äÏËÅÒ +$ #SlitDirection +# ïÒÉÅÎÔÁÃÉÑ ÄÏËÅÒÁ +$ #SlitPlacement +# íÅÓÔÏÐÏÌÏÖÅÎÉÑ ÄÏËÅÒÁ
A nls/ru_RU/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# ÐÐ +$ #NoStrftimeTimeFormatA +# ÄÐ +$ #ToolbarTitle +# ôÕÌÂÁÒ +$ #EditWkspcName +# òÅÄÁËÔÉÒÏ×ÁÔØ ÉÍÑ ÔÅËÕÝÅÇÏ ÒÁÂÏÞÅÇÏ ÓÔÏÌÁ +$ #ToolbarPlacement +# íÅÓÔÏÐÏÌÏÖÅÎÉÅ ÔÕÌÂÁÒÁ
A nls/ru_RU/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: ÓÏÚÄÁÅÔÓÑ 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: ÐÒÏ×ÁÌÅÎ ÐÒÏÃÅÓÓ XGetWindowAttributres\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: ÎÅÔ ×ÏÚÍÏÖÎÏÓÔÉ ÎÁÊÔÉ ÜËÒÁÎ ÄÌÑ ËÏÒÎÅ×ÏÇÏ ÏËÎÁ 0x%lx\n +$ #Unnamed +# âÅÚÙÍÑÎÎÏÅ +$ #MapRequest +# BlackboxWindow::mapRequestEvent() ÄÌÑ 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() ÄÌÑ 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: reparent 0x%lx to root\n
A nls/ru_RU/Windowmenu.m

@@ -0,0 +1,20 @@

+$set 10 #Windowmenu + +$ #SendTo +# ïÔÐÒÁ×ÉÔØ ÎÁ ... +$ #Shade +# ó×ÅÒÎÕÔØ × ÚÁÇÏÌÏ×ÏË +$ #Iconify +# ó×ÅÒÎÕÔØ × ÉËÏÎËÕ +$ #Maximize +# íÁËÓÉÍÉÚÉÒÏ×ÁÔØ +$ #Raise +# ðÏÄÎÑÔØ ÎÁ×ÅÒÈ +$ #Lower +# ïÐÕÓÔÉÔØ ×ÎÉÚ +$ #Stick +# ðÒÉËÌÅÉÔØ +$ #KillClient +# õÂÉÔØ ËÌÉÅÎÔÓËÏÅ ÐÒÉÌÏÖÅÎÉÅ +$ #Close +# úÁËÒÙÔØ
A nls/ru_RU/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# òÁÂÏÞÉÊ ÓÔÏÌ %d
A nls/ru_RU/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# òÁÂÏÞÉÅ ÓÔÏÌÙ +$ #NewWorkspace +# îÏ×ÙÊ ÒÁÂÏÞÉÊ ÓÔÏÌ +$ #RemoveLast +# õÄÁÌÉÔØ ÐÏÓÌÅÄÎÉÊ
A nls/ru_RU/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: ÎÅ ÎÁÊÄÅÎÏ ÜËÒÁÎÏ× ÄÌÑ ÏÂÓÌÕÖÉ×ÁÎÉÑ, ÏÔÍÅÎÁ...\n +$ #MapRequest +# Blackbox::process_event: MapRequest for 0x%lx\n
A nls/ru_RU/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: ÏÛÉÂËÁ: ÎÅÏÂÈÏÄÉÍÏ ÚÁÄÁÔØ ÏÄÉÎ ÉÚ ÓÌÅÄÕÀÝÉÈ ËÌÀÞÅÊ: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> ÓÏÅÄÉÎÅÎÉÅ Ó ÄÉÓÐÌÅÅÍ\n\ + -mod <x> <y> ÍÁËÅÔ ËÌÅÔËÉ\n\ + -foreground, -fg <color> Ã×ÅÔ ÐÅÒÅÄÎÅÇÏ ÐÌÁÎÁ ËÌÅÔËÉ\n\ + -background, -bg <color> Ã×ÅÔ ÆÏÎÁ ËÌÅÔËÉ\n\n\ + -gradient <texture> ÇÒÁÄÉÅÎÔ\n\ + -from <color> ÎÁÞÁÌØÎÙÊ Ã×ÅÔ ÇÒÁÄÉÅÎÔÁ\n\ + -to <color> ËÏÎÅÞÎÙÊ Ã×ÅÔ ÇÒÁÄÉÅÎÔÁ\n\n\ + -solid <color> ÓÐÌÏÛÎÏÊ Ã×ÅÔ\n\n\ + -help ×Ù×ÅÓÔÉ ÜÔÕ ÐÏÄÓËÁÚËÕ É ×ÙÊÔÉ\n +
A nls/ru_RU/common.m

@@ -0,0 +1,58 @@

+$set 15 #Common + +$ #Yes +# äÁ +$ #No +# îÅÔ + +$ #DirectionTitle +# îÁÐÒÁ×ÌÅÎÉÅ +$ #DirectionHoriz +# ðÏ ÇÏÒÉÚÏÎÔÁÌÉ +$ #DirectionVert +# ðÏ ×ÅÒÔÉËÁÌÉ + +$ #AlwaysOnTop +# ÷ÓÅÇÄÁ ÎÁ×ÅÒÈÕ + +$ #PlacementTitle +# íÅÓÔÏÐÏÌÏÖÅÎÉÅ +$ #PlacementTopLeft +# óÌÅ×Á ××ÅÒÈÕ +$ #PlacementCenterLeft +# óÌÅ×Á ÐÏ ÃÅÎÔÒÕ +$ #PlacementBottomLeft +# óÌÅ×Á ×ÎÉÚÕ +$ #PlacementTopCenter +# ó×ÅÒÈÕ ÐÏ ÃÅÎÔÒÕ +$ #PlacementBottomCenter +# óÎÉÚÕ ÐÏ ÃÅÎÔÒÕ +$ #PlacementTopRight +# óÐÒÁ×Á Ó×ÅÒÈÕ +$ #PlacementCenterRight +# óÐÒÁ×Á ÐÏ ÃÅÎÔÒÕ +$ #PlacementBottomRight +# óÐÒÁ×Á ×ÎÉÚÕ +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #PlacementRightCenter +# Right Center +$ #PlacementRightBottom +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative + +$ #AutoHide +# Auto hide
A nls/ru_RU/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# ÏÛÉÂËÁ: '-rc' ÔÒÅÂÕÅÔ ÎÁÌÉÞÉÅ ÁÒÇÕÍÅÎÔÁ\n +$ #DISPLAYRequiresArg +# ÏÛÉÂËÁ: '-display' ÔÒÅÂÕÅÔ ÎÁÌÉÞÉÅ ÁÒÇÕÍÅÎÔÁ\n +$ #WarnDisplaySet +# ÐÒÅÄÕÐÒÅÖÄÅÎÉÅ: ÎÅ×ÏÚÍÏÖÎÏ ÕÓÔÁÎÏ×ÉÔØ ÐÅÒÅÍÅÎÎÕÀ ÏËÒÕÖÅÎÉÑ 'DISPLAY'\n +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string>\t\tÉÓÐÏÌØÚÏ×ÁÔØ ÚÁÄÁÎÎÙÊ ÄÉÓÐÌÅÊ.\n\ + -rc <string>\t\t\tÉÓÐÏÌØÚÏ×ÁÔØ ÁÌØÔÅÒÎÁÔÉ×ÎÙÊ ÆÁÊÌ ÒÅÓÕÒÓÏ×.\n\ + -version\t\t\t×Ù×ÅÓÔÉ ÎÏÍÅÒ ×ÅÒÓÉÉ É ×ÙÊÔÉ.\n\ + -help\t\t\t\t×Ù×ÅÓÔÉ ÜÔÕ ÐÏÄÓËÁÚËÕ É ×ÙÊÔÉ.\n\n +$ #CompileOptions +# Compile time options:\n\ + Debugging\t\t\t%s\n\ + Interlacing:\t\t\t%s\n\ + Shape:\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + 8bpp Ordered Dithering:\t%s\n\n
A nls/sv_SE/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s: X-fel: %s(%d) opkod %d/%d\n resurs 0x%lx\n +$ #SignalCaught +# %s: signal %d fångad\n +$ #ShuttingDown +# stänger ner\n +$ #Aborting +# avbryter... dumpar kärna\n +$ #XConnectFail +# BaseDisplay::BaseDisplay: anslutning till X server misslyckades.\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay: kunde inte markera skärmanslutning som stäng-vid-exekvering\n +$ #BadWindowRemove +# BaseDisplay::eventLoop(): tar bort dåligt fönster från händelsekön\n
A nls/sv_SE/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Blackboxmeny
A nls/sv_SE/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Inställningar +$ #FocusModel +# Fokusmodell +$ #WindowPlacement +# Fönsterplacering +$ #ImageDithering +# Bilddithering +$ #OpaqueMove +# Ogenomskinlig fönsterförflyttning +$ #FullMax +# Full maximering +$ #FocusNew +# Fokus på nya fönster +$ #FocusLast +# Fokusera fönster vid skrivbordsbyte +$ #ClickToFocus +# Klicka för fokus +$ #SloppyFocus +# Hafsig fokus +$ #AutoRaise +# Höj automatiskt +$ #SmartRows +# Smart placering (Rader) +$ #SmartCols +# Smart placering (Kolumner) +$ #Cascade +# Kaskadplacering +$ #LeftRight +# Från vänster +$ #RightLeft +# Från höger +$ #TopBottom +# Uppifrån +$ #BottomTop +# Nerifrån +$ #Tabs +# Använd Flikar +$ #Icons +# Använd Ikoner +$ #TabPlacement +# Flik Placering +$ #TabRotateVertical +# Rotera Vertikala Flikar +$ #SemiSloppyFocus +# Halv hafsig fokus
A nls/sv_SE/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Ikoner
A nls/sv_SE/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid: fel under skapande av pixmap\n +$ #ErrorCreatingXImage +# BImage::renderXImage: fel under skapande av XImage\n +$ #UnsupVisual +# BImage::renderXImage: ej stöd för färgdjup\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap: fel under skapande av pixmap\n +$ #InvalidColormapSize +# BImageControl::BImageControl: ogiltig färgkarta storlek %d (%d/%d/%d) - reducerar\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl: fel under allokering av färgkarta\n +$ #ColorAllocFail +# BImageControl::BImageControl: misslyckades att allokera färg %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl: pixmap cache - släpper %d pixmappar\n +$ #PixmapCacheLarge +# BImageControl::renderImage: stor cache, tvingar upprensning\n +$ #ColorParseError +# BImageControl::getColor: färgfel: '%s'\n +$ #ColorAllocError +# BImageControl::getColor: färgallokeringsfel: '%s'\n
A nls/sv_SE/Makefile.am

@@ -0,0 +1,30 @@

+# nls/sv_SE/Makefile.am for Blackbox-0.61.x - an X11 Window Manager + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST=$(MFILES) + +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/sv_SE; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/sv_SE/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/sv_SE; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/sv_SE/Makefile.in

@@ -0,0 +1,221 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/sv_SE/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/sv_SE; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/sv_SE/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/sv_SE; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/sv_SE/Screen.m

@@ -0,0 +1,52 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen: ett fel inträffade under en förfrågan till X servern.\n \ +en annan fönsterhanterare körs redan på skärmen %s.\n +$ #ManagingScreen +# BScreen::BScreen: hanterar skärm %d med visuell 0x%lx, färgdjup %d\n +$ #FontLoadFail +# BScreen::LoadStyle(): kunde inte ladda font '%s'\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): kunde inte ladda standardfont.\n +$ #EmptyMenuFile +# %s: tom menyfil\n +$ #xterm +# xterm +$ #Restart +# Starta om +$ #Exit +# Avsluta +$ #EXECError +# BScreen::parseMenuFile: [exec] fel, ingen menyetikett och/eller kommando definierat\n +$ #EXITError +# BScreen::parseMenuFile: [exit] fel, ingen menyetikett definierad\n +$ #STYLEError +# BScreen::parseMenuFile: [style] fel, ingen menyetikett och/eller filnamn definierat\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] fel, ingen menyetikett definierad\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] fel, inget filnamn definierat\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] fel, '%s' är inte en vanlig fil\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] fel, ingen menyetikett definierad\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] fel, ingen menyetikett definiera\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] fel, ingen menyetikett definierad\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] fel, ingen katalog definierad\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] fel, '%s' är inte en katalog\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] fel, '%s' existerar inte\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] fel, ingen menyetikett definierad\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# W: %4d x H: %4d +
A nls/sv_SE/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Slitriktning +$ #SlitPlacement +# Slitplacering
A nls/sv_SE/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Verktygslist +$ #EditWkspcName +# Ändra namn på skrivbordet +$ #ToolbarPlacement +# Verktygslistens placering
A nls/sv_SE/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow: skapar 0x%lx\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow: XGetWindowAttributes misslyckades\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow: kan inte hitta skärm för rootfönster 0x%lx\n +$ #Unnamed +# Inget namn +$ #MapRequest +# BlackboxWindow::mapRequestEvent() för 0x%lx\n +$ #UnmapNotify +# BlackboxWindow::unmapNotifyEvent() för 0x%lx\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: återför 0x%lx till root\n
A nls/sv_SE/Windowmenu.m

@@ -0,0 +1,22 @@

+$set 10 #Windowmenu + +$ #SendTo +# Skicka till... +$ #SendGroupTo +# Skicka grupp till... +$ #Shade +# Skugga +$ #Iconify +# Ikonifiera +$ #Maximize +# Maximera +$ #Raise +# Höj +$ #Lower +# Sänk +$ #Stick +# Klibbig +$ #KillClient +# Döda klient +$ #Close +# Stäng
A nls/sv_SE/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Skrivbord %d
A nls/sv_SE/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Skrivbord +$ #NewWorkspace +# Nytt skrivbord +$ #RemoveLast +# Ta bort sista
A nls/sv_SE/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: inga hanterbara skärmar hittades, avslutar\n +$ #MapRequest +# Blackbox::process_event: MapRequest för 0x%lx\n
A nls/sv_SE/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s: fel: måste specifiera en av: -solid, -mod, -gradient\n +$ #Usage +# %s 2.0: (c) 1997-2000 Brad Hughes\n\n\ + -display <string> skärmanslutning\n\ + -mod <x> <y> modulamönster\n\ + -foreground, -fg <color> förgrundsfärg för modulamönster\n\ + -background, -bg <color> bakgrundsfärg för modulamönster\n\n\ + -gradient <texture> texturlutning\n\ + -from <color> startfärg\n\ + -to <color> slutfärg\n\n\ + -solid <color> solid färg\n\n\ + -help visa denna hjälptext och avsluta\n +
A nls/sv_SE/common.m

@@ -0,0 +1,58 @@

+$set 15 #Common + +$ #Yes +# Ja +$ #No +# Nej + +$ #DirectionTitle +# Riktning +$ #DirectionHoriz +# Horisontell +$ #DirectionVert +# Vertikal + +$ #AlwaysOnTop +# Alltid överst + +$ #PlacementTitle +# Placering +$ #PlacementTopLeft +# Uppe till vänster +$ #PlacementCenterLeft +# Mitten till vänster +$ #PlacementBottomLeft +# Nere till vänster +$ #PlacementTopCenter +# Uppe i mitten +$ #PlacementBottomCenter +# Nere i mitten +$ #PlacementTopRight +# Uppe till höger +$ #PlacementCenterRight +# Mitten till höger +$ #PlacementBottomRight +# Nere till höger +$ #PlacementLeftTop +# Till vänster uppe +$ #PlacementLeftCenter +# Till vänster i mitten +$ #PlacementLeftBottom +# Till vänster nere +$ #PlacementRightTop +# Till höger uppe +$ #PlacementRightCenter +# Till höger i mitten +$ #PlacementRightBottom +# Till höger nere +$ #PlacementTopRelative +# Utdragen uppe +$ #PlacementBottomRelative +# Utdragen nere +$ #PlacementLeftRelative +# Till vänster utdragen +$ #PlacementRightRelative +# Till höger utdragen + +$ #AutoHide +# Göm automatiskt
A nls/sv_SE/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# fel: '-rc' kräver ett argument\n +$ #DISPLAYRequiresArg +# fel: '-display' kräver ett argument\n +$ #WarnDisplaySet +# varning: kunde inte sätta variabeln 'DISPLAY'\n +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <string>\t\tanvänd skärmanslutning.\n\ + -rc <string>\t\t\tanvänd alternativ resursfil.\n\ + -version\t\t\tvisa version och avsluta.\n\ + -help\t\t\t\tvisa denna hjälptext och avsluta.\n\n +$ #CompileOptions +# Kompilerad med:\n\ + Avlusning\t\t\t%s\n\ + Interlacing:\t\t\t%s\n\ + Form:\t\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + 8bpp ordnad dithering:\t%s\n\n
A nls/tr_TR/BaseDisplay.m

@@ -0,0 +1,16 @@

+$set 1 #BaseDisplay + +$ #XError +# %s : X hatasý : %s ( %d ) opkodlar %d/%d\n kaynak 0x%lx\n +$ #SignalCaught +# %s : %d sinyali alýndý \n +$ #ShuttingDown +# kapatýlýyorum\n +$ #Aborting +# kapatýlýyorum ... çöküntüyü býrakýyorum\n +$ #XConnectFail +# BaseDisplay::BaseDisplay : X sunucusuna baðlanýlýnamadý .\n +$ #CloseOnExecFail +# BaseDisplay::BaseDisplay : çalýþtýrýrken kapatmada ekrana baðlanýlýnamadý \n +$ #BadWindowRemove +# BaseDisplay::eventLoop() : eylem kuyruðundaki 'kötü' pencereyi siliyorum \n
A nls/tr_TR/Basemenu.m

@@ -0,0 +1,4 @@

+$set 2 #Basemenu + +$ #BlackboxMenu +# Blackbox mönüsü
A nls/tr_TR/Configmenu.m

@@ -0,0 +1,48 @@

+$set 3 #Configmenu + +$ #ConfigOptions +# Ayarlar +$ #FocusModel +# Foküsleme +$ #WindowPlacement +# Pencere yerleþimi +$ #ImageDithering +# Resim oluþturmasý +$ #OpaqueMove +# Ekraný içerikli taþý +$ #FullMax +# Tam ekranla, vallahi +$ #FocusNew +# Yeni pencereleri foküsle +$ #FocusLast +# Masaüstündeki son pencereyi foküsle +$ #ClickToFocus +# Týklayarak foküsle +$ #SloppyFocus +# Aðýr foküsle +$ #AutoRaise +# Otomatikman yükselt +$ #SmartRows +# Akýllý yerleþim( Sýralar ) +$ #SmartCols +# Akýllý yerleþim( Sütunlar ) +$ #Cascade +# Cascade Placement +$ #LeftRight +# Soldan saða +$ #RightLeft +# Saðdan sola +$ #TopBottom +# Üstten aþaða +$ #BottomTop +# Alttan üste +$ #Tabs +# Use Tabs +$ #Icons +# Use Icons +$ #TabPlacement +# Tab Placement +$ #TabRotateVertical +# Rotate Vertical Tabs +$ #SemiSloppyFocus +# Semi Sloppy Focus
A nls/tr_TR/Icon.m

@@ -0,0 +1,4 @@

+$set 4 #Icon + +$ #Icons +# Ikonalar
A nls/tr_TR/Image.m

@@ -0,0 +1,24 @@

+$set 5 #Image + +$ #ErrorCreatingSolidPixmap +# BImage::render_solid : resmi yaratamadým\n +$ #ErrorCreatingXImage +# BImage::renderXImage : XImage'i yaratamadým\n +$ #UnsupVisual +# BImage::renderXImage : desteklenmeyen görünüþ( renk derinliði )\n +$ #ErrorCreatingPixmap +# BImage::renderPixmap : resmi yaratamadým\n +$ #InvalidColormapSize +# BImageControl::BImageControl : geçersiz renk haritasý büyüklüðü %d (%d/%d/%d) - azaltýyorum\n +$ #ErrorAllocatingColormap +# BImageControl::BImageControl : renk haritasý ayrýlanamadý\n +$ #ColorAllocFail +# BImageControl::BImageControl : rengi ayrýrken hata oldu : %d/%d/%d\n +$ #PixmapRelease +# BImageControl::~BImageControl : resim arabelleði - %d resim temizlendi\n +$ #PixmapCacheLarge +# BImageControl::renderImage : arabellek büyük, temizlemeye baþlýyorum\n +$ #ColorParseError +# BImageControl::getColor : renk tarama hatasý : '%s'\n +$ #ColorAllocError +# BImageControl::getColor : renk ayýrma hatasý : '%s'\n
A nls/tr_TR/Makefile.am

@@ -0,0 +1,34 @@

+# nls/tr_TR/Makefile.am for Blackbox-0.61.x - an X11 Window Manager +# +# -- Türkce tercüme dizini için bir yapim-dosya-tabaný +# kabalak -- kabalak@gmx.net +# + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST=$(MFILES) + +all-local: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/tr_TR; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/tr_TR/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/tr_TR; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi
A nls/tr_TR/Makefile.in

@@ -0,0 +1,225 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 Blackbox-0.61.x - an X11 Window Manager +# +# -- 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +NLSTEST = @NLS@ +CLEANFILES = blackbox.cat +MAINTAINERCLEANFILES = Makefile.in Translation.m +MFILES = BaseDisplay.m Basemenu.m Configmenu.m Icon.m Image.m Screen.m Slit.m Toolbar.m Window.m Windowmenu.m Workspace.m Workspacemenu.m blackbox.m common.m main.m bsetroot.m +EXTRA_DIST = $(MFILES) +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 --include-deps nls/tr_TR/Makefile + +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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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]* + +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 + -rm -f libtool + +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: blackbox.cat +install-data-local: blackbox.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) blackbox.cat $(DESTDIR)$(pkgdatadir)/nls/tr_TR; \ + fi +uninstall-local: + @if test x$(NLSTEST) = "x-DNLS"; then \ + rm -f $(DESTDIR)$(pkgdatadir)/nls/tr_TR/blackbox.cat; \ + rmdir $(DESTDIR)$(pkgdatadir)/nls/tr_TR; \ + fi + +Translation.m: $(MFILES) + @if test x$(NLSTEST) = "x-DNLS"; then \ + awk -f ../convert.awk output=Translation.m $(MFILES); \ + fi + +blackbox.cat: Translation.m + @if test x$(NLSTEST) = "x-DNLS"; then \ + $(gencat_cmd) blackbox.cat Translation.m; \ + fi + +# 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:
A nls/tr_TR/Screen.m

@@ -0,0 +1,52 @@

+$set 6 #Screen + +$ #AnotherWMRunning +# BScreen::BScreen : X sunucusunu sorgularken hata oldu.\n \ +%s ekranýnda baþka bir pencere yöneticisi çalýþýyor gibi.\n +$ #ManagingScreen +# BScreen::BScreen : %d ekraný, 0x%lx görünümüyle , %d derinliðiyle\n +$ #FontLoadFail +# BScreen::LoadStyle() : '%s' yazý tipi yüklenemedi.\n +$ #DefaultFontLoadFail +# BScreen::LoadStyle(): önayarlý yazý tipi yüklenemedi.\n +$ #EmptyMenuFile +# %s : boþ mönü dosyasý\n +$ #xterm +# X komutasý +$ #Restart +# Yeniden baþla +$ #Exit +# Çýk +$ #EXECError +# BScreen::parseMenuFile : [exec] hatasý, mönü yaftasý ve/yada komuta belirlenmedi\n +$ #EXITError +# BScreen::parseMenuFile : [exit] hatasý, mönü yaftasý belirlenmedi\n +$ #STYLEError +# BScreen::parseMenuFile : [style] hatasý, mönü yaftasý ve/yada dosya adý belirlenmedi\n +$ #CONFIGError +# BScreen::parseMenuFile: [config] hatasý, mönü yaftasý belirlenmedi\n +$ #INCLUDEError +# BScreen::parseMenuFile: [include] hatasý, dosya adý belirlenmedi\n +$ #INCLUDEErrorReg +# BScreen::parseMenuFile: [include] hatasý, '%s' vasat bir dosya deðil\n +$ #SUBMENUError +# BScreen::parseMenuFile: [submenu] hatasý, mönü yaftasý belirlenmedi\n +$ #RESTARTError +# BScreen::parseMenuFile: [restart] hatasý, mönü yaftasý belirlenmedi\n +$ #RECONFIGError +# BScreen::parseMenuFile: [reconfig] hatasý, mönü yaftasý belirlenmedi\n +$ #STYLESDIRError +# BScreen::parseMenuFile: [stylesdir/stylesmenu] hatasý, dizin adý belirlenmedi\n +$ #STYLESDIRErrorNotDir +# BScreen::parseMenuFile: [stylesdir/stylesmenu] hatasý, '%s' bir dizin \ +deðildir\n +$ #STYLESDIRErrorNoExist +# BScreen::parseMenuFile: [stylesdir/stylesmenu] hatasý, '%s' var deðil\n +$ #WORKSPACESError +# BScreen::parseMenuFile: [workspaces] hatasý, mönü yaftasý belirlenmedi\n +$ #PositionLength +# 0: 0000 x 0: 0000 +$ #PositionFormat +# X: %4d x Y: %4d +$ #GeometryFormat +# Y: %4d x E: %4d
A nls/tr_TR/Slit.m

@@ -0,0 +1,8 @@

+$set 7 #Slit + +$ #SlitTitle +# Slit +$ #SlitDirection +# Slit yönü +$ #SlitPlacement +# Slit yerleþimi
A nls/tr_TR/Toolbar.m

@@ -0,0 +1,22 @@

+$set 8 #Toolbar + +$ #NoStrftimeLength +# 00:00000 +$ #NoStrftimeDateFormat +# %02d/%02d/%02d +$ #NoStrftimeDateFormatEu +# %02d.%02d.%02d +$ #NoStrftimeTimeFormat24 +# %02d:%02d +$ #NoStrftimeTimeFormat12 +# %02d:%02d %sm +$ #NoStrftimeTimeFormatP +# p +$ #NoStrftimeTimeFormatA +# a +$ #ToolbarTitle +# Blackbox çubuðu +$ #EditWkspcName +# Geçerli masaüstü ismini deðiþtir +$ #ToolbarPlacement +# Blackbox çubuðunun yerleþimi
A nls/tr_TR/Window.m

@@ -0,0 +1,17 @@

+$set 9 #Window + + +$ #Creating +# BlackboxWindow::BlackboxWindow : 0x%lx'i yarat#_yorum\n +$ #XGetWindowAttributesFail +# BlackboxWindow::BlackboxWindow : XGetWindowAttributres baþarýsýz oldu\n +$ #CannotFindScreen +# BlackboxWindow::BlackboxWindow : 0x%lx ana penceresi için ekraný belirleyemedim\n +$ #Unnamed +# Isimsiz +$ #MapRequest +# 0x%lx için BlackboxWindow::mapRequestEvent()\n +$ #UnmapNotify +# 0x%lx için BlackboxWindow::unmapNotifyEvent()\n +$ #UnmapNotifyReparent +# BlackboxWindow::unmapnotifyEvent: 0x%lx'i ana pencereyi boya\n
A nls/tr_TR/Windowmenu.m

@@ -0,0 +1,20 @@

+$set 10 #Windowmenu + +$ #SendTo +# Gönder ... +$ #Shade +# Topla +$ #Iconify +# Ikonalaþtýr +$ #Maximize +# Azamileþtir +$ #Raise +# Alçalt +$ #Lower +# Yükselt +$ #Stick +# Yapýþýk +$ #KillClient +# Öldür +$ #Close +# Kapat
A nls/tr_TR/Workspace.m

@@ -0,0 +1,4 @@

+$set 11 #Workspace + +$ #DefaultNameFormat +# Masaüstü %d
A nls/tr_TR/Workspacemenu.m

@@ -0,0 +1,8 @@

+$set 12 #Workspacemenu + +$ #WorkspacesTitle +# Masaüstleri +$ #NewWorkspace +# Yeni bir masaüstü +$ #RemoveLast +# Son masaüstünü sil
A nls/tr_TR/blackbox.m

@@ -0,0 +1,6 @@

+$set 13 #blackbox + +$ #NoManagableScreens +# Blackbox::Blackbox: yönetebilinen ekran bulunamadý, bitiriliyorum\n +$ #MapRequest +# Blackbox::process_event: 0x%lx için MapRequest\n
A nls/tr_TR/bsetroot.m

@@ -0,0 +1,16 @@

+$set 16 #bsetroot + +$ #MustSpecify +# %s : hata : -solid, -mod yada -gradient'den birisini belirlemek zorundasýn\n +$ #Usage +# %s 2.0 : Tel'if hakký (c) 1997-2000 Brad Hughes\n\n\ + -display <metin> ekran belirlemesi\n\ + -mod <x> <y> bölüþüm iþlemi\n\ + -foreground, -fg <renk> bölüþüm önalaný\n\ + -background, -bg <renk> bölüþüm ardalaný\n\n\ + -gradient <kaplam> geçiþim kaplamý\n\ + -from <renk> geçiþim baþlama rengi\n\ + -to <renk> geçiþim bitiþ rengi\n\n\ + -solid <renk> tek renk\n\n\ + -help bu yardým iletisini göster ve çýk\n +
A nls/tr_TR/common.m

@@ -0,0 +1,58 @@

+$set 15 #Common + +$ #Yes +# Evet +$ #No +# Hayýr + +$ #DirectionTitle +# Yön +$ #DirectionHoriz +# Ufki +$ #DirectionVert +# Dikey + +$ #AlwaysOnTop +# Her zaman üstte + +$ #PlacementTitle +# Yerleþim +$ #PlacementTopLeft +# Sol üst +$ #PlacementCenterLeft +# Sol orta +$ #PlacementBottomLeft +# Sol alt +$ #PlacementTopCenter +# Üst orta +$ #PlacementBottomCenter +# Alt orta +$ #PlacementTopRight +# Sað üst +$ #PlacementCenterRight +# Sað orta +$ #PlacementBottomRight +# Sað üst +$ #PlacementLeftTop +# Left Top +$ #PlacementLeftCenter +# Left Center +$ #PlacementLeftBottom +# Left Bottom +$ #PlacementRightTop +# Right Top +$ #PlacementRightCenter +# Right Center +$ #PlacementRightBottom +# Right Bottom +$ #PlacementTopRelative +# Top Relative +$ #PlacementBottomRelative +# Bottom Relative +$ #PlacementLeftRelative +# Left Relative +$ #PlacementRightRelative +# Right Relative + +$ #AutoHide +# Auto hide
A nls/tr_TR/main.m

@@ -0,0 +1,21 @@

+$set 14 #main + +$ #RCRequiresArg +# hata : '-rc' bir argüman bekler\n +$ #DISPLAYRequiresArg +# hata : '-display' bir argüman bekler\n +$ #WarnDisplaySet +# ikaz : 'DISPLAY' verisini oturtamadým\n +$ #Usage +# Fluxbox %s: (c) 2001 Henrik Kinnunen\n\n\ + -display <metin>\t\tekraný kullan.\n\ + -rc <metin>\t\t\tbaþka bir ayarlama dosyasýný kullan.\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 +# Denetleme seçenekleri :\n\ + Bilgilendirme\t\t\t%s\n\ + Týzlama:\t\t\t%s\n\ + Gölgeleme:\t\t\t%s\n\ + Slit:\t\t\t\t%s\n\ + R8b'e göre týzla:\t%s\n\n
A src/BaseDisplay.cc

@@ -0,0 +1,612 @@

+// BaseDisplay.cc for Blackbox - an X11 Window manager +// 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. + +// +// Changes for Fluxbox made by Henrik Kinnunen (fluxgen@linuxmail.org) +// + +// 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 <X11/Xlib.h> +#include <X11/Xatom.h> +#include <X11/Xutil.h> +#include <X11/cursorfont.h> + +#ifdef SHAPE +# include <X11/extensions/shape.h> +#endif // SHAPE + +#include "i18n.hh" +#include "BaseDisplay.hh" +#include "LinkedList.hh" +#include "Timer.hh" + +#ifdef HAVE_FCNTL_H +# include <fcntl.h> +#endif // HAVE_FCNTL_H + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +#endif // STDC_HEADERS + +#ifdef HAVE_UNISTD_H +# include <sys/types.h> +# include <unistd.h> +#endif // HAVE_UNISTD_H + +#ifdef HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif // HAVE_SYS_SELECT_H + +#ifdef HAVE_SIGNAL_H +# include <signal.h> +#endif // HAVE_SIGNAL_H + +#ifndef SA_NODEFER +# ifdef SA_INTERRUPT +# define SA_NODEFER SA_INTERRUPT +# else // !SA_INTERRUPT +# define SA_NODEFER (0) +# endif // SA_INTERRUPT +#endif // SA_NODEFER + +#ifdef HAVE_SYS_WAIT_H +# include <sys/types.h> +# include <sys/wait.h> +#endif // HAVE_SYS_WAIT_H + +#if defined(HAVE_PROCESS_H) && defined(__EMX__) +# include <process.h> +#endif // HAVE_PROCESS_H __EMX__ + + +// X error handler to handle any and all X errors while the application is +// running +static Bool internal_error = False; +static Window last_bad_window = None; + +BaseDisplay *base_display; + +#ifdef DEBUG +static int handleXErrors(Display *d, XErrorEvent *e) { + char errtxt[128]; + + XGetErrorText(d, e->error_code, errtxt, 128); + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + BaseDisplaySet, BaseDisplayXError, +#else // !NLS + 0, 0, +#endif // NLS + "%s: X error: %s(%d) opcodes %d/%d\n resource 0x%lx\n"), + base_display->getApplicationName(), errtxt, e->error_code, + e->request_code, e->minor_code, e->resourceid); +#else // !DEBUG +static int handleXErrors(Display *, XErrorEvent *e) { +#endif // DEBUG + + if (e->error_code == BadWindow) + last_bad_window = e->resourceid; + + if (internal_error) + abort(); + + return(False); +} + + +// signal handler to allow for proper and gentle shutdown + +#ifndef HAVE_SIGACTION +static RETSIGTYPE signalhandler(int sig) { +#else // HAVE_SIGACTION +static void signalhandler(int sig) { +#endif // HAVE_SIGACTION + I18n *i18n = I18n::instance(); + static int re_enter = 0; + + switch (sig) { + case SIGCHLD: + int status; + waitpid(-1, &status, WNOHANG | WUNTRACED); + +#ifndef HAVE_SIGACTION + // assume broken, braindead sysv signal semantics + signal(SIGCHLD, (RETSIGTYPE (*)(int)) signalhandler); +#endif // HAVE_SIGACTION + + break; + + default: + if (base_display->handleSignal(sig)) { + +#ifndef HAVE_SIGACTION + // assume broken, braindead sysv signal semantics + signal(sig, (RETSIGTYPE (*)(int)) signalhandler); +#endif // HAVE_SIGACTION + + return; + } + + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + BaseDisplaySet, BaseDisplaySignalCaught, +#else // !NLS + 0, 0, +#endif // NLS + "%s: signal %d caught\n"), + base_display->getApplicationName(), sig); + + if (! base_display->isStartup() && ! re_enter) { + internal_error = True; + + re_enter = 1; + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + BaseDisplaySet, BaseDisplayShuttingDown, +#else // !NLS + 0, 0, +#endif // NLS + "shutting down\n")); + base_display->shutdown(); + } + + if (sig != SIGTERM && sig != SIGINT) { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + BaseDisplaySet, BaseDisplayAborting, +#else // !NLS + 0, 0, +#endif // NLS + "aborting... dumping core\n")); + abort(); + } + + exit(0); + + break; + } +} + + +// 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) { + 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; + + _startup = True; + _shutdown = False; + server_grabs = 0; + last_bad_window = None; + I18n *i18n = I18n::instance(); + ::base_display = this; + +#ifdef HAVE_SIGACTION + struct sigaction action; + + action.sa_handler = signalhandler; + action.sa_mask = sigset_t(); + action.sa_flags = SA_NOCLDSTOP | SA_NODEFER; + + sigaction(SIGSEGV, &action, NULL); + sigaction(SIGFPE, &action, NULL); + sigaction(SIGTERM, &action, NULL); + sigaction(SIGINT, &action, NULL); + sigaction(SIGCHLD, &action, NULL); + sigaction(SIGHUP, &action, NULL); + sigaction(SIGUSR1, &action, NULL); + sigaction(SIGUSR2, &action, NULL); +#else // !HAVE_SIGACTION + signal(SIGSEGV, (RETSIGTYPE (*)(int)) signalhandler); + signal(SIGFPE, (RETSIGTYPE (*)(int)) signalhandler); + signal(SIGTERM, (RETSIGTYPE (*)(int)) signalhandler); + signal(SIGINT, (RETSIGTYPE (*)(int)) signalhandler); + signal(SIGUSR1, (RETSIGTYPE (*)(int)) signalhandler); + signal(SIGUSR2, (RETSIGTYPE (*)(int)) signalhandler); + signal(SIGHUP, (RETSIGTYPE (*)(int)) signalhandler); + signal(SIGCHLD, (RETSIGTYPE (*)(int)) signalhandler); +#endif // HAVE_SIGACTION + + if (! (display = XOpenDisplay(dpy_name))) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + BaseDisplaySet, BaseDisplayXConnectFail, +#else // !NLS + 0, 0, +#endif // NLS + "BaseDisplay::BaseDisplay: connection to X server failed.\n")); + throw static_cast<int>(2); //throw error 2 + } else if (fcntl(ConnectionNumber(display), F_SETFD, 1) == -1) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + BaseDisplaySet, BaseDisplayCloseOnExecFail, +#else // !NLS + 0, 0, +#endif // NLS + "BaseDisplay::BaseDisplay: couldn't mark display connection " + "as close-on-exec\n")); + throw static_cast<int>(2); //throw error 2 + } + + number_of_screens = ScreenCount(display); + display_name = XDisplayName(dpy_name); + +#ifdef SHAPE + shape.extensions = XShapeQueryExtension(display, &shape.event_basep, + &shape.error_basep); +#else // !SHAPE + shape.extensions = False; +#endif // SHAPE +//---------- setup atoms + + 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); + + blackbox_hints = XInternAtom(display, "_BLACKBOX_HINTS", False); + blackbox_attributes = XInternAtom(display, "_BLACKBOX_ATTRIBUTES", False); + blackbox_change_attributes = + XInternAtom(display, "_BLACKBOX_CHANGE_ATTRIBUTES", False); + + blackbox_structure_messages = + XInternAtom(display, "_BLACKBOX_STRUCTURE_MESSAGES", False); + blackbox_notify_startup = + XInternAtom(display, "_BLACKBOX_NOTIFY_STARTUP", False); + blackbox_notify_window_add = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_ADD", False); + blackbox_notify_window_del = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_DEL", False); + blackbox_notify_current_workspace = + XInternAtom(display, "_BLACKBOX_NOTIFY_CURRENT_WORKSPACE", False); + blackbox_notify_workspace_count = + XInternAtom(display, "_BLACKBOX_NOTIFY_WORKSPACE_COUNT", False); + blackbox_notify_window_focus = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_FOCUS", False); + blackbox_notify_window_raise = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_RAISE", False); + blackbox_notify_window_lower = + XInternAtom(display, "_BLACKBOX_NOTIFY_WINDOW_LOWER", False); + + blackbox_change_workspace = + XInternAtom(display, "_BLACKBOX_CHANGE_WORKSPACE", False); + blackbox_change_window_focus = + XInternAtom(display, "_BLACKBOX_CHANGE_WINDOW_FOCUS", False); + blackbox_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 + +#ifdef GNOME + /* + gnome_wm_win_layer = XInternAtom(display, "_WIN_LAYER", False); + gnome_wm_win_state = XInternAtom(display, "_WIN_STATE", False); + gnome_wm_win_hints = XInternAtom(display, "_WIN_HINTS", False); + gnome_wm_win_app_state = XInternAtom(display, "_WIN_APP_STATE", False); + gnome_wm_win_expanded_size = XInternAtom(display, "_WIN_EXPANDED_SIZE", False); + gnome_wm_win_icons = XInternAtom(display, "_WIN_ICONS", False); + gnome_wm_win_workspace = XInternAtom(display, "_WIN_WORKSPACE", False); + gnome_wm_win_workspace_count = XInternAtom(display, "_WIN_WORKSPACE_COUNT", False); + gnome_wm_win_workspace_names = XInternAtom(display, "_WIN_WORKSPACE_NAMES", False); + gnome_wm_win_client_list = XInternAtom(display, "_WIN_CLIENT_LIST", False); + gnome_wm_prot = XInternAtom(display, "_WIN_PROTOCOLS", False); + gnome_wm_supporting_wm_check = XInternAtom(display, "_WIN_SUPPORTING_WM_CHECK", False); + */ +#endif // GNOME + + 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); + + XSetErrorHandler((XErrorHandler) handleXErrors); + + timerList = new LinkedList<BTimer>; + + screenInfoList = new LinkedList<ScreenInfo>; + int i; + for (i = 0; i < number_of_screens; i++) { + ScreenInfo *screeninfo = new ScreenInfo(this, i); + screenInfoList->insert(screeninfo); + } +} + + +BaseDisplay::~BaseDisplay(void) { + + while (screenInfoList->count()) { + ScreenInfo *si = screenInfoList->first(); + + screenInfoList->remove(si); + delete si; + } + + + delete screenInfoList; + + // we don't create the BTimers, we don't delete them + while (timerList->count()) + timerList->remove(0); + + delete timerList; + + XCloseDisplay(display); +} + +void BaseDisplay::eventLoop(void) { + run(); + + int xfd = ConnectionNumber(display); + + while ((! _shutdown) && (! internal_error)) { + if (XPending(display)) { + XEvent e; + XNextEvent(display, &e); + + if (last_bad_window != None && e.xany.window == last_bad_window) { +#ifdef DEBUG + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + BaseDisplaySet, BaseDisplayBadWindowRemove, +#else // !NLS + 0, 0, +#endif // NLS + "BaseDisplay::eventLoop(): removing bad window " + "from event queue\n")); +#endif // DEBUG + } else { + last_bad_window = None; + process_event(&e); + } + } else { + fd_set rfds; + timeval now, tm, *timeout = (timeval *) 0; + + FD_ZERO(&rfds); + FD_SET(xfd, &rfds); + + if (timerList->count()) { + gettimeofday(&now, 0); + + tm.tv_sec = tm.tv_usec = 0l; + + BTimer *timer = timerList->first(); + + 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; + } + + select(xfd + 1, &rfds, 0, 0, timeout); + + // check for timer timeout + gettimeofday(&now, 0); + + LinkedListIterator<BTimer> it(timerList); + for(; it.current(); it++) { + tm.tv_sec = it.current()->getStartTime().tv_sec + + it.current()->getTimeout().tv_sec; + tm.tv_usec = it.current()->getStartTime().tv_usec + + it.current()->getTimeout().tv_usec; + + if ((now.tv_sec < tm.tv_sec) || + (now.tv_sec == tm.tv_sec && now.tv_usec < tm.tv_usec)) + break; + + it.current()->fireTimeout(); + + // restart the current timer so that the start time is updated + if (! it.current()->doOnce()) + it.current()->start(); + else + it.current()->stop(); + } + } + } +} + + +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; + + LinkedListIterator<BTimer> it(timerList); + int index = 0; + for (; it.current(); it++, index++) + if ((it.current()->getTimeout().tv_sec > timer->getTimeout().tv_sec) || + ((it.current()->getTimeout().tv_sec == timer->getTimeout().tv_sec) && + (it.current()->getTimeout().tv_usec >= timer->getTimeout().tv_usec))) + break; + + timerList->insert(timer, index); +} + + +void BaseDisplay::removeTimer(BTimer *timer) { + timerList->remove(timer); +} + + +ScreenInfo::ScreenInfo(BaseDisplay *d, 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)); + + // search for a TrueColor Visual... if we can't find one... we will use the + // default visual for the screen + XVisualInfo vinfo_template, *vinfo_return; + int vinfo_nitems; + + vinfo_template.screen = screen_number; + vinfo_template.c_class = TrueColor; + + visual = (Visual *) 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; + visual = (vinfo_return + i)->visual; + } + } + + XFree(vinfo_return); + } + + if (visual) + colormap = XCreateColormap(basedisplay->getXDisplay(), root_window, + visual, AllocNone); + else { + visual = DefaultVisual(basedisplay->getXDisplay(), screen_number); + colormap = DefaultColormap(basedisplay->getXDisplay(), screen_number); + } +}
A src/BaseDisplay.hh

@@ -0,0 +1,368 @@

+// BaseDisplay.hh for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> +#include <X11/Xatom.h> + +// forward declaration +class BaseDisplay; +class ScreenInfo; + +#include "LinkedList.hh" +#include "Timer.hh" + +#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 _blackbox_hints { + unsigned long flags, attrib, workspace, stack, decoration; +} BlackboxHints; + +typedef struct _blackbox_attributes { + unsigned long flags, attrib, workspace, stack; + int premax_x, premax_y; + unsigned int premax_w, premax_h; +} BlackboxAttributes; + +#define PropBlackboxHintsElements (5) +#define PropBlackboxAttributesElements (8) + +#ifndef __EMX__ +void bexec(const char *, char *); +#endif // !__EMX__ + +char *bstrdup(const char *); +template <typename Z> inline Z min(Z a, Z b) { return ((a < b) ? a : b); } +template <typename Z> inline Z max(Z a, Z b) { return ((a > b) ? a : b); } + +class BaseDisplay { + +public: + BaseDisplay(char *, char * = 0); + virtual ~BaseDisplay(void); + +#ifdef GNOME + inline Atom *getGnomeListAtoms() { return gnome_atom_list; } + inline Atom &getGnomeProtAtom() { return gnome_wm_prot; } + inline Atom &getGnomeClientListAtom() { return gnome_wm_win_client_list; } + inline Atom &getGnomeSupportingWMCheckAtom() { return gnome_wm_supporting_wm_check; } + inline Atom &getGnomeWorkspaceAtom() { return gnome_wm_win_workspace; } + inline Atom &getGnomeWorkspaceCountAtom() { return gnome_wm_win_workspace_count; } + inline Atom &getGnomeWorkspaceNamesAtom() { return gnome_wm_win_workspace_names; } +#endif //GNOME + + inline const Atom &getWMChangeStateAtom(void) const + { return xa_wm_change_state; } + inline const Atom &getWMStateAtom(void) const + { return xa_wm_state; } + inline const Atom &getWMDeleteAtom(void) const + { return xa_wm_delete_window; } + inline const Atom &getWMProtocolsAtom(void) const + { return xa_wm_protocols; } + inline const Atom &getWMTakeFocusAtom(void) const + { return xa_wm_take_focus; } + inline const Atom &getWMColormapAtom(void) const + { return xa_wm_colormap_windows; } + inline const Atom &getMotifWMHintsAtom(void) const + { return motif_wm_hints; } + + // this atom is for normal app->WM hints about decorations, stacking, + // starting workspace etc... + inline const Atom &getFluxboxHintsAtom(void) const + { return blackbox_hints;} + + // these atoms are for normal app->WM interaction beyond the scope of the + // ICCCM... + inline const Atom &getFluxboxAttributesAtom(void) const + { return blackbox_attributes; } + inline const Atom &getFluxboxChangeAttributesAtom(void) const + { return blackbox_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 &getFluxboxStructureMessagesAtom(void) const + { return blackbox_structure_messages; } + + // *Notify* portions of the NETStructureMessages protocol + inline const Atom &getFluxboxNotifyStartupAtom(void) const + { return blackbox_notify_startup; } + inline const Atom &getFluxboxNotifyWindowAddAtom(void) const + { return blackbox_notify_window_add; } + inline const Atom &getFluxboxNotifyWindowDelAtom(void) const + { return blackbox_notify_window_del; } + inline const Atom &getFluxboxNotifyWindowFocusAtom(void) const + { return blackbox_notify_window_focus; } + inline const Atom &getFluxboxNotifyCurrentWorkspaceAtom(void) const + { return blackbox_notify_current_workspace; } + inline const Atom &getFluxboxNotifyWorkspaceCountAtom(void) const + { return blackbox_notify_workspace_count; } + inline const Atom &getFluxboxNotifyWindowRaiseAtom(void) const + { return blackbox_notify_window_raise; } + inline const Atom &getFluxboxNotifyWindowLowerAtom(void) const + { return blackbox_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 &getFluxboxChangeWorkspaceAtom(void) const + { return blackbox_change_workspace; } + inline const Atom &getFluxboxChangeWindowFocusAtom(void) const + { return blackbox_change_window_focus; } + inline const Atom &getFluxboxCycleWindowFocusAtom(void) const + { return blackbox_cycle_window_focus; } + +#ifdef NEWWMSPEC + + // root window properties + inline const Atom &getNETSupportedAtom(void) const + { return net_supported; } + inline const Atom &getNETClientListAtom(void) const + { return net_client_list; } + inline const Atom &getNETClientListStackingAtom(void) const + { return net_client_list_stacking; } + inline const Atom &getNETNumberOfDesktopsAtom(void) const + { return net_number_of_desktops; } + inline const Atom &getNETDesktopGeometryAtom(void) const + { return net_desktop_geometry; } + inline const Atom &getNETDesktopViewportAtom(void) const + { return net_desktop_viewport; } + inline const Atom &getNETCurrentDesktopAtom(void) const + { return net_current_desktop; } + inline const Atom &getNETDesktopNamesAtom(void) const + { return net_desktop_names; } + inline const Atom &getNETActiveWindowAtom(void) const + { return net_active_window; } + inline const Atom &getNETWorkareaAtom(void) const + { return net_workarea; } + inline const Atom &getNETSupportingWMCheckAtom(void) const + { return net_supporting_wm_check; } + inline const Atom &getNETVirtualRootsAtom(void) const + { return net_virtual_roots; } + + // root window messages + inline const Atom &getNETCloseWindowAtom(void) const + { return net_close_window; } + inline const Atom &getNETWMMoveResizeAtom(void) const + { return net_wm_moveresize; } + + // application window properties + inline const Atom &getNETPropertiesAtom(void) const + { return net_properties; } + inline const Atom &getNETWMNameAtom(void) const + { return net_wm_name; } + inline const Atom &getNETWMDesktopAtom(void) const + { return net_wm_desktop; } + inline const Atom &getNETWMWindowTypeAtom(void) const + { return net_wm_window_type; } + inline const Atom &getNETWMStateAtom(void) const + { return net_wm_state; } + inline const Atom &getNETWMStrutAtom(void) const + { return net_wm_strut; } + inline const Atom &getNETWMIconGeometryAtom(void) const + { return net_wm_icon_geometry; } + inline const Atom &getNETWMIconAtom(void) const + { return net_wm_icon; } + inline const Atom &getNETWMPidAtom(void) const + { return net_wm_pid; } + inline const Atom &getNETWMHandledIconsAtom(void) const + { return net_wm_handled_icons; } + + // application protocols + inline const Atom &getNETWMPingAtom(void) const + { return net_wm_ping; } + +#endif // NEWWMSPEC + + inline ScreenInfo *getScreenInfo(int s) + { return (ScreenInfo *) screenInfoList->find(s); } + + inline const Bool &hasShapeExtensions(void) const + { return shape.extensions; } + inline const Bool &doShutdown(void) const + { return _shutdown; } + inline const Bool &isStartup(void) const + { return _startup; } + + inline const Cursor &getSessionCursor(void) const + { return cursor.session; } + inline const Cursor &getMoveCursor(void) const + { return cursor.move; } + inline const Cursor &getLowerLeftAngleCursor(void) const + { return cursor.ll_angle; } + inline const Cursor &getLowerRightAngleCursor(void) const + { return cursor.lr_angle; } + + inline Display *getXDisplay(void) { return display; } + + inline const char *getXDisplayName(void) const + { return (const char *) display_name; } + inline const char *getApplicationName(void) const + { return (const char *) application_name; } + + inline const int &getNumberOfScreens(void) const + { return number_of_screens; } + inline const int &getShapeEventBase(void) const + { return shape.event_basep; } + + inline void shutdown(void) { _shutdown = True; } + inline void run(void) { _startup = _shutdown = False; } + + const Bool validateWindow(Window); + + void grab(void); + void ungrab(void); + void eventLoop(void); + 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; + +private: + struct cursor { + Cursor session, move, ll_angle, lr_angle; + } cursor; + + struct shape { + Bool extensions; + int event_basep, error_basep; + } shape; + + 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 blackbox_attributes, blackbox_change_attributes, blackbox_hints; + + // NETStructureMessages + Atom blackbox_structure_messages, blackbox_notify_startup, + blackbox_notify_window_add, blackbox_notify_window_del, + blackbox_notify_window_focus, blackbox_notify_current_workspace, + blackbox_notify_workspace_count, blackbox_notify_window_raise, + blackbox_notify_window_lower; + + // message_types for client -> wm messages + Atom blackbox_change_workspace, blackbox_change_window_focus, + blackbox_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 + +#ifdef GNOME + union { + Atom gnome_wm_win_layer, gnome_wm_win_state, gnome_wm_win_hints, + gnome_wm_win_app_state, gnome_wm_win_expanded_size, + gnome_wm_win_icons, gnome_wm_win_workspace, + gnome_wm_win_workspace_count, gnome_wm_win_workspace_names, + gnome_wm_win_client_list; + Atom gnome_atom_list[10]; + }; + Atom gnome_wm_prot; + Atom gnome_wm_supporting_wm_check; +#endif // GNOME + + + Bool _startup, _shutdown; + Display *display; + LinkedList<ScreenInfo> *screenInfoList; + LinkedList<BTimer> *timerList; + + char *display_name, *application_name; + int number_of_screens, server_grabs, colors_per_channel; + +protected: + + virtual void process_event(XEvent *) = 0; + + +}; + + +class ScreenInfo { +public: + ScreenInfo(BaseDisplay *, int); + + inline BaseDisplay *getBaseDisplay(void) { 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 const int &getDepth(void) const { return depth; } + inline const int &getScreenNumber(void) const { return screen_number; } + + inline const unsigned int &getWidth(void) const { return width; } + inline const unsigned int &getHeight(void) const { return height; } + +private: + BaseDisplay *basedisplay; + Visual *visual; + Window root_window; + Colormap colormap; + + int depth, screen_number; + unsigned int width, height; + + +}; + + +#endif // __BaseDisplay_hh
A src/Basemenu.cc

@@ -0,0 +1,1067 @@

+// Basemenu.cc for fluxbox - an X11 Window manager +// 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 "i18n.hh" +#include "fluxbox.hh" +#include "Basemenu.hh" +#include "Screen.hh" + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +#endif // STDC_HEADERS + + +static Basemenu *shown = (Basemenu *) 0; + +Basemenu::Basemenu(BScreen *scrn) { + screen = scrn; + fluxbox = Fluxbox::instance(); + image_ctrl = screen->getImageControl(); + display = fluxbox->getXDisplay(); + parent = (Basemenu *) 0; + alignment = AlignDontCare; + + title_vis = + movable = + hide_tree = True; + + shifted = + internal_menu = + moving = + torn = + visible = False; + + menu.x = + menu.y = + menu.x_shift = + menu.y_shift = + menu.x_move = + menu.y_move = 0; + + which_sub = + which_press = + which_sbl = -1; + + menu.frame_pixmap = + menu.title_pixmap = + menu.hilite_pixmap = + menu.sel_pixmap = None; + + menu.bevel_w = screen->getBevelWidth(); + + I18n *i18n = I18n::instance(); + + if (i18n->multibyte()) { + menu.width = menu.title_h = menu.item_w = menu.frame_h = + screen->getMenuStyle()->titlefont.set_extents->max_ink_extent.height + + (menu.bevel_w * 2); + } else { + menu.width = menu.title_h = menu.item_w = menu.frame_h = + screen->getMenuStyle()->titlefont.fontstruct->ascent + + screen->getMenuStyle()->titlefont.fontstruct->descent + + (menu.bevel_w * 2); + } + menu.label = 0; + + menu.sublevels = + menu.persub = + menu.minsub = 0; + + if (i18n->multibyte()) { + menu.item_h = screen->getMenuStyle()->framefont.set_extents->max_ink_extent.height + + (menu.bevel_w); + } else { + menu.item_h = screen->getMenuStyle()->framefont.fontstruct->ascent + + screen->getMenuStyle()->framefont.fontstruct->descent + + (menu.bevel_w); + } + menu.height = menu.title_h + screen->getBorderWidth() + menu.frame_h; + + //set attributes for menu window + unsigned long attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | + CWColormap | CWOverrideRedirect | CWEventMask; + XSetWindowAttributes attrib; + attrib.background_pixmap = None; + attrib.background_pixel = attrib.border_pixel = + screen->getBorderColor()->getPixel(); + attrib.colormap = screen->getColormap(); + attrib.override_redirect = True; + attrib.event_mask = ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | ExposureMask; + + //create menu window + menu.window = + XCreateWindow(display, screen->getRootWindow(), menu.x, menu.y, menu.width, + menu.height, screen->getBorderWidth(), screen->getDepth(), + InputOutput, screen->getVisual(), attrib_mask, &attrib); + + fluxbox->saveMenuSearch(menu.window, this); + + //attibutes for title to menuwindow + attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | CWEventMask; + attrib.background_pixel = screen->getBorderColor()->getPixel(); + attrib.event_mask |= EnterWindowMask | LeaveWindowMask; + //create menu title + menu.title = + XCreateWindow(display, menu.window, 0, 0, menu.width, menu.height, 0, + screen->getDepth(), InputOutput, screen->getVisual(), + attrib_mask, &attrib); + fluxbox->saveMenuSearch(menu.title, this); + + attrib.event_mask |= PointerMotionMask; + menu.frame = XCreateWindow(display, menu.window, 0, + menu.title_h + screen->getBorderWidth(), + menu.width, menu.frame_h, 0, + screen->getDepth(), InputOutput, + screen->getVisual(), attrib_mask, &attrib); + fluxbox->saveMenuSearch(menu.frame, this); + + menuitems = new LinkedList<BasemenuItem>; + + // 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 +} + + +Basemenu::~Basemenu(void) { + XUnmapWindow(display, menu.window); + + if (shown && shown->getWindowID() == getWindowID()) + shown = (Basemenu *) 0; + + int n = menuitems->count(); + for (int i = 0; i < n; ++i) + remove(0); + + delete menuitems; + + if (menu.label) + delete [] menu.label; + + if (menu.title_pixmap) + image_ctrl->removeImage(menu.title_pixmap); + + if (menu.frame_pixmap) + image_ctrl->removeImage(menu.frame_pixmap); + + if (menu.hilite_pixmap) + image_ctrl->removeImage(menu.hilite_pixmap); + + if (menu.sel_pixmap) + image_ctrl->removeImage(menu.sel_pixmap); + + fluxbox->removeMenuSearch(menu.title); + XDestroyWindow(display, menu.title); + + fluxbox->removeMenuSearch(menu.frame); + XDestroyWindow(display, menu.frame); + + fluxbox->removeMenuSearch(menu.window); + XDestroyWindow(display, menu.window); +} + + +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 *item = new BasemenuItem(label, function, exec); + menuitems->insert(item, pos); + + return menuitems->count(); +} + + +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); + + submenu->parent = this; + + return menuitems->count(); +} + + +int Basemenu::insert(const char **ulabel, int pos, int function) { + BasemenuItem *item = new BasemenuItem(ulabel, function); + menuitems->insert(item, pos); + + return menuitems->count(); +} + + +int Basemenu::remove(int index) { + if (index < 0 || index > menuitems->count()) return -1; + + BasemenuItem *item = menuitems->remove(index); + + if (item) { + if ((! internal_menu) && (item->submenu())) { + Basemenu *tmp = (Basemenu *) item->submenu(); + + if (! tmp->internal_menu) { + delete tmp; + } else + tmp->internal_hide(); + } + + 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(); +} + + +void Basemenu::update(void) { + I18n *i18n = I18n::instance(); + + if (i18n->multibyte()) { + menu.item_h = screen->getMenuStyle()->framefont.set_extents->max_ink_extent.height + + menu.bevel_w; + menu.title_h = screen->getMenuStyle()->titlefont.set_extents->max_ink_extent.height + + (menu.bevel_w * 2); + } else { + menu.item_h = screen->getMenuStyle()->framefont.fontstruct->ascent + + screen->getMenuStyle()->framefont.fontstruct->descent + + menu.bevel_w; + menu.title_h = screen->getMenuStyle()->titlefont.fontstruct->ascent + + screen->getMenuStyle()->titlefont.fontstruct->descent + + (menu.bevel_w * 2); + } + + if (title_vis) { + const char *s = (menu.label) ? menu.label : + i18n->getMessage( +#ifdef NLS + BasemenuSet, BasemenuBlackboxMenu, +#else // !NLS + 0, 0, +#endif // NLS + "fluxbox Menu"); + int l = strlen(s); + + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getMenuStyle()->titlefont.set, s, l, &ink, &logical); + menu.item_w = logical.width; + } else + menu.item_w = XTextWidth(screen->getMenuStyle()->titlefont.fontstruct, s, l); + + menu.item_w += (menu.bevel_w * 2); + } else + menu.item_w = 1; + + int ii = 0; + LinkedListIterator<BasemenuItem> it(menuitems); + for (; it.current(); it++) { + BasemenuItem *itmp = it.current(); + + const char *s = ((itmp->u && *itmp->u) ? *itmp->u : + ((itmp->l) ? itmp->l : (const char *) 0)); + int l = strlen(s); + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getMenuStyle()->framefont.set, s, l, &ink, &logical); + ii = logical.width; + } else + ii = XTextWidth(screen->getMenuStyle()->framefont.fontstruct, s, l); + + ii += (menu.bevel_w * 2) + (menu.item_h * 2); + + menu.item_w = ((menu.item_w < (unsigned int) ii) ? ii : menu.item_w); + } + + if (menuitems->count()) { + menu.sublevels = 1; + + while (((menu.item_h * (menuitems->count() + 1) / menu.sublevels) + + menu.title_h + screen->getBorderWidth()) > + screen->getHeight()) + menu.sublevels++; + + if (menu.sublevels < menu.minsub) menu.sublevels = menu.minsub; + + menu.persub = menuitems->count() / menu.sublevels; + if (menuitems->count() % menu.sublevels) menu.persub++; + } else { + menu.sublevels = 0; + menu.persub = 0; + } + + menu.width = (menu.sublevels * (menu.item_w)); + 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; + if (! menu.frame_h) menu.frame_h = 1; + if (menu.height < 1) menu.height = 1; + + Pixmap tmp; + BTexture *texture; + if (title_vis) { + tmp = menu.title_pixmap; + texture = &(screen->getMenuStyle()->title); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + menu.title_pixmap = None; + XSetWindowBackground(display, menu.title, + texture->getColor()->getPixel()); + } else { + menu.title_pixmap = + image_ctrl->renderImage(menu.width, menu.title_h, texture); + XSetWindowBackgroundPixmap(display, menu.title, menu.title_pixmap); + } + if (tmp) image_ctrl->removeImage(tmp); + XClearWindow(display, menu.title); + } + + tmp = menu.frame_pixmap; + texture = &(screen->getMenuStyle()->frame); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + menu.frame_pixmap = None; + XSetWindowBackground(display, menu.frame, + texture->getColor()->getPixel()); + } else { + menu.frame_pixmap = + 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->getTexture() == (BImage_Flat | BImage_Solid)) + menu.hilite_pixmap = None; + else + menu.hilite_pixmap = + image_ctrl->renderImage(menu.item_w, menu.item_h, texture); + if (tmp) image_ctrl->removeImage(tmp); + + tmp = menu.sel_pixmap; + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) + menu.sel_pixmap = None; + else { + int hw = menu.item_h / 2; + menu.sel_pixmap = + image_ctrl->renderImage(hw, hw, texture); + } + if (tmp) image_ctrl->removeImage(tmp); + + XResizeWindow(display, menu.window, menu.width, menu.height); + + if (title_vis) + 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); + + XClearWindow(display, menu.window); + XClearWindow(display, menu.title); + XClearWindow(display, menu.frame); + + if (title_vis && visible) redrawTitle(); + + int i = 0; + for (i = 0; visible && i < menuitems->count(); i++) + if (i == which_sub) { + drawItem(i, True, 0); + drawSubmenu(i); + } else + drawItem(i, False, 0); + + if (parent && visible) + parent->drawSubmenu(parent->which_sub); + + XMapSubwindows(display, menu.window); +} + + +void Basemenu::show(void) { + XMapSubwindows(display, menu.window); + XMapWindow(display, menu.window); + visible = True; + + if (! parent) { + if (shown && (! shown->torn)) + shown->hide(); + + shown = this; + } +} + + +void Basemenu::hide(void) { + if ((! torn) && hide_tree && parent && parent->isVisible()) { + Basemenu *p = parent; + + while (p->isVisible() && (! p->torn) && p->parent) p = p->parent; + p->internal_hide(); + } else + internal_hide(); +} + + +void Basemenu::internal_hide(void) { + if (which_sub != -1) { + BasemenuItem *tmp = menuitems->find(which_sub); + tmp->submenu()->internal_hide(); + } + + if (parent && (! torn)) { + parent->drawItem(parent->which_sub, False, True); + + parent->which_sub = -1; + } else if (shown && shown->menu.window == menu.window) + shown = (Basemenu *) 0; + + torn = visible = False; + which_sub = which_press = which_sub = -1; + + XUnmapWindow(display, menu.window); +} + + +void Basemenu::move(int x, int y) { + menu.x = x; + menu.y = y; + XMoveWindow(display, menu.window, x, y); + if (which_sub != -1) + drawSubmenu(which_sub); +} + + +void Basemenu::redrawTitle(void) { + I18n *i18n = I18n::instance(); + char *text = (char *) ((menu.label) ? menu.label : + i18n->getMessage( +#ifdef NLS + BasemenuSet, BasemenuBlackboxMenu, +#else // !NLS + 0, 0, +#endif // NLS + "fluxbox Menu")); + int dx = menu.bevel_w, len = strlen(text); + unsigned int l; + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getMenuStyle()->titlefont.set, text, len, &ink, &logical); + l = logical.width; + } else + l = XTextWidth(screen->getMenuStyle()->titlefont.fontstruct, text, len); + + l += (menu.bevel_w * 2); + + switch (screen->getMenuStyle()->titlefont.justify) { + case FFont::Right: + dx += menu.width - l; + break; + + case FFont::Center: + dx += (menu.width - l) / 2; + break; + default: + break; + } + + if (i18n->multibyte()) + XmbDrawString(display, menu.title, screen->getMenuStyle()->titlefont.set, + screen->getMenuStyle()->t_text_gc, dx, menu.bevel_w - + screen->getMenuStyle()->titlefont.set_extents->max_ink_extent.y, + text, len); + else + XDrawString(display, menu.title, screen->getMenuStyle()->t_text_gc, dx, + screen->getMenuStyle()->titlefont.fontstruct->ascent + menu.bevel_w, + text, len); +} + + +void Basemenu::drawSubmenu(int index) { + if (which_sub != -1 && which_sub != index) { + BasemenuItem *itmp = menuitems->find(which_sub); + + if (! itmp->submenu()->isTorn()) + itmp->submenu()->internal_hide(); + } + + if (index >= 0 && index < menuitems->count()) { + BasemenuItem *item = menuitems->find(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; + + if (alignment == AlignTop) { + y = (((shifted) ? menu.y_shift : menu.y) + + ((title_vis) ? menu.title_h + screen->getBorderWidth() : 0) - + ((item->submenu()->title_vis) ? + 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) - + ((item->submenu()->title_vis) ? + 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()) { + x = ((shifted) ? menu.x_shift : menu.x) - + item->submenu()->getWidth() - screen->getBorderWidth(); + } + + if (x < 0) x = 0; + + if ((y + item->submenu()->getHeight()) > screen->getHeight()) { + y = screen->getHeight() - item->submenu()->getHeight() - + screen->getBorderWidth2x(); + } + + 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; + else + return False; + else + return False; +} + + +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 = menuitems->find(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; + int text_x = 0, text_y = 0, len = strlen(text), sel_x = 0, sel_y = 0; + 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; + + I18n *i18n = I18n::instance(); + + if (text) { + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getMenuStyle()->framefont.set, text, len, &ink, &logical); + text_w = logical.width; + text_y = item_y + (menu.bevel_w / 2) - + screen->getMenuStyle()->framefont.set_extents->max_ink_extent.y; + } else { + text_w = XTextWidth(screen->getMenuStyle()->framefont.fontstruct, text, len); + text_y = item_y + + screen->getMenuStyle()->framefont.fontstruct->ascent + + (menu.bevel_w / 2); + } + + switch(screen->getMenuStyle()->framefont.justify) { + case FFont::Left: + text_x = item_x + menu.bevel_w + menu.item_h + 1; + break; + + case FFont::Right: + text_x = item_x + menu.item_w - (menu.item_h + menu.bevel_w + text_w); + break; + default: //center + text_x = item_x + ((menu.item_w + 1 - text_w) / 2); + break; + } + + text_h = menu.item_h - menu.bevel_w; + } + + GC 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)); + + sel_x = item_x; + + 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; + + if (clear) { + XClearArea(display, menu.frame, item_x, item_y, menu.item_w, menu.item_h, + False); + } else if (! (x == y && y == -1 && w == h && h == 0)) { + // calculate the which part of the hilite to redraw + if (! (max(item_x, x) <= (signed) min(item_x + menu.item_w, x + w) && + max(item_y, y) <= (signed) min(item_y + menu.item_h, y + h))) { + dohilite = False; + } else { + hilite_x = max(item_x, x); + hilite_y = max(item_y, y); + hilite_w = min(item_x + menu.item_w, x + w) - hilite_x; + hilite_h = min(item_y + menu.item_h, y + h) - hilite_y; + hoff_x = hilite_x % menu.item_w; + hoff_y = hilite_y % menu.item_h; + } + + // check if we need to redraw the text + int text_ry = item_y + (menu.bevel_w / 2); + if (! (max(text_x, x) <= (signed) min(text_x + text_w, x + w) && + max(text_ry, y) <= (signed) min(text_ry + text_h, y + h))) + dotext = False; + + // check if we need to redraw the select pixmap/menu bullet + if (! (max(sel_x, x) <= (signed) min(sel_x + half_w, x + w) && + max(sel_y, y) <= (signed) min(sel_y + half_w, y + h))) + dosel = False; + + } + + 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, + hilite_w, hilite_h, hilite_x, hilite_y); + } else { + XFillRectangle(display, menu.frame, + screen->getMenuStyle()->hilite_gc, + hilite_x, hilite_y, hilite_w, hilite_h); + } + } else if (dosel && item->isSelected() && + (menu.sel_pixmap != ParentRelative)) { + if (menu.sel_pixmap) { + XCopyArea(display, menu.sel_pixmap, menu.frame, + screen->getMenuStyle()->hilite_gc, 0, 0, + half_w, half_w, sel_x, sel_y); + } else { + XFillRectangle(display, menu.frame, + screen->getMenuStyle()->hilite_gc, + sel_x, sel_y, half_w, half_w); + } + } + + if (dotext && text) { + if (i18n->multibyte()) { + XmbDrawString(display, menu.frame, screen->getMenuStyle()->framefont.set, + tgc, text_x, text_y, text, len); + } else + XDrawString(display, menu.frame, tgc, text_x, text_y, text, len); + } + + if (dosel && item->submenu()) { + switch (screen->getMenuStyle()->bullet) { + case Square: + 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) { + tri[0].x = sel_x + quarter_w - 2; + tri[0].y = sel_y + quarter_w - 2; + tri[1].x = 4; + tri[1].y = 2; + tri[2].x = -4; + tri[2].y = 2; + } else { + tri[0].x = sel_x + quarter_w - 2; + tri[0].y = item_y + half_w; + tri[1].x = 4; + tri[1].y = 2; + tri[2].x = 0; + tri[2].y = -4; + } + + XFillPolygon(display, menu.frame, gc, tri, 3, Convex, + CoordModePrevious); + break; + + case Diamond: + XPoint dia[4]; + + dia[0].x = sel_x + quarter_w - 3; + dia[0].y = item_y + half_w; + dia[1].x = 3; + dia[1].y = -3; + dia[2].x = 3; + dia[2].y = 3; + dia[3].x = -3; + dia[3].y = 3; + + XFillPolygon(display, menu.frame, gc, dia, 4, Convex, + CoordModePrevious); + break; + } + } +} + + +void Basemenu::setLabel(const char *l) { + if (menu.label) + delete [] menu.label; + + if (l) menu.label = bstrdup(l); + else menu.label = 0; +} + + +void Basemenu::setItemSelected(int index, Bool sel) { + if (index < 0 || index >= menuitems->count()) return; + + BasemenuItem *item = find(index); + if (! item) return; + + item->setSelected(sel); + if (visible) drawItem(index, (index == which_sub), True); +} + + +Bool Basemenu::isItemSelected(int index) { + if (index < 0 || index >= menuitems->count()) return False; + + BasemenuItem *item = find(index); + if (! item) return False; + + return item->isSelected(); +} + + +void Basemenu::setItemEnabled(int index, Bool enable) { + if (index < 0 || index >= menuitems->count()) return; + + BasemenuItem *item = find(index); + if (! item) return; + + item->setEnabled(enable); + if (visible) drawItem(index, (index == which_sub), True); +} + + +Bool Basemenu::isItemEnabled(int index) { + if (index < 0 || index >= menuitems->count()) return False; + + BasemenuItem *item = find(index); + if (! item) return False; + + return item->isEnabled(); +} + + +void Basemenu::buttonPressEvent(XButtonEvent *be) { + if (be->window == menu.frame) { + 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) { + which_press = i; + which_sbl = sbl; + + BasemenuItem *item = menuitems->find(w); + + if (item->submenu()) + drawSubmenu(w); + else + drawItem(w, (item->isEnabled()), True); + } + } else { + menu.x_move = be->x_root - menu.x; + menu.y_move = be->y_root - menu.y; + } +} + + +void Basemenu::buttonReleaseEvent(XButtonEvent *re) { + if (re->window == menu.title) { + if (moving) { + moving = False; + + if (which_sub != -1) + drawSubmenu(which_sub); + } + + if (re->x >= 0 && re->x <= (signed) menu.width && + re->y >= 0 && re->y <= (signed) menu.title_h) + if (re->button == 3) + hide(); + } else if (re->window == menu.frame && + re->x >= 0 && re->x < (signed) menu.width && + re->y >= 0 && re->y < (signed) menu.frame_h) { + + if (re->button == 3) { + 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; + + if (w < menuitems->count() && w >= 0) { + drawItem(p, (p == which_sub), True); + + if (p == w && isItemEnabled(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 + drawItem(p, False, True); + } + } +} + + +void Basemenu::motionNotifyEvent(XMotionEvent *me) { + if (me->window == menu.title && (me->state & Button1Mask)) { + if (movable) { + if (! moving) { + if (parent && (! torn)) { + parent->drawItem(parent->which_sub, False, True); + parent->which_sub = -1; + } + + moving = torn = True; + + if (which_sub != -1) + drawSubmenu(which_sub); + } else { + menu.x = me->x_root - menu.x_move, + menu.y = me->y_root - menu.y_move; + + XMoveWindow(display, menu.window, menu.x, menu.y); + + if (which_sub != -1) + drawSubmenu(which_sub); + } + } + } else if ((! (me->state & Button1Mask)) && me->window == menu.frame && + 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; + + if ((i != which_press || sbl != which_sbl) && + (w < menuitems->count() && w >= 0)) { + if (which_press != -1 && which_sbl != -1) { + int p = (which_sbl * menu.persub) + which_press; + BasemenuItem *item = menuitems->find(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); + + if (itmp->submenu()) + drawSubmenu(w); + else + drawItem(w, (itmp->isEnabled()), True); + } + } +} + + +void Basemenu::exposeEvent(XExposeEvent *ee) { + if (ee->window == menu.title) { + redrawTitle(); + } else if (ee->window == menu.frame) { + LinkedListIterator<BasemenuItem> it(menuitems); + + // this is a compilicated algorithm... lets do it step by step... + // first... we see in which sub level the expose starts... and how many + // items down in that sublevel + + int sbl = (ee->x / menu.item_w), id = (ee->y / menu.item_h), + // next... figure out how many sublevels over the redraw spans + sbl_d = ((ee->x + ee->width) / menu.item_w), + // then we see how many items down to redraw + id_d = ((ee->y + ee->height) / menu.item_h); + + if (id_d > menu.persub) id_d = menu.persub; + + // draw the sublevels and the number of items the exposure spans + 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++) { + int index = ii + (i * menu.persub); + // redraw the item + drawItem(index, (which_sub == index), False, + ee->x, ee->y, ee->width, ee->height); + } + } + } +} + + +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(); + shifted = True; + } else if (menu.x < 0) { + menu.x_shift = -screen->getBorderWidth(); + shifted = True; + } + + if (menu.y + menu.height > screen->getHeight()) { + menu.y_shift = screen->getHeight() - menu.height - + screen->getBorderWidth(); + shifted = True; + } else if (menu.y + (signed) menu.title_h < 0) { + menu.y_shift = -screen->getBorderWidth(); + shifted = True; + } + + if (shifted) + XMoveWindow(display, menu.window, menu.x_shift, menu.y_shift); + + if (which_sub != -1) { + BasemenuItem *tmp = menuitems->find(which_sub); + if (tmp->submenu()->isVisible()) { + 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(); + + drawItem(which_sub, False, True); + which_sub = -1; + } + } + } + } +} + + +void Basemenu::leaveNotifyEvent(XCrossingEvent *ce) { + if (ce->window == menu.frame) { + if (which_press != -1 && which_sbl != -1 && menuitems->count() > 0) { + int p = (which_sbl * menu.persub) + which_press; + + drawItem(p, (p == which_sub), True); + + which_sbl = which_press = -1; + } + + if (shifted) { + XMoveWindow(display, menu.window, menu.x, menu.y); + shifted = False; + + if (which_sub != -1) drawSubmenu(which_sub); + } + } +} + + +void Basemenu::reconfigure(void) { + XSetWindowBackground(display, menu.window, + screen->getBorderColor()->getPixel()); + XSetWindowBorder(display, menu.window, + screen->getBorderColor()->getPixel()); + XSetWindowBorderWidth(display, menu.window, screen->getBorderWidth()); + + menu.bevel_w = screen->getBevelWidth(); + update(); +}
A src/Basemenu.hh

@@ -0,0 +1,192 @@

+// Basemenu.hh for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> + +// forward declarations +class Basemenu; +class BasemenuItem; + +class Fluxbox; +class BImageControl; +class BScreen; + +#include "LinkedList.hh" + + +class Basemenu { +private: + LinkedList<BasemenuItem> *menuitems; + Fluxbox *fluxbox; + Basemenu *parent; + BImageControl *image_ctrl; + 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 *); + 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 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 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 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); + + 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); + + 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) { + l = lp; + e = ep; + s = 0; + f = fp; + u = 0; + enabled = 1; + selected = 0; + } + + BasemenuItem(const char *lp, Basemenu *mp) { + l = lp; + s = mp; + e = 0; + f = 0; + u = 0; + enabled = 1; + selected = 0; + } + + BasemenuItem(const char **up, int fp) { + u = up; + l = e = 0; + f = fp; + s = 0; + 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
A src/Clientmenu.cc

@@ -0,0 +1,63 @@

+// Clientmenu.cc for Blackbox - an X11 Window manager +// 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 "fluxbox.hh" +#include "Clientmenu.hh" +#include "Screen.hh" +#include "Window.hh" +#include "Workspace.hh" +#include "Workspacemenu.hh" + + +Clientmenu::Clientmenu(Workspace *ws) : Basemenu(ws->getScreen()) { + wkspc = ws; + screen = wkspc->getScreen(); + + setInternalMenu(); +} + + +void Clientmenu::itemSelected(int button, int index) { + if (button > 2) return; + + FluxboxWindow *win = wkspc->getWindow(index); + if (win) { + if (button == 1) { + if (! wkspc->isCurrent()) wkspc->setCurrent(); + } else if (button == 2) { + if (! wkspc->isCurrent()) win->deiconify(True, False); + } + wkspc->raiseWindow(win); + win->setInputFocus(); + } + + if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) hide(); +}
A src/Clientmenu.hh

@@ -0,0 +1,49 @@

+// Clientmenu.hh for Blackbox - an X11 Window manager +// 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 __Clientmenu_hh +#define __Clientmenu_hh + +// forward declarations +class Clientmenu; + +#include "Basemenu.hh" +#include "Workspace.hh" +#include "fluxbox.hh" + + +class Clientmenu : public Basemenu { +private: + BScreen *screen; + Workspace *wkspc; + + +protected: + virtual void itemSelected(int, int); + + +public: + Clientmenu(Workspace *); +}; + + +#endif // __Clientmenu_hh +
A src/Configmenu.cc

@@ -0,0 +1,814 @@

+// Configmenu.cc for Blackbox - An X11 Window Manager +// 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 "i18n.hh" +#include "Configmenu.hh" +#include "Toolbar.hh" +#include "Window.hh" + +#define CMENU_USE_TABS 8 +#define CMENU_USE_ICONS 9 +#define CMENU_TAB_ROTATE 21 + +Configmenu::Configmenu(BScreen *scr) : Basemenu(scr) { + screen = scr; + + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuConfigOptions, +#else // !NLS + 0, 0, +#endif // NLS + "Config options")); + + setInternalMenu(); + + focusmenu = new Focusmenu(this); + placementmenu = new Placementmenu(this); + tabmenu = new Tabmenu(this); + + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuFocusModel, +#else // !NLS + 0, 0, +#endif // NLS + "Focus Model"), focusmenu); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuWindowPlacement, +#else //! NLS + 0, 0, +#endif // NLS + "Window Placement"), placementmenu); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuTabPlacement, +#else // !NLS + 0, 0, +#endif // NLS + "Tab Placement"), tabmenu); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuImageDithering, +#else // !NLS + 0, 0, +#endif // NLS + "Image Dithering"), 1); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuOpaqueMove, +#else // !NLS + 0, 0, +#endif // NLS + "Opaque Window Moving"), 2); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuFullMax, +#else // !NLS + 0, 0, +#endif // NLS + "Full Maximization"), 3); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuFocusNew, +#else // !NLS + 0, 0, +#endif // NLS + "Focus New Windows"), 4); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuFocusLast, +#else // !NLS + 0, 0, +#endif // NLS + "Focus Last Window on Workspace"), 5); + + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuTabs, +#else // !NLS + 0, 0, +#endif // NLS + "Use Tabs"), CMENU_USE_TABS); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuIcons, +#else // !NLS + 0, 0, +#endif // NLS + "Use Icons"), CMENU_USE_ICONS); + + + + update(); + + setItemSelected(3, screen->getImageControl()->doDither()); + setItemSelected(4, screen->doOpaqueMove()); + setItemSelected(5, screen->doFullMax()); + setItemSelected(6, screen->doFocusNew()); + setItemSelected(7, screen->doFocusLast()); + setItemSelected(CMENU_USE_TABS, Fluxbox::instance()->useTabs()); + setItemSelected(CMENU_USE_ICONS, Fluxbox::instance()->useIconBar()); +} + + +Configmenu::~Configmenu(void) { + delete focusmenu; + delete placementmenu; + delete tabmenu; +} + + +void Configmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + + if (item->function()) + switch(item->function()) { + case 1: // dither + screen->getImageControl()-> + setDither((! screen->getImageControl()->doDither())); + + setItemSelected(index, screen->getImageControl()->doDither()); + + break; + + case 2: // opaque move + screen->saveOpaqueMove((! screen->doOpaqueMove())); + + setItemSelected(index, screen->doOpaqueMove()); + + break; + + case 3: // full maximization + screen->saveFullMax((! screen->doFullMax())); + + setItemSelected(index, screen->doFullMax()); + + break; + case 4: // focus new windows + screen->saveFocusNew((! screen->doFocusNew())); + + setItemSelected(index, screen->doFocusNew()); + break; + + case 5: // focus last window on workspace + screen->saveFocusLast((! screen->doFocusLast())); + setItemSelected(index, screen->doFocusLast()); + break; + case CMENU_USE_TABS: + { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->saveTabs(!fluxbox->useTabs()); + setItemSelected(index, fluxbox->useTabs()); + screen->reconfigure(); + } + break; + case CMENU_USE_ICONS: + { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->saveIconBar(!fluxbox->useIconBar()); + setItemSelected(index, fluxbox->useIconBar()); + screen->reconfigure(); + } + break; + } + } +} + + +void Configmenu::reconfigure(void) { + focusmenu->reconfigure(); + placementmenu->reconfigure(); + tabmenu->reconfigure(); + + Basemenu::reconfigure(); +} + + +Configmenu::Focusmenu::Focusmenu(Configmenu *cm) : Basemenu(cm->screen) { + configmenu = cm; + I18n *i18n = I18n::instance(); + setLabel(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuFocusModel, +#else // !NLS + 0, 0, +#endif // NLS + "Focus Model")); + setInternalMenu(); + + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuClickToFocus, +#else // !NLS + 0, 0, +#endif // NLS + "Click To Focus"), 1); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuSloppyFocus, +#else // !NLS + 0, 0, +#endif // NLS + "Sloppy Focus"), 2); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuSemiSloppyFocus, +#else // !NLS + 0, 0, +#endif // NLS + "Semi Sloppy Focus"), 3); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuAutoRaise, +#else // !NLS + 0, 0, +#endif // NLS + "Auto Raise"), 3); + + update(); + + setItemSelected(0, !(configmenu->screen->isSloppyFocus() || + configmenu->screen->isSemiSloppyFocus())); + setItemSelected(1, configmenu->screen->isSloppyFocus()); + setItemSelected(2, configmenu->screen->isSemiSloppyFocus()); + setItemEnabled(3, (configmenu->screen->isSloppyFocus() || + configmenu->screen->isSemiSloppyFocus())); + setItemSelected(3, configmenu->screen->doAutoRaise()); +} + + +void Configmenu::Focusmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + + if (item->function()) { + switch (item->function()) { + case 1: // click to focus + configmenu->screen->saveSloppyFocus(False); + configmenu->screen->saveSemiSloppyFocus(False); + configmenu->screen->saveAutoRaise(False); + + if (! Fluxbox::instance()->getFocusedWindow()) { + XSetInputFocus(Fluxbox::instance()->getXDisplay(), + configmenu->screen->getToolbar()->getWindowID(), + RevertToParent, CurrentTime); + } else { + XSetInputFocus(Fluxbox::instance()->getXDisplay(), + Fluxbox::instance()->getFocusedWindow()->getClientWindow(), + RevertToParent, CurrentTime); + } + + configmenu->screen->reconfigure(); + + break; + + case 2: // sloppy focus + configmenu->screen->saveSemiSloppyFocus(False); + configmenu->screen->saveSloppyFocus(True); + + configmenu->screen->reconfigure(); + + break; + + case 3: // semi sloppy focus + configmenu->screen->saveSloppyFocus(False); + configmenu->screen->saveSemiSloppyFocus(True); + + configmenu->screen->reconfigure(); + + break; + + case 4: // auto raise with sloppy focus + Bool change = ((configmenu->screen->doAutoRaise()) ? False : True); + configmenu->screen->saveAutoRaise(change); + + break; + } + + setItemSelected(0, !(configmenu->screen->isSloppyFocus() || + configmenu->screen->isSemiSloppyFocus())); + setItemSelected(1, configmenu->screen->isSloppyFocus()); + setItemSelected(2, configmenu->screen->isSemiSloppyFocus()); + setItemEnabled(3, (configmenu->screen->isSloppyFocus() || + configmenu->screen->isSemiSloppyFocus())); + setItemSelected(3, configmenu->screen->doAutoRaise()); + } + } +} + + +Configmenu::Placementmenu::Placementmenu(Configmenu *cm) : Basemenu(cm->screen) { + configmenu = cm; + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuWindowPlacement, +#else // !NLS + 0, 0, +#endif // NLS + "Window Placement")); + setInternalMenu(); + + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuSmartRows, +#else // !NLS + 0, 0, +#endif // NLS + "Smart Placement (Rows)"), BScreen::RowSmartPlacement); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuSmartCols, +#else // !NLS + 0, 0, +#endif // NLS + "Smart Placement (Columns)"), BScreen::ColSmartPlacement); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuCascade, +#else // !NLS + 0, 0, +#endif // NLS + "Cascade Placement"), BScreen::CascadePlacement); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuLeftRight, +#else // !NLS + 0, 0, +#endif // NLS + "Left to Right"), BScreen::LeftRight); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuRightLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Right to Left"), BScreen::RightLeft); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuTopBottom, +#else // !NLS + 0, 0, +#endif // NLS + "Top to Bottom"), BScreen::TopBottom); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuBottomTop, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom to Top"), BScreen::BottomTop); + + update(); + + switch (configmenu->screen->getPlacementPolicy()) { + case BScreen::RowSmartPlacement: + setItemSelected(0, True); + break; + + case BScreen::ColSmartPlacement: + setItemSelected(1, True); + break; + + case BScreen::CascadePlacement: + setItemSelected(2, True); + break; + } + + Bool rl = (configmenu->screen->getRowPlacementDirection() == + BScreen::LeftRight), + tb = (configmenu->screen->getColPlacementDirection() == + BScreen::TopBottom); + + setItemSelected(3, rl); + setItemSelected(4, ! rl); + + setItemSelected(5, tb); + setItemSelected(6, ! tb); +} + + +void Configmenu::Placementmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + + if (item->function()) { + switch (item->function()) { + case BScreen::RowSmartPlacement: + configmenu->screen->savePlacementPolicy(item->function()); + + setItemSelected(0, True); + setItemSelected(1, False); + setItemSelected(2, False); + + break; + + case BScreen::ColSmartPlacement: + configmenu->screen->savePlacementPolicy(item->function()); + + setItemSelected(0, False); + setItemSelected(1, True); + setItemSelected(2, False); + + break; + + case BScreen::CascadePlacement: + configmenu->screen->savePlacementPolicy(item->function()); + + setItemSelected(0, False); + setItemSelected(1, False); + setItemSelected(2, True); + + break; + + case BScreen::LeftRight: + configmenu->screen->saveRowPlacementDirection(BScreen::LeftRight); + + setItemSelected(3, True); + setItemSelected(4, False); + + break; + + case BScreen::RightLeft: + configmenu->screen->saveRowPlacementDirection(BScreen::RightLeft); + + setItemSelected(3, False); + setItemSelected(4, True); + + break; + + case BScreen::TopBottom: + configmenu->screen->saveColPlacementDirection(BScreen::TopBottom); + + setItemSelected(5, True); + setItemSelected(6, False); + + break; + + case BScreen::BottomTop: + configmenu->screen->saveColPlacementDirection(BScreen::BottomTop); + + setItemSelected(5, False); + setItemSelected(6, True); + + break; + } + } + } +} + +Configmenu::Tabmenu::Tabmenu(Configmenu *cm) : Basemenu(cm->screen) { + configmenu = cm; + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuTabPlacement, +#else // !NLS + 0, 0, +#endif // NLS + "Tab Placement")); + setInternalMenu(); + + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Top Left"), Tab::PTop + Tab::ALeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Top Center"), Tab::PTop + Tab::ACenter); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopRight, +#else // !NLS + 0, 0, +#endif // NLS + "Top Right"), Tab::PTop + Tab::ARight); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopRelative, +#else // !NLS + 0, 0, +#endif // NLS + "Top Relative"), Tab::PTop + Tab::ARelative); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Left"), Tab::PBottom + Tab::ALeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Center"), Tab::PBottom + Tab::ACenter); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomRight, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Right"), Tab::PBottom + Tab::ARight); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomRelative, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Relative"), Tab::PBottom + Tab::ARelative); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementLeftTop, +#else // !NLS + 0, 0, +#endif // NLS + "Left Top"), Tab::PLeft + Tab::ARight); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementLeftCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Left Center"), Tab::PLeft + Tab::ACenter); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementLeftBottom, +#else // !NLS + 0, 0, +#endif // NLS + "Left Bottom"), Tab::PLeft + Tab::ALeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementLeftRelative, +#else // !NLS + 0, 0, +#endif // NLS + "Left Relative"), Tab::PLeft + Tab::ARelative); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementRightTop, +#else // !NLS + 0, 0, +#endif // NLS + "Right Top"), Tab::PRight + Tab::ARight); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementRightCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Right Center"), Tab::PRight + Tab::ACenter); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementRightBottom, +#else // !NLS + 0, 0, +#endif // NLS + "Right Bottom"), Tab::PRight + Tab::ALeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementRightRelative, +#else // !NLS + 0, 0, +#endif // NLS + "Right Relative"), Tab::PRight + Tab::ARelative); + insert(i18n->getMessage( +#ifdef NLS + ConfigmenuSet, ConfigmenuTabRotateVertical, +#else // !NLS + 0, 0, +#endif // NLS + "Rotate Vertical Tabs"), CMENU_TAB_ROTATE); + update(); + setSelected(); +} + + +void Configmenu::Tabmenu::itemSelected(int button, int index) { + if (button == 1) { + fprintf(stderr, "Item(%d)\n", index); + BasemenuItem *item = find(index); + + switch (item->function()) { + case (Tab::PTop + Tab::ALeft): + configmenu->screen->saveTabPlacement(Tab::PTop); + configmenu->screen->saveTabAlignment(Tab::ALeft); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PTop + Tab::ACenter): + configmenu->screen->saveTabPlacement(Tab::PTop); + configmenu->screen->saveTabAlignment(Tab::ACenter); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PTop + Tab::ARight): + configmenu->screen->saveTabPlacement(Tab::PTop); + configmenu->screen->saveTabAlignment(Tab::ARight); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PTop + Tab::ARelative): + configmenu->screen->saveTabPlacement(Tab::PTop); + configmenu->screen->saveTabAlignment(Tab::ARelative); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PBottom + Tab::ALeft): + configmenu->screen->saveTabPlacement(Tab::PBottom); + configmenu->screen->saveTabAlignment(Tab::ALeft); + + configmenu->screen->reconfigure(); + + break; + case (Tab::PBottom + Tab::ACenter): + configmenu->screen->saveTabPlacement(Tab::PBottom); + configmenu->screen->saveTabAlignment(Tab::ACenter); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PBottom + Tab::ARight): + configmenu->screen->saveTabPlacement(Tab::PBottom); + configmenu->screen->saveTabAlignment(Tab::ARight); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PBottom + Tab::ARelative): + configmenu->screen->saveTabPlacement(Tab::PBottom); + configmenu->screen->saveTabAlignment(Tab::ARelative); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PLeft + Tab::ARight): + configmenu->screen->saveTabPlacement(Tab::PLeft); + configmenu->screen->saveTabAlignment(Tab::ARight); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PLeft + Tab::ACenter): + configmenu->screen->saveTabPlacement(Tab::PLeft); + configmenu->screen->saveTabAlignment(Tab::ACenter); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PLeft + Tab::ALeft): + configmenu->screen->saveTabPlacement(Tab::PLeft); + configmenu->screen->saveTabAlignment(Tab::ALeft); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PLeft + Tab::ARelative): + configmenu->screen->saveTabPlacement(Tab::PLeft); + configmenu->screen->saveTabAlignment(Tab::ARelative); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PRight + Tab::ARight): + configmenu->screen->saveTabPlacement(Tab::PRight); + configmenu->screen->saveTabAlignment(Tab::ARight); + + configmenu->screen->reconfigure(); + + break; + case (Tab::PRight + Tab::ACenter): + configmenu->screen->saveTabPlacement(Tab::PRight); + configmenu->screen->saveTabAlignment(Tab::ACenter); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PRight + Tab::ALeft): + configmenu->screen->saveTabPlacement(Tab::PRight); + configmenu->screen->saveTabAlignment(Tab::ALeft); + + configmenu->screen->reconfigure(); + + break; + + case (Tab::PRight + Tab::ARelative): + configmenu->screen->saveTabPlacement(Tab::PRight); + configmenu->screen->saveTabAlignment(Tab::ARelative); + + configmenu->screen->reconfigure(); + + break; + + case CMENU_TAB_ROTATE: + if (configmenu->screen->isTabRotateVertical()) + configmenu->screen->saveTabRotateVertical(False); + else + configmenu->screen->saveTabRotateVertical(True); + break; + } + + Fluxbox::instance()->reconfigureTabs(); //TODO + setSelected(); + } +} + +void Configmenu::Tabmenu::setSelected(void) { + setItemSelected(0, (configmenu->screen->getTabPlacement() == Tab::PTop && + configmenu->screen->getTabAlignment() == Tab::ALeft)); + setItemSelected(1, (configmenu->screen->getTabPlacement() == Tab::PTop && + configmenu->screen->getTabAlignment() == Tab::ACenter)); + setItemSelected(2, (configmenu->screen->getTabPlacement() == Tab::PTop && + configmenu->screen->getTabAlignment() == Tab::ARight)); + setItemSelected(3, (configmenu->screen->getTabPlacement() == Tab::PTop && + configmenu->screen->getTabAlignment() == Tab::ARelative)); + setItemSelected(4, (configmenu->screen->getTabPlacement() == Tab::PBottom && + configmenu->screen->getTabAlignment() == Tab::ALeft)); + setItemSelected(5, (configmenu->screen->getTabPlacement() == Tab::PBottom && + configmenu->screen->getTabAlignment() == Tab::ACenter)); + setItemSelected(6, (configmenu->screen->getTabPlacement() == Tab::PBottom && + configmenu->screen->getTabAlignment() == Tab::ARight)); + setItemSelected(7, (configmenu->screen->getTabPlacement() == Tab::PBottom && + configmenu->screen->getTabAlignment() == Tab::ARelative)); + setItemSelected(8, (configmenu->screen->getTabPlacement() == Tab::PLeft && + configmenu->screen->getTabAlignment() == Tab::ARight)); + setItemSelected(9, (configmenu->screen->getTabPlacement() == Tab::PLeft && + configmenu->screen->getTabAlignment() == Tab::ACenter)); + setItemSelected(10, (configmenu->screen->getTabPlacement() == Tab::PLeft && + configmenu->screen->getTabAlignment() == Tab::ALeft)); + setItemSelected(11, (configmenu->screen->getTabPlacement() == Tab::PLeft && + configmenu->screen->getTabAlignment() == Tab::ARelative)); + setItemSelected(12, (configmenu->screen->getTabPlacement() == Tab::PRight && + configmenu->screen->getTabAlignment() == Tab::ARight)); + setItemSelected(13, (configmenu->screen->getTabPlacement() == Tab::PRight && + configmenu->screen->getTabAlignment() == Tab::ACenter)); + setItemSelected(14, (configmenu->screen->getTabPlacement() == Tab::PRight && + configmenu->screen->getTabAlignment() == Tab::ALeft)); + setItemSelected(15, (configmenu->screen->getTabPlacement() == Tab::PRight && + configmenu->screen->getTabAlignment() == Tab::ARelative)); + setItemEnabled(16, (configmenu->screen->getTabPlacement() == Tab::PLeft || + configmenu->screen->getTabPlacement() == Tab::PRight)); + setItemSelected(16, (configmenu->screen->isTabRotateVertical() && + (configmenu->screen->getTabPlacement() == Tab::PLeft || + configmenu->screen->getTabPlacement() == Tab::PRight))); +}
A src/Configmenu.hh

@@ -0,0 +1,95 @@

+// Configmenu.hh for Blackbox - An X11 Window Manager +// 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 _CONFIGMENU_HH_ +#define _CONFIGMENU_HH_ + +// forward declaration +class Configmenu; + +#include "Basemenu.hh" +#include "Screen.hh" +#include "fluxbox.hh" + + +class Configmenu : public Basemenu { +private: + class Focusmenu : public Basemenu { + private: + Configmenu *configmenu; + + protected: + virtual void itemSelected(int, int); + + public: + Focusmenu(Configmenu *); + }; + + class Placementmenu : public Basemenu { + private: + Configmenu *configmenu; + + protected: + virtual void itemSelected(int, int); + + public: + Placementmenu(Configmenu *); + }; + + class Tabmenu : public Basemenu { + private: + Configmenu *configmenu; + void setSelected(void); + protected: + virtual void itemSelected(int, int); + + public: + Tabmenu(Configmenu *); + }; + +// Fluxbox *fluxbox; + BScreen *screen; + Focusmenu *focusmenu; + Placementmenu *placementmenu; + Tabmenu *tabmenu; + + friend class Focusmenu; + friend class Placementmenu; + friend class Tabmenu; + + +protected: + virtual void itemSelected(int, int); + + +public: + Configmenu(BScreen *); + virtual ~Configmenu(void); + + inline Basemenu *getFocusmenu(void) { return focusmenu; } + inline Basemenu *getPlacementmenu(void) { return placementmenu; } + inline Basemenu *getTabmenu(void) { return tabmenu; } + + void reconfigure(void); +}; + + +#endif // _CONFIGMENU_HH_
A src/Icon.cc

@@ -0,0 +1,67 @@

+// Icon.cc for Blackbox - an X11 Window manager +// 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 "i18n.hh" +#include "Icon.hh" +#include "Screen.hh" +#include "Window.hh" + + +Iconmenu::Iconmenu(BScreen *scrn) : Basemenu(scrn) { + setInternalMenu(); + + screen = scrn; + setLabel(I18n::instance()->getMessage( +#ifdef NLS + IconSet, IconIcons, +#else // !NLS + 0, 0, +#endif // NLS + "Icons")); + update(); +} + + +void Iconmenu::itemSelected(int button, int index) { + if (button == 1) { + if (index >= 0 && index < screen->getIconCount()) { + FluxboxWindow *win = screen->getIcon(index); + + if (win) { + win->deiconify(); + win->setInputFocus(); + } + } + + if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) + hide(); + } +}
A src/Icon.hh

@@ -0,0 +1,48 @@

+// Icon.hh for Blackbox - an X11 Window manager +// 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 _ICON_HH_ +#define _ICON_HH_ + +// forward declaration +class Iconmenu; + +class BScreen; + +#include "Basemenu.hh" +#include "LinkedList.hh" + + +class Iconmenu : public Basemenu { +private: + BScreen *screen; + + +protected: + virtual void itemSelected(int, int); + + +public: + Iconmenu(BScreen *); +}; + + +#endif //_ICON_HH_
A src/IconBar.cc

@@ -0,0 +1,341 @@

+// IconBar.cc +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 "IconBar.hh" +#include "i18n.hh" + +IconBarObj::IconBarObj(FluxboxWindow *fluxboxwin, Window iconwin) { + m_iconwin = iconwin; + m_fluxboxwin = fluxboxwin; +} + +IconBarObj::~IconBarObj() { + +} + +IconBar::IconBar(BScreen *scrn, Window parent) { + m_parent = parent; + m_screen = scrn; + m_iconlist = new IconList; + m_display = scrn->getBaseDisplay()->getXDisplay(); +} + +IconBar::~IconBar() { + delete m_iconlist; +} + +//------------ addIcon ----------------------- +// Adds icon to iconbar and repostions the +// icons. +// returns window to iconobj +//-------------------------------------------- +Window IconBar::addIcon(FluxboxWindow *fluxboxwin) { + + Window iconwin = createIconWindow(fluxboxwin, m_parent); + decorate(iconwin); + //add window object to list + m_iconlist->insert(new IconBarObj(fluxboxwin, iconwin)); + //reposition all icons to fit windowbar + repositionIcons(); + + XMapSubwindows(m_display, iconwin); + XMapWindow(m_display, iconwin); + + return iconwin; +} + +//----------- delIcon ------------------- +// Removes icon from list and +// repositions the rest of the icons +// Return X Window of the removed iconobj +// returns None if no window was found +//--------------------------------------- +Window IconBar::delIcon(FluxboxWindow *fluxboxwin) { + Window retwin = None; + IconBarObj *obj = findIcon(fluxboxwin); + if (obj) { + m_iconlist->remove(obj); + retwin = obj->getIconWin(); + delete obj; + XDestroyWindow(m_display, retwin); + repositionIcons(); + } + return retwin; +} + +//------------ loadTheme --------------- +// renders theme to m_focus_pm +// with the size width * height +//-------------------------------------- +void IconBar::loadTheme(unsigned int width, unsigned int height) { + BImageControl *image_ctrl = m_screen->getImageControl(); + Pixmap tmp = m_focus_pm; + BTexture *texture = &(m_screen->getWindowStyle()->tab.l_focus); + + if (texture->getTexture() & BImage_ParentRelative ) { + + BTexture *pt = &(m_screen->getWindowStyle()->tab.t_focus); + if (pt->getTexture() == (BImage_Flat | BImage_Solid)) { + m_focus_pm = None; + m_focus_pixel = pt->getColor()->getPixel(); + } else + m_focus_pm = + image_ctrl->renderImage(width, height, pt); + + } else { + + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + m_focus_pm = None; + m_focus_pixel = texture->getColor()->getPixel(); + } else + m_focus_pm = + image_ctrl->renderImage(width, height, texture); + } + if (tmp) image_ctrl->removeImage(tmp); +} + +//------------ decorate ------------------ +// sets the background pixmap/color, +// border, border width of the window +//---------------------------------------- +void IconBar::decorate(Window win) { + + XSetWindowBorderWidth(m_display, win, m_screen->getWindowStyle()->tab.border_width); + XSetWindowBorder(m_display, win, m_screen->getWindowStyle()->tab.border_color.getPixel()); + if (m_focus_pm) + XSetWindowBackgroundPixmap(m_display, win, m_focus_pm); + else + XSetWindowBackground(m_display, win, m_focus_pixel); +} + + +//------------ reconfigure --------------- +// Reconfigures the icons +// theme, pos and width +//---------------------------------------- +void IconBar::reconfigure() { + repositionIcons(); + +} +//---------- exposeEvent ----------------- +// Handles the expose event +// just redraws all the icons +//---------------------------------------- +void IconBar::exposeEvent(XExposeEvent *ee) { + IconBarObj *obj=0; + IconListIterator it(m_iconlist); + for (; it.current(); it++) { + if (it.current()->getIconWin() == ee->window) { + obj = it.current(); + break; + } + } + + if (obj) { + + Window root; + unsigned int width, height; + unsigned int border_width, depth; //not used + int x, y; + XGetGeometry(m_display, m_parent, &root, &x, &y, &width, &height, + &border_width, &depth); + + //max width on every icon + unsigned int icon_width = width / m_iconlist->count(); + + //load right size of theme + loadTheme(icon_width, height); + + draw(obj, icon_width); + + } +} + +//------------ repositionIcons ------------ +// Calculates and moves/resizes the icons +//----------------------------------------- +void IconBar::repositionIcons(void) { + if (!m_iconlist->count()) + return; + + Window root; + unsigned int width, height; + unsigned int border_width, depth; //not used + int x, y; + XGetGeometry(m_display, m_parent, &root, &x, &y, &width, &height, + &border_width, &depth); + + //max width on every icon + unsigned int icon_width = width / m_iconlist->count(); + + //load right size of theme + loadTheme(icon_width, height); + + IconListIterator it(m_iconlist); + + for (x = 0; it.current(); it++, x+=icon_width) { + Window iconwin = it.current()->getIconWin(); + XMoveResizeWindow(m_display, iconwin, + x, 0, + icon_width, height); + draw(it.current(), icon_width); + decorate(iconwin); + } + +} + +//------------ createIconWindow ---------------- +// creates the X Window of icon +// returns the created X Window +//---------------------------------------------- +Window IconBar::createIconWindow(FluxboxWindow *fluxboxwin, Window parent) { + unsigned long attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | + CWColormap | CWOverrideRedirect | CWEventMask; + XSetWindowAttributes attrib; + attrib.background_pixmap = None; + attrib.background_pixel = attrib.border_pixel = + fluxboxwin->getScreen()->getWindowStyle()->tab.border_color.getPixel(); + attrib.colormap = fluxboxwin->getScreen()->getColormap(); + attrib.override_redirect = True; + attrib.event_mask = ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | ExposureMask | EnterWindowMask; + + //create iconwindow + Window iconwin = XCreateWindow(m_display, parent, 0, 0, 1, 1, 0, + fluxboxwin->getScreen()->getDepth(), InputOutput, fluxboxwin->getScreen()->getVisual(), + attrib_mask, &attrib); + + return iconwin; +} + +//------------ draw ------------------ +// Draws theme and string to Window w +//------------------------------------ +void IconBar::draw(IconBarObj *obj, int width) { + if (!obj) + return; + + FluxboxWindow *fluxboxwin = obj->getFluxboxWin(); + Window iconwin = obj->getIconWin(); + char *title = *fluxboxwin->getIconTitle(); + unsigned int title_len = strlen(title); + unsigned int title_text_w; + + if (I18n::instance()->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(m_screen->getWindowStyle()->font.set, + title, title_len, &ink, &logical); + title_text_w = logical.width; + } else { + title_text_w = XTextWidth(m_screen->getWindowStyle()->font.fontstruct, + title, title_len); + } + + int l = title_text_w; + int dlen=title_len; + unsigned int bevel_w = m_screen->getBevelWidth(); + int dx=bevel_w*2; + + for (; dlen >= 0; dlen--) { + if (I18n::instance()->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(m_screen->getWindowStyle()->tab.font.set, + title, dlen, + &ink, &logical); + l = logical.width; + } else + l = XTextWidth(m_screen->getWindowStyle()->tab.font.fontstruct, + title, dlen); + l += (bevel_w * 4); + + if (l < width) + break; + } + + + switch (m_screen->getWindowStyle()->tab.font.justify) { + case FFont::Right: + dx += width - l; + break; + case FFont::Center: + dx += (width - l) / 2; + break; + default: + break; + } + + //Draw title to m_tabwin + + XClearWindow(m_display, iconwin); + + if (I18n::instance()->multibyte()) { + XmbDrawString(m_display, iconwin, + m_screen->getWindowStyle()->tab.font.set, + m_screen->getWindowStyle()->tab.l_text_focus_gc, dx, + 1 - m_screen->getWindowStyle()->tab.font.set_extents->max_ink_extent.y, + title, dlen); + } else { + XDrawString(m_display, iconwin, + m_screen->getWindowStyle()->tab.l_text_focus_gc, dx, + m_screen->getWindowStyle()->tab.font.fontstruct->ascent + 1, + title, dlen); + } + +} + +//------------ findWindow ---------- +// Tries to find the FluxboxWindow of the X Window +// in iconbar +// returns the fluxboxwindow on success else +// 0 on failure +//---------------------------------- +FluxboxWindow *IconBar::findWindow(Window w) { + + IconListIterator it(m_iconlist); + + for (; it.current(); it++) { + IconBarObj *tmp = it.current(); + if (tmp) + if (tmp->getIconWin() == w) + return tmp->getFluxboxWin(); + } + + return 0; +} + +//----------- findIcon --------------- +// Tries to find a fluxboxwin icon in the iconlist +// returns pointer to IconBarObj on success else +// 0 on failure +//------------------------------------ +IconBarObj *IconBar::findIcon(FluxboxWindow *fluxboxwin) { + + IconListIterator it(m_iconlist); + + for (; it.current(); it++) { + IconBarObj *tmp = it.current(); + if (tmp) + if (tmp->getFluxboxWin() == fluxboxwin) + return tmp; + } + + return 0; +}
A src/IconBar.hh

@@ -0,0 +1,72 @@

+// IconBar.hh +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 _ICONBAR_HH_ +#define _ICONBAR_HH_ + +#include <vector> +#include "Window.hh" +#include "LinkedList.hh" + +class Fluxbox; + +class IconBarObj +{ +public: + IconBarObj(FluxboxWindow *fluxboxwin, Window iconwin); + ~IconBarObj(); + inline Window getIconWin(void) { return m_iconwin; } + inline FluxboxWindow *getFluxboxWin(void) { return m_fluxboxwin; } +private: + Window m_iconwin; + FluxboxWindow *m_fluxboxwin; +}; + +typedef LinkedList<IconBarObj> IconList; +typedef LinkedListIterator<IconBarObj> IconListIterator; + +class IconBar +{ +public: + IconBar(BScreen *scrn, Window parent); + ~IconBar(); + void draw(); + void reconfigure(); + Window addIcon(FluxboxWindow *fluxboxwin); + Window delIcon(FluxboxWindow *fluxboxwin); + void buttonPressEvent(XButtonEvent *be); + FluxboxWindow *findWindow(Window w); + void exposeEvent(XExposeEvent *ee); +private: + void draw(IconBarObj *obj, int width); + void loadTheme(unsigned int width, unsigned int height); + void decorate(Window win); + IconBarObj *findIcon(FluxboxWindow *fluxboxwin); + void repositionIcons(void); + Window createIconWindow(FluxboxWindow *fluxboxwin, Window parent); + BScreen *m_screen; + Display *m_display; + Window m_parent; + IconList *m_iconlist; + Pixmap m_focus_pm; + unsigned long m_focus_pixel; +}; + +#endif // _ICONBAR_HH_
A src/Image.cc

@@ -0,0 +1,2593 @@

+// Image.cc for Blackbox - an X11 Window manager +// 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 "i18n.hh" +#include "BaseDisplay.hh" +#include "Image.hh" + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#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 +# include <stdlib.h> +# include <string.h> +#endif // STDC_HEADERS + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef HAVE_CTYPE_H +# include <ctype.h> +#endif // HAVE_CTYPE_H + +static unsigned long bsqrt(unsigned long x) { + if (x <= 0) return 0; + if (x == 1) return 1; + + 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; + + width = ((signed) w > 0) ? w : 1; + height = ((signed) h > 0) ? h : 1; + + red = new unsigned char[width * height]; + green = new unsigned char[width * height]; + blue = new unsigned char[width * height]; + + xtable = ytable = (unsigned int *) 0; + + cpc = control->getColorsPerChannel(); + cpccpc = cpc * cpc; + + 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); +} + + +BImage::~BImage(void) { + if (red) delete [] red; + if (green) delete [] green; + if (blue) delete [] blue; +} + + +Pixmap BImage::render(BTexture *texture) { + if (texture->getTexture() & BImage_ParentRelative) + return ParentRelative; + else if (texture->getTexture() & BImage_Solid) + return render_solid(texture); + else if (texture->getTexture() & BImage_Gradient) + return render_gradient(texture); + + return None; +} + + +Pixmap BImage::render_solid(BTexture *texture) { + Pixmap pixmap = XCreatePixmap(control->getBaseDisplay()->getXDisplay(), + control->getDrawable(), width, + height, control->getDepth()); + if (pixmap == None) { + fprintf(stderr, + I18n::instance()->getMessage( +#ifdef NLS + ImageSet, ImageErrorCreatingSolidPixmap, +#else // !NLS + 0, 0, +#endif // NLS + "BImage::render_solid: error creating pixmap\n")); + return None; + } + + XGCValues gcv; + GC gc, hgc, lgc; + + gcv.foreground = texture->getColor()->getPixel(); + gcv.fill_style = FillSolid; + gc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, + GCForeground | GCFillStyle, &gcv); + + gcv.foreground = texture->getHiColor()->getPixel(); + hgc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, + GCForeground, &gcv); + + gcv.foreground = texture->getLoColor()->getPixel(); + lgc = XCreateGC(control->getBaseDisplay()->getXDisplay(), pixmap, + GCForeground, &gcv); + + 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, + GCForeground, &gcv); + + register unsigned int i = 0; + for (; i < height; i += 2) + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, igc, + 0, i, width, i); + + XFreeGC(control->getBaseDisplay()->getXDisplay(), igc); + } +#endif // INTERLACE + + + if (texture->getTexture() & BImage_Bevel1) { + if (texture->getTexture() & BImage_Raised) { + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, + 0, height - 1, width - 1, height - 1); + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, + width - 1, height - 1, width - 1, 0); + + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + 0, 0, width - 1, 0); + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + 0, height - 1, 0, 0); + } else if (texture->getTexture() & BImage_Sunken) { + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + 0, height - 1, width - 1, height - 1); + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + width - 1, height - 1, width - 1, 0); + + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, + 0, 0, width - 1, 0); + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, + 0, height - 1, 0, 0); + } + } else if (texture->getTexture() & BImage_Bevel2) { + if (texture->getTexture() & BImage_Raised) { + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, + 1, height - 3, width - 3, height - 3); + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, + width - 3, height - 3, width - 3, 1); + + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + 1, 1, width - 3, 1); + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + 1, height - 3, 1, 1); + } else if (texture->getTexture() & BImage_Sunken) { + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + 1, height - 3, width - 3, height - 3); + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, hgc, + width - 3, height - 3, width - 3, 1); + + XDrawLine(control->getBaseDisplay()->getXDisplay(), pixmap, lgc, + 1, 1, width - 3, 1); + 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); + + return pixmap; +} + + +Pixmap BImage::render_gradient(BTexture *texture) { + int inverted = 0; + +#ifdef INTERLACE + interlaced = texture->getTexture() & BImage_Interlaced; +#endif // INTERLACE + + if (texture->getTexture() & BImage_Sunken) { + from = texture->getColorTo(); + to = texture->getColor(); + + if (! (texture->getTexture() & BImage_Invert)) inverted = 1; + } else { + from = texture->getColor(); + to = texture->getColorTo(); + + if (texture->getTexture() & BImage_Invert) inverted = 1; + } + + control->getGradientBuffers(width, height, &xtable, &ytable); + + 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->getTexture() & BImage_Bevel1) bevel1(); + else if (texture->getTexture() & BImage_Bevel2) bevel2(); + + if (inverted) invert(); + + Pixmap pixmap = renderPixmap(); + + return pixmap; + +} + + +XImage *BImage::renderXImage(void) { + I18n *i18n = I18n::instance(); + XImage *image = + XCreateImage(control->getBaseDisplay()->getXDisplay(), + control->getVisual(), control->getDepth(), ZPixmap, 0, 0, + width, height, 32, 0); + + if (! image) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ImageSet, ImageErrorCreatingXImage, +#else // !NLS + 0, 0, +#endif // NLS + "BImage::renderXImage: error creating XImage\n")); + return (XImage *) 0; + } + + // insurance policy + image->data = (char *) 0; + + 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; + + o = image->bits_per_pixel + ((image->byte_order == MSBFirst) ? 1 : 0); + + 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) { + 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]; + + 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]; + + 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); + + 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; + } + } + + pixel_data = (ppixel_data += image->bytes_per_line); + } + + break; + + 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(); + + for (x = 0; x < width; x++) { + *(rerr + x) = *(red + x); + *(gerr + x) = *(green + x); + *(berr + x) = *(blue + x); + } + + *(rerr + x) = *(gerr + x) = *(berr + x) = 0; +#endif // ORDEREDPSEUDO + + for (y = 0, offset = 0; y < height; y++) { +#ifdef ORDEREDPSEUDO + dithy = y & 7; + + for (x = 0; x < width; x++, offset++) { + dithx = x & 7; + + r = red[offset]; + g = green[offset]; + b = blue[offset]; + + 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]; + + 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++; + + pixel = (r * cpccpc) + (g * cpc) + b; + *(pixel_data++) = colors[pixel].pixel; + } + + 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); + } + + *(nrerr + x) = *(red + (--i)); + *(ngerr + x) = *(green + i); + *(nberr + x) = *(blue + i); + } + + for (x = 0; x < width; x++) { + rr = rerr[x]; + gg = gerr[x]; + bb = berr[x]; + + if (rr > 255) rr = 255; else if (rr < 0) rr = 0; + if (gg > 255) gg = 255; else if (gg < 0) gg = 0; + if (bb > 255) bb = 255; else if (bb < 0) bb = 0; + + r = red_table[rr]; + g = green_table[gg]; + b = blue_table[bb]; + + rer = rerr[x] - r*dd; + ger = gerr[x] - g*dd; + ber = berr[x] - b*dd; + + pixel = (r * cpccpc) + (g * cpc) + b; + *pixel_data++ = colors[pixel].pixel; + + r = rer >> 1; + g = ger >> 1; + b = ber >> 1; + rerr[x+1] += r; + gerr[x+1] += g; + berr[x+1] += b; + nrerr[x] += r; + ngerr[x] += g; + nberr[x] += b; + } + + offset += width; + + pixel_data = (ppixel_data += image->bytes_per_line); + + terr = rerr; + rerr = nrerr; + nrerr = terr; + + terr = gerr; + gerr = ngerr; + ngerr = terr; + + terr = berr; + berr = nberr; + nberr = terr; + } + + delete [] rerr; + delete [] gerr; + delete [] berr; + delete [] nrerr; + delete [] ngerr; + delete [] nberr; +#endif // ORDEREDPSUEDO + + break; } + + /* + case StaticGray: + case GrayScale: + 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); + + er = r & 0x7; + eg = g & 0x7; + eb = b & 0x7; + + if ((dither[dithy][dithx] < er) && (r < (256 - 8))) + r += 8; + if ((dither[dithy][dithx] < (eg << 1)) && (g < (256 - 4))) + g += 4; + if ((dither[dithy][dithx] < eb) && (b < (256 - 8))) + b += 8; + + r = *(red_table + r); + g = *(green_table + g); + b = *(blue_table + b); + + g = ((r * 30) + (g * 59) + (b * 11)) / 100; + *pixel_data++ = colors[g].pixel; + } + + pixel_data = (ppixel_data += image->bytes_per_line); + } + + break; + */ + + default: + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ImageSet, ImageUnsupVisual, +#else // !NLS + 0, 0, +#endif // NLS + "BImage::renderXImage: unsupported visual\n")); + delete [] d; + XDestroyImage(image); + return (XImage *) 0; + } + } else { + switch (control->getVisual()->c_class) { + case StaticColor: + case PseudoColor: + for (y = 0, offset = 0; y < height; y++) { + for (x = 0; x < width; x++, offset++) { + r = red_table[red[offset]]; + g = green_table[green[offset]]; + b = blue_table[blue[offset]]; + + pixel = (r * cpccpc) + (g * cpc) + b; + *pixel_data++ = colors[pixel].pixel; + } + + pixel_data = (ppixel_data += image->bytes_per_line); + } + + break; + + case TrueColor: + for (y = 0, offset = 0; y < height; y++) { + for (x = 0; x < width; x++, offset++) { + r = red_table[red[offset]]; + g = green_table[green[offset]]; + b = blue_table[blue[offset]]; + + pixel = (r << red_offset) | (g << green_offset) | (b << blue_offset); + + 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; + } + } + + pixel_data = (ppixel_data += image->bytes_per_line); + } + + break; + + case StaticGray: + case GrayScale: + for (y = 0, offset = 0; y < height; y++) { + for (x = 0; x < width; x++, offset++) { + r = *(red_table + *(red + offset)); + g = *(green_table + *(green + offset)); + b = *(blue_table + *(blue + offset)); + + g = ((r * 30) + (g * 59) + (b * 11)) / 100; + *pixel_data++ = colors[g].pixel; + } + + pixel_data = (ppixel_data += image->bytes_per_line); + } + + break; + + default: + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ImageSet, ImageUnsupVisual, +#else // !NLS + 0, 0, +#endif // NLS + "BImage::renderXImage: unsupported visual\n")); + delete [] d; + XDestroyImage(image); + return (XImage *) 0; + } +} + + image->data = (char *) d; + return image; +} + + +Pixmap BImage::renderPixmap(void) { + I18n *i18n = I18n::instance(); + Pixmap pixmap = + XCreatePixmap(control->getBaseDisplay()->getXDisplay(), + control->getDrawable(), width, height, control->getDepth()); + + if (pixmap == None) { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + ImageSet, ImageErrorCreatingPixmap, +#else // !NLS + 0, 0, +#endif // NLS + "BImage::renderPixmap: error creating pixmap\n")); + return None; + } + + XImage *image = renderXImage(); + + if (! image) { + XFreePixmap(control->getBaseDisplay()->getXDisplay(), pixmap); + return None; + } else if (! image->data) { + XDestroyImage(image); + XFreePixmap(control->getBaseDisplay()->getXDisplay(), pixmap); + return None; + } + + XPutImage(control->getBaseDisplay()->getXDisplay(), pixmap, + DefaultGC(control->getBaseDisplay()->getXDisplay(), + control->getScreenInfo()->getScreenNumber()), + image, 0, 0, 0, 0, width, height); + + if (image->data) { + delete [] image->data; + image->data = NULL; + } + + XDestroyImage(image); + + return pixmap; +} + + +void BImage::bevel1(void) { + if (width > 2 && height > 2) { + unsigned char *pr = red, *pg = green, *pb = blue; + + register unsigned char r, g, b, rr ,gg ,bb; + register unsigned int w = width, h = height - 1, wh = w * h; + + while (--w) { + r = *pr; + rr = r + (r >> 1); + if (rr < r) rr = ~0; + g = *pg; + gg = g + (g >> 1); + if (gg < g) gg = ~0; + b = *pb; + bb = b + (b >> 1); + if (bb < b) bb = ~0; + + *pr = rr; + *pg = gg; + *pb = bb; + + r = *(pr + wh); + rr = (r >> 2) + (r >> 1); + if (rr > r) rr = 0; + g = *(pg + wh); + gg = (g >> 2) + (g >> 1); + if (gg > g) gg = 0; + b = *(pb + wh); + bb = (b >> 2) + (b >> 1); + if (bb > b) bb = 0; + + *((pr++) + wh) = rr; + *((pg++) + wh) = gg; + *((pb++) + wh) = bb; + } + + r = *pr; + rr = r + (r >> 1); + if (rr < r) rr = ~0; + g = *pg; + gg = g + (g >> 1); + if (gg < g) gg = ~0; + b = *pb; + bb = b + (b >> 1); + if (bb < b) bb = ~0; + + *pr = rr; + *pg = gg; + *pb = bb; + + r = *(pr + wh); + rr = (r >> 2) + (r >> 1); + if (rr > r) rr = 0; + g = *(pg + wh); + gg = (g >> 2) + (g >> 1); + if (gg > g) gg = 0; + b = *(pb + wh); + bb = (b >> 2) + (b >> 1); + if (bb > b) bb = 0; + + *(pr + wh) = rr; + *(pg + wh) = gg; + *(pb + wh) = bb; + + pr = red + width; + pg = green + width; + pb = blue + width; + + while (--h) { + r = *pr; + rr = r + (r >> 1); + if (rr < r) rr = ~0; + g = *pg; + gg = g + (g >> 1); + if (gg < g) gg = ~0; + b = *pb; + bb = b + (b >> 1); + if (bb < b) bb = ~0; + + *pr = rr; + *pg = gg; + *pb = bb; + + pr += width - 1; + pg += width - 1; + pb += width - 1; + + r = *pr; + rr = (r >> 2) + (r >> 1); + if (rr > r) rr = 0; + g = *pg; + gg = (g >> 2) + (g >> 1); + if (gg > g) gg = 0; + b = *pb; + bb = (b >> 2) + (b >> 1); + if (bb > b) bb = 0; + + *(pr++) = rr; + *(pg++) = gg; + *(pb++) = bb; + } + + r = *pr; + rr = r + (r >> 1); + if (rr < r) rr = ~0; + g = *pg; + gg = g + (g >> 1); + if (gg < g) gg = ~0; + b = *pb; + bb = b + (b >> 1); + if (bb < b) bb = ~0; + + *pr = rr; + *pg = gg; + *pb = bb; + + pr += width - 1; + pg += width - 1; + pb += width - 1; + + r = *pr; + rr = (r >> 2) + (r >> 1); + if (rr > r) rr = 0; + g = *pg; + gg = (g >> 2) + (g >> 1); + if (gg > g) gg = 0; + b = *pb; + bb = (b >> 2) + (b >> 1); + if (bb > b) bb = 0; + + *pr = rr; + *pg = gg; + *pb = bb; + } +} + + +void BImage::bevel2(void) { + if (width > 4 && height > 4) { + unsigned char r, g, b, rr ,gg ,bb, *pr = red + width + 1, + *pg = green + width + 1, *pb = blue + width + 1; + unsigned int w = width - 2, h = height - 1, wh = width * (height - 3); + + while (--w) { + r = *pr; + rr = r + (r >> 1); + if (rr < r) rr = ~0; + g = *pg; + gg = g + (g >> 1); + if (gg < g) gg = ~0; + b = *pb; + bb = b + (b >> 1); + if (bb < b) bb = ~0; + + *pr = rr; + *pg = gg; + *pb = bb; + + r = *(pr + wh); + rr = (r >> 2) + (r >> 1); + if (rr > r) rr = 0; + g = *(pg + wh); + gg = (g >> 2) + (g >> 1); + if (gg > g) gg = 0; + b = *(pb + wh); + bb = (b >> 2) + (b >> 1); + if (bb > b) bb = 0; + + *((pr++) + wh) = rr; + *((pg++) + wh) = gg; + *((pb++) + wh) = bb; + } + + pr = red + width; + pg = green + width; + pb = blue + width; + + while (--h) { + r = *pr; + rr = r + (r >> 1); + if (rr < r) rr = ~0; + g = *pg; + gg = g + (g >> 1); + if (gg < g) gg = ~0; + b = *pb; + bb = b + (b >> 1); + if (bb < b) bb = ~0; + + *(++pr) = rr; + *(++pg) = gg; + *(++pb) = bb; + + pr += width - 3; + pg += width - 3; + pb += width - 3; + + r = *pr; + rr = (r >> 2) + (r >> 1); + if (rr > r) rr = 0; + g = *pg; + gg = (g >> 2) + (g >> 1); + if (gg > g) gg = 0; + b = *pb; + bb = (b >> 2) + (b >> 1); + if (bb > b) bb = 0; + + *(pr++) = rr; + *(pg++) = gg; + *(pb++) = bb; + + pr++; pg++; pb++; + } + } +} + + +void BImage::invert(void) { + register unsigned int i, j, wh = (width * height) - 1; + unsigned char tmp; + + for (i = 0, j = wh; j > i; j--, i++) { + tmp = *(red + j); + *(red + j) = *(red + i); + *(red + i) = tmp; + + tmp = *(green + j); + *(green + j) = *(green + i); + *(green + i) = tmp; + + tmp = *(blue + j); + *(blue + j) = *(blue + i); + *(blue + i) = tmp; + } +} + + +void BImage::dgradient(void) { + // diagonal gradient code was written by Mike Cole <mike@mydot.com> + // modified for interlacing by Brad Hughes + + float drx, dgx, dbx, dry, dgy, dby, yr = 0.0, yg = 0.0, yb = 0.0, + xr = (float) from->getRed(), + xg = (float) from->getGreen(), + xb = (float) from->getBlue(); + unsigned char *pr = red, *pg = green, *pb = blue; + unsigned int w = width * 2, h = height * 2, *xt = xtable, *yt = ytable; + + register unsigned int x, y; + + dry = drx = (float) (to->getRed() - from->getRed()); + dgy = dgx = (float) (to->getGreen() - from->getGreen()); + dby = dbx = (float) (to->getBlue() - from->getBlue()); + + // Create X table + drx /= w; + dgx /= w; + dbx /= w; + + for (x = 0; x < width; x++) { + *(xt++) = (unsigned char) (xr); + *(xt++) = (unsigned char) (xg); + *(xt++) = (unsigned char) (xb); + + xr += drx; + xg += dgx; + xb += dbx; + } + + // Create Y table + dry /= h; + dgy /= h; + dby /= h; + + for (y = 0; y < height; y++) { + *(yt++) = ((unsigned char) yr); + *(yt++) = ((unsigned char) yg); + *(yt++) = ((unsigned char) yb); + + yr += dry; + yg += dgy; + yb += dby; + } + + // Combine tables to create gradient + +#ifdef INTERLACE + if (! interlaced) { +#endif // INTERLACE + + // normal dgradient + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + *(pr++) = *(xt++) + *(yt); + *(pg++) = *(xt++) + *(yt + 1); + *(pb++) = *(xt++) + *(yt + 2); + } + } + +#ifdef INTERLACE + } else { + // faked interlacing effect + unsigned char channel, channel2; + + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + if (y & 1) { + channel = *(xt++) + *(yt); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pr++) = channel2; + + channel = *(xt++) + *(yt + 1); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pg++) = channel2; + + channel = *(xt++) + *(yt + 2); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pb++) = channel2; + } else { + channel = *(xt++) + *(yt); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pr++) = channel2; + + channel = *(xt++) + *(yt + 1); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pg++) = channel2; + + channel = *(xt++) + *(yt + 2); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pb++) = channel2; + } + } + } + } +#endif // INTERLACE + +} + + +void BImage::hgradient(void) { + float drx, dgx, dbx, + xr = (float) from->getRed(), + xg = (float) from->getGreen(), + xb = (float) from->getBlue(); + unsigned char *pr = red, *pg = green, *pb = blue; + + register unsigned int x, y; + + drx = (float) (to->getRed() - from->getRed()); + dgx = (float) (to->getGreen() - from->getGreen()); + dbx = (float) (to->getBlue() - from->getBlue()); + + drx /= width; + dgx /= width; + dbx /= width; + +#ifdef INTERLACE + if (interlaced && height > 2) { + // faked interlacing effect + unsigned char channel, channel2; + + for (x = 0; x < width; x++, pr++, pg++, pb++) { + channel = (unsigned char) xr; + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *pr = channel2; + + channel = (unsigned char) xg; + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *pg = channel2; + + channel = (unsigned char) xb; + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *pb = channel2; + + + channel = (unsigned char) xr; + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pr + width) = channel2; + + channel = (unsigned char) xg; + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pg + width) = channel2; + + channel = (unsigned char) xb; + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pb + width) = channel2; + + xr += drx; + xg += dgx; + xb += dbx; + } + + pr += width; + pg += width; + pb += width; + + int offset; + + for (y = 2; y < height; y++, pr += width, pg += width, pb += width) { + if (y & 1) offset = width; else offset = 0; + + memcpy(pr, (red + offset), width); + memcpy(pg, (green + offset), width); + memcpy(pb, (blue + offset), width); + } + } else { +#endif // INTERLACE + + // normal hgradient + for (x = 0; x < width; x++) { + *(pr++) = (unsigned char) (xr); + *(pg++) = (unsigned char) (xg); + *(pb++) = (unsigned char) (xb); + + xr += drx; + xg += dgx; + xb += dbx; + } + + for (y = 1; y < height; y++, pr += width, pg += width, pb += width) { + memcpy(pr, red, width); + memcpy(pg, green, width); + memcpy(pb, blue, width); + } + +#ifdef INTERLACE + } +#endif // INTERLACE + +} + + +void BImage::vgradient(void) { + float dry, dgy, dby, + yr = (float) from->getRed(), + yg = (float) from->getGreen(), + yb = (float) from->getBlue(); + unsigned char *pr = red, *pg = green, *pb = blue; + + register unsigned int y; + + dry = (float) (to->getRed() - from->getRed()); + dgy = (float) (to->getGreen() - from->getGreen()); + dby = (float) (to->getBlue() - from->getBlue()); + + dry /= height; + dgy /= height; + dby /= height; + +#ifdef INTERLACE + if (interlaced) { + // faked interlacing effect + unsigned char channel, channel2; + + for (y = 0; y < height; y++, pr += width, pg += width, pb += width) { + if (y & 1) { + channel = (unsigned char) yr; + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + memset(pr, channel2, width); + + channel = (unsigned char) yg; + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + memset(pg, channel2, width); + + channel = (unsigned char) yb; + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + memset(pb, channel2, width); + } else { + channel = (unsigned char) yr; + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + memset(pr, channel2, width); + + channel = (unsigned char) yg; + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + memset(pg, channel2, width); + + channel = (unsigned char) yb; + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + memset(pb, channel2, width); + } + + yr += dry; + yg += dgy; + yb += dby; + } + } else { +#endif // INTERLACE + + // normal vgradient + for (y = 0; y < height; y++, pr += width, pg += width, pb += width) { + memset(pr, (unsigned char) yr, width); + memset(pg, (unsigned char) yg, width); + memset(pb, (unsigned char) yb, width); + + yr += dry; + yg += dgy; + yb += dby; + } + +#ifdef INTERLACE + } +#endif // INTERLACE + +} + + +void BImage::pgradient(void) { + // pyramid gradient - based on original dgradient, written by + // Mosfet (mosfet@kde.org) + // adapted from kde sources for Blackbox by Brad Hughes + + float yr, yg, yb, drx, dgx, dbx, dry, dgy, dby, + xr, xg, xb; + int rsign, gsign, bsign; + unsigned char *pr = red, *pg = green, *pb = blue; + unsigned int tr = to->getRed(), tg = to->getGreen(), tb = to->getBlue(), + *xt = xtable, *yt = ytable; + + register unsigned int x, y; + + dry = drx = (float) (to->getRed() - from->getRed()); + dgy = dgx = (float) (to->getGreen() - from->getGreen()); + dby = dbx = (float) (to->getBlue() - from->getBlue()); + + rsign = (drx < 0) ? -1 : 1; + gsign = (dgx < 0) ? -1 : 1; + bsign = (dbx < 0) ? -1 : 1; + + xr = yr = (drx / 2); + xg = yg = (dgx / 2); + xb = yb = (dbx / 2); + + // Create X table + drx /= width; + dgx /= width; + dbx /= width; + + for (x = 0; x < width; x++) { + *(xt++) = (unsigned char) ((xr < 0) ? -xr : xr); + *(xt++) = (unsigned char) ((xg < 0) ? -xg : xg); + *(xt++) = (unsigned char) ((xb < 0) ? -xb : xb); + + xr -= drx; + xg -= dgx; + xb -= dbx; + } + + // Create Y table + dry /= height; + dgy /= height; + dby /= height; + + for (y = 0; y < height; y++) { + *(yt++) = ((unsigned char) ((yr < 0) ? -yr : yr)); + *(yt++) = ((unsigned char) ((yg < 0) ? -yg : yg)); + *(yt++) = ((unsigned char) ((yb < 0) ? -yb : yb)); + + yr -= dry; + yg -= dgy; + yb -= dby; + } + + // Combine tables to create gradient + +#ifdef INTERLACE + if (! interlaced) { +#endif // INTERLACE + + // normal pgradient + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + *(pr++) = (unsigned char) (tr - (rsign * (*(xt++) + *(yt)))); + *(pg++) = (unsigned char) (tg - (gsign * (*(xt++) + *(yt + 1)))); + *(pb++) = (unsigned char) (tb - (bsign * (*(xt++) + *(yt + 2)))); + } + } + +#ifdef INTERLACE + } else { + // faked interlacing effect + unsigned char channel, channel2; + + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + if (y & 1) { + channel = (unsigned char) (tr - (rsign * (*(xt++) + *(yt)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pr++) = channel2; + + channel = (unsigned char) (tg - (gsign * (*(xt++) + *(yt + 1)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pg++) = channel2; + + channel = (unsigned char) (tb - (bsign * (*(xt++) + *(yt + 2)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pb++) = channel2; + } else { + channel = (unsigned char) (tr - (rsign * (*(xt++) + *(yt)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pr++) = channel2; + + channel = (unsigned char) (tg - (gsign * (*(xt++) + *(yt + 1)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pg++) = channel2; + + channel = (unsigned char) (tb - (bsign * (*(xt++) + *(yt + 2)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pb++) = channel2; + } + } + } + } +#endif // INTERLACE + +} + + +void BImage::rgradient(void) { + // rectangle gradient - based on original dgradient, written by + // Mosfet (mosfet@kde.org) + // adapted from kde sources for Blackbox by Brad Hughes + + float drx, dgx, dbx, dry, dgy, dby, xr, xg, xb, yr, yg, yb; + int rsign, gsign, bsign; + unsigned char *pr = red, *pg = green, *pb = blue; + unsigned int tr = to->getRed(), tg = to->getGreen(), tb = to->getBlue(), + *xt = xtable, *yt = ytable; + + register unsigned int x, y; + + dry = drx = (float) (to->getRed() - from->getRed()); + dgy = dgx = (float) (to->getGreen() - from->getGreen()); + dby = dbx = (float) (to->getBlue() - from->getBlue()); + + rsign = (drx < 0) ? -2 : 2; + gsign = (dgx < 0) ? -2 : 2; + bsign = (dbx < 0) ? -2 : 2; + + xr = yr = (drx / 2); + xg = yg = (dgx / 2); + xb = yb = (dbx / 2); + + // Create X table + drx /= width; + dgx /= width; + dbx /= width; + + for (x = 0; x < width; x++) { + *(xt++) = (unsigned char) ((xr < 0) ? -xr : xr); + *(xt++) = (unsigned char) ((xg < 0) ? -xg : xg); + *(xt++) = (unsigned char) ((xb < 0) ? -xb : xb); + + xr -= drx; + xg -= dgx; + xb -= dbx; + } + + // Create Y table + dry /= height; + dgy /= height; + dby /= height; + + for (y = 0; y < height; y++) { + *(yt++) = ((unsigned char) ((yr < 0) ? -yr : yr)); + *(yt++) = ((unsigned char) ((yg < 0) ? -yg : yg)); + *(yt++) = ((unsigned char) ((yb < 0) ? -yb : yb)); + + yr -= dry; + yg -= dgy; + yb -= dby; + } + + // Combine tables to create gradient + +#ifdef INTERLACE + if (! interlaced) { +#endif // INTERLACE + + // normal rgradient + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + *(pr++) = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); + *(pg++) = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); + *(pb++) = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); + } + } + +#ifdef INTERLACE + } else { + // faked interlacing effect + unsigned char channel, channel2; + + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + if (y & 1) { + channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pr++) = channel2; + + channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pg++) = channel2; + + channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pb++) = channel2; + } else { + channel = (unsigned char) (tr - (rsign * max(*(xt++), *(yt)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pr++) = channel2; + + channel = (unsigned char) (tg - (gsign * max(*(xt++), *(yt + 1)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pg++) = channel2; + + channel = (unsigned char) (tb - (bsign * max(*(xt++), *(yt + 2)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pb++) = channel2; + } + } + } + } +#endif // INTERLACE + +} + + +void BImage::egradient(void) { + // elliptic gradient - based on original dgradient, written by + // Mosfet (mosfet@kde.org) + // adapted from kde sources for Blackbox by Brad Hughes + + float drx, dgx, dbx, dry, dgy, dby, yr, yg, yb, xr, xg, xb; + int rsign, gsign, bsign; + unsigned char *pr = red, *pg = green, *pb = blue; + unsigned int *xt = xtable, *yt = ytable, + tr = (unsigned long) to->getRed(), + tg = (unsigned long) to->getGreen(), + tb = (unsigned long) to->getBlue(); + + register unsigned int x, y; + + dry = drx = (float) (to->getRed() - from->getRed()); + dgy = dgx = (float) (to->getGreen() - from->getGreen()); + dby = dbx = (float) (to->getBlue() - from->getBlue()); + + rsign = (drx < 0) ? -1 : 1; + gsign = (dgx < 0) ? -1 : 1; + bsign = (dbx < 0) ? -1 : 1; + + xr = yr = (drx / 2); + xg = yg = (dgx / 2); + xb = yb = (dbx / 2); + + // Create X table + drx /= width; + dgx /= width; + dbx /= width; + + for (x = 0; x < width; x++) { + *(xt++) = (unsigned long) (xr * xr); + *(xt++) = (unsigned long) (xg * xg); + *(xt++) = (unsigned long) (xb * xb); + + xr -= drx; + xg -= dgx; + xb -= dbx; + } + + // Create Y table + dry /= height; + dgy /= height; + dby /= height; + + for (y = 0; y < height; y++) { + *(yt++) = (unsigned long) (yr * yr); + *(yt++) = (unsigned long) (yg * yg); + *(yt++) = (unsigned long) (yb * yb); + + yr -= dry; + yg -= dgy; + yb -= dby; + } + + // Combine tables to create gradient + +#ifdef INTERLACE + if (! interlaced) { +#endif // INTERLACE + + // normal egradient + 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)))); + *(pg++) = (unsigned char) + (tg - (gsign * control->getSqrt(*(xt++) + *(yt + 1)))); + *(pb++) = (unsigned char) + (tb - (bsign * control->getSqrt(*(xt++) + *(yt + 2)))); + } + } + +#ifdef INTERLACE + } else { + // faked interlacing effect + unsigned char channel, channel2; + + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + if (y & 1) { + channel = (unsigned char) + (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)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pg++) = channel2; + + channel = (unsigned char) + (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)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pr++) = channel2; + + channel = (unsigned char) + (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)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pb++) = channel2; + } + } + } + } +#endif // INTERLACE + +} + + +void BImage::pcgradient(void) { + // pipe cross gradient - based on original dgradient, written by + // Mosfet (mosfet@kde.org) + // adapted from kde sources for Blackbox by Brad Hughes + + float drx, dgx, dbx, dry, dgy, dby, xr, xg, xb, yr, yg, yb; + int rsign, gsign, bsign; + unsigned char *pr = red, *pg = green, *pb = blue; + unsigned int *xt = xtable, *yt = ytable, + tr = to->getRed(), + tg = to->getGreen(), + tb = to->getBlue(); + + register unsigned int x, y; + + dry = drx = (float) (to->getRed() - from->getRed()); + dgy = dgx = (float) (to->getGreen() - from->getGreen()); + dby = dbx = (float) (to->getBlue() - from->getBlue()); + + rsign = (drx < 0) ? -2 : 2; + gsign = (dgx < 0) ? -2 : 2; + bsign = (dbx < 0) ? -2 : 2; + + xr = yr = (drx / 2); + xg = yg = (dgx / 2); + xb = yb = (dbx / 2); + + // Create X table + drx /= width; + dgx /= width; + dbx /= width; + + for (x = 0; x < width; x++) { + *(xt++) = (unsigned char) ((xr < 0) ? -xr : xr); + *(xt++) = (unsigned char) ((xg < 0) ? -xg : xg); + *(xt++) = (unsigned char) ((xb < 0) ? -xb : xb); + + xr -= drx; + xg -= dgx; + xb -= dbx; + } + + // Create Y table + dry /= height; + dgy /= height; + dby /= height; + + for (y = 0; y < height; y++) { + *(yt++) = ((unsigned char) ((yr < 0) ? -yr : yr)); + *(yt++) = ((unsigned char) ((yg < 0) ? -yg : yg)); + *(yt++) = ((unsigned char) ((yb < 0) ? -yb : yb)); + + yr -= dry; + yg -= dgy; + yb -= dby; + } + + // Combine tables to create gradient + +#ifdef INTERLACE + if (! interlaced) { +#endif // INTERLACE + + // normal pcgradient + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + *(pr++) = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); + *(pg++) = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1)))); + *(pb++) = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2)))); + } + } + +#ifdef INTERLACE + } else { + // faked interlacing effect + unsigned char channel, channel2; + + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + if (y & 1) { + channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pr++) = channel2; + + channel = (unsigned char) (tg - (bsign * min(*(xt++), *(yt + 1)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pg++) = channel2; + + channel = (unsigned char) (tb - (gsign * min(*(xt++), *(yt + 2)))); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pb++) = channel2; + } else { + channel = (unsigned char) (tr - (rsign * min(*(xt++), *(yt)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pr++) = channel2; + + channel = (unsigned char) (tg - (gsign * min(*(xt++), *(yt + 1)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pg++) = channel2; + + channel = (unsigned char) (tb - (bsign * min(*(xt++), *(yt + 2)))); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pb++) = channel2; + } + } + } + } +#endif // INTERLACE + +} + + +void BImage::cdgradient(void) { + // cross diagonal gradient - based on original dgradient, written by + // Mosfet (mosfet@kde.org) + // adapted from kde sources for Blackbox by Brad Hughes + + float drx, dgx, dbx, dry, dgy, dby, yr = 0.0, yg = 0.0, yb = 0.0, + xr = (float) from->getRed(), + xg = (float) from->getGreen(), + xb = (float) from->getBlue(); + unsigned char *pr = red, *pg = green, *pb = blue; + unsigned int w = width * 2, h = height * 2, *xt, *yt; + + register unsigned int x, y; + + dry = drx = (float) (to->getRed() - from->getRed()); + dgy = dgx = (float) (to->getGreen() - from->getGreen()); + dby = dbx = (float) (to->getBlue() - from->getBlue()); + + // Create X table + drx /= w; + dgx /= w; + dbx /= w; + + for (xt = (xtable + (width * 3) - 1), x = 0; x < width; x++) { + *(xt--) = (unsigned char) xb; + *(xt--) = (unsigned char) xg; + *(xt--) = (unsigned char) xr; + + xr += drx; + xg += dgx; + xb += dbx; + } + + // Create Y table + dry /= h; + dgy /= h; + dby /= h; + + for (yt = ytable, y = 0; y < height; y++) { + *(yt++) = (unsigned char) yr; + *(yt++) = (unsigned char) yg; + *(yt++) = (unsigned char) yb; + + yr += dry; + yg += dgy; + yb += dby; + } + + // Combine tables to create gradient + +#ifdef INTERLACE + if (! interlaced) { +#endif // INTERLACE + + // normal cdgradient + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + *(pr++) = *(xt++) + *(yt); + *(pg++) = *(xt++) + *(yt + 1); + *(pb++) = *(xt++) + *(yt + 2); + } + } + +#ifdef INTERLACE + } else { + // faked interlacing effect + unsigned char channel, channel2; + + for (yt = ytable, y = 0; y < height; y++, yt += 3) { + for (xt = xtable, x = 0; x < width; x++) { + if (y & 1) { + channel = *(xt++) + *(yt); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pr++) = channel2; + + channel = *(xt++) + *(yt + 1); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pg++) = channel2; + + channel = *(xt++) + *(yt + 2); + channel2 = (channel >> 1) + (channel >> 2); + if (channel2 > channel) channel2 = 0; + *(pb++) = channel2; + } else { + channel = *(xt++) + *(yt); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pr++) = channel2; + + channel = *(xt++) + *(yt + 1); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pg++) = channel2; + + channel = *(xt++) + *(yt + 2); + channel2 = channel + (channel >> 3); + if (channel2 < channel) channel2 = ~0; + *(pb++) = channel2; + } + } + } + } +#endif // INTERLACE + +} + + +BImageControl::BImageControl(BaseDisplay *dpy, ScreenInfo *scrn, Bool _dither, + int _cpc, unsigned long cache_timeout, + unsigned long cmax) +{ + I18n *i18n = I18n::instance(); + basedisplay = dpy; + screeninfo = scrn; + setDither(_dither); + setColorsPerChannel(_cpc); + + cache_max = cmax; +#ifdef TIMEDCACHE + if (cache_timeout) { + 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(); + + int count; + XPixmapFormatValues *pmv = XListPixmapFormats(basedisplay->getXDisplay(), + &count); + 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( +#ifdef NLS + ImageSet, ImageInvalidColormapSize, +#else // !NLS + 0, 0, +#endif // NLS + "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( +#ifdef NLS + ImageSet, ImageErrorAllocatingColormap, +#else // !NLS + 0, 0, +#endif // NLS + "BImageControl::BImageControl: error allocating " + "colormap\n")); + throw static_cast<int>(1); //throw exit code 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(); + + for (i = 0; i < ncolors; i++) { + if (! XAllocColor(basedisplay->getXDisplay(), colormap, &colors[i])) { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + ImageSet, ImageColorAllocFail, +#else // !NLS + 0, 0, +#endif // NLS + "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(); + + 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); + 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, + &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( +#ifdef NLS + ImageSet, ImageInvalidColormapSize, +#else // !NLS + 0, 0, +#endif // NLS + "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( +#ifdef NLS + ImageSet, ImageErrorAllocatingColormap, +#else // !NLS + 0, 0, +#endif // NLS + "BImageControl::BImageControl: error allocating " + "colormap\n")); + throw static_cast<int>(1); // throw exit code 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(); + 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, + &colors[i])) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ImageSet, ImageColorAllocFail, +#else // !NLS + 0, 0, +#endif // NLS + "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(); + + 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); + 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, + &colors[i])) { + colors[i].flags = DoRed|DoGreen|DoBlue; + break; + } + } + } + } + } + + break; + } + + default: + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ImageSet, ImageUnsupVisual, +#else // !NLS + 0, 0, +#endif // NLS + "BImageControl::BImageControl: unsupported visual %d\n"), + getVisual()->c_class); + throw static_cast<int>(1); //throw error code 1 + + } + + cache = new LinkedList<Cache>; +} + + +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); + + delete [] colors; + } + + if (cache->count()) { + int i, n = cache->count(); + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + ImageSet, ImagePixmapRelease, +#else // !NLS + 0, 0, +#endif // NLS + "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); + 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<Cache> it(cache); + + for (; it.current(); it++) { + if ((it.current()->width == width) && + (it.current()->height == height) && + (it.current()->texture == texture) && + (it.current()->pixel1 == c1->getPixel())) + if (texture & BImage_Gradient) { + if (it.current()->pixel2 == c2->getPixel()) { + it.current()->count++; + return it.current()->pixmap; + } + } else { + it.current()->count++; + return it.current()->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); + 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); + + if ((unsigned) cache->count() > cache_max) { +#ifdef DEBUG + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + ImageSet, ImagePixmapCacheLarge, +#else // !NLS + 0, 0, +#endif // NLS + "BImageControl::renderImage: cache is large, " + "forcing cleanout\n")); +#endif // DEBUG + + timeout(); + } + + return pixmap; + } + + return None; +} + + +void BImageControl::removeImage(Pixmap pixmap) { + if (pixmap) { + LinkedListIterator<Cache> it(cache); + for (; it.current(); it++) { + if (it.current()->pixmap == pixmap) { + Cache *tmp = it.current(); + + 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)) + fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", + colorname); + 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)) + fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", + colorname); + else { + if (! XAllocColor(basedisplay->getXDisplay(), colormap, &color)) + fprintf(stderr, "BImageControl::getColor: color alloc error: \"%s\"\n", + colorname); + else + fprintf(stderr, "%s(%d) Allocated color:%s", __FILE__, __LINE__, 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(); + + Bool install = True; + int i = 0, ncmap = 0; + Colormap *cmaps = + 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); + + XFree(cmaps); + } + + 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) { + 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) { + if (! color) return; + + if (color->isAllocated()) { + unsigned long pixel = color->getPixel(); + + 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<Cache> it(cache); + for (; it.current(); it++) { + Cache *tmp = it.current(); + + if (tmp->count <= 0) { + XFreePixmap(basedisplay->getXDisplay(), tmp->pixmap); + cache->remove(tmp); + delete tmp; + } + } +}
A src/Image.hh

@@ -0,0 +1,242 @@

+// Image.hh for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> +#include <X11/Xutil.h> + +#include "Timer.hh" + +class BImage; +class BImageControl; + + +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; } +}; + + +// 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 + +#include "BaseDisplay.hh" +#include "LinkedList.hh" + + +class BImage { +private: + 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(void); + + Pixmap render(BTexture *); + Pixmap render_solid(BTexture *); + Pixmap render_gradient(BTexture *); +}; + + +class BImageControl : public TimeoutHandler { +private: + Bool dither; + 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> *cache; + + +protected: + Pixmap searchCache(unsigned int, unsigned int, unsigned long, BColor *, + BColor *); + + +public: + BImageControl(BaseDisplay *, ScreenInfo *, Bool = False, int = 4, + unsigned long = 300000l, unsigned long = 200l); + virtual ~BImageControl(void); + + inline BaseDisplay *getBaseDisplay(void) { return basedisplay; } + + inline const Bool &doDither(void) { return dither; } + inline const Colormap &getColormap(void) const { return colormap; } + inline ScreenInfo *getScreenInfo(void) { return screeninfo; } + + inline const Window &getDrawable(void) const { return window; } + + inline Visual *getVisual(void) { 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); + + virtual void timeout(void); +}; + + +#endif // __Image_hh +
A src/Keys.cc

@@ -0,0 +1,583 @@

+// Key2.cc for Fluxbox - an X11 Window manager +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef HAVE_CTYPE_H +# include <ctype.h> +#endif // HAVE_CTYPE_H + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +# include <errno.h> +#endif // STDC_HEADERS + +#if HAVE_STRINGS_H +# include <strings.h> +#endif + +#ifdef HAVE_SYS_TYPES_H +# include <sys/types.h> +#endif // HAVE_SYS_TYPES_H + +#ifdef HAVE_SYS_WAIT_H +# include <sys/wait.h> +#endif // HAVE_SYS_WAIT_H + +#ifdef HAVE_UNISTD_H +# include <unistd.h> +#endif // HAVE_UNISTD_H + +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif // HAVE_SYS_STAT_H + +#include <X11/Xlib.h> +#include <X11/Xproto.h> +#include <X11/keysym.h> + +#include "Keys.hh" +#include "fluxbox.hh" + +#include <iostream> +#include <fstream> + +using namespace std; + +Keys::t_actionstr Keys::m_actionlist[] = { + {"Minimize", grabIconify}, + {"Raise", grabRaise}, + {"Lower", grabLower}, + {"Close", grabClose}, + {"AbortKeychain", grabAbortKeychain}, + {"Workspace1", grabWorkspace1}, + {"Workspace2", grabWorkspace2}, + {"Workspace3", grabWorkspace3}, + {"Workspace4", grabWorkspace4}, + {"Workspace5", grabWorkspace5}, + {"Workspace6", grabWorkspace6}, + {"Workspace7", grabWorkspace7}, + {"Workspace8", grabWorkspace8}, + {"Workspace9", grabWorkspace9}, + {"Workspace10", grabWorkspace10}, + {"Workspace11", grabWorkspace11}, + {"Workspace12", grabWorkspace12}, + {"NextWorkspace", grabNextWorkspace}, + {"PrevWorkspace", grabPrevWorkspace}, + {"LeftWorkspace", grabLeftWorkspace}, + {"RightWorkspace", grabRightWorkspace}, + {"KillWindow", grabKillWindow}, + {"NextWindow", grabNextWindow}, + {"PrevWindow", grabPrevWindow}, + {"NextTab", grabNextTab}, + {"PrevTab", grabPrevTab}, + {"ShadeWindow", grabShade}, + {"MaximizeWindow", grabMaximize}, + {"StickWindow", grabStick}, + {"ExecCommand", grabExecute}, + {"MaximizeVertical", grabVertMax}, + {"MaximizeHorizontal", grabHorizMax}, + {"NudgeRight", grabNudgeRight}, + {"NudgeLeft", grabNudgeLeft}, + {"NudgeUp", grabNudgeUp}, + {"NudgeDown", grabNudgeDown}, + {"BigNudgeRight", grabBigNudgeRight}, + {"BigNudgeLeft", grabBigNudgeLeft}, + {"BigNudgeUp", grabBigNudgeUp}, + {"BigNudgeDown", grabBigNudgeDown}, + {"HorizontalIncrement", grabHorizInc}, + {"VerticalIncrement", grabVertInc}, + {"HorizontalDecrement", grabHorizDec}, + {"VerticalDecrement", grabVertDec}, + {"ToggleDecor", grabToggleDecor}, + {0, lastKeygrab} + }; + +Keys::Keys(char *filename) { + m_abortkey=0; + load(filename); +} + +Keys::~Keys() { + deleteTree(); +} +//--------- deleteTree ----------- +// Destroys the keytree and m_abortkey +//-------------------------------- +void Keys::deleteTree() { + while (!m_keylist.empty()) { + if (m_keylist.back()) + delete m_keylist.back(); + m_keylist.pop_back(); + } + if (m_abortkey) { + delete m_abortkey; + m_abortkey=0; + } +} +//-------------- load ---------------- +// Load and grab keys +// Returns true on success else false +// TODO: error checking and nls on them? +// and possible replacement of strtok +//------------------------------------ +bool Keys::load(char *filename) { + if (!filename) + return false; + + Fluxbox *fluxbox = Fluxbox::instance(); + Display *display = fluxbox->getXDisplay(); + ScreenInfo *screeninfo=0; + //ungrab all keys + int screen=0; + while ((screeninfo = fluxbox->getScreenInfo(screen++)) ) { + XUngrabKey(display, AnyKey, AnyModifier, + screeninfo->getRootWindow()); + } + + XSync(display, False); + + //open the file + ifstream infile(filename); + if (!infile) + return false; + + + char *linebuffer = new char[1024]; + int line=0; + int linepos=0; //position in the line + + while (!infile.eof()) { + infile.getline(linebuffer, 1024); + + line++; + char *val = strtok(linebuffer, " "); + linepos = (val==0 ? 0 : strlen(val) + 1); + + int numarg = 1; + unsigned int key=0, mod=0; + char keyarg=0; + t_key *current_key=0, *last_key=0; + + while (val) { + + if (val[0]!=':') { + keyarg++; + if (keyarg==1) //first arg is modifier + mod = getModifier(val); + else if (keyarg>1) { + + //keyarg=0; + key = getKey(val); + if (!key){ //if no keycode was found try the modifier + int tmpmod = getModifier(val); + if (tmpmod) + mod |= tmpmod; //add it to modifier + + } else if (!current_key) { + + current_key = new t_key(key, mod); + last_key = current_key; + + } else { + + t_key *temp_key = new t_key(key, mod); + last_key->keylist.push_back(temp_key); + last_key = temp_key; + } + + } + + } else { + + val++; //ignore the ':' + + unsigned int i=0; + + for (i=0; i< lastKeygrab; i++) { + if (strcasecmp(m_actionlist[i].string, val) == 0) + break; + } + + if (i < lastKeygrab ) { + if (!current_key) { + cerr<<"Error on line: "<<line<<endl; + cerr<<linebuffer<<endl; + delete current_key; + current_key = 0; + last_key = 0; + break; //break out and read next line + } + + //special case for grabAbortKeychain + if (m_actionlist[i].action == grabAbortKeychain) { + if (last_key!=current_key) + cerr<<"Keys: "<<m_actionlist[i].string<<" cant be in chained mode"<<endl; + else if (m_abortkey) + cerr<<"Keys: "<<m_actionlist[i].string<<" is already bound."<<endl; + else + m_abortkey = new t_key(current_key->key, current_key->mod, grabAbortKeychain); + + delete current_key; + current_key = 0; + last_key = 0; + break; //break out and read next line + } + + last_key->action = m_actionlist[i].action; + if (last_key->action == grabExecute) + last_key->execcommand = &linebuffer[linepos]; + + //add the keychain to list + if (!mergeTree(current_key)) + cerr<<"Keys: Faild to merge keytree!"<<endl; + + #ifdef DEBUG + if (m_actionlist[i].action == Keys::grabExecute) { + + cerr<<"linepos:"<<linepos<<endl; + cerr<<"buffer:"<<&linebuffer[linepos]<<endl; + cerr<<"command:"<<last_key->execcommand<<endl; + + } + #endif + + //clear keypointers now that we have them in m_keylist + delete current_key; + current_key = 0; + last_key = 0; + + } else { //destroy list if no action is found + #ifdef DEBUG + cerr<<"Didnt find action="<<val<<endl; + #endif + //destroy current_key ... this will also destroy the last_key + delete current_key; + current_key = 0; + last_key = 0; + } + + break; //dont process this linebuffer more + } + numarg++; + val = strtok(0, " "); + linepos += (val == 0 ? 0 : strlen(val) + 1); + } + } + + delete linebuffer; + #ifdef DEBUG + showTree(); + #endif + return true; +} + +//--------- grabKey --------------- +// Grabs a key with the modifier +// and with numlock,capslock and scrollock +//--------------------------------- +void Keys::grabKey(unsigned int key, unsigned int mod) { + + Fluxbox *fluxbox = Fluxbox::instance(); + Display *display = fluxbox->getXDisplay(); + + #ifdef DEBUG + cerr<<__FILE__<<"("<<__LINE__<<"): keycode "<<key<<" mod "<<hex<<mod<<dec<<endl; + #endif + int i=0; + ScreenInfo *screeninfo=0; + + while ((screeninfo = fluxbox->getScreenInfo(i++)) ) { + Window root = screeninfo->getRootWindow(); + XGrabKey(display, key, mod, + root, True, + GrabModeAsync, GrabModeAsync); + + // Grab with numlock, capslock and scrlock + + //numlock + XGrabKey(display, key, mod|Mod2Mask, + root, True, + GrabModeAsync, GrabModeAsync); + //scrolllock + XGrabKey(display, key, mod|Mod5Mask, + root, True, + GrabModeAsync, GrabModeAsync); + //capslock + XGrabKey(display, key, mod|LockMask, + root, True, + GrabModeAsync, GrabModeAsync); + + //capslock+numlock + XGrabKey(display, key, mod|LockMask|Mod2Mask, + root, True, + GrabModeAsync, GrabModeAsync); + + //capslock+scrolllock + XGrabKey(display, key, mod|LockMask|Mod5Mask, + root, True, + GrabModeAsync, GrabModeAsync); + + //capslock+numlock+scrolllock + XGrabKey(display, key, mod|Mod2Mask|Mod5Mask|LockMask, + root, True, + GrabModeAsync, GrabModeAsync); + + //numlock+scrollLock + XGrabKey(display, key, mod|Mod2Mask|Mod5Mask, + root, True, + GrabModeAsync, GrabModeAsync); + + } + +} + +//------------ getModifier --------------- +// Returns the modifier for the modstr +// else zero on failure. +// TODO fix more masks +//---------------------------------------- +unsigned int Keys::getModifier(char *modstr) { + if (!modstr) + return 0; + struct t_modlist{ + char *string; + unsigned int mask; + bool operator == (char *modstr) { + return (strcasecmp(string, modstr) == 0 && mask !=0); + } + } modlist[] = { + {"SHIFT", ShiftMask}, + {"CONTROL", ControlMask}, + {"MOD1", Mod1Mask}, + {"MOD2", Mod2Mask}, + {"MOD3", Mod3Mask}, + {"MOD4", Mod4Mask}, + {"MOD5", Mod5Mask}, + {0, 0} + }; + + for (unsigned int i=0; modlist[i].string!=0; i++) { + if (modlist[i]==modstr) + return modlist[i].mask; + } + + return 0; +} + +//----------- getKey ---------------- +// Returns keycode of keystr on success +// else it returns zero +//----------------------------------- +unsigned int Keys::getKey(char *keystr) { + if (!keystr) + return 0; + return XKeysymToKeycode(Fluxbox::instance()->getXDisplay(), + XStringToKeysym + (keystr)); +} + +//--------- getAction ----------------- +// returns the KeyAction of the XKeyEvent +//------------------------------------- +Keys::KeyAction Keys::getAction(XKeyEvent *ke) { + static t_key *next_key = 0; + //remove numlock, capslock and scrolllock + ke->state &= ~Mod2Mask & ~Mod5Mask & ~LockMask; + + if (m_abortkey && *m_abortkey==ke) { //abort current keychain + next_key = 0; + return m_abortkey->action; + } + + if (!next_key) { + + for (unsigned int i=0; i<m_keylist.size(); i++) { + if (*m_keylist[i] == ke) { + if (m_keylist[i]->keylist.size()) { + next_key = m_keylist[i]; + break; //end for-loop + } else { + if (m_keylist[i]->action == grabExecute) + m_execcmdstring = m_keylist[i]->execcommand; //update execcmdstring if action is grabExecute + return m_keylist[i]->action; + } + } + } + + } else { //check the nextkey + t_key *temp_key = next_key->find(ke); + if (temp_key) { + if (temp_key->keylist.size()) { + next_key = temp_key; + } else { + next_key = 0; + if (temp_key->action == grabExecute) + m_execcmdstring = temp_key->execcommand; //update execcmdstring if action is grabExecute + return temp_key->action; + } + } else { + temp_key = next_key; + next_key = 0; + if (temp_key->action == grabExecute) + m_execcmdstring = temp_key->execcommand; //update execcmdstring if action is grabExecute + return temp_key->action; + } + + } + + return lastKeygrab; +} + +//--------- reconfigure ------------- +// deletes the tree and load configuration +// returns true on success else false +//----------------------------------- +bool Keys::reconfigure(char *filename) { + deleteTree(); + return load(filename); +} + +//------------- getActionStr ------------------ +// Tries to find the action for the key +// Returns actionstring on success else +// 0 on failure +//--------------------------------------------- +const char *Keys::getActionStr(KeyAction action) { + for (unsigned int i=0; m_actionlist[i].string!=0 ; i++) { + if (m_actionlist[i].action == action) + return m_actionlist[i].string; + } + + return 0; +} + +#ifdef DEBUG +//--------- showTree ----------- +// Debug function that show the +// keytree. Starts with the +// rootlist +//------------------------------ +void Keys::showTree() { + for (unsigned int i=0; i<m_keylist.size(); i++) { + if (m_keylist[i]) { + cerr<<i<<" "; + showKeyTree(m_keylist[i]); + } else + cerr<<"Null @ "<<i<<endl; + } +} + +//---------- showKeyTree -------- +// Debug function to show t_key tree +//------------------------------- +void Keys::showKeyTree(t_key *key, unsigned int w) { + for (unsigned int i=0; i<w+1; i++) + cerr<<"-"; + if (!key->keylist.empty()) { + for (unsigned int i=0; i<key->keylist.size(); i++) { + cerr<<"( "<<(int)key->key<<" "<<(int)key->mod<<" )"; + showKeyTree(key->keylist[i], 4); + cerr<<endl; + } + } else + cerr<<"( "<<(int)key->key<<" "<<(int)key->mod<<" ) {"<<getActionStr(key->action)<<"}"<<endl; +} +#endif //DEBUG +//------------ mergeTree --------------- +// Merges two chains and binds new keys +// Returns true on success else false. +//--------------------------------------- +bool Keys::mergeTree(t_key *newtree, t_key *basetree) { + if (basetree==0) { + unsigned int baselist_i=0; + for (; baselist_i<m_keylist.size(); baselist_i++) { + if (m_keylist[baselist_i]->mod == newtree->mod && + m_keylist[baselist_i]->key == newtree->key) { + if (newtree->keylist.size() && m_keylist[baselist_i]->action == lastKeygrab) { + //assumes the newtree only have one branch + return mergeTree(newtree->keylist[0], m_keylist[baselist_i]); + } else + break; + } + } + + if (baselist_i == m_keylist.size()) { + grabKey(newtree->key, newtree->mod); + m_keylist.push_back(new t_key(newtree)); + if (newtree->keylist.size()) + return mergeTree(newtree->keylist[0], m_keylist.back()); + return true; + } + + } else { + unsigned int baselist_i = 0; + for (; baselist_i<basetree->keylist.size(); baselist_i++) { + if (basetree->keylist[baselist_i]->mod == newtree->mod && + basetree->keylist[baselist_i]->key == newtree->key) { + if (newtree->keylist.size()) { + //assumes the newtree only have on branch + return mergeTree(newtree->keylist[0], basetree->keylist[baselist_i]); + } else + return false; + } + } + //if it wasn't in the list grab the key and add it to the list + if (baselist_i==basetree->keylist.size()) { + grabKey(newtree->key, newtree->mod); + basetree->keylist.push_back(new t_key(newtree)); + if (newtree->keylist.size()) + return mergeTree(newtree->keylist[0], basetree->keylist.back()); + return true; + } + } + + return false; +} + +Keys::t_key::t_key(unsigned int key_, unsigned int mod_, KeyAction action_) { + action = action_; + key = key_; + mod = mod_; +} + +Keys::t_key::t_key(t_key *k) { + action = k->action; + key = k->key; + mod = k->mod; + execcommand = k->execcommand; +} + +Keys::t_key::~t_key() { + while (!keylist.empty()) { + t_key *k = keylist.back(); + delete k; + keylist.pop_back(); + } +}
A src/Keys.hh

@@ -0,0 +1,116 @@

+// Key2.hh for Fluxbox - an X11 Window manager +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 _KEYS_HH_ +#define _KEYS_HH_ + +#include <string> +#include <vector> + +class Keys +{ +public: +enum KeyAction{ + grabIconify=0, + grabRaise, + grabLower, + grabClose, + grabAbortKeychain, + grabWorkspace1, grabWorkspace2, grabWorkspace3, grabWorkspace4, grabWorkspace5, + grabWorkspace6, grabWorkspace7, grabWorkspace8, grabWorkspace9, grabWorkspace10, + grabWorkspace11, grabWorkspace12, grabNextWorkspace, grabPrevWorkspace, + grabLeftWorkspace, grabRightWorkspace, + grabKillWindow, grabNextWindow, grabPrevWindow, + grabNextTab, grabPrevTab, + grabShade, grabMaximize, grabStick, grabExecute, grabVertMax, + grabHorizMax, grabNudgeRight, grabNudgeLeft,grabNudgeUp, + grabNudgeDown, grabBigNudgeRight, grabBigNudgeLeft, + grabBigNudgeUp, grabBigNudgeDown, + grabHorizInc, grabVertInc, grabHorizDec, grabVertDec, + grabToggleDecor, + lastKeygrab + }; + + Keys(char *filename); + ~Keys(); + bool load(char *filename=0); + KeyAction getAction(XKeyEvent *ke); + bool reconfigure(char *filename); + const char *getActionStr(KeyAction action); + std::string getExecCommand() { return m_execcmdstring; } +private: + void deleteTree(); + + void bindKey(unsigned int key, unsigned int mod); + unsigned int getModifier(char *modstr); + unsigned int getKey(char *keystr); + void grabKey(unsigned int key, unsigned int mod); + std::string filename; + + class t_key { + public: + t_key(unsigned int key, unsigned int mod, KeyAction action_ = lastKeygrab); + t_key(t_key *k); + ~t_key(); + + inline t_key *find(unsigned int key_, unsigned int mod_) { + for (unsigned int i=0; i<keylist.size(); i++) { + if (keylist[i]->key == key_ && keylist[i]->mod == mod_) + return keylist[i]; + } + return 0; + } + inline t_key *find(XKeyEvent *ke) { + for (unsigned int i=0; i<keylist.size(); i++) { + if (keylist[i]->key == ke->keycode && keylist[i]->mod == ke->state) + return keylist[i]; + } + return 0; + } + + inline bool operator == (XKeyEvent *ke) { + return (mod == ke->state && key == ke->keycode); + } + + KeyAction action; + unsigned int key; + unsigned int mod; + std::vector<t_key *> keylist; + std::string execcommand; + }; + + bool mergeTree(t_key *newtree, t_key *basetree=0); + #ifdef DEBUG + //debug functions + void showTree(); + void showKeyTree(t_key *key, unsigned int w=0); + #endif //DEBUG + struct t_actionstr{ + const char *string; + KeyAction action; + }; + static t_actionstr m_actionlist[]; + + std::vector<t_key *> m_keylist; + t_key *m_abortkey; //abortkey for keygrabbing chain + std::string m_execcmdstring; //copy of the execcommandstring +}; + +#endif // _KEYS_HH_
A src/LinkedList.cc

@@ -0,0 +1,354 @@

+// LinkedList.cc for Blackbox - an X11 Window manager +// 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 + +#include "LinkedList.hh" + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif // HAVE_CONFIG_H + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + + +__llist_iterator::__llist_iterator(__llist *l) { + // initialize the iterator... + list = l; + + if (list) { + if (! list->iterators) + list->iterators = new __llist; + + list->iterators->insert(this); + } + + reset(); +} + + +__llist_iterator::~__llist_iterator(void) { + if (list && list->iterators) + list->iterators->remove(this); +} + + +void *__llist_iterator::current(void) { + // return the current node data... if any + return ((node) ? node->getData() : 0); +} + + +void __llist_iterator::reset(void) { + // update the iterator's current node to the first node in the linked list + if (list) + node = list->_first; +} + + +const int __llist_iterator::set(const int index) { + // set the current node to index + if (list) { + if (index < list->elements && index >= 0 && list->_first) { + node = list->_first; + + for (register int i = 0; i < index; i++) + node = node->getNext(); + + return 1; + } + } + + node = (__llist_node *) 0; + return 0; +} + + +void __llist_iterator::operator++(void) { + // iterate to the next node in the list... + node = ((node) ? node->getNext() : 0); +} + + +void __llist_iterator::operator++(int) { + // iterate to the next node in the list... + node = ((node) ? node->getNext() : 0); +} + + +__llist::__llist(void *d) { + // initialize the linked list... + _first = (__llist_node *) 0; + _last = (__llist_node *) 0; + iterators = (__llist *) 0; + elements = 0; + + if (d) insert(d); +} + + +__llist::~__llist(void) { + // remove all the items in the list... + for (register int i = 0, r = elements; i < r; i++) + remove(0); + + if (iterators) { + __llist_node *n = iterators->_first; + + while (n) { + ((__llist_iterator *) n->getData())->list = (__llist *) 0; + ((__llist_iterator *) n->getData())->node = (__llist_node *) 0; + + n = n->getNext(); + } + + delete iterators; + } +} + + +const int __llist::insert(void *d, int index) { + // insert item into linked list at specified index... + + if ((! _first) || (! _last)) { + // list is empty... insert the item as the first item, regardless of the + // index given + _first = new __llist_node; + _first->setData(d); + _first->setNext((__llist_node *) 0); + _last = _first; + } else { + if (index == 0) { + // if index is 0... prepend the data on the list + __llist_node *nnode = new __llist_node; + + nnode->setData(d); + nnode->setNext(_first); + + _first = nnode; + } else if ((index == -1) || (index == elements)) { + // if index is -1... append the data on the list + __llist_node *nnode = new __llist_node; + + nnode->setData(d); + nnode->setNext((__llist_node *) 0); + _last->setNext(nnode); + + _last = nnode; + } else if (index < elements) { + // otherwise... insert the item at the position specified by index + __llist_node *nnode = new __llist_node, *inode = _first->getNext(); + + if (! nnode) + return -1; + + nnode->setData(d); + + for (register int i = 1; i < index; i++) + if (inode) + inode = inode->getNext(); + else { + delete nnode; + return -1; + } + + if ((! inode) || inode == _last) { + nnode->setNext((__llist_node *) 0); + _last->setNext(nnode); + + _last = nnode; + } else { + nnode->setNext(inode->getNext()); + inode->setNext(nnode); + } + } + } + + return ++elements; +} + + +const int __llist::remove(void *d) { + // remove list item whose data pointer address matches the pointer address + // given + + if ((! _first) || (! _last)) + return -1; + else if (_first->getData() == d) { + // remove the first item in the list... + __llist_node *node = _first; + _first = _first->getNext(); + + if (iterators && iterators->_first) { + __llist_node *n = iterators->_first; + while (n) { + ((__llist_iterator *) n->getData())->reset(); + n = n->getNext(); + } + } + + --elements; + delete node; + return 0; + } else { + // iterate through the list and remove the first occurance of the item + + // NOTE: we don't validate _first in this assignment, because it is checked + // for validity above... + __llist_node *rnode = _first->getNext(), *prev = _first; + + for (register int i = 1; i < elements; i++) + if (rnode) + if (rnode->getData() == d) { + // we found the item... update the previous node and delete the + // now useless rnode... + prev->setNext(rnode->getNext()); + + if (rnode == _last) + _last = prev; + + if (iterators && iterators->_first) { + __llist_node *n = iterators->_first; + while (n) { + ((__llist_iterator *) n->getData())->reset(); + n = n->getNext(); + } + } + + --elements; + delete rnode; + return i; + } else { + prev = rnode; + rnode = rnode->getNext(); + } + + return -1; + } +} + + +void *__llist::remove(const int index) { + if (index >= elements || index < 0 || (! _first) || (! _last)) + return (void *) 0; + + // remove list item at specified index within the list + if (index == 0) { + // remove the first item in the list... + __llist_node *node = _first; + void *data_return = _first->getData(); + + _first = _first->getNext(); + + if (iterators && iterators->_first) { + __llist_node *n = iterators->_first; + while (n) { + ((__llist_iterator *) n->getData())->reset(); + n = n->getNext(); + } + } + + --elements; + delete node; + + return data_return; + } else { + __llist_node *rnode = _first->getNext(), *prev = _first; + void *data_return = (void *) 0; + + for (register int i = 1; i < index; i++) + if (rnode) { + prev = rnode; + rnode = rnode->getNext(); + } else + return (void *) 0; + + if (! rnode) return (void *) 0; + + prev->setNext(rnode->getNext()); + data_return = rnode->getData(); + + if (rnode == _last) + _last = prev; + + if (iterators && iterators->_first) { + __llist_node *n = iterators->_first; + while (n) { + ((__llist_iterator *) n->getData())->reset(); + n = n->getNext(); + } + } + + --elements; + data_return = rnode->getData(); + delete rnode; + return data_return; + } + + return (void *) 0; +} + +void *__llist::find(const int index) { + if (index >= elements || index < 0 || (! _first) || (! _last)) + return (void *) 0; + + if (index == 0) { + // return the first item + return first(); + } else if (index == (elements - 1)) { + // return the last item + return last(); + } else { + __llist_node *fnode = _first->getNext(); + + for (register int i = 1; i < index; i++) + if (fnode) + fnode = fnode->getNext(); + else + return (void *) 0; + + return fnode->getData(); + } + + return (void *) 0; +} + + +void *__llist::first(void) { + if (_first) + return _first->getData(); + + return (void *) 0; +} + + +void *__llist::last(void) { + if (_last) + return _last->getData(); + + return (void *) 0; +}
A src/LinkedList.hh

@@ -0,0 +1,131 @@

+// LinkedList.hh for Blackbox - an X11 Window manager +// 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 _LINKEDLIST_HH_ +#define _LINKEDLIST_HH_ + + +class __llist_node { +private: + __llist_node *next; + void *data; + +protected: + +public: + __llist_node(void) { next = (__llist_node *) 0; data = (void *) 0; } + + inline __llist_node *getNext(void) { return next; } + + inline void *getData(void) { return data; } + inline void setData(void *d) { data = d; } + inline void setNext(__llist_node *n) { next = n; } +}; + + +// forward declaration +class __llist; + + +class __llist_iterator { +private: + __llist *list; + __llist_node *node; + + friend class __llist; + + +protected: + __llist_iterator(__llist *); + ~__llist_iterator(void); + + const int set(const int); + + void *current(void); + void reset(void); + + void operator++(void); + void operator++(int); +}; + + +class __llist { +private: + int elements; + __llist_node *_first, *_last; + __llist *iterators; + + friend class __llist_iterator; + + +protected: + __llist(void * = 0); + ~__llist(void); + + inline const int &count(void) const { return elements; } + inline const int empty(void) const { return (elements == 0); } + + const int insert(void *, int = -1); + const int remove(void *); + + void *find(const int); + void *remove(const int); + void *first(void); + void *last(void); +}; + + +template <class Z> +class LinkedListIterator : public __llist_iterator { +public: + LinkedListIterator(__llist *d = 0) : __llist_iterator(d) { return; } + + inline Z *current(void) { return (Z *) __llist_iterator::current(); } + + inline const int set(const int i) { return __llist_iterator::set(i); } + + inline void reset(void) { __llist_iterator::reset(); } + + inline void operator++(void) { __llist_iterator::operator++(); } + inline void operator++(int) { __llist_iterator::operator++(0); } +}; + + +template <class Z> +class LinkedList : public __llist { +public: + LinkedList(Z *d = 0) : __llist(d) { return; } + + inline Z *find(const int i) { return (Z *) __llist::find(i); } + inline Z *remove(const int i) { return (Z *) __llist::remove(i); } + inline Z *first(void) { return (Z *) __llist::first(); } + inline Z *last(void) { return (Z *) __llist::last(); } + + inline const int count(void) const { return __llist::count(); } + inline const int empty(void) const { return __llist::empty(); } + + inline const int insert(Z *d, int i = -1) { return __llist::insert((void *) d, i); } + inline const int remove(Z *d) { return __llist::remove((void *) d); } +}; + + +#endif // _LINKEDLIST_HH_ +
A src/Makefile.am

@@ -0,0 +1,55 @@

+# Makefile.am for fluxbox +# Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +# +# src/Makefile.am for Blackbox 0.61.x - an X11 Window manager +# 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. + + +DEFAULT_MENU=$(pkgdatadir)/menu +DEFAULT_STYLE=$(pkgdatadir)/styles/Clean +DEFAULT_TITLEBAR=$(pkgdatadir)/titlebar +DEFAULT_KEYSFILE=$(pkgdatadir)/keys +DEFAULT_INITFILE= + +CPPFLAGS= -Wall @CPPFLAGS@ @SHAPE@ @SLIT@ @INTERLACE@ @ORDEREDPSEUDO@ \ +@DEBUG@ @NEWWMSPEC@ @NLS@ @TIMEDCACHE@ @KDE@ @GNOME@ \ +-DLOCALEPATH=\"$(pkgdatadir)/nls\" \ +-DDEFAULTMENU=\"$(DEFAULT_MENU)\" \ +-DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" \ +-DDEFAULTTITLEBAR=\"$(DEFAULT_TITLEBAR)\"\ +-DDEFAULTKEYSFILE=\"$(DEFAULT_KEYSFILE)\"\ +-DDEFAULT_INITFILE=\"$(pkgdatadir)/init\" + +bin_PROGRAMS= fluxbox + +fluxbox_SOURCES= BaseDisplay.cc BaseDisplay.hh Basemenu.cc Basemenu.hh \ + Clientmenu.cc Clientmenu.hh Configmenu.cc Configmenu.hh \ + Icon.cc Icon.hh Image.cc Image.hh LinkedList.cc LinkedList.hh \ + Netizen.cc Netizen.hh Rootmenu.cc Rootmenu.hh Screen.cc Screen.hh\ + Slit.cc Slit.hh Timer.cc Timer.hh Toolbar.cc Toolbar.hh \ + Window.cc Window.hh Windowmenu.cc Windowmenu.hh \ + Workspace.cc Workspace.hh Workspacemenu.cc Workspacemenu.hh \ + fluxbox.cc fluxbox.hh bsd-snprintf.c bsd-snprintf.h \ + i18n.cc i18n.hh main.cc Tab.hh Tab.cc Keys.cc Keys.hh\ + IconBar.cc IconBar.hh Theme.hh Theme.cc misc.hh misc.cc \ + Rotated.hh +MAINTAINERCLEANFILES= Makefile.in +
A src/Makefile.in

@@ -0,0 +1,371 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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 fluxbox +# Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +# +# src/Makefile.am for Blackbox 0.61.x - an X11 Window manager +# 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +DEFAULT_MENU = $(pkgdatadir)/menu +DEFAULT_STYLE = $(pkgdatadir)/styles/Clean +DEFAULT_TITLEBAR = $(pkgdatadir)/titlebar +DEFAULT_KEYSFILE = $(pkgdatadir)/keys +DEFAULT_INITFILE = + +CPPFLAGS = -Wall @CPPFLAGS@ @SHAPE@ @SLIT@ @INTERLACE@ @ORDEREDPSEUDO@ @DEBUG@ @NEWWMSPEC@ @NLS@ @TIMEDCACHE@ @KDE@ @GNOME@ -DLOCALEPATH=\"$(pkgdatadir)/nls\" -DDEFAULTMENU=\"$(DEFAULT_MENU)\" -DDEFAULTSTYLE=\"$(DEFAULT_STYLE)\" -DDEFAULTTITLEBAR=\"$(DEFAULT_TITLEBAR)\" -DDEFAULTKEYSFILE=\"$(DEFAULT_KEYSFILE)\" -DDEFAULT_INITFILE=\"$(pkgdatadir)/init\" + + +bin_PROGRAMS = fluxbox + +fluxbox_SOURCES = BaseDisplay.cc BaseDisplay.hh Basemenu.cc Basemenu.hh Clientmenu.cc Clientmenu.hh Configmenu.cc Configmenu.hh Icon.cc Icon.hh Image.cc Image.hh LinkedList.cc LinkedList.hh Netizen.cc Netizen.hh Rootmenu.cc Rootmenu.hh Screen.cc Screen.hh Slit.cc Slit.hh Timer.cc Timer.hh Toolbar.cc Toolbar.hh Window.cc Window.hh Windowmenu.cc Windowmenu.hh Workspace.cc Workspace.hh Workspacemenu.cc Workspacemenu.hh fluxbox.cc fluxbox.hh bsd-snprintf.c bsd-snprintf.h i18n.cc i18n.hh main.cc Tab.hh Tab.cc Keys.cc Keys.hh IconBar.cc IconBar.hh Theme.hh Theme.cc misc.hh misc.cc Rotated.hh + +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@ +fluxbox_OBJECTS = BaseDisplay.o Basemenu.o Clientmenu.o Configmenu.o \ +Icon.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 \ +fluxbox.o bsd-snprintf.o i18n.o main.o Tab.o Keys.o IconBar.o Theme.o \ +misc.o +fluxbox_LDADD = $(LDADD) +fluxbox_DEPENDENCIES = +fluxbox_LDFLAGS = +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=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 +SOURCES = $(fluxbox_SOURCES) +OBJECTS = $(fluxbox_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cc .lo .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps src/Makefile + +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 " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(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: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +fluxbox: $(fluxbox_OBJECTS) $(fluxbox_DEPENDENCIES) + @rm -f fluxbox + $(CXXLINK) $(fluxbox_LDFLAGS) $(fluxbox_OBJECTS) $(fluxbox_LDADD) $(LIBS) +.cc.o: + $(CXXCOMPILE) -c $< +.cc.lo: + $(LTCXXCOMPILE) -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) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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-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-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \ + distclean-tags distclean-generic clean-am + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-libtool \ + 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-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool tags 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 \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# 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:
A src/Netizen.cc

@@ -0,0 +1,145 @@

+// Netizen.cc for Blackbox - An X11 Window Manager +// 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 "Netizen.hh" + + +Netizen::Netizen(BScreen *scr, Window win) { + screen = scr; + basedisplay = screen->getBaseDisplay(); + window = win; + + event.type = ClientMessage; + event.xclient.message_type = basedisplay->getFluxboxStructureMessagesAtom(); + event.xclient.display = basedisplay->getXDisplay(); + event.xclient.window = window; + event.xclient.format = 32; + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyStartupAtom(); + 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); +} + + +void Netizen::sendWorkspaceCount(void) { + + #ifdef GNOME +/* long val = screen->getCount(); + XChangeProperty(basedisplay->getXDisplay(), screen->getRootWindow(), + basedisplay->getGnomeWorkspaceCountAtom(), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&val, 1);*/ + printf("UPDATE!\n"); + unsigned long data=(unsigned long) screen->getCount(); + Atom atom_set; + // CARD32 val; + + atom_set = XInternAtom(basedisplay->getXDisplay(), "_WIN_WORKSPACE_COUNT", False); + // val = mode.numdesktops; + XChangeProperty(basedisplay->getXDisplay(), window, atom_set, + XA_CARDINAL, 32, PropModeReplace,(unsigned char *)&data, 1); + #endif //GNOME + + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWorkspaceCountAtom(); + event.xclient.data.l[1] = screen->getCount(); + + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + + +} + + +void Netizen::sendCurrentWorkspace(void) { + #ifdef GNOME + //update atom to workspace + long val; + val = screen->getCurrentWorkspaceID(); + XChangeProperty(basedisplay->getXDisplay(), screen->getRootWindow(), + basedisplay->getGnomeWorkspaceAtom(), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&val, 1); + + #endif + + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyCurrentWorkspaceAtom(); + event.xclient.data.l[1] = screen->getCurrentWorkspaceID(); + + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + +} + + +void Netizen::sendWindowFocus(Window w) { + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowFocusAtom(); + event.xclient.data.l[1] = w; + + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); +} + + +void Netizen::sendWindowAdd(Window w, unsigned long p) { + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowAddAtom(); + event.xclient.data.l[1] = w; + event.xclient.data.l[2] = p; + + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); + + event.xclient.data.l[2] = 0l; +} + + +void Netizen::sendWindowDel(Window w) { + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowDelAtom(); + event.xclient.data.l[1] = w; + + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); +} + + +void Netizen::sendWindowRaise(Window w) { + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowRaiseAtom(); + event.xclient.data.l[1] = w; + + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); +} + + +void Netizen::sendWindowLower(Window w) { + event.xclient.data.l[0] = basedisplay->getFluxboxNotifyWindowLowerAtom(); + event.xclient.data.l[1] = w; + + XSendEvent(basedisplay->getXDisplay(), window, False, NoEventMask, &event); +} + + +void Netizen::sendConfigNotify(XEvent *e) { + XSendEvent(basedisplay->getXDisplay(), window, False, + StructureNotifyMask, e); +}
A src/Netizen.hh

@@ -0,0 +1,64 @@

+// Netizen.hh for Blackbox - An X11 Window Manager +// 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 _NETIZEN_HH_ +#define _NETIZEN_HH_ + +// forward declaration +class Netizen; + +#include <X11/Xlib.h> + +#include "BaseDisplay.hh" +#include "Screen.hh" + + +class Netizen { +private: + BaseDisplay *basedisplay; + BScreen *screen; + Window window; + XEvent event; + + +protected: + + +public: + Netizen(BScreen *, Window); + + inline const Window &getWindowID(void) const { return window; } + + void sendWorkspaceCount(void); + void sendCurrentWorkspace(void); + + void sendWindowFocus(Window); + void sendWindowAdd(Window, unsigned long); + void sendWindowDel(Window); + void sendWindowRaise(Window); + void sendWindowLower(Window); + + void sendConfigNotify(XEvent *); +}; + + +#endif // _NETIZEN_HH_ +
A src/Rootmenu.cc

@@ -0,0 +1,115 @@

+// Rootmenu.cc for Blackbox - an X11 Window manager +// 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 "fluxbox.hh" +#include "Rootmenu.hh" +#include "Screen.hh" + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +#endif // STDC_HEADERS + +#ifdef HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif // HAVE_SYS_PARAM_H + +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif // MAXPATHLEN + + +Rootmenu::Rootmenu(BScreen *scrn) : Basemenu(scrn) { + screen = scrn; +} + + +void Rootmenu::itemSelected(int button, int index) { + + Fluxbox *fluxbox = Fluxbox::instance(); + + if (button == 1) { + BasemenuItem *item = find(index); + + if (item->function()) { + switch (item->function()) { + case BScreen::Execute: + if (item->exec()) { + #ifndef __EMX__ + char displaystring[MAXPATHLEN]; + sprintf(displaystring, "DISPLAY=%s", + DisplayString(screen->getBaseDisplay()->getXDisplay())); + sprintf(displaystring + strlen(displaystring) - 1, "%d", + 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: + fluxbox->restart(); + break; + + case BScreen::RestartOther: + if (item->exec()) + fluxbox->restart(item->exec()); + break; + + case BScreen::Exit: + fluxbox->shutdown(); + break; + + case BScreen::SetStyle: + if (item->exec()) { + fluxbox->saveStyleFilename(item->exec()); + fluxbox->reconfigureTabs(); //TODO + } + + case BScreen::Reconfigure: + fluxbox->reconfigure(); + return; + } + + if (! (screen->getRootmenu()->isTorn() || isTorn()) && + item->function() != BScreen::Reconfigure && + item->function() != BScreen::SetStyle) + hide(); + } + } +} +
A src/Rootmenu.hh

@@ -0,0 +1,47 @@

+// Rootmenu.hh for Blackbox - an X11 Window manager +// 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 _ROOTMENU_HH_ +#define _ROOTMENU_HH_ + +// forward declarations +class Rootmenu; +class BScreen; + +#include "Basemenu.hh" + + +class Rootmenu : public Basemenu { +private: + BScreen *screen; + + +protected: + virtual void itemSelected(int, int); + + +public: + Rootmenu(BScreen *); +}; + + +#endif // _ROOTMENU_HH_ +
A src/Rotated.hh

@@ -0,0 +1,83 @@

+/* ************************************************************************ */ + + +/* Header file for the `xvertext' routines. + + Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma) */ + + +/* ************************************************************************ */ + + +#ifndef _XVERTEXT_INCLUDED_ +#define _XVERTEXT_INCLUDED_ + + +#define XV_VERSION 2.0 +#define XV_COPYRIGHT "xvertext routines Copyright (c) 1992 Alan Richardson" + + +/* ---------------------------------------------------------------------- */ + + +/* *** The font structures *** */ + +struct BitmapStruct { + int bit_w; + int bit_h; + + Pixmap bm; +}; + +struct XRotCharStruct { + int ascent; + int descent; + int lbearing; + int rbearing; + int width; + + BitmapStruct glyph; +}; + +struct XRotFontStruct { + int dir; + int height; + int max_ascent; + int max_descent; + int max_char; + int min_char; + char *name; + + XFontStruct *xfontstruct; + + XRotCharStruct per_char[95]; +}; + + +/* ---------------------------------------------------------------------- */ + + +extern float XRotVersion(char *, int); +extern XRotFontStruct *XRotLoadFont(Display *, char *, float); +extern void XRotUnloadFont(Display *, XRotFontStruct *); +extern unsigned int XRotTextWidth(XRotFontStruct *, char *, int); +extern void XRotDrawString(Display *, XRotFontStruct *, Drawable, GC, + int, int, char *, int); + +/* ---------------------------------------------------------------------- */ + +extern int xv_errno; + +#define XV_NOFONT 1 /* no such font on X server */ +#define XV_NOMEM 2 /* couldn't do malloc */ +#define XV_NOXIMAGE 3 /* couldn't create an XImage */ + + +/* ---------------------------------------------------------------------- */ + + +#else + +extern int xv_errno; + +#endif
A src/Screen.cc

@@ -0,0 +1,1677 @@

+// Screen.cc for Blackbox - an X11 Window manager +// 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 <X11/Xatom.h> +#include <X11/keysym.h> + +#include "i18n.hh" +#include "fluxbox.hh" +#include "Clientmenu.hh" +#include "Icon.hh" +#include "Image.hh" +#include "Screen.hh" + +#ifdef SLIT +#include "Slit.hh" +#endif // SLIT + +#include "Rootmenu.hh" +#include "Toolbar.hh" +#include "Window.hh" +#include "Workspace.hh" +#include "Workspacemenu.hh" + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +# include <sys/types.h> +#endif // STDC_HEADERS + +#ifdef HAVE_CTYPE_H +# include <ctype.h> +#endif // HAVE_CTYPE_H + +#ifdef HAVE_DIRENT_H +# include <dirent.h> +#endif // HAVE_DIRENT_H + +#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif // HAVE_LOCALE_H + +#ifdef HAVE_UNISTD_H +# include <sys/types.h> +# include <unistd.h> +#endif // HAVE_UNISTD_H + +#ifdef HAVE_SYS_STAT_H +# include <sys/stat.h> +#endif // HAVE_SYS_STAT_H + +#ifdef HAVE_STDARG_H +# include <stdarg.h> +#endif // HAVE_STDARG_H + +#ifndef HAVE_SNPRINTF +# include "bsd-snprintf.h" +#endif // !HAVE_SNPRINTF + +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif // MAXPATHLEN + +#ifndef FONT_ELEMENT_SIZE +#define FONT_ELEMENT_SIZE 50 +#endif // FONT_ELEMENT_SIZE + +#include <iostream> +using namespace std; + +static Bool running = True; + +static int anotherWMRunning(Display *display, XErrorEvent *) { + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + ScreenSet, ScreenAnotherWMRunning, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::BScreen: an error occured while querying the X server.\n" + " another window manager already running on display %s.\n"), + DisplayString(display)); + + running = False; + + return(-1); +} + +static int dcmp(const void *one, const void *two) { + return (strcmp((*(char **) one), (*(char **) two))); +} + +BScreen::BScreen(Fluxbox *b, int scrn) : ScreenInfo(b, scrn) { + theme = 0; + fluxbox = b; + + event_mask = ColormapChangeMask | EnterWindowMask | PropertyChangeMask | + SubstructureRedirectMask | KeyPressMask | KeyReleaseMask | + ButtonPressMask | ButtonReleaseMask; + + XErrorHandler old = XSetErrorHandler((XErrorHandler) anotherWMRunning); + XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), event_mask); + XSync(getBaseDisplay()->getXDisplay(), False); + XSetErrorHandler((XErrorHandler) old); + + managed = running; + if (! managed) + return; + + I18n *i18n = I18n::instance(); + + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ScreenSet, ScreenManagingScreen, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::BScreen: managing screen %d " + "using visual 0x%lx, depth %d\n"), + getScreenNumber(), XVisualIDFromVisual(getVisual()), + getDepth()); + + rootmenu = 0; + +#ifdef HAVE_STRFTIME + resource.strftime_format = 0; +#endif // HAVE_STRFTIME + +#ifdef HAVE_GETPID + pid_t bpid = getpid(); + + XChangeProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), + fluxbox->getFluxboxPidAtom(), XA_CARDINAL, + sizeof(pid_t) * 8, PropModeReplace, + (unsigned char *) &bpid, 1); +#endif // HAVE_GETPID + + + XDefineCursor(getBaseDisplay()->getXDisplay(), getRootWindow(), + fluxbox->getSessionCursor()); + + workspaceNames = new LinkedList<char>; + workspacesList = new LinkedList<Workspace>; + rootmenuList = new LinkedList<Rootmenu>; + netizenList = new LinkedList<Netizen>; + iconList = new LinkedList<FluxboxWindow>; + + image_control = + new BImageControl(fluxbox, this, True, fluxbox->getColorsPerChannel(), + fluxbox->getCacheLife(), fluxbox->getCacheMax()); + image_control->installRootColormap(); + root_colormap_installed = True; + + fluxbox->load_rc(this); + + image_control->setDither(resource.image_dither); + theme = new Theme(getBaseDisplay()->getXDisplay(), getColormap(), getScreenNumber(), + image_control, fluxbox->getStyleFilename()); +#ifdef GNOME + /* create the GNOME window */ + Window gnome_win = XCreateSimpleWindow(getBaseDisplay()->getXDisplay(), + getRootWindow(), 0, 0, 5, 5, 0, 0, 0); + + /* supported WM check */ + XChangeProperty(getBaseDisplay()->getXDisplay(), + getRootWindow(), getBaseDisplay()->getGnomeSupportingWMCheckAtom(), + XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); + XChangeProperty(getBaseDisplay()->getXDisplay(), gnome_win, + getBaseDisplay()->getGnomeSupportingWMCheckAtom(), + XA_CARDINAL, 32, PropModeReplace, (unsigned char *) &gnome_win, 1); + + XChangeProperty(getBaseDisplay()->getXDisplay(), + getRootWindow(), getBaseDisplay()->getGnomeProtAtom(), + XA_ATOM, 32, PropModeReplace, + (unsigned char *)getBaseDisplay()->getGnomeListAtoms(), 10); +#endif + + + const char *s = i18n->getMessage( +#ifdef NLS + ScreenSet, ScreenPositionLength, +#else // !NLS + 0, 0, +#endif // NLS + "0: 0000 x 0: 0000"); + int l = strlen(s); + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(theme->getWindowStyle()->font.set, s, l, &ink, &logical); + geom_w = logical.width; + + geom_h = theme->getWindowStyle()->font.set_extents->max_ink_extent.height; + } else { + geom_h = theme->getWindowStyle()->font.fontstruct->ascent + + theme->getWindowStyle()->font.fontstruct->descent; + + geom_w = XTextWidth(theme->getWindowStyle()->font.fontstruct, s, l); + } + + geom_w += getBevelWidth()*2; + geom_h += getBevelWidth()*2; + + XSetWindowAttributes attrib; + unsigned long mask = CWBorderPixel | CWColormap | CWSaveUnder; + attrib.border_pixel = getBorderColor()->getPixel(); + attrib.colormap = getColormap(); + attrib.save_under = True; + + geom_window = + XCreateWindow(getBaseDisplay()->getXDisplay(), getRootWindow(), + 0, 0, geom_w, geom_h, theme->getBorderWidth(), getDepth(), + InputOutput, getVisual(), mask, &attrib); + geom_visible = False; + + if (theme->getWindowStyle()->l_focus.getTexture() & BImage_ParentRelative) { + if (theme->getWindowStyle()->t_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; + XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->t_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &theme->getWindowStyle()->t_focus); + XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), + geom_window, geom_pixmap); + } + } else { + if (theme->getWindowStyle()->l_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; + XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->l_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &theme->getWindowStyle()->l_focus); + XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), + geom_window, geom_pixmap); + } + } + + workspacemenu = new Workspacemenu(this); + iconmenu = new Iconmenu(this); + configmenu = new Configmenu(this); + + Workspace *wkspc = (Workspace *) 0; + if (resource.workspaces != 0) { + for (int i = 0; i < resource.workspaces; ++i) { + wkspc = new Workspace(this, workspacesList->count()); + workspacesList->insert(wkspc); + workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); + } + } else { + wkspc = new Workspace(this, workspacesList->count()); + workspacesList->insert(wkspc); + workspacemenu->insert(wkspc->getName(), wkspc->getMenu()); + } + + workspacemenu->insert(i18n-> + getMessage( +#ifdef NLS + IconSet, IconIcons, +#else // !NLS + 0, 0, +#endif // NLS + "Icons"), + iconmenu); + workspacemenu->update(); + + current_workspace = workspacesList->first(); + workspacemenu->setItemSelected(2, True); + + toolbar = new Toolbar(this); + +#ifdef SLIT + slit = new Slit(this); +#endif // SLIT + + InitMenu(); + + raiseWindows(0, 0); + rootmenu->update(); + + changeWorkspaceID(0); + + int i; + unsigned int nchild; + Window r, p, *children; + XQueryTree(getBaseDisplay()->getXDisplay(), getRootWindow(), &r, &p, + &children, &nchild); + + // preen the window list of all icon windows... for better dockapp support + for (i = 0; i < (int) nchild; i++) { + if (children[i] == None) continue; + + XWMHints *wmhints = XGetWMHints(getBaseDisplay()->getXDisplay(), + children[i]); + + if (wmhints) { + if ((wmhints->flags & IconWindowHint) && + (wmhints->icon_window != children[i])) + for (int j = 0; j < (int) nchild; j++) + if (children[j] == wmhints->icon_window) { + children[j] = None; + + break; + } + + XFree(wmhints); + } + } + + // manage shown windows + for (i = 0; i < (int) nchild; ++i) { + if (children[i] == None || (! fluxbox->validateWindow(children[i]))) + continue; + + XWindowAttributes attrib; + if (XGetWindowAttributes(getBaseDisplay()->getXDisplay(), children[i], + &attrib)) { + if (attrib.override_redirect) + continue; + + if (attrib.map_state != IsUnmapped) { + new FluxboxWindow(children[i], this); + + FluxboxWindow *win = fluxbox->searchWindow(children[i]); + if (win) { + XMapRequestEvent mre; + mre.window = children[i]; + win->restoreAttributes(); + win->mapRequestEvent(&mre); + } + } + } + } + + if (! resource.sloppy_focus) + XSetInputFocus(getBaseDisplay()->getXDisplay(), toolbar->getWindowID(), + RevertToParent, CurrentTime); + + XFree(children); + XFlush(getBaseDisplay()->getXDisplay()); + +} + + +BScreen::~BScreen(void) { + if (! managed) return; + + if (geom_pixmap != None) + image_control->removeImage(geom_pixmap); + + if (geom_window != None) + 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); + +#ifdef HAVE_STRFTIME + if (resource.strftime_format) + delete [] resource.strftime_format; +#endif // HAVE_STRFTIME + + delete rootmenu; + delete workspacemenu; + delete iconmenu; + delete configmenu; + +#ifdef SLIT + delete slit; +#endif // SLIT + + delete toolbar; + delete image_control; + + delete workspacesList; + delete workspaceNames; + delete rootmenuList; + delete iconList; + delete netizenList; + delete theme; + theme = 0; + +} + +void BScreen::reconfigure(void) { + + theme->load(fluxbox->getStyleFilename()); + theme->reconfigure(); + I18n *i18n = I18n::instance(); + + const char *s = i18n->getMessage( +#ifdef NLS + ScreenSet, ScreenPositionLength, +#else // !NLS + 0, 0, +#endif // NLS + "0: 0000 x 0: 0000"); + int l = strlen(s); + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(theme->getWindowStyle()->font.set, s, l, &ink, &logical); + geom_w = logical.width; + + geom_h = theme->getWindowStyle()->font.set_extents->max_ink_extent.height; + } else { + geom_w = XTextWidth(theme->getWindowStyle()->font.fontstruct, s, l); + + geom_h = theme->getWindowStyle()->font.fontstruct->ascent + + theme->getWindowStyle()->font.fontstruct->descent; + } + + geom_w += getBevelWidth()*2; + geom_h += getBevelWidth()*2; + + Pixmap tmp = geom_pixmap; + if (theme->getWindowStyle()->l_focus.getTexture() & BImage_ParentRelative) { + if (theme->getWindowStyle()->t_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; + XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->t_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &theme->getWindowStyle()->t_focus); + XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), + geom_window, geom_pixmap); + } + } else { + if (theme->getWindowStyle()->l_focus.getTexture() == + (BImage_Flat | BImage_Solid)) { + geom_pixmap = None; + XSetWindowBackground(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->l_focus.getColor()->getPixel()); + } else { + geom_pixmap = image_control->renderImage(geom_w, geom_h, + &theme->getWindowStyle()->l_focus); + XSetWindowBackgroundPixmap(getBaseDisplay()->getXDisplay(), + geom_window, geom_pixmap); + } + } + if (tmp) image_control->removeImage(tmp); + + XSetWindowBorderWidth(getBaseDisplay()->getXDisplay(), geom_window, + theme->getBorderWidth()); + XSetWindowBorder(getBaseDisplay()->getXDisplay(), geom_window, + theme->getBorderColor().getPixel()); + + workspacemenu->reconfigure(); + iconmenu->reconfigure(); + + { + int remember_sub = rootmenu->getCurrentSubmenu(); + InitMenu(); + raiseWindows(0, 0); + rootmenu->reconfigure(); + rootmenu->drawSubmenu(remember_sub); + } + + configmenu->reconfigure(); + + toolbar->reconfigure(); + +#ifdef SLIT + slit->reconfigure(); +#endif // SLIT + + LinkedListIterator<Workspace> wit(workspacesList); + for (; wit.current(); wit++) + wit.current()->reconfigure(); + + LinkedListIterator<FluxboxWindow> iit(iconList); + for (; iit.current(); iit++) + if (iit.current()->validateClient()) + iit.current()->reconfigure(); + + image_control->timeout(); +} + + +void BScreen::rereadMenu(void) { + InitMenu(); + raiseWindows(0, 0); + + rootmenu->reconfigure(); +} + + +void BScreen::removeWorkspaceNames(void) { + while (workspaceNames->count()) + delete [] workspaceNames->remove(0); +} + +void BScreen::updateWorkspaceNamesAtom(void) { + +#ifdef GNOME + XTextProperty text; + int number_of_desks = workspaceNames->count(); + + char s[1024]; + char *names[number_of_desks]; + + for (int i = 0; i < number_of_desks; i++) { + sprintf(s, "Desktop %i", i); + names[i] = new char[strlen(s) + 1]; + strcpy(names[i], s); + } + + if (XStringListToTextProperty(names, number_of_desks, &text)) { + XSetTextProperty(getBaseDisplay()->getXDisplay(), getRootWindow(), + &text, getBaseDisplay()->getGnomeWorkspaceNamesAtom()); + XFree(text.value); + } + + for (int i = 0; i < number_of_desks; i++) + delete names[i]; + +#endif + +} + +void BScreen::addIcon(FluxboxWindow *w) { + if (! w) return; + + w->setWorkspace(-1); + w->setWindowNumber(iconList->count()); + + iconList->insert(w); + + iconmenu->insert((const char **) w->getIconTitle()); + iconmenu->update(); + toolbar->addIcon(w); +} + + +void BScreen::removeIcon(FluxboxWindow *w) { + if (! w) return; + + iconList->remove(w->getWindowNumber()); + + iconmenu->remove(w->getWindowNumber()); + iconmenu->update(); + toolbar->delIcon(w); + + LinkedListIterator<FluxboxWindow> it(iconList); + for (int i = 0; it.current(); it++, i++) + it.current()->setWindowNumber(i); +} + + +FluxboxWindow *BScreen::getIcon(int index) { + if (index >= 0 && index < iconList->count()) + return iconList->find(index); + + return (FluxboxWindow *) 0; +} + + +int BScreen::addWorkspace(void) { + Workspace *wkspc = new Workspace(this, workspacesList->count()); + workspacesList->insert(wkspc); + + workspacemenu->insert(wkspc->getName(), wkspc->getMenu(), + wkspc->getWorkspaceID() + 1); + workspacemenu->update(); + + toolbar->reconfigure(); + + updateNetizenWorkspaceCount(); + + + return workspacesList->count(); + +} + + +int BScreen::removeLastWorkspace(void) { + if (workspacesList->count() > 1) { + Workspace *wkspc = workspacesList->last(); + + if (current_workspace->getWorkspaceID() == wkspc->getWorkspaceID()) + changeWorkspaceID(current_workspace->getWorkspaceID() - 1); + + wkspc->removeAll(); + + workspacemenu->remove(wkspc->getWorkspaceID() + 2); + workspacemenu->update(); + + workspacesList->remove(wkspc); + delete wkspc; + + toolbar->reconfigure(); + + updateNetizenWorkspaceCount(); + + return workspacesList->count(); + } + + return 0; +} + + +void BScreen::changeWorkspaceID(int id) { + if (! current_workspace || id >= workspacesList->count() || id < 0) + return; + + if (id != current_workspace->getWorkspaceID()) { + current_workspace->hideAll(); + + workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, + False); + + if (fluxbox->getFocusedWindow() && + fluxbox->getFocusedWindow()->getScreen() == this && + (! fluxbox->getFocusedWindow()->isStuck())) { + + current_workspace->setLastFocusedWindow(fluxbox->getFocusedWindow()); + fluxbox->setFocusedWindow((FluxboxWindow *) 0); + + } + + current_workspace = getWorkspace(id); + + workspacemenu->setItemSelected(current_workspace->getWorkspaceID() + 2, + True); + toolbar->redrawWorkspaceLabel(True); + + current_workspace->showAll(); + + if (resource.focus_last && current_workspace->getLastFocusedWindow()) { + XSync(fluxbox->getXDisplay(), False); + current_workspace->getLastFocusedWindow()->setInputFocus(); + } + } + + + + updateNetizenCurrentWorkspace(); +} + + +void BScreen::addNetizen(Netizen *n) { + netizenList->insert(n); + + n->sendWorkspaceCount(); + n->sendCurrentWorkspace(); + + LinkedListIterator<Workspace> it(workspacesList); + for (; it.current(); it++) { + int i; + for (i = 0; i < it.current()->getCount(); i++) + n->sendWindowAdd(it.current()->getWindow(i)->getClientWindow(), + it.current()->getWorkspaceID()); + } + + Window f = ((fluxbox->getFocusedWindow()) ? + fluxbox->getFocusedWindow()->getClientWindow() : None); + n->sendWindowFocus(f); +} + + +void BScreen::removeNetizen(Window w) { + LinkedListIterator<Netizen> it(netizenList); + int i = 0; + + for (; it.current(); it++, i++) + if (it.current()->getWindowID() == w) { + Netizen *n = netizenList->remove(i); + delete n; + + break; + } +} + + +void BScreen::updateNetizenCurrentWorkspace(void) { + LinkedListIterator<Netizen> it(netizenList); + for (; it.current(); it++) + it.current()->sendCurrentWorkspace(); +} + + +void BScreen::updateNetizenWorkspaceCount(void) { + LinkedListIterator<Netizen> it(netizenList); + for (; it.current(); it++) + it.current()->sendWorkspaceCount(); +} + + +void BScreen::updateNetizenWindowFocus(void) { + LinkedListIterator<Netizen> it(netizenList); + Window f = ((fluxbox->getFocusedWindow()) ? + fluxbox->getFocusedWindow()->getClientWindow() : None); + for (; it.current(); it++) + it.current()->sendWindowFocus(f); +} + + +void BScreen::updateNetizenWindowAdd(Window w, unsigned long p) { + LinkedListIterator<Netizen> it(netizenList); + for (; it.current(); it++) + it.current()->sendWindowAdd(w, p); +} + + +void BScreen::updateNetizenWindowDel(Window w) { + LinkedListIterator<Netizen> it(netizenList); + for (; it.current(); it++) + it.current()->sendWindowDel(w); +} + + +void BScreen::updateNetizenWindowRaise(Window w) { + LinkedListIterator<Netizen> it(netizenList); + for (; it.current(); it++) + it.current()->sendWindowRaise(w); +} + + +void BScreen::updateNetizenWindowLower(Window w) { + LinkedListIterator<Netizen> it(netizenList); + for (; it.current(); it++) + it.current()->sendWindowLower(w); +} + + +void BScreen::updateNetizenConfigNotify(XEvent *e) { + LinkedListIterator<Netizen> it(netizenList); + for (; it.current(); it++) + it.current()->sendConfigNotify(e); +} + + +void BScreen::raiseWindows(Window *workspace_stack, int num) { + Window *session_stack = new + Window[(num + workspacesList->count() + rootmenuList->count() + 13)]; + int i = 0, k = num; + + XRaiseWindow(getBaseDisplay()->getXDisplay(), iconmenu->getWindowID()); + *(session_stack + i++) = iconmenu->getWindowID(); + + LinkedListIterator<Workspace> wit(workspacesList); + for (; wit.current(); wit++) + *(session_stack + i++) = wit.current()->getMenu()->getWindowID(); + + *(session_stack + i++) = workspacemenu->getWindowID(); + + *(session_stack + i++) = configmenu->getFocusmenu()->getWindowID(); + *(session_stack + i++) = configmenu->getPlacementmenu()->getWindowID(); + *(session_stack + i++) = configmenu->getTabmenu()->getWindowID(); + *(session_stack + i++) = configmenu->getWindowID(); + +#ifdef SLIT + *(session_stack + i++) = slit->getMenu()->getDirectionmenu()->getWindowID(); + *(session_stack + i++) = slit->getMenu()->getPlacementmenu()->getWindowID(); + *(session_stack + i++) = slit->getMenu()->getWindowID(); +#endif // SLIT + + *(session_stack + i++) = + toolbar->getMenu()->getPlacementmenu()->getWindowID(); + *(session_stack + i++) = toolbar->getMenu()->getWindowID(); + + LinkedListIterator<Rootmenu> rit(rootmenuList); + for (; rit.current(); rit++) + *(session_stack + i++) = rit.current()->getWindowID(); + *(session_stack + i++) = rootmenu->getWindowID(); + + if (toolbar->isOnTop()) + *(session_stack + i++) = toolbar->getWindowID(); + +#ifdef SLIT + if (slit->isOnTop()) + *(session_stack + i++) = slit->getWindowID(); +#endif // SLIT + + while (k--) + *(session_stack + i++) = *(workspace_stack + k); + + 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::getNameOfWorkspace(int id, char **name) { + if (id >= 0 && id < workspaceNames->count()) { + char *wkspc_name = workspaceNames->find(id); + + if (wkspc_name) + *name = bstrdup(wkspc_name); + } else + *name = 0; +} + + +void BScreen::reassociateWindow(FluxboxWindow *w, int wkspc_id, Bool ignore_sticky) { + if (! w) return; + + if (wkspc_id == -1) + wkspc_id = current_workspace->getWorkspaceID(); + + if (w->getWorkspaceNumber() == wkspc_id) + return; + + if (w->isIconic()) { + removeIcon(w); + getWorkspace(wkspc_id)->addWindow(w); + } else if (ignore_sticky || ! w->isStuck()) { + getWorkspace(w->getWorkspaceNumber())->removeWindow(w); + getWorkspace(wkspc_id)->addWindow(w); + } +} + + +void BScreen::nextFocus(void) { + Bool have_focused = False; + int focused_window_number = -1; + FluxboxWindow *next; + + if (fluxbox->getFocusedWindow()) + if (fluxbox->getFocusedWindow()->getScreen()->getScreenNumber() == + getScreenNumber()) { + have_focused = True; + focused_window_number = fluxbox->getFocusedWindow()->getWindowNumber(); + } + + if ((getCurrentWorkspace()->getCount() > 1) && have_focused) { + int next_window_number = focused_window_number; + do { + 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_window_number != focused_window_number) + getCurrentWorkspace()->raiseWindow(next); + } else if (getCurrentWorkspace()->getCount() >= 1) { + next = current_workspace->getWindow(0); + + current_workspace->raiseWindow(next); + next->setInputFocus(); + } +} + + +void BScreen::prevFocus(void) { + Bool have_focused = False; + int focused_window_number = -1; + FluxboxWindow *prev; + + if (fluxbox->getFocusedWindow()) + if (fluxbox->getFocusedWindow()->getScreen()->getScreenNumber() == + getScreenNumber()) { + have_focused = True; + focused_window_number = fluxbox->getFocusedWindow()->getWindowNumber(); + } + + if ((getCurrentWorkspace()->getCount() > 1) && have_focused) { + int prev_window_number = focused_window_number; + do { + if ((--prev_window_number) < 0) + prev_window_number = getCurrentWorkspace()->getCount() - 1; + + prev = getCurrentWorkspace()->getWindow(prev_window_number); + } while ((! prev->setInputFocus()) && (prev_window_number != + focused_window_number)); + + 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(); + } +} + +//--------- raiseFocus ----------- +// Raise the current focused window +//-------------------------------- +void BScreen::raiseFocus(void) { + Bool have_focused = False; + int focused_window_number = -1; + + if (fluxbox->getFocusedWindow()) + if (fluxbox->getFocusedWindow()->getScreen()->getScreenNumber() == + getScreenNumber()) { + have_focused = True; + focused_window_number = fluxbox->getFocusedWindow()->getWindowNumber(); + } + + if ((getCurrentWorkspace()->getCount() > 1) && have_focused) + getWorkspace(fluxbox->getFocusedWindow()->getWorkspaceNumber())-> + raiseWindow(fluxbox->getFocusedWindow()); +} + + +void BScreen::InitMenu(void) { + I18n *i18n = I18n::instance(); + + if (rootmenu) { + while (rootmenuList->count()) + rootmenuList->remove(0); + + while (rootmenu->getCount()) + rootmenu->remove(0); + } else + rootmenu = new Rootmenu(this); + + Bool defaultMenu = True; + + if (fluxbox->getMenuFilename()) { + FILE *menu_file = fopen(fluxbox->getMenuFilename(), "r"); + + if (menu_file) { + if (! feof(menu_file)) { + const int buff_size = 1024; + char line[buff_size], label[buff_size]; + memset(line, 0, buff_size); + memset(label, 0, buff_size); + + while (fgets(line, buff_size, 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 (index == -1) + index = 0; + label[index] = '\0'; + + rootmenu->setLabel(label); + defaultMenu = parseMenuFile(menu_file, rootmenu); + break; + } + } + } + } else { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + ScreenSet, ScreenEmptyMenuFile, +#else // !NLS + 0, 0, +#endif // NLS + "%s: Empty menu file"), + fluxbox->getMenuFilename()); + } + + fclose(menu_file); + } else + perror(fluxbox->getMenuFilename()); + } + + if (defaultMenu) { + rootmenu->setInternalMenu(); + rootmenu->insert(i18n->getMessage( +#ifdef NLS + ScreenSet, Screenxterm, +#else // !NLS + 0, 0, +#endif // NLS + "xterm"), + BScreen::Execute, + i18n->getMessage( +#ifdef NLS + ScreenSet, Screenxterm, +#else // !NLS + 0, 0, +#endif // NLS + "xterm")); + rootmenu->insert(i18n->getMessage( +#ifdef NLS + ScreenSet, ScreenRestart, +#else // !NLS + 0, 0, +#endif // NLS + "Restart"), + BScreen::Restart); + rootmenu->insert(i18n->getMessage( +#ifdef NLS + ScreenSet, ScreenExit, +#else // !NLS + 0, 0, +#endif // NLS + "Exit"), + BScreen::Exit); + } else + fluxbox->saveMenuFilename(fluxbox->getMenuFilename()); +} + + +Bool BScreen::parseMenuFile(FILE *file, Rootmenu *menu) { + const int buff_size = 1024; + char line[buff_size], label[buff_size], command[buff_size]; + + while (! feof(file)) { + memset(line, 0, buff_size); + memset(label, 0, buff_size); + memset(command, 0, buff_size); + + if (fgets(line, buff_size, file)) { + if (line[0] != '#') { + register int i, key = 0, parse = 0, + index = -1, + line_length = strlen(line), label_length = 0, command_length = 0; + + // determine the keyword + key = 0; + for (i = 0; i < line_length; i++) { + if (line[i] == '[') + parse = 1; + else if (line[i] == ']') + break; + else if (line[i] != ' ') + if (parse) + key += tolower(line[i]); + } + + // get the label enclosed in ()'s + parse = 0; + + for (i = 0; i < line_length; i++) { + if (line[i] == '(') { + index = 0; + parse = 1; + } else if (line[i] == ')') + break; + else if (index++ >= 0) { + if (line[i] == '\\' && i < line_length - 1) + i++; + label[index - 1] = line[i]; + } + } + if (parse) { + label[index] = '\0'; + label_length = index; + } else { + label[0] = '\0'; + label_length = 0; + } + + // get the command enclosed in {}'s + parse = 0; + index = -1; + for (i = 0; i < line_length; i++) + if (line[i] == '{') { + index = 0; + parse = 1; + } else if (line[i] == '}') break; + else if (index++ >= 0) { + if (line[i] == '\\' && i < line_length - 1) + i++; + command[index - 1] = line[i]; + } + + if (parse) { + command[index] = '\0'; + command_length = index; + } else { + command[0] = '\0'; + command_length = 0; + } + + I18n *i18n = I18n::instance(); + + switch (key) { + case 311: //end + return ((menu->getCount() == 0) ? True : False); + break; + + case 333: // nop + menu->insert(label); + break; + + case 421: // exec + if ((! *label) && (! *command)) { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + ScreenSet, ScreenEXECError, +#else // !NLS + 0, 0, +#endif // NLS + "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( +#ifdef NLS + ScreenSet, ScreenEXITError, +#else // !NLS + 0, 0, +#endif // NLS + "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( +#ifdef NLS + ScreenSet, ScreenSTYLEError, +#else // !NLS + 0, 0, +#endif // NLS + "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( +#ifdef NLS + ScreenSet, ScreenCONFIGError, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::parseMenufile: [config] error, " + "no label defined")); + continue; + } + + menu->insert(label, configmenu); + + break; + + case 740: // include + { + if (! *label) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ScreenSet, ScreenINCLUDEError, +#else // !NLS + 0, 0, +#endif // NLS + "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( +#ifdef NLS + ScreenSet, ScreenINCLUDEErrorReg, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::parseMenuFile: [include] error: " + "'%s' is not a regular file\n"), newfile); + break; + } + + if (! feof(submenufile)) { + if (! parseMenuFile(submenufile, menu)) + fluxbox->saveMenuFilename(newfile); + + fclose(submenufile); + } + } else + perror(newfile); + } + } + + break; + + case 767: // submenu + { + if (! *label) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ScreenSet, ScreenSUBMENUError, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::parseMenuFile: [submenu] error, " + "no menu label defined\n")); + continue; + } + + 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); + } + + break; + + case 773: // restart + { + if (! *label) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ScreenSet, ScreenRESTARTError, +#else // !NLS + 0, 0, +#endif // NLS + "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( +#ifdef NLS + ScreenSet, ScreenRECONFIGError, +#else // !NLS + 0, 0, +#endif // NLs + "BScreen::parseMenuFile: [reconfig] error, " + "no menu label defined\n")); + continue; + } + + menu->insert(label, BScreen::Reconfigure); + } + + break; + + case 995: // stylesdir + case 1113: // stylesmenu + { + Bool newmenu = ((key == 1113) ? True : False); + + if ((! *label) || ((! *command) && newmenu)) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ScreenSet, ScreenSTYLESDIRError, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::parseMenuFile: [stylesdir/stylesmenu]" + " error, no directory defined\n")); + continue; + } + + char stylesdir[MAXPATHLEN]; + + char *directory = ((newmenu) ? command : label); + int directory_length = ((newmenu) ? command_length : label_length); + + // perform shell style ~ home directory expansion + char *homedir = 0; + int homedir_len = 0; + + if (*directory == '~' && *(directory + 1) == '/') { + homedir = getenv("HOME"); + homedir_len = strlen(homedir); + } + + if (homedir && homedir_len != 0) { + strncpy(stylesdir, homedir, homedir_len); + + strncpy(stylesdir + homedir_len, directory + 1, + directory_length - 1); + *(stylesdir + directory_length + homedir_len - 1) = '\0'; + } else { + strncpy(stylesdir, directory, directory_length); + *(stylesdir + directory_length) = '\0'; + } + + struct stat statbuf; + + if (! stat(stylesdir, &statbuf)) { + if (S_ISDIR(statbuf.st_mode)) { + Rootmenu *stylesmenu; + + if (newmenu) + stylesmenu = new Rootmenu(this); + else + stylesmenu = menu; + + DIR *d = opendir(stylesdir); + int entries = 0; + struct dirent *p; + + // get the total number of directory entries + while ((p = readdir(d))) entries++; + rewinddir(d); + + char **ls = new char* [entries]; + int index = 0; + while ((p = readdir(d))) + ls[index++] = bstrdup(p->d_name); + + qsort(ls, entries, sizeof(char *), dcmp); + + int n, slen = strlen(stylesdir); + for (n = 0; n < entries; n++) { + int nlen = strlen(ls[n]); + char style[MAXPATHLEN + 1]; + + strncpy(style, stylesdir, slen); + *(style + slen) = '/'; + strncpy(style + slen + 1, ls[n], nlen + 1); + + 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); + } + + fluxbox->saveMenuFilename(stylesdir); + } else { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ScreenSet, ScreenSTYLESDIRErrorNotDir, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::parseMenuFile:" + " [stylesdir/stylesmenu] error, %s is not a" + " directory\n"), stylesdir); + } + } else { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + ScreenSet, ScreenSTYLESDIRErrorNoExist, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::parseMenuFile: [stylesdir/stylesmenu]" + " error, %s does not exist\n"), stylesdir); + } + + break; + } + + case 1090: // workspaces + { + if (! *label) { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + ScreenSet, ScreenWORKSPACESError, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen:parseMenuFile: [workspaces] error, " + "no menu label defined\n")); + continue; + } + + menu->insert(label, workspacemenu); + + break; + } + } + } + } + } + + return ((menu->getCount() == 0) ? True : False); +} + + +void BScreen::shutdown(void) { + fluxbox->grab(); + + XSelectInput(getBaseDisplay()->getXDisplay(), getRootWindow(), NoEventMask); + XSync(getBaseDisplay()->getXDisplay(), False); + + LinkedListIterator<Workspace> it(workspacesList); + for (; it.current(); it ++) + it.current()->shutdown(); + + while (iconList->count()) { + iconList->first()->restore(); + delete iconList->first(); + } + +#ifdef SLIT + slit->shutdown(); +#endif // SLIT + + fluxbox->ungrab(); +} + + +void BScreen::showPosition(int x, int y) { + if (! geom_visible) { + XMoveResizeWindow(getBaseDisplay()->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); + + geom_visible = True; + } + const int label_size = 1024; + char label[label_size]; + + snprintf(label, label_size, + I18n::instance()->getMessage( +#ifdef NLS + ScreenSet, ScreenPositionFormat, +#else // !NLS + 0, 0, +#endif // NLS + "X: %4d x Y: %4d"), x, y); + + XClearWindow(getBaseDisplay()->getXDisplay(), geom_window); + + if (I18n::instance()->multibyte()) + XmbDrawString(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->font.set, theme->getWindowStyle()->l_text_focus_gc, + theme->getBevelWidth(), theme->getBevelWidth() - + theme->getWindowStyle()->font.set_extents->max_ink_extent.y, + label, strlen(label)); + else + XDrawString(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->l_text_focus_gc, + theme->getBevelWidth(), + theme->getWindowStyle()->font.fontstruct->ascent + + theme->getBevelWidth(), label, strlen(label)); + +} + + +void BScreen::showGeometry(unsigned int gx, unsigned int gy) { + if (! geom_visible) { + XMoveResizeWindow(getBaseDisplay()->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); + + geom_visible = True; + } + + char label[1024]; + + sprintf(label, + I18n::instance()->getMessage( +#ifdef NLS + ScreenSet, ScreenGeometryFormat, +#else // !NLS + 0, 0, +#endif // NLS + "W: %4d x H: %4d"), gx, gy); + + XClearWindow(getBaseDisplay()->getXDisplay(), geom_window); + + if (I18n::instance()->multibyte()) + XmbDrawString(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->font.set, theme->getWindowStyle()->l_text_focus_gc, + theme->getBevelWidth(), theme->getBevelWidth() - + theme->getWindowStyle()->font.set_extents->max_ink_extent.y, + label, strlen(label)); + else + XDrawString(getBaseDisplay()->getXDisplay(), geom_window, + theme->getWindowStyle()->l_text_focus_gc, + theme->getBevelWidth(), + theme->getWindowStyle()->font.fontstruct->ascent + + theme->getBevelWidth(), label, strlen(label)); +} + + +void BScreen::hideGeometry(void) { + if (geom_visible) { + XUnmapWindow(getBaseDisplay()->getXDisplay(), geom_window); + geom_visible = False; + } +} + +//-------------- nextWorkspace --------------- +// Goes to the workspace "right" of the current +//-------------------------------------------- +void BScreen::nextWorkspace(void) { + if (getCurrentWorkspaceID()+1 > getCount()-1) + changeWorkspaceID(0); + else + changeWorkspaceID(getCurrentWorkspaceID()+1); +} + +//------------- prevWorkspace ---------------- +// Goes to the workspace "left" of the current +//-------------------------------------------- +void BScreen::prevWorkspace(void) { + if (getCurrentWorkspaceID()-1 < 0) + changeWorkspaceID(getCount()-1); + else + changeWorkspaceID(getCurrentWorkspaceID()-1); +}
A src/Screen.hh

@@ -0,0 +1,349 @@

+// Screen.hh for fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// Screen.hh for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> +#include <X11/Xresource.h> + +#ifdef TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +# else // !HAVE_SYS_TIME_H +# include <time.h> +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +#include <stdio.h> + +#include "Theme.hh" + +// forward declaration +class BScreen; +#ifndef _BASEDISPLAY_HH_ +#include "BaseDisplay.hh" +#endif +#ifndef _CONFIGMENU_HH_ +#include "Configmenu.hh" +#endif +#ifndef _ICON_HH_ +#include "Icon.hh" +#endif +#ifndef _LINKEDLIST_HH_ +#include "LinkedList.hh" +#endif +#ifndef _NETIZEN_HH_ +#include "Netizen.hh" +#endif +#ifndef _ROOTMENU_HH_ +#include "Rootmenu.hh" +#endif +#ifndef _TIMER_HH_ +#include "Timer.hh" +#endif +#ifndef _WORKSPACE_HH_ +#include "Workspace.hh" +#endif +#ifndef _WORKSPACEMENU_HH_ +#include "Workspacemenu.hh" +#endif +#ifndef _FLUXBOX_HH_ +#include "fluxbox.hh" +#endif + +#ifdef SLIT +# include "Slit.hh" +#endif // SLIT + +class BScreen : public ScreenInfo { +public: + BScreen(Fluxbox *, 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 &isSemiSloppyFocus(void) const + { return resource.semi_sloppy_focus; } + inline const Bool &isRootColormapInstalled(void) const + { return root_colormap_installed; } + inline const Bool &isScreenManaged(void) const { return managed; } + inline const Bool &isTabRotateVertical(void) const + { return resource.tab_rotate_vertical; } + inline const Bool &doAutoRaise(void) const { return resource.auto_raise; } + 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; } + + inline const GC &getOpGC() const { return theme->getOpGC(); } + + inline const BColor *getBorderColor(void) { return &theme->getBorderColor(); } + inline BImageControl *getImageControl(void) { return image_control; } + inline Rootmenu *getRootmenu(void) { 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; } +#endif // SLIT + + inline Toolbar *getToolbar(void) { return toolbar; } + + inline Workspace *getWorkspace(int w) { return workspacesList->find(w); } + inline Workspace *getCurrentWorkspace(void) { return current_workspace; } + + inline Workspacemenu *getWorkspacemenu(void) { return workspacemenu; } + + inline const unsigned int &getHandleWidth(void) const + { return theme->getHandleWidth(); } + inline const unsigned int &getBevelWidth(void) const + { return theme->getBevelWidth(); } + inline const unsigned int &getFrameWidth(void) const + { return theme->getFrameWidth(); } + inline const unsigned int &getBorderWidth(void) const + { return theme->getBorderWidth(); } + inline const unsigned int getBorderWidth2x(void) const + { return theme->getBorderWidth()*2; } + + 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 LinkedList<FluxboxWindow> *getIconList(void) { return iconList; } + 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 const int getTabPlacement(void) + { return resource.tab_placement; } + inline const int getTabAlignment(void) + { return resource.tab_alignment; } + + inline void setRootColormapInstalled(Bool r) { root_colormap_installed = r; } + inline void saveSloppyFocus(Bool s) { resource.sloppy_focus = s; } + inline void saveSemiSloppyFocus(Bool s) { resource.semi_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 saveTabPlacement(unsigned int p) { resource.tab_placement = p; } + inline void saveTabAlignment(unsigned int a) { resource.tab_alignment = a; } + inline void saveTabRotateVertical(Bool r) + { resource.tab_rotate_vertical = r; } + inline void iconUpdate(void) { iconmenu->update(); } + inline Iconmenu *getIconmenu(void) { return iconmenu; } + + +#ifdef HAVE_STRFTIME + inline char *getStrftimeFormat(void) { return resource.strftime_format; } + void saveStrftimeFormat(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; } +#endif // HAVE_STRFTIME + + inline WindowStyle *getWindowStyle(void) { return theme->getWindowStyle(); } + inline MenuStyle *getMenuStyle(void) { return theme->getMenuStyle(); } + inline ToolbarStyle *getToolbarStyle(void) { return theme->getToolbarStyle(); } + + FluxboxWindow *getIcon(int); + + int addWorkspace(void); + int removeLastWorkspace(void); + //scroll workspaces + void nextWorkspace(); + void prevWorkspace(); + + void removeWorkspaceNames(void); + void updateWorkspaceNamesAtom(void); + + void addWorkspaceName(char *); + void addNetizen(Netizen *); + void removeNetizen(Window); + void addIcon(FluxboxWindow *); + void removeIcon(FluxboxWindow *); + void getNameOfWorkspace(int, char **); + void changeWorkspaceID(int); + void raiseWindows(Window *, int); + void reassociateWindow(FluxboxWindow *, int, Bool); + void prevFocus(void); + void nextFocus(void); + void raiseFocus(void); + void reconfigure(void); + void rereadMenu(void); + void shutdown(void); + void showPosition(int, int); + void showGeometry(unsigned int, unsigned int); + void hideGeometry(void); + + void updateNetizenCurrentWorkspace(void); + void updateNetizenWorkspaceCount(void); + void updateNetizenWindowFocus(void); + 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 { 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, WindowTab}; + +private: + Theme *theme; + + Bool root_colormap_installed, managed, geom_visible; + GC opGC; + Pixmap geom_pixmap; + Window geom_window; + + Fluxbox *fluxbox; + BImageControl *image_control; + Configmenu *configmenu; + Iconmenu *iconmenu; + + Rootmenu *rootmenu; + + LinkedList<Rootmenu> *rootmenuList; + LinkedList<Netizen> *netizenList; + LinkedList<FluxboxWindow> *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<char> *workspaceNames; + LinkedList<Workspace> *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, tab_rotate_vertical, semi_sloppy_focus; +// BColor border_color; +// XrmDatabase stylerc; + + int workspaces, toolbar_placement, toolbar_width_percent, placement_policy, + edge_snap_threshold, row_direction, col_direction; + + unsigned int tab_placement, tab_alignment; + +#ifdef SLIT + Bool slit_on_top, slit_auto_hide; + int slit_placement, slit_direction; +#endif // SLIT + + // unsigned int handle_width, frame_width, + // border_width, border_width_2x; + +#ifdef HAVE_STRFTIME + char *strftime_format; +#else // !HAVE_STRFTIME + Bool clock24hour; + int date_format; +#endif // HAVE_STRFTIME + + + } resource; + + +protected: + Bool parseMenuFile(FILE *, Rootmenu *); + + bool readDatabaseTexture(char *, char *, BTexture *, unsigned long); + bool readDatabaseColor(char *, char *, BColor *, unsigned long); + + void readDatabaseFontSet(char *, char *, XFontSet *); + XFontSet createFontSet(char *); + void readDatabaseFont(char *, char *, XFontStruct **); + + void InitMenu(void); + + +}; + + +#endif // __Screen_hh
A src/Slit.cc

@@ -0,0 +1,905 @@

+// Slit.cc for Blackbox - an X11 Window manager +// 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 + +#ifdef SLIT + +#include <X11/keysym.h> + +#include "i18n.hh" +#include "fluxbox.hh" +#include "Image.hh" +#include "Screen.hh" +#include "Slit.hh" +#include "Toolbar.hh" + + +Slit::Slit(BScreen *scr) { + screen = scr; + fluxbox = Fluxbox::instance(); + + on_top = screen->isSlitOnTop(); + hidden = do_auto_hide = screen->doSlitAutoHide(); + + display = screen->getBaseDisplay()->getXDisplay(); + frame.window = frame.pixmap = None; + + timer = new BTimer(fluxbox, this); + timer->setTimeout(fluxbox->getAutoRaiseDelay()); + timer->fireOnce(True); + + clientList = new LinkedList<SlitClient>; + + 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(); + 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.window = + XCreateWindow(display, screen->getRootWindow(), frame.x, frame.y, + frame.width, frame.height, screen->getBorderWidth(), + screen->getDepth(), InputOutput, screen->getVisual(), + create_mask, &attrib); + fluxbox->saveSlitSearch(frame.window, this); + + reconfigure(); +} + + +Slit::~Slit() { + fluxbox->grab(); + + if (timer->isTiming()) timer->stop(); + delete timer; + + delete clientList; + delete slitmenu; + + screen->getImageControl()->removeImage(frame.pixmap); + + fluxbox->removeSlitSearch(frame.window); + + XDestroyWindow(display, frame.window); + + fluxbox->ungrab(); +} + + +void Slit::addClient(Window w) { + fluxbox->grab(); + + if (fluxbox->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); + 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; + } + + XFree(wmhints); + } else { + client->icon_window = None; + client->window = client->client_window; + } + #ifndef KDE + XWindowAttributes attrib; + if (XGetWindowAttributes(display, client->window, &attrib)) { + client->width = attrib.width; + client->height = attrib.height; + } else { + client->width = client->height = 64; + } + #else //KDE stuff starts here + XWindowAttributes attrib; + //Check and see if new client is a KDE dock applet + //If so force reasonable size + bool iskdedockapp=false; + Atom ajunk; + int ijunk; + unsigned long *data = (unsigned long *) 0, uljunk; + + // Check if KDE v2.x dock applet + if (XGetWindowProperty(fluxbox->getXDisplay(), w, + fluxbox->getKWM2DockwindowAtom(), 0l, 1l, False, + fluxbox->getKWM2DockwindowAtom(), + &ajunk, &ijunk, &uljunk, &uljunk, + (unsigned char **) &data) == Success) { + iskdedockapp = (data && data[0] != 0); + XFree((char *) data); + } + + // Check if KDE v1.x dock applet + if (!iskdedockapp) { + if (XGetWindowProperty(fluxbox->getXDisplay(), w, + fluxbox->getKWM1DockwindowAtom(), 0l, 1l, False, + fluxbox->getKWM1DockwindowAtom(), + &ajunk, &ijunk, &uljunk, &uljunk, + (unsigned char **) &data) == Success) { + iskdedockapp = (data && data[0] != 0); + XFree((char *) data); + } + } + + if (iskdedockapp) + client->width = client->height = 24; + else { + if (XGetWindowAttributes(display, client->window, &attrib)) { + client->width = attrib.width; + client->height = attrib.height; + } else + client->width = client->height = 64; + } + #endif // KDE + + XSetWindowBorderWidth(display, client->window, 0); + + 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); + XFlush(display); + + clientList->insert(client); + + fluxbox->saveSlitSearch(client->client_window, this); + fluxbox->saveSlitSearch(client->icon_window, this); + reconfigure(); + } + + fluxbox->ungrab(); +} + + +void Slit::removeClient(SlitClient *client, Bool remap) { + fluxbox->removeSlitSearch(client->client_window); + fluxbox->removeSlitSearch(client->icon_window); + clientList->remove(client); + + screen->removeNetizen(client->window); + + if (remap && fluxbox->validateWindow(client->window)) { + XSelectInput(display, frame.window, NoEventMask); + XSelectInput(display, client->window, NoEventMask); + XReparentWindow(display, client->window, screen->getRootWindow(), + client->x, client->y); + XChangeSaveSet(display, client->window, SetModeDelete); + XSelectInput(display, frame.window, SubstructureRedirectMask | + ButtonPressMask | EnterWindowMask | LeaveWindowMask); + XFlush(display); + } + + delete client; +} + + +void Slit::removeClient(Window w, Bool remap) { + fluxbox->grab(); + + Bool reconf = False; + + LinkedListIterator<SlitClient> it(clientList); + for (; it.current(); it++) + if (it.current()->window == w) { + removeClient(it.current(), remap); + reconf = True; + + break; + } + + if (reconf) reconfigure(); + + fluxbox->ungrab(); +} + + +void Slit::reconfigure(void) { + frame.width = 0; + frame.height = 0; + LinkedListIterator<SlitClient> it(clientList); + + switch (screen->getSlitDirection()) { + case Vertical: + for (; it.current(); it++) { + frame.height += it.current()->height + screen->getBevelWidth(); + + if (frame.width < it.current()->width) + frame.width = it.current()->width; + } + + if (frame.width < 1) + frame.width = 1; + else + frame.width += (screen->getBevelWidth() * 2); + + if (frame.height < 1) + frame.height = 1; + else + frame.height += screen->getBevelWidth(); + + break; + + case Horizontal: + for (; it.current(); it++) { + frame.width += it.current()->width + screen->getBevelWidth(); + + if (frame.height < it.current()->height) + frame.height = it.current()->height; + } + + if (frame.width < 1) + frame.width = 1; + else + frame.width += screen->getBevelWidth(); + + if (frame.height < 1) + frame.height = 1; + else + frame.height += (screen->getBevelWidth() * 2); + + break; + } + + reposition(); + + XSetWindowBorderWidth(display ,frame.window, screen->getBorderWidth()); + XSetWindowBorder(display, frame.window, + screen->getBorderColor()->getPixel()); + + if (! clientList->count()) + XUnmapWindow(display, frame.window); + else + XMapWindow(display, frame.window); + + Pixmap tmp = frame.pixmap; + 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, + texture); + XSetWindowBackgroundPixmap(display, frame.window, frame.pixmap); + } + if (tmp) image_ctrl->removeImage(tmp); + XClearWindow(display, frame.window); + + int x, y; + it.reset(); + + switch (screen->getSlitDirection()) { + case Vertical: + x = 0; + y = screen->getBevelWidth(); + + for (; it.current(); it++) { + x = (frame.width - it.current()->width) / 2; + + XMoveResizeWindow(display, it.current()->window, x, y, + it.current()->width, it.current()->height); + XMapWindow(display, it.current()->window); + + // for ICCCM compliance + it.current()->x = x; + it.current()->y = y; + + XEvent event; + event.type = ConfigureNotify; + + event.xconfigure.display = display; + event.xconfigure.event = it.current()->window; + event.xconfigure.window = it.current()->window; + event.xconfigure.x = x; + event.xconfigure.y = y; + event.xconfigure.width = it.current()->width; + event.xconfigure.height = it.current()->height; + event.xconfigure.border_width = 0; + event.xconfigure.above = frame.window; + event.xconfigure.override_redirect = False; + + XSendEvent(display, it.current()->window, False, StructureNotifyMask, + &event); + + y += it.current()->height + screen->getBevelWidth(); + } + + break; + + case Horizontal: + x = screen->getBevelWidth(); + y = 0; + + for (; it.current(); it++) { + y = (frame.height - it.current()->height) / 2; + + XMoveResizeWindow(display, it.current()->window, x, y, + it.current()->width, it.current()->height); + XMapWindow(display, it.current()->window); + + // for ICCCM compliance + it.current()->x = x; + it.current()->y = y; + + XEvent event; + event.type = ConfigureNotify; + + event.xconfigure.display = display; + event.xconfigure.event = it.current()->window; + event.xconfigure.window = it.current()->window; + event.xconfigure.x = frame.x + x + screen->getBorderWidth(); + event.xconfigure.y = frame.y + y + screen->getBorderWidth(); + event.xconfigure.width = it.current()->width; + event.xconfigure.height = it.current()->height; + event.xconfigure.border_width = 0; + event.xconfigure.above = frame.window; + event.xconfigure.override_redirect = False; + + XSendEvent(display, it.current()->window, False, StructureNotifyMask, + &event); + + x += it.current()->width + screen->getBevelWidth(); + } + + break; + } + + slitmenu->reconfigure(); +} + + +void Slit::reposition(void) { + // place the slit in the appropriate place + switch (screen->getSlitPlacement()) { + case TopLeft: + frame.x = 0; + frame.y = 0; + if (screen->getSlitDirection() == Vertical) { + frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.width; + frame.y_hidden = 0; + } else { + frame.x_hidden = 0; + frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.height; + } + break; + + case CenterLeft: + frame.x = 0; + frame.y = (screen->getHeight() - frame.height) / 2; + frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.width; + frame.y_hidden = frame.y; + break; + + case BottomLeft: + frame.x = 0; + frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); + if (screen->getSlitDirection() == Vertical) { + frame.x_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.width; + frame.y_hidden = frame.y; + } else { + frame.x_hidden = 0; + frame.y_hidden = screen->getHeight() - screen->getBevelWidth() + - screen->getBorderWidth(); + } + break; + + case TopCenter: + frame.x = (screen->getWidth() - frame.width) / 2; + frame.y = 0; + frame.x_hidden = frame.x; + frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.height; + break; + + case BottomCenter: + frame.x = (screen->getWidth() - frame.width) / 2; + frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); + frame.x_hidden = frame.x; + frame.y_hidden = screen->getHeight() - screen->getBevelWidth() + - screen->getBorderWidth(); + break; + + case TopRight: + frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); + frame.y = 0; + if (screen->getSlitDirection() == Vertical) { + frame.x_hidden = screen->getWidth() - screen->getBevelWidth() + - screen->getBorderWidth(); + frame.y_hidden = 0; + } else { + frame.x_hidden = frame.x; + frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.height; + } + break; + + case CenterRight: + default: + frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); + frame.y = (screen->getHeight() - frame.height) / 2; + frame.x_hidden = screen->getWidth() - screen->getBevelWidth() + - screen->getBorderWidth(); + frame.y_hidden = frame.y; + break; + + case BottomRight: + frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); + frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); + if (screen->getSlitDirection() == Vertical) { + frame.x_hidden = screen->getWidth() - screen->getBevelWidth() + - screen->getBorderWidth(); + frame.y_hidden = frame.y; + } else { + frame.x_hidden = frame.x; + frame.y_hidden = screen->getHeight() - screen->getBevelWidth() + - screen->getBorderWidth(); + } + break; + } + + Toolbar *tbar = screen->getToolbar(); + int sw = frame.width + screen->getBorderWidth2x(), + sh = frame.height + screen->getBorderWidth2x(), + tw = tbar->getWidth() + screen->getBorderWidth(), + th = tbar->getHeight() + screen->getBorderWidth(); + + 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(); + else + frame.y_hidden = frame.y; + } else { + frame.y -= tbar->getExposedHeight(); + if (screen->getSlitDirection() == Vertical) + frame.y_hidden -= tbar->getExposedHeight(); + else + frame.y_hidden = frame.y; + } + } + + if (hidden) + XMoveResizeWindow(display, frame.window, frame.x_hidden, + frame.y_hidden, frame.width, frame.height); + else + XMoveResizeWindow(display, frame.window, frame.x, + frame.y, frame.width, frame.height); +} + + +void Slit::shutdown(void) { + while (clientList->count()) + removeClient(clientList->first()); +} + + +void Slit::buttonPressEvent(XButtonEvent *e) { + if (e->window != frame.window) return; + + if (e->button == Button1 && (! on_top)) { + Window w[1] = { frame.window }; + screen->raiseWindows(w, 1); + } else if (e->button == Button2 && (! on_top)) { + XLowerWindow(display, frame.window); + } else if (e->button == Button3) { + if (! slitmenu->isVisible()) { + int x, y; + + x = e->x_root - (slitmenu->getWidth() / 2); + y = e->y_root - (slitmenu->getHeight() / 2); + + if (x < 0) + x = 0; + else if (x + slitmenu->getWidth() > screen->getWidth()) + x = screen->getWidth() - slitmenu->getWidth(); + + if (y < 0) + y = 0; + else if (y + slitmenu->getHeight() > screen->getHeight()) + y = screen->getHeight() - slitmenu->getHeight(); + + slitmenu->move(x, y); + slitmenu->show(); + } else + slitmenu->hide(); + } +} + + +void Slit::enterNotifyEvent(XCrossingEvent *) { + if (! do_auto_hide) + return; + + if (hidden) { + if (! timer->isTiming()) timer->start(); + } else { + if (timer->isTiming()) timer->stop(); + } +} + + +void Slit::leaveNotifyEvent(XCrossingEvent *) { + if (! do_auto_hide) + return; + + if (hidden) { + if (timer->isTiming()) timer->stop(); + } else if (! slitmenu->isVisible()) { + if (! timer->isTiming()) timer->start(); + } +} + + +void Slit::configureRequestEvent(XConfigureRequestEvent *e) { + fluxbox->grab(); + + if (fluxbox->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<SlitClient> it(clientList); + for (; it.current(); it++) + if (it.current()->window == e->window) + if (it.current()->width != ((unsigned) e->width) || + it.current()->height != ((unsigned) e->height)) { + it.current()->width = (unsigned) e->width; + it.current()->height = (unsigned) e->height; + + reconf = True; + + break; + } + + if (reconf) reconfigure(); + + } + + fluxbox->ungrab(); +} + + +void Slit::timeout(void) { + hidden = ! hidden; + if (hidden) + XMoveWindow(display, frame.window, frame.x_hidden, frame.y_hidden); + else + XMoveWindow(display, frame.window, frame.x, frame.y); +} + + +Slitmenu::Slitmenu(Slit *sl) : Basemenu(sl->screen) { + slit = sl; + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + SlitSet, SlitSlitTitle, +#else // !NLS + 0, 0, +#endif // NLS + "Slit")); + setInternalMenu(); + + directionmenu = new Directionmenu(this); + placementmenu = new Placementmenu(this); + + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonDirectionTitle, +#else // !NLS + 0, 0, +#endif // NLS + "Direction"), + directionmenu); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTitle, +#else // !NLS + 0, 0, +#endif // NLS + "Placement"), + placementmenu); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonAlwaysOnTop, +#else // !NLS + 0, 0, +#endif // NLS + "Always on top"), 1); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonAutoHide, +#else // !NLS + 0, 0, +#endif // NLS + "Auto hide"), 2); + + update(); + + if (slit->isOnTop()) setItemSelected(2, True); + if (slit->doAutoHide()) setItemSelected(3, True); +} + + +Slitmenu::~Slitmenu(void) { + delete directionmenu; + delete placementmenu; +} + + +void Slitmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + if (! item) return; + + switch (item->function()) { + case 1: // always on top + { + Bool change = ((slit->isOnTop()) ? False : True); + slit->on_top = change; + setItemSelected(2, change); + + if (slit->isOnTop()) slit->screen->raiseWindows((Window *) 0, 0); + break; + } + + case 2: // auto hide + { + Bool change = ((slit->doAutoHide()) ? False : True); + slit->do_auto_hide = change; + setItemSelected(3, change); + + break; + } + } + } +} + + +void Slitmenu::internal_hide(void) { + Basemenu::internal_hide(); + if (slit->doAutoHide()) + slit->timeout(); +} + + +void Slitmenu::reconfigure(void) { + directionmenu->reconfigure(); + placementmenu->reconfigure(); + + Basemenu::reconfigure(); +} + + +Slitmenu::Directionmenu::Directionmenu(Slitmenu *sm) : Basemenu(sm->slit->screen) { + slitmenu = sm; + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + SlitSet, SlitSlitDirection, +#else // !NLS + 0, 0, +#endif // NLS + "Slit Direction")); + setInternalMenu(); + + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonDirectionHoriz, +#else // !NLS + 0, 0, +#endif // NLS + "Horizontal"), + Slit::Horizontal); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonDirectionVert, +#else // !NLS + 0, 0, +#endif // NLS + "Vertical"), + Slit::Vertical); + + update(); + + if (sm->slit->screen->getSlitDirection() == Slit::Horizontal) + setItemSelected(0, True); + else + setItemSelected(1, True); +} + + +void Slitmenu::Directionmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + if (! item) return; + + slitmenu->slit->screen->saveSlitDirection(item->function()); + + if (item->function() == Slit::Horizontal) { + setItemSelected(0, True); + setItemSelected(1, False); + } else { + setItemSelected(0, False); + setItemSelected(1, True); + } + + hide(); + slitmenu->slit->reconfigure(); + } +} + + +Slitmenu::Placementmenu::Placementmenu(Slitmenu *sm) : Basemenu(sm->slit->screen) { + slitmenu = sm; + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + SlitSet, SlitSlitPlacement, +#else // !NLS + 0, 0, +#endif // NLS + "Slit Placement")); + setMinimumSublevels(3); + setInternalMenu(); + + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Top Left"), + Slit::TopLeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementCenterLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Center Left"), + Slit::CenterLeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Left"), + Slit::BottomLeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Top Center"), + Slit::TopCenter); + insert(""); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Center"), + Slit::BottomCenter); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopRight, +#else // !NLS + 0, 0, +#endif // NLS + "Top Right"), + Slit::TopRight); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementCenterRight, +#else // !NLS + 0, 0, +#endif // NLS + "Center Right"), + Slit::CenterRight); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomRight, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Right"), + Slit::BottomRight); + + update(); +} + + +void Slitmenu::Placementmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + if (! item) return; + + if (item->function()) { + slitmenu->slit->screen->saveSlitPlacement(item->function()); + hide(); + slitmenu->slit->reconfigure(); + } + } +} + + +#endif // SLIT
A src/Slit.hh

@@ -0,0 +1,159 @@

+// Slit.hh for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> +#include <X11/Xutil.h> + +// forward declaration +class Slit; +class Slitmenu; + +#include "Basemenu.hh" +#include "LinkedList.hh" + + +class Slitmenu : public Basemenu { +private: + class Directionmenu : public Basemenu { + private: + Slitmenu *slitmenu; + + protected: + virtual void itemSelected(int, int); + + public: + Directionmenu(Slitmenu *); + }; + + class Placementmenu : public Basemenu { + private: + Slitmenu *slitmenu; + + protected: + virtual void itemSelected(int, int); + + public: + Placementmenu(Slitmenu *); + }; + + Directionmenu *directionmenu; + Placementmenu *placementmenu; + + Slit *slit; + + friend class Directionmenu; + friend class Placementmenu; + friend class Slit; + + +protected: + virtual void itemSelected(int, int); + virtual void internal_hide(void); + + +public: + Slitmenu(Slit *); + virtual ~Slitmenu(void); + + inline Basemenu *getDirectionmenu(void) { return directionmenu; } + inline Basemenu *getPlacementmenu(void) { return placementmenu; } + + void reconfigure(void); +}; + + +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; + Display *display; + + Fluxbox *fluxbox; + BScreen *screen; + BTimer *timer; + + LinkedList<SlitClient> *clientList; + Slitmenu *slitmenu; + + struct frame { + Pixmap pixmap; + Window window; + + int x, y, x_hidden, y_hidden; + unsigned int width, height; + } frame; + + friend class Slitmenu; + friend class Slitmenu::Directionmenu; + friend class Slitmenu::Placementmenu; + + +public: + Slit(BScreen *); + 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; } + + void addClient(Window); + void removeClient(SlitClient *, Bool = True); + void removeClient(Window, Bool = True); + void reconfigure(void); + void reposition(void); + void shutdown(void); + + void buttonPressEvent(XButtonEvent *); + void enterNotifyEvent(XCrossingEvent *); + void leaveNotifyEvent(XCrossingEvent *); + void configureRequestEvent(XConfigureRequestEvent *); + + virtual void timeout(void); + + enum { Vertical = 1, Horizontal }; + enum { TopLeft = 1, CenterLeft, BottomLeft, TopCenter, BottomCenter, + TopRight, CenterRight, BottomRight }; +}; + + +#endif // __Slit_hh
A src/Tab.cc

@@ -0,0 +1,1069 @@

+// Tab.cc for Fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 "Tab.hh" +#include <iostream> +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif // HAVE_CONFIG_H +#include "i18n.hh" + +#include "misc.hh" + +using namespace std; + +bool Tab::m_stoptabs = false; +Tab::t_tabplacementlist Tab::m_tabplacementlist[] = { + {PTop, "Top"}, + {PBottom, "Bottom"}, + {PLeft, "Left"}, + {PRight, "Right"}, + {pnone, "none"} + }; + +Tab::t_tabplacementlist Tab::m_tabalignmentlist[] = { + {ALeft, "Left"}, + {ACenter, "Center"}, + {ARight, "Right"}, + {ARelative, "Relative"}, + {anone, "none"} + }; + +Tab::Tab(FluxboxWindow *win, Tab *prev, Tab *next) { + //set default values + + m_focus = m_moving = false; + m_configured = true; // only set to false before Fluxbox::reconfigure + m_move_x = m_move_y = 0; + m_prev = prev; m_next = next; + m_win = win; + m_display = Fluxbox::instance()->getXDisplay(); + + if ((m_win->screen->getTabPlacement() == PLeft || + m_win->screen->getTabPlacement() == PRight) && + m_win->screen->isTabRotateVertical()) { + m_size_w = Fluxbox::instance()->getTabHeight(); + m_size_h = Fluxbox::instance()->getTabWidth(); + } else { + m_size_w = Fluxbox::instance()->getTabWidth(); + m_size_h = Fluxbox::instance()->getTabHeight(); + } + + createTabWindow(); + + calcIncrease(); +} + +Tab::~Tab() { + + disconnect(); + + Fluxbox::instance()->removeTabSearch(m_tabwin); + XDestroyWindow(m_display, m_tabwin); +} + + +//---------------- createTabWindow --------------- +// (private) +// Creates the Window for tab to be above the title window. +// This should only be called by the constructor. +//------------------------------------------------- +void Tab::createTabWindow() { + unsigned long attrib_mask = CWBackPixmap | CWBackPixel | CWBorderPixel | + CWColormap | CWOverrideRedirect | CWEventMask; + XSetWindowAttributes attrib; + attrib.background_pixmap = None; + attrib.background_pixel = attrib.border_pixel = + m_win->screen->getWindowStyle()->tab.border_color.getPixel(); + attrib.colormap = m_win->screen->getColormap(); + attrib.override_redirect = True; + attrib.event_mask = ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | ExposureMask | EnterWindowMask; + //Notice that m_size_w gets the TOTAL width of tabs INCLUDING borders + m_tabwin = XCreateWindow(m_display, m_win->screen->getRootWindow(), + -30000, -30000, //TODO: So that it wont flicker or + // appear before the window do + m_size_w - m_win->screen->getWindowStyle()->tab.border_width_2x, + m_size_h - m_win->screen->getWindowStyle()->tab.border_width_2x, + m_win->screen->getWindowStyle()->tab.border_width, + m_win->screen->getDepth(), InputOutput, + m_win->screen->getVisual(), attrib_mask, &attrib); + //set grab + XGrabButton(m_display, Button1, Mod1Mask, m_tabwin, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, Fluxbox::instance()->getMoveCursor()); + + + //save to tabsearch + Fluxbox::instance()->saveTabSearch(m_tabwin, this); + + XMapSubwindows(m_display, m_tabwin); + + XMapWindow(m_display, m_tabwin); + + decorate(); +} + +//-------------- focus -------------------- +// Called when the focus changes in m_win +// updates pixmap or color and draws the tab +//----------------------------------------- +void Tab::focus() { + + if (m_win->focused) { + if (m_focus_pm) + XSetWindowBackgroundPixmap(m_display, m_tabwin, m_focus_pm); + else + XSetWindowBackground(m_display, m_tabwin, m_focus_pixel); + } else { + if (m_unfocus_pm) + XSetWindowBackgroundPixmap(m_display, m_tabwin, m_unfocus_pm); + else + XSetWindowBackground(m_display, m_tabwin, m_unfocus_pixel); + } + XClearWindow(m_display, m_tabwin); + draw(false); +} + +//-------------- raise -------------------- +// Raises the tabs in the tablist +//----------------------------------------- +void Tab::raise() { + //get first tab + Tab *first = 0; + first = getFirst(this); + //raise tabs + for (; first!=0; first = first->m_next) + m_win->screen->raiseWindows(&first->m_tabwin, 1); +} + +//-------------- decorate -------------------- +// decorates the tab with current theme +// TODO optimize this +//-------------------------------------------- +void Tab::decorate() { + + BImageControl *image_ctrl = m_win->screen->getImageControl(); + Pixmap tmp = m_focus_pm; + BTexture *texture = &(m_win->screen->getWindowStyle()->tab.l_focus); + + if (texture->getTexture() & BImage_ParentRelative ) { + BTexture *pt = &(m_win->screen->getWindowStyle()->tab.t_focus); + if (pt->getTexture() == (BImage_Flat | BImage_Solid)) { + m_focus_pm = None; + m_focus_pixel = pt->getColor()->getPixel(); + } else + m_focus_pm = + image_ctrl->renderImage(m_size_w, m_size_h, pt); + if (tmp) image_ctrl->removeImage(tmp); + + } else { + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + m_focus_pm = None; + m_focus_pixel = texture->getColor()->getPixel(); + } else + m_focus_pm = + image_ctrl->renderImage(m_size_w, m_size_h, texture); + if (tmp) image_ctrl->removeImage(tmp); + } + + tmp = m_unfocus_pm; + texture = &(m_win->screen->getWindowStyle()->tab.l_unfocus); + + if (texture->getTexture() & BImage_ParentRelative ) { + BTexture *pt = &(m_win->screen->getWindowStyle()->tab.t_unfocus); + if (pt->getTexture() == (BImage_Flat | BImage_Solid)) { + m_unfocus_pm = None; + m_unfocus_pixel = pt->getColor()->getPixel(); + } else + m_unfocus_pm = + image_ctrl->renderImage(m_size_w, m_size_h, pt); + } else { + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + m_unfocus_pm = None; + m_unfocus_pixel = texture->getColor()->getPixel(); + } else + m_unfocus_pm = + image_ctrl->renderImage(m_size_w, m_size_h, texture); + } + + if (tmp) image_ctrl->removeImage(tmp); + + XSetWindowBorderWidth(m_display, m_tabwin, + m_win->screen->getWindowStyle()->tab.border_width); + XSetWindowBorder(m_display, m_tabwin, + m_win->screen->getWindowStyle()->tab.border_color.getPixel()); +} + + +//-------------- deiconify ------------------- +// Deiconifies the tab +// Used from FluxboxWindow to deiconify the tab when the window is deiconfied +//-------------------------------------------- +void Tab::deiconify() { + XMapWindow(m_display, m_tabwin); +} + +//------------- iconify -------------------- +// Iconifies the tab. +// Used from FluxboxWindow to hide tab win when window is iconified +// disconnects itself from the list +//------------------------------------------ +void Tab::iconify() { + disconnect(); + withdraw(); +} + +//------------ withdraw -------------- +// Unmaps the tab from display +//------------------------------------ +void Tab::withdraw() { + XUnmapWindow(m_display, m_tabwin); +} + +//------------ stick -------------------- +// Set/reset the the sticky on all windows in the list +//--------------------------------------- +void Tab::stick() { + + //get first tab + Tab *first = 0; + first = getFirst(this); + + //now do stick for all windows in the list + for (; first!=0; first = first->m_next) { + FluxboxWindow *win = first->m_win; //just for convenient + if (win->stuck) { + win->blackbox_attrib.flags ^= AttribOmnipresent; + win->blackbox_attrib.attrib ^= AttribOmnipresent; + win->stuck = false; + if (!win->iconic) + win->screen->reassociateWindow(win, -1, true); + + } else { + win->stuck = true; + win->blackbox_attrib.flags |= AttribOmnipresent; + win->blackbox_attrib.attrib |= AttribOmnipresent; + } + + win->setState(win->current_state); + } + +} + +//------------- resize ------------- +// Resize the window's in the tablist +//---------------------------------- +void Tab::resize() { + Tab *first = getFirst(this); + + //now move and resize the windows in the list + for (; first != 0; first = first->m_next) { + if (first!=this) { + first->m_win->configure(m_win->frame.x, m_win->frame.y, + m_win->frame.width, m_win->frame.height); + } + } + + // need to resize tabs if in relative mode + if (m_win->screen->getTabAlignment() == ARelative) { + calcIncrease(); + setPosition(); + } +} + +//----------- shade -------------- +// Shades the windows in the tablist +//-------------------------------- +void Tab::shade() { + for(Tab *first = getFirst(this); first != 0; first = first->m_next) { + if (first==this) + continue; + first->m_win->shade(); + } + + if (m_win->screen->getTabPlacement() == PLeft || + m_win->screen->getTabPlacement() == PRight) { + resizeGroup(); + calcIncrease(); + } + + if (!(m_win->screen->getTabPlacement() == PTop)) + setPosition(); +} + +//------------ draw ----------------- +// Draws the tab +// if pressed = true then it draws the tab in pressed +// mode else it draws it in normal mode +// TODO: the "draw in pressed mode" +//----------------------------------- +void Tab::draw(bool pressed) { + unsigned int tabtext_w; + + GC gc = ((m_win->focused) ? m_win->screen->getWindowStyle()->tab.l_text_focus_gc : + m_win->screen->getWindowStyle()->tab.l_text_unfocus_gc); + + // Different routines for drawing rotated text + if ((m_win->screen->getTabPlacement() == PLeft || + m_win->screen->getTabPlacement() == PRight) && + (!m_win->isShaded() && m_win->screen->isTabRotateVertical())) { + + tabtext_w = XRotTextWidth(m_win->screen->getWindowStyle()->tab.rot_font, + m_win->client.title, m_win->client.title_len); + tabtext_w += (m_win->frame.bevel_w * 4); + + DrawRotString(m_display, m_tabwin, gc, + m_win->screen->getWindowStyle()->tab.rot_font, + m_win->screen->getWindowStyle()->tab.font.justify, + tabtext_w, m_size_w, m_size_h, + m_win->frame.bevel_w, m_win->client.title); + + } else { + if (I18n::instance()->multibyte()) { // TODO: maybe move this out from here? + XRectangle ink, logical; + XmbTextExtents(m_win->screen->getWindowStyle()->tab.font.set, + m_win->client.title, m_win->client.title_len, + &ink, &logical); + tabtext_w = logical.width; + } else { + tabtext_w = XTextWidth( + m_win->screen->getWindowStyle()->tab.font.fontstruct, + m_win->client.title, m_win->client.title_len); + } + tabtext_w += (m_win->frame.bevel_w * 4); + + DrawString(m_display, m_tabwin, gc, + &m_win->screen->getWindowStyle()->tab.font, + tabtext_w, m_size_w, + m_win->frame.bevel_w, m_win->client.title); + } +} + +//------------- setPosition ----------------- +// Position tab ( follow the m_win pos ). +// (and resize) +// Set new position of the other tabs in the chain +//------------------------------------------- +void Tab::setPosition() { + //don't do anything if the tablist is freezed + if (m_stoptabs) + return; + + Tab *first = 0; + int pos_x = 0, pos_y = 0; + + m_stoptabs = true; //freeze tablist + + //and check for max tabs + //TODO: optimize! There is many ways to implement this... + //posible movement to a static member function + + //Tab placement + if (m_win->screen->getTabPlacement() == PTop) { + pos_y = m_win->frame.y - m_size_h; + + } else if (m_win->screen->getTabPlacement() == PBottom || + m_win->isShaded()) { + if (m_win->isShaded()) + pos_y = m_win->frame.y + m_win->getTitleHeight() + + m_win->screen->getBorderWidth2x(); + else + pos_y = m_win->frame.y + m_win->getHeight() + + m_win->screen->getBorderWidth2x(); + + } else if (m_win->screen->getTabPlacement() == PLeft) { + pos_x = m_win->frame.x - m_size_w; + + } else if (m_win->screen->getTabPlacement() == PRight) { + pos_x = m_win->frame.x + m_win->frame.width + + m_win->screen->getBorderWidth2x(); + } + + //Tab alignment + if (m_win->screen->getTabPlacement() == PTop || + m_win->screen->getTabPlacement() == PBottom || + m_win->isShaded()) { + switch(m_win->screen->getTabAlignment()) { + case ARelative: + case ALeft: + pos_x = m_win->frame.x; + break; + case ACenter: + pos_x = calcCenterXPos(); + break; + case ARight: + pos_x = m_win->frame.x + m_win->frame.width + + m_win->screen->getBorderWidth2x() - m_size_w; + break; + } + } else { //PLeft | PRight + switch(m_win->screen->getTabAlignment()) { + case ALeft: + pos_y = m_win->frame.y - m_size_h + m_win->frame.height + + m_win->screen->getBorderWidth2x(); + break; + case ACenter: + pos_y = calcCenterYPos(); + break; + case ARelative: + case ARight: + pos_y = m_win->frame.y; + break; + } + } + + for (first = getFirst(this); + first!=0; + pos_x += first->m_inc_x, pos_y += first->m_inc_y, + first = first->m_next){ + + XMoveWindow(m_display, first->m_tabwin, pos_x, pos_y); + + //dont move fluxboxwindow if the itterator = this + if (first!=this) { + first->m_win->configure(m_win->frame.x, m_win->frame.y, + m_win->frame.width, m_win->frame.height); + } + } + + m_stoptabs = false; +} + +//------------- calcIncrease ---------------- +// calculates m_inc_x and m_inc_y for tabs +// used for positioning the tabs. +//------------------------------------------- +void Tab::calcIncrease(void) { + #ifdef DEBUG + cerr << "Calculating tab increase" << endl; + #endif // DEBUG + + Tab *first; + int inc_x = 0, inc_y = 0; + unsigned int tabs = 0, i = 0; + + if (m_win->screen->getTabPlacement() == PTop || + m_win->screen->getTabPlacement() == PBottom || + m_win->isShaded()) { + inc_y = 0; + + switch(m_win->screen->getTabAlignment()) { + case ALeft: + inc_x = m_size_w; + break; + case ACenter: + inc_x = m_size_w; + break; + case ARight: + inc_x = -m_size_w; + break; + case ARelative: + inc_x = calcRelativeWidth(); + break; + } + } else if (m_win->screen->getTabPlacement() == PLeft || + m_win->screen->getTabPlacement() == PRight) { + inc_x = 0; + + switch(m_win->screen->getTabAlignment()) { + case ALeft: + inc_y = -m_size_h; + break; + case ACenter: + inc_y = m_size_h; + break; + case ARight: + inc_y = m_size_h; + break; + case ARelative: + inc_y = calcRelativeHeight(); + break; + } + } + + for (first = getFirst(this); first!=0; first = first->m_next, tabs++); + + for (first = getFirst(this); first!=0; first = first->m_next, i++){ + + //TODO: move this out from here? + if ((m_win->screen->getTabPlacement() == PTop || + m_win->screen->getTabPlacement() == PBottom || + m_win->isShaded()) && + m_win->screen->getTabAlignment() == ARelative) { + if (!((m_win->frame.width + + m_win->screen->getBorderWidth2x()) % tabs) || + i >= ((m_win->frame.width + + m_win->screen->getBorderWidth2x()) % tabs)) { + first->setTabWidth(inc_x); + first->m_inc_x = inc_x; + } else { // adding 1 extra pixel to get tabs like win width + first->setTabWidth(inc_x + 1); + first->m_inc_x = inc_x + 1; + } + first->m_inc_y = inc_y; + } else if (m_win->screen->getTabAlignment() == ARelative) { + if (!((m_win->frame.height + + m_win->screen->getBorderWidth2x()) % tabs) || + i >= ((m_win->frame.height + + m_win->screen->getBorderWidth2x()) % tabs)) { + + first->setTabHeight(inc_y); + first->m_inc_y = inc_y; + } else { + // adding 1 extra pixel to get tabs match window width + first->setTabHeight(inc_y + 1); + first->m_inc_y = inc_y + 1; + } + first->m_inc_x = inc_x; + } else { // non relative modes + first->m_inc_x = inc_x; + first->m_inc_y = inc_y; + } + } +} + +//------------- buttonPressEvent ----------- +// Handle button press event here. +//------------------------------------------ +void Tab::buttonPressEvent(XButtonEvent *be) { + //draw in pressed mode + draw(true); + + //set window to titlewindow so we can take advatage of drag function + be->window = m_win->frame.title; + + //call windows buttonpress eventhandler + m_win->buttonPressEvent(be); +} + +//----------- buttonReleaseEvent ---------- +// Handle button release event here. +// If tab is dropped then it should try to find +// the window where the tab where dropped. +//----------------------------------------- +void Tab::buttonReleaseEvent(XButtonEvent *be) { + + if (m_moving) { + + m_moving = false; + + //erase tabmoving rectangle + XDrawRectangle(m_display, m_win->screen->getRootWindow(), + m_win->screen->getOpGC(), + m_move_x, m_move_y, + m_size_w, m_size_h); + + Fluxbox::instance()->ungrab(); + XUngrabPointer(m_display, CurrentTime); + + //storage of window and pos of window where we dropped the tab + Window child; + int dest_x = 0, dest_y = 0; + + //find window on coordinates of buttonReleaseEvent + if (XTranslateCoordinates(m_display, m_win->screen->getRootWindow(), + m_win->screen->getRootWindow(), + be->x_root, be->y_root, &dest_x, &dest_y, &child)) { + + Tab *tab = 0; + //search tablist for a tabwindow + if ((tab = Fluxbox::instance()->searchTab(child))!=0) { + // do only attach a hole chain if we dropped the + // first tab in the dropped chain... + + if (m_prev) + disconnect(); + + // attach this tabwindow chain to the tabwindow chain we found. + tab->insert(this); + + } else { + disconnect(); + + // (ab)using dest_x and dest_y + switch(m_win->screen->getTabPlacement()) { + case PTop: + dest_x = be->x_root; + dest_y = be->y_root; + switch(m_win->screen->getTabAlignment()) { + case ACenter: + dest_x -= (m_win->frame.width / 2) - (m_size_w / 2); + break; + case ARight: + dest_x -= m_win->frame.width - m_size_w; + break; + } + break; + case PBottom: + dest_x = be->x_root; + dest_y = be->y_root - m_win->frame.height; + switch(m_win->screen->getTabAlignment()) { + case ACenter: + dest_x -= (m_win->frame.width / 2) - (m_size_w / 2); + break; + case ARight: + dest_x -= m_win->frame.width - m_size_w; + break; + } + break; + case PLeft: + dest_x = be->x_root; + dest_y = be->y_root; + switch(m_win->screen->getTabAlignment()) { + case ACenter: + dest_y -= (m_win->frame.height / 2) - (m_size_h / 2); + break; + case ALeft: + dest_y -= m_win->frame.height + m_size_h; + break; + } + break; + case PRight: + dest_x = be->x_root - m_win->frame.width; + dest_y = be->y_root; + switch(m_win->screen->getTabAlignment()) { + case ACenter: + dest_y -= (m_win->frame.height / 2) - (m_size_h / 2); + break; + case ALeft: + dest_y -= m_win->frame.height + m_size_h; + break; + } + break; + } + //TODO: this causes an calculate increase event, even if + // only moving a tab! + m_win->configure(dest_x, dest_y, m_win->frame.width, m_win->frame.height); + } + } + } else { + + //raise this tabwindow + raise(); + + //set window to title window soo we can use m_win handler for menu + be->window = m_win->frame.title; + + //call windows buttonrelease event handler so it can popup a menu if needed + m_win->buttonReleaseEvent(be); + } + +} + +//------------- exposeEvent ------------ +// Handle expose event here. +// Draws the tab unpressed +//-------------------------------------- +void Tab::exposeEvent(XExposeEvent *ee) { + draw(false); +} + +//----------- motionNotifyEvent -------- +// Handles motion event here +// Draws the rectangle of moving tab +//-------------------------------------- +void Tab::motionNotifyEvent(XMotionEvent *me) { + + Fluxbox *fluxbox = Fluxbox::instance(); + + //if mousebutton 2 is pressed + if (me->state & Button2Mask) { + if (!m_moving) { + m_moving = true; + + XGrabPointer(m_display, me->window, False, Button2MotionMask | + ButtonReleaseMask, GrabModeAsync, GrabModeAsync, + None, fluxbox->getMoveCursor(), CurrentTime); + + fluxbox->grab(); + + m_move_x = me->x_root - 1; + m_move_y = me->y_root - 1; + + XDrawRectangle(m_display, m_win->screen->getRootWindow(), + m_win->screen->getOpGC(), + m_move_x, m_move_y, + m_size_w, m_size_h); + + } else { + + int dx = me->x_root - 1, dy = me->y_root - 1; + + dx -= m_win->screen->getBorderWidth(); + dy -= m_win->screen->getBorderWidth(); + + if (m_win->screen->getEdgeSnapThreshold()) { + int drx = m_win->screen->getWidth() - (dx + 1); + + if (dx > 0 && dx < drx && dx < m_win->screen->getEdgeSnapThreshold()) + dx = 0; + else if (drx > 0 && drx < m_win->screen->getEdgeSnapThreshold()) + dx = m_win->screen->getWidth() - 1; + + int dtty, dbby, dty, dby; + + switch (m_win->screen->getToolbarPlacement()) { + case Toolbar::TopLeft: + case Toolbar::TopCenter: + case Toolbar::TopRight: + dtty = m_win->screen->getToolbar()->getExposedHeight() + + m_win->screen->getBorderWidth(); + dbby = m_win->screen->getHeight(); + break; + + default: + dtty = 0; + dbby = m_win->screen->getToolbar()->getY(); + break; + } + + dty = dy - dtty; + dby = dbby - (dy + 1); + + if (dy > 0 && dty < m_win->screen->getEdgeSnapThreshold()) + dy = dtty; + else if (dby > 0 && dby < m_win->screen->getEdgeSnapThreshold()) + dy = dbby - 1; + + } + + //erase rectangle + XDrawRectangle(m_display, m_win->screen->getRootWindow(), + m_win->screen->getOpGC(), + m_move_x, m_move_y, + m_size_w, m_size_h); + + //redraw rectangle at new pos + m_move_x = dx; + m_move_y = dy; + XDrawRectangle(m_display, m_win->screen->getRootWindow(), + m_win->screen->getOpGC(), + m_move_x, m_move_y, + m_size_w, m_size_h); + + } + } +} + +//-------------- getFirst() --------- +// Returns the first Tab in the chain +// of currentchain. +//----------------------------------- +Tab *Tab::getFirst(Tab *current) { + if (current==0) + return 0; + for (; current->m_prev != 0; current = current->m_prev); + return current; +} + +//-------------- insert ------------ +// (private) +// Inserts a tab in the chain +//---------------------------------- +void Tab::insert(Tab *tab) { + + if (!tab || tab == this) //dont insert if the tab = 0 or the tab = this + return; + + Tab *first = getFirst(this); + + //if the tab already in chain then disconnect it + for (; first!=0; first = first->m_next) { + if (first==tab) { + #ifdef DEBUG + cerr<<"Tab already in chain. Disconnecting!"<<endl; + #endif // DEBUG + tab->disconnect(); + break; + } + } + + //get last tab in the chain to be inserted + Tab *last = tab; + for (; last->m_next!=0; last=last->m_next); + //do sticky before we connect it to the chain + //sticky bit on window + if (m_win->isStuck() && !tab->m_win->isStuck() || + !m_win->isStuck() && tab->m_win->isStuck()) + tab->m_win->stick(); //this will set all the m_wins in the list + + //connect the tab to this chain + + if (m_next) + m_next->m_prev = last; + tab->m_prev = this; + last->m_next = m_next; + + m_next = tab; + + //TODO: cleanup and optimize + //move and resize all windows in the tablist we inserted + //only from first tab of the inserted chain to the last + for (; tab!=last->m_next; tab=tab->m_next) { + if (m_win->isShaded() != tab->m_win->isShaded()) { + if (m_win->screen->getTabPlacement() == PLeft || + m_win->screen->getTabPlacement() == PRight) { + // if window were grouping to, we need to shade the tab window + // _after_ reconfigure + if(m_win->isShaded()) { + tab->m_win->configure(m_win->frame.x, m_win->frame.y, + m_win->frame.width, m_win->frame.height); + tab->m_win->shade(); + // don't need unshading as configure will fix that for me + } else { + if ((m_win->frame.width != tab->m_win->frame.width) || + (m_win->frame.height != tab->m_win->frame.height)) { + tab->m_win->configure(m_win->frame.x, m_win->frame.y, + m_win->frame.width, m_win->frame.height); + } else // need to change shade state as configure _won't_ + // do the trick if the new and old size is the same + tab->m_win->shade(); + } + + tab->resizeGroup(); + tab->calcIncrease(); + + } else { // PTop & PBottom + if(m_win->isShaded()) { + + tab->m_win->configure(m_win->frame.x, m_win->frame.y, + m_win->frame.width, m_win->frame.height); + tab->m_win->shade(); + // don't need unshading as configure will fix that for me + } else { + if ((m_win->frame.width != tab->m_win->frame.width) || + (m_win->frame.height != tab->m_win->frame.height)) { + + tab->m_win->configure(m_win->frame.x, m_win->frame.y, + m_win->frame.width, m_win->frame.height); + } else + tab->m_win->shade(); + } + } + + // both window have the same shaded state + } else { + if ((m_win->frame.width != tab->m_win->frame.width) || + (m_win->frame.height != tab->m_win->frame.height)) { + + tab->m_win->configure(m_win->frame.x, m_win->frame.y, + m_win->frame.width, m_win->frame.height); + + // need to shade the tab window as configure will mess it up + if (m_win->isShaded()) + tab->m_win->shade(); + } + } + + // TODO: should check if alignemnt is left or right, + // cus then resize is allready done resize tabs + if(m_win->screen->getTabAlignment() == ARelative) { + tab->resizeGroup(); + tab->calcIncrease(); + } + m_win->tab->setPosition(); + } +} + +//---------- disconnect() -------------- +// Disconnects the tab from any chain +//-------------------------------------- +void Tab::disconnect() { + Tab *tmp = 0; + if (m_prev) { //if this have a chain to "the left" (previous tab) then set it's next to this next + m_prev->m_next = m_next; + tmp = m_prev; + } + if (m_next) { //if this have a chain to "the right" (next tab) then set it's prev to this prev + m_next->m_prev = m_prev; + tmp = m_next; + } + + //mark as no chain, previous and next. + m_prev = 0; + m_next = 0; + + //reposition the tabs + if (tmp) { + if (m_win->screen->getTabAlignment() == ARelative) + tmp->calcIncrease(); + tmp->setPosition(); + } + + if (m_win->screen->getTabAlignment() == ARelative) + calcIncrease(); + + setPosition(); +} + +// ------------ setTabWidth -------------- +// Sets Tab width _including_ borders +// --------------------------------------- +void Tab::setTabWidth(unsigned int w) { + if (w > m_win->screen->getWindowStyle()->tab.border_width_2x) { + m_size_w = w; + XResizeWindow(m_display, m_tabwin, + m_size_w - m_win->screen->getWindowStyle()->tab.border_width_2x, + m_size_h - m_win->screen->getWindowStyle()->tab.border_width_2x); + } +} + +// ------------ setTabHeight --------- +// Sets Tab height _including_ borders +// --------------------------------------- +void Tab::setTabHeight(unsigned int h) { + if (h > m_win->screen->getWindowStyle()->tab.border_width_2x) { + m_size_h = h; + XResizeWindow(m_display, m_tabwin, + m_size_w - m_win->screen->getWindowStyle()->tab.border_width_2x, + m_size_h - m_win->screen->getWindowStyle()->tab.border_width_2x); + } +} + +// ------------ resizeGroup -------------- +// This function is used when (un)shading +// to get right size/width of tabs when +// PLeft || PRight && isTabRotateVertical +// --------------------------------------- +void Tab::resizeGroup(void) { + #ifdef DEBUG + cerr << "Resising group" << endl; + #endif //DEBUG + Tab *first; + for (first = getFirst(this); first != 0; first = first->m_next) { + if ((m_win->screen->getTabPlacement() == PLeft || + m_win->screen->getTabPlacement() == PRight) && + m_win->screen->isTabRotateVertical() && + !m_win->isShaded()) { + first->setTabWidth(Fluxbox::instance()->getTabHeight()); + first->setTabHeight(Fluxbox::instance()->getTabWidth()); + } else { + first->setTabWidth(Fluxbox::instance()->getTabWidth()); + first->setTabHeight(Fluxbox::instance()->getTabHeight()); + } + //TODO: do I have to set this all the time? + first->m_configured = true; //used in Fluxbox::reconfigure() + } +} + +//------------- calcRelativeWidth -------- +// Returns: Calculated width for relative +// alignment +//---------------------------------------- +unsigned int Tab::calcRelativeWidth() { + unsigned int num=0; + //calculate num objs in list (extract this to a function?) + for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); + + return ((m_win->frame.width + m_win->screen->getBorderWidth2x())/num); +} + +//------------- calcRelativeHeight ------- +// Returns: Calculated height for relative +// alignment +//---------------------------------------- +unsigned int Tab::calcRelativeHeight() { + unsigned int num=0; + //calculate num objs in list (extract this to a function?) + for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); + + return ((m_win->frame.height + m_win->screen->getBorderWidth2x())/num); +} + +//------------- calcCenterXPos ----------- +// Returns: Calculated x position for +// centered alignment +//---------------------------------------- +unsigned int Tab::calcCenterXPos() { + unsigned int num=0; + //calculate num objs in list (extract this to a function?) + for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); + + return (m_win->frame.x + ((m_win->frame.width - (m_size_w * num)) / 2)); +} + +//------------- calcCenterYPos ----------- +// Returns: Calculated y position for +// centered alignment +//---------------------------------------- +unsigned int Tab::calcCenterYPos() { + unsigned int num=0; + //calculate num objs in list (extract this to a function?) + for (Tab *first=getFirst(this); first!=0; first=first->m_next, num++); + + return (m_win->frame.y + ((m_win->frame.height - (m_size_h * num)) / 2)); +} + + +//------- getTabPlacementString ---------- +// Returns the tabplacement string of the +// tabplacement number on success else +// 0. +//---------------------------------------- +const char *Tab::getTabPlacementString(int placement) { + for (int i=0; i<(pnone / 5); i++) { + if (m_tabplacementlist[i] == placement) + return m_tabplacementlist[i].string; + } + return 0; +} + +//------- getTabPlacementNum ------------- +// Returns the tabplacement number of the +// tabplacement string on success else +// the type none on failure. +//---------------------------------------- +int Tab::getTabPlacementNum(const char *string) { + for (int i=0; i<(pnone / 5); i ++) { + if (m_tabplacementlist[i] == string) { + return m_tabplacementlist[i].tp; + } + } + return pnone; +} + +//------- getTabAlignmentString ---------- +// Returns the tabplacement string of the +// tabplacement number on success else +// 0. +//---------------------------------------- +const char *Tab::getTabAlignmentString(int placement) { + for (int i=0; i<anone; i++) { + if (m_tabalignmentlist[i] == placement) + return m_tabalignmentlist[i].string; + } + return 0; +} + +//------- getTabAlignmentNum ------------- +// Returns the tabplacement number of the +// tabplacement string on success else +// the type none on failure. +//---------------------------------------- +int Tab::getTabAlignmentNum(const char *string) { + for (int i=0; i<anone; i++) { + if (m_tabalignmentlist[i] == string) { + return m_tabalignmentlist[i].tp; + } + } + return anone; +}
A src/Tab.hh

@@ -0,0 +1,125 @@

+// Tab.hh for Fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 _TAB_HH_ +#define _TAB_HH_ + +#ifndef _IMAGE_HH_ +#include "Image.hh" +#endif +#ifndef _SCREEN_HH_ +#include "Screen.hh" +#endif +#ifndef _WINDOW_HH_ +#include "Window.hh" +#endif + +//Note: Tab is a friend of FluxboxWindow + + +class Tab { +public: + Tab(FluxboxWindow *win, Tab *prev=0, Tab *next=0); + ~Tab(); + void draw(bool pressed); + inline Tab *next() const { return m_next; } + inline Tab *prev() const { return m_prev; } + inline FluxboxWindow *getWindow() const { return m_win; } + inline unsigned int getTabWidth() const { return m_size_w; } + inline unsigned int getTabHeight() const { return m_size_h; } + void focus(); + void decorate(); + void deiconify(); + void iconify(); + void raise(); + void withdraw(); + void stick(); + void resize(); + void shade(); + //position tab to follow (FluxboxWindow *) m_win + void setPosition(); + //event handlers + void buttonReleaseEvent(XButtonEvent *be); + void buttonPressEvent(XButtonEvent *be); + void exposeEvent(XExposeEvent *ee); + void motionNotifyEvent(XMotionEvent *me); + static Tab *getFirst(Tab *current); + void disconnect(); + + enum { PTop = 0, PBottom = 5, PLeft = 10, PRight = 15, pnone = 20}; + enum { ALeft = 0, ACenter, ARight, ARelative, anone }; + + static const char *getTabPlacementString(int placement); + static int getTabPlacementNum(const char *string); + static const char *getTabAlignmentString(int placement); + static int getTabAlignmentNum(const char *string); + //TODO: do these have to be public? + void resizeGroup(void); // used when (un)shading windows + void calcIncrease(void); + inline bool configured() { return m_configured; } + inline void setConfigured(bool value) { m_configured = value; } +private: + bool m_configured; + + void insert(Tab *next); + //The size of the tab + unsigned int m_size_w; + unsigned int m_size_h; + //Increasements + int m_inc_x; + int m_inc_y; + static const int m_max_tabs; + bool m_focus, m_moving; // moving and focus + void createTabWindow(); // creates the X win of tab + void setTabWidth(unsigned int w); + void setTabHeight(unsigned int h); + unsigned int calcRelativeWidth(); + unsigned int calcRelativeHeight(); + unsigned int calcCenterXPos(); + unsigned int calcCenterYPos(); + int m_move_x, m_move_y; // Move coordinates, holds moving coordinates when draging + Tab *m_prev; + Tab *m_next; + FluxboxWindow *m_win; + Window m_tabwin; + Display *m_display; + Pixmap m_focus_pm, m_unfocus_pm; + unsigned long m_focus_pixel, m_unfocus_pixel; + static bool m_stoptabs; //used to "freeze" the tabs functions + + struct t_tabplacementlist{ + int tp; + const char *string; + inline bool operator == (int p) { + return (tp==p); + } + inline bool operator == (const char *str) { + if (strcasecmp(string, str)==0) + return true; + return false; + } + }; + static t_tabplacementlist m_tabplacementlist[]; + static t_tabplacementlist m_tabalignmentlist[]; + +}; + +#endif //_TAB_HH_
A src/Theme.cc

@@ -0,0 +1,1182 @@

+// Theme.cc for fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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. + +// A lot of the code base is taken from Screen.cc in Blackbox 0.61.1 +// and Brad Hughes (bhuges@tcac.net) should get alot of credit for it +// Screen.cc - 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 _GNU_SOURCE +#define _GNU_SOURCE +#endif // _GNU_SOURCE + +#ifdef HAVE_CONFIG_H +# include "config.h" +#endif //HAVE_CONFIG_H_ + +#ifdef HAVE_CTYPE_H +# include <ctype.h> +#endif // HAVE_CTYPE_H + +#include "Theme.hh" +#include "i18n.hh" +#include "Basemenu.hh" +#include "fluxbox.hh" + +#include <X11/Xresource.h> +#include <stdio.h> +#include <stdarg.h> +#include <string.h> + +#ifndef FONT_ELEMENT_SIZE +# define FONT_ELEMENT_SIZE 50 +#endif // FONT_ELEMENT_SIZE + +#ifndef HAVE_STRCASESTR + +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 + +Theme::Theme(Display *display, Colormap colormap, int screennum, BImageControl *ic, const char *filename) { + + Window rootwindow = DefaultRootWindow(display); + m_screennum = screennum; + m_display = display; + m_imagecontrol = ic; + m_colormap = colormap; + //default settings + m_menustyle.titlefont.set = m_menustyle.framefont.set = m_toolbarstyle.font.set = + m_windowstyle.font.set = m_windowstyle.tab.font.set = 0; + + m_menustyle.titlefont.fontstruct = m_menustyle.framefont.fontstruct = m_toolbarstyle.font.fontstruct = + m_windowstyle.font.fontstruct = m_windowstyle.tab.font.fontstruct = 0; + m_windowstyle.tab.rot_font = 0; + + load(filename); + //-------- create gc for the styles ------------ + + + XGCValues gcv; + unsigned long gc_value_mask = GCForeground; + + if (! I18n::instance()->multibyte()) + gc_value_mask |= GCFont; + + gcv.foreground = WhitePixel(m_display, screennum)^BlackPixel(m_display, screennum); + gcv.function = GXxor; + gcv.subwindow_mode = IncludeInferiors; + m_opgc = XCreateGC(m_display, rootwindow, + GCForeground | GCFunction | GCSubwindowMode, &gcv); + + gcv.foreground = m_windowstyle.l_text_focus.getPixel(); + if (m_windowstyle.font.fontstruct) + gcv.font = m_windowstyle.font.fontstruct->fid; + + m_windowstyle.l_text_focus_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_windowstyle.l_text_unfocus.getPixel(); + if (m_windowstyle.font.fontstruct) + gcv.font = m_windowstyle.font.fontstruct->fid; + m_windowstyle.l_text_unfocus_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + //---- Tab + gcv.foreground = m_windowstyle.tab.l_text_focus.getPixel(); + if (m_windowstyle.tab.font.fontstruct) + gcv.font = m_windowstyle.tab.font.fontstruct->fid; + + m_windowstyle.tab.l_text_focus_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_windowstyle.tab.l_text_unfocus.getPixel(); + m_windowstyle.tab.l_text_unfocus_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + //---end Tab + + + gcv.foreground = m_windowstyle.b_pic_focus.getPixel(); + m_windowstyle.b_pic_focus_gc = + XCreateGC(m_display, rootwindow, + GCForeground, &gcv); + + gcv.foreground = m_windowstyle.b_pic_unfocus.getPixel(); + m_windowstyle.b_pic_unfocus_gc = + XCreateGC(m_display, rootwindow, + GCForeground, &gcv); + + gcv.foreground = m_menustyle.t_text.getPixel(); + if (m_menustyle.titlefont.fontstruct) + gcv.font = m_menustyle.titlefont.fontstruct->fid; + m_menustyle.t_text_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.f_text.getPixel(); + if (m_menustyle.framefont.fontstruct) + gcv.font = m_menustyle.framefont.fontstruct->fid; + + m_menustyle.f_text_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.h_text.getPixel(); + m_menustyle.h_text_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.d_text.getPixel(); + m_menustyle.d_text_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.hilite.getColor()->getPixel(); + m_menustyle.hilite_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.l_text.getPixel(); + if (m_toolbarstyle.font.fontstruct) + gcv.font = m_toolbarstyle.font.fontstruct->fid; + m_toolbarstyle.l_text_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.w_text.getPixel(); + m_toolbarstyle.w_text_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.c_text.getPixel(); + m_toolbarstyle.c_text_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.b_pic.getPixel(); + m_toolbarstyle.b_pic_gc = + XCreateGC(m_display, rootwindow, + gc_value_mask, &gcv); + +} + +Theme::~Theme() { + + freeMenuStyle(); + freeWindowStyle(); + freeToolbarStyle(); + freeTabStyle(); +} + +//----- freeMenuStyle ----- +// free memory allocated for m_menustyle +// should only be called from ~Theme +//-------------------- +void Theme::freeMenuStyle() { + if (m_menustyle.titlefont.set) + XFreeFontSet(m_display, m_menustyle.titlefont.set); + + if (m_menustyle.titlefont.fontstruct) + XFreeFont(m_display, m_menustyle.titlefont.fontstruct); + + if (m_menustyle.framefont.set) + XFreeFontSet(m_display, m_menustyle.framefont.set); + + if (m_menustyle.framefont.fontstruct) + XFreeFont(m_display, m_menustyle.framefont.fontstruct); + + XFreeGC(m_display, m_menustyle.t_text_gc); + XFreeGC(m_display, m_menustyle.f_text_gc); + XFreeGC(m_display, m_menustyle.h_text_gc); + XFreeGC(m_display, m_menustyle.d_text_gc); + XFreeGC(m_display, m_menustyle.hilite_gc); +} + +//----- freeWindowStyle ----- +// free memory allocated for m_windowstyle +// should only be called from ~Theme +//-------------------- +void Theme::freeWindowStyle() { + if (m_windowstyle.font.set) + XFreeFontSet(m_display, m_windowstyle.font.set); + + if (m_windowstyle.font.fontstruct) + XFreeFont(m_display, m_windowstyle.font.fontstruct); + + XFreeGC(m_display, m_windowstyle.l_text_focus_gc); + XFreeGC(m_display, m_windowstyle.l_text_unfocus_gc); + XFreeGC(m_display, m_windowstyle.b_pic_focus_gc); + XFreeGC(m_display, m_windowstyle.b_pic_unfocus_gc); +} + +//----- freeTabStyle ----- +// free memory allocated for m_windowstyle.tab +// should only be called from ~Theme +//-------------------- +void Theme::freeTabStyle() { + + if (m_windowstyle.tab.font.set) + XFreeFontSet(m_display, m_windowstyle.tab.font.set); + + if (m_windowstyle.tab.font.fontstruct) + XFreeFont(m_display, m_windowstyle.tab.font.fontstruct); + + if (m_windowstyle.tab.rot_font) + XRotUnloadFont(m_display, m_windowstyle.tab.rot_font); + + + XFreeGC(m_display, m_windowstyle.tab.l_text_focus_gc); + XFreeGC(m_display, m_windowstyle.tab.l_text_unfocus_gc); +} + +//----- freeToolbarStyle ----- +// free memory allocated for m_toolbarstyle +// should only be called from ~Theme +//-------------------- +void Theme::freeToolbarStyle() { + + if (m_toolbarstyle.font.set) + XFreeFontSet(m_display, m_toolbarstyle.font.set); + + if (m_toolbarstyle.font.fontstruct) + XFreeFont(m_display, m_toolbarstyle.font.fontstruct); + + XFreeGC(m_display, m_toolbarstyle.l_text_gc); + XFreeGC(m_display, m_toolbarstyle.w_text_gc); + XFreeGC(m_display, m_toolbarstyle.c_text_gc); + XFreeGC(m_display, m_toolbarstyle.b_pic_gc); + +} + +//---------- load ------------ +// Loads a theme from a file +//---------------------------- +void Theme::load(const char *filename) { + m_database = XrmGetFileDatabase(filename); + if (!m_database) + m_database = XrmGetFileDatabase(DEFAULTSTYLE); + + loadMenuStyle(); + loadToolbarStyle(); + loadWindowStyle(); + loadRootCommand(); + loadTabStyle(); + loadMisc(); + + XrmDestroyDatabase(m_database); +} + +void Theme::loadMenuStyle() { + + readDatabaseTexture("menu.title", "Menu.Title", + &m_menustyle.title, + WhitePixel(m_display, m_screennum)); + readDatabaseTexture("menu.frame", "Menu.Frame", + &m_menustyle.frame, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("menu.hilite", "Menu.Hilite", + &m_menustyle.hilite, + WhitePixel(m_display, m_screennum)); + readDatabaseColor("menu.title.textColor", "Menu.Title.TextColor", + &m_menustyle.t_text, + BlackPixel(m_display, m_screennum)); + readDatabaseColor("menu.frame.textColor", "Menu.Frame.TextColor", + &m_menustyle.f_text, + WhitePixel(m_display, m_screennum)); + readDatabaseColor("menu.frame.disableColor", "Menu.Frame.DisableColor", + &m_menustyle.d_text, + BlackPixel(m_display, m_screennum)); + readDatabaseColor("menu.hilite.textColor", "Menu.Hilite.TextColor", + &m_menustyle.h_text, + BlackPixel(m_display, m_screennum)); + + XrmValue value; + char *value_type=0; + + if (XrmGetResource(m_database, "menu.title.justify", + "Menu.Title.Justify", &value_type, &value)) { + + if (strstr(value.addr, "right") || strstr(value.addr, "Right")) + m_menustyle.titlefont.justify = FFont::Right; + else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) + m_menustyle.titlefont.justify = FFont::Center; + else + m_menustyle.titlefont.justify = FFont::Left; + + } else + m_menustyle.titlefont.justify = FFont::Left; + + if (XrmGetResource(m_database, "menu.frame.justify", + "Menu.Frame.Justify", &value_type, &value)) { + + if (strstr(value.addr, "right") || strstr(value.addr, "Right")) + m_menustyle.framefont.justify = FFont::Right; + else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) + m_menustyle.framefont.justify = FFont::Center; + else + m_menustyle.framefont.justify = FFont::Left; + + } else + m_menustyle.framefont.justify = FFont::Left; + + if (XrmGetResource(m_database, "menu.bullet", "Menu.Bullet", + &value_type, &value)) { + + if (! strncasecmp(value.addr, "empty", value.size)) + m_menustyle.bullet = Basemenu::Empty; + else if (! strncasecmp(value.addr, "square", value.size)) + m_menustyle.bullet = Basemenu::Square; + else if (! strncasecmp(value.addr, "diamond", value.size)) + m_menustyle.bullet = Basemenu::Diamond; + else + m_menustyle.bullet = Basemenu::Triangle; + + } else + m_menustyle.bullet = Basemenu::Triangle; + + if (XrmGetResource(m_database, "menu.bullet.position", + "Menu.Bullet.Position", &value_type, &value)) { + + if (! strncasecmp(value.addr, "right", value.size)) + m_menustyle.bullet_pos = Basemenu::Right; + else + m_menustyle.bullet_pos = Basemenu::Left; + + } else + m_menustyle.bullet_pos = Basemenu::Left; + + //---------- font + + if (I18n::instance()->multibyte()) { + + readDatabaseFontSet("menu.title.font", "Menu.Title.Font", + &m_menustyle.titlefont.set); + readDatabaseFontSet("menu.frame.font", "Menu.Frame.Font", + &m_menustyle.framefont.set); + + m_menustyle.titlefont.set_extents = + XExtentsOfFontSet(m_menustyle.titlefont.set); + m_menustyle.framefont.set_extents = + XExtentsOfFontSet(m_menustyle.framefont.set); + + } else { + + readDatabaseFont("menu.title.font", "Menu.Title.Font", + &m_menustyle.titlefont.fontstruct); + + readDatabaseFont("menu.frame.font", "Menu.Frame.Font", + &m_menustyle.framefont.fontstruct); + } + +} + +void Theme::loadWindowStyle() { + + readDatabaseTexture("window.title.focus", "Window.Title.Focus", + &m_windowstyle.t_focus, + WhitePixel(m_display, + m_screennum)); + readDatabaseTexture("window.title.unfocus", "Window.Title.Unfocus", + &m_windowstyle.t_unfocus, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("window.label.focus", "Window.Label.Focus", + &m_windowstyle.l_focus, + WhitePixel(m_display, m_screennum)); + + readDatabaseTexture("window.label.unfocus", "Window.Label.Unfocus", + &m_windowstyle.l_unfocus, + BlackPixel(m_display, m_screennum)); + + + readDatabaseTexture("window.handle.focus", "Window.Handle.Focus", + &m_windowstyle.h_focus, + WhitePixel(m_display, m_screennum)); + readDatabaseTexture("window.handle.unfocus", "Window.Handle.Unfocus", + &m_windowstyle.h_unfocus, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("window.grip.focus", "Window.Grip.Focus", + &m_windowstyle.g_focus, + WhitePixel(m_display, m_screennum)); + readDatabaseTexture("window.grip.unfocus", "Window.Grip.Unfocus", + &m_windowstyle.g_unfocus, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("window.button.focus", "Window.Button.Focus", + &m_windowstyle.b_focus, + WhitePixel(m_display, m_screennum)); + readDatabaseTexture("window.button.unfocus", "Window.Button.Unfocus", + &m_windowstyle.b_unfocus, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("window.button.pressed", "Window.Button.Pressed", + &m_windowstyle.b_pressed, + BlackPixel(m_display, m_screennum)); + readDatabaseColor("window.frame.focusColor", + "Window.Frame.FocusColor", + &m_windowstyle.f_focus, + WhitePixel(m_display, m_screennum)); + readDatabaseColor("window.frame.unfocusColor", + "Window.Frame.UnfocusColor", + &m_windowstyle.f_unfocus, + BlackPixel(m_display, m_screennum)); + readDatabaseColor("window.label.focus.textColor", + "Window.Label.Focus.TextColor", + &m_windowstyle.l_text_focus, + BlackPixel(m_display, m_screennum)); + readDatabaseColor("window.label.unfocus.textColor", + "Window.Label.Unfocus.TextColor", + &m_windowstyle.l_text_unfocus, + WhitePixel(m_display, m_screennum)); + readDatabaseColor("window.button.focus.picColor", + "Window.Button.Focus.PicColor", + &m_windowstyle.b_pic_focus, + BlackPixel(m_display, m_screennum)); + readDatabaseColor("window.button.unfocus.picColor", + "Window.Button.Unfocus.PicColor", + &m_windowstyle.b_pic_unfocus, + WhitePixel(m_display, m_screennum)); + + //----- font + + if (I18n::instance()->multibyte()) { + readDatabaseFontSet("window.font", "Window.Font", + &m_windowstyle.font.set); + + m_windowstyle.font.set_extents = + XExtentsOfFontSet(m_windowstyle.font.set); + } else { + readDatabaseFont("window.font", "Window.Font", + &m_windowstyle.font.fontstruct); + } + + XrmValue value; + char *value_type; + + if (XrmGetResource(m_database, "window.justify", "Window.Justify", + &value_type, &value)) { + if (strstr(value.addr, "right") || strstr(value.addr, "Right")) + m_windowstyle.font.justify = FFont::Right; + else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) + m_windowstyle.font.justify = FFont::Center; + else + m_windowstyle.font.justify = FFont::Left; + } else + m_windowstyle.font.justify = FFont::Left; + +} + +void Theme::loadTabStyle() { + + if (!readDatabaseTexture("window.tab.title.focus", "Window.Tab.Title.Focus", + &m_windowstyle.tab.t_focus, + WhitePixel(m_display, m_screennum))) + m_windowstyle.tab.t_focus = m_windowstyle.t_focus; + + if (!readDatabaseTexture("window.tab.title.unfocus", "Window.Tab.Title.Unfocus", + &m_windowstyle.tab.t_unfocus, + BlackPixel(m_display, m_screennum))) + m_windowstyle.tab.t_unfocus = m_windowstyle.t_unfocus; + + if (!readDatabaseTexture("window.tab.label.focus", "Window.Tab.Label.Focus", + &m_windowstyle.tab.l_focus, + WhitePixel(m_display, m_screennum))) + m_windowstyle.tab.l_focus = m_windowstyle.l_focus; + + if (!readDatabaseTexture("window.tab.label.unfocus", "Window.Tab.Label.Unfocus", + &m_windowstyle.tab.l_unfocus, + BlackPixel(m_display, m_screennum))) + m_windowstyle.tab.l_unfocus = m_windowstyle.l_unfocus; + + + if (!readDatabaseColor("window.tab.label.focus.textColor", + "Window.Tab.Label.Focus.TextColor", + &m_windowstyle.tab.l_text_focus, + BlackPixel(m_display, m_screennum))) + m_windowstyle.tab.l_text_focus = m_windowstyle.l_text_focus; + + if (!readDatabaseColor("window.tab.label.unfocus.textColor", + "Window.Tab.Label.Unfocus.TextColor", + &m_windowstyle.tab.l_text_unfocus, + WhitePixel(m_display, m_screennum))) + m_windowstyle.tab.l_text_unfocus = m_windowstyle.l_text_unfocus; + + readDatabaseColor("window.tab.borderColor", "Window.Tab.BorderColor", + &m_windowstyle.tab.border_color, + BlackPixel(m_display, m_screennum)); + + + XrmValue value; + char *value_type; + + if (XrmGetResource(m_database, "window.tab.borderWidth", "Window.Tab.BorderWidth", + &value_type, &value)) { + if (sscanf(value.addr, "%u", &m_windowstyle.tab.border_width) != 1) + m_windowstyle.tab.border_width = 1; + } else + m_windowstyle.tab.border_width = 1; + m_windowstyle.tab.border_width_2x = m_windowstyle.tab.border_width*2; + + //---------- font + + if (I18n::instance()->multibyte()) { + readDatabaseFontSet("window.tab.font", "Window.Tab.Font", + &m_windowstyle.tab.font.set); + + m_windowstyle.tab.font.set_extents = + XExtentsOfFontSet(m_windowstyle.tab.font.set); + } else { + XFontStruct *fontstruct = 0; + readDatabaseFont("window.tab.font", "Window.Tab.Font", + &fontstruct); + m_windowstyle.tab.font.fontstruct = fontstruct; + } + + //--------- rotated font for left and right tabs + + // TODO: add extra checking + if (XrmGetResource(m_database, "window.tab.font", "Window.Tab.Font", + &value_type, &value)) { + if (! (m_windowstyle.tab.rot_font = XRotLoadFont(m_display, value.addr, 90.0)) ) + m_windowstyle.tab.rot_font = XRotLoadFont(m_display, "fixed", 90); + } else + m_windowstyle.tab.rot_font = XRotLoadFont(m_display, "fixed", 90); + + + if (XrmGetResource(m_database, "window.tab.justify", "Window.Tab.Justify", + &value_type, &value)) { + if (strstr(value.addr, "right") || strstr(value.addr, "Right")) + m_windowstyle.tab.font.justify = FFont::Right; + else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) + m_windowstyle.tab.font.justify = FFont::Center; + else + m_windowstyle.tab.font.justify = FFont::Left; + } else + m_windowstyle.tab.font.justify = FFont::Left; + +} + +void Theme::loadToolbarStyle() { + + readDatabaseTexture("toolbar", "Toolbar", + &m_toolbarstyle.toolbar, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("toolbar.label", "Toolbar.Label", + &m_toolbarstyle.label, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("toolbar.windowLabel", "Toolbar.WindowLabel", + &m_toolbarstyle.window, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("toolbar.button", "Toolbar.Button", + &m_toolbarstyle.button, + WhitePixel(m_display, m_screennum)); + readDatabaseTexture("toolbar.button.pressed", "Toolbar.Button.Pressed", + &m_toolbarstyle.pressed, + BlackPixel(m_display, m_screennum)); + readDatabaseTexture("toolbar.clock", "Toolbar.Clock", + &m_toolbarstyle.clock, + BlackPixel(m_display, m_screennum)); + readDatabaseColor("toolbar.label.textColor", "Toolbar.Label.TextColor", + &m_toolbarstyle.l_text, + WhitePixel(m_display, m_screennum)); + readDatabaseColor("toolbar.windowLabel.textColor", + "Toolbar.WindowLabel.TextColor", + &m_toolbarstyle.w_text, + WhitePixel(m_display, m_screennum)); + readDatabaseColor("toolbar.clock.textColor", "Toolbar.Clock.TextColor", + &m_toolbarstyle.c_text, + WhitePixel(m_display, m_screennum)); + readDatabaseColor("toolbar.button.picColor", "Toolbar.Button.PicColor", + &m_toolbarstyle.b_pic, + BlackPixel(m_display, m_screennum)); + + + // ----------- load font + + if (I18n::instance()->multibyte()) { + readDatabaseFontSet("toolbar.font", "Toolbar.Font", + &m_toolbarstyle.font.set); + + m_toolbarstyle.font.set_extents = + XExtentsOfFontSet(m_toolbarstyle.font.set); + } else { + readDatabaseFont("toolbar.font", "Toolbar.Font", + &m_toolbarstyle.font.fontstruct); + } + XrmValue value; + char *value_type; + + if (XrmGetResource(m_database, "toolbar.justify", + "Toolbar.Justify", &value_type, &value)) { + if (strstr(value.addr, "right") || strstr(value.addr, "Right")) + m_toolbarstyle.font.justify = FFont::Right; + else if (strstr(value.addr, "center") || strstr(value.addr, "Center")) + m_toolbarstyle.font.justify = FFont::Center; + else + m_toolbarstyle.font.justify = FFont::Left; + } else + m_toolbarstyle.font.justify = FFont::Left; + +} + +void Theme::loadRootCommand() { + XrmValue value; + char *value_type; + Fluxbox *fb=Fluxbox::instance(); +// printf("getting root command from fb->getRootCommand()"); + const char *root_cmd=fb->getRootCommand(); +// printf("root kommandot: %s\n", root_cmd); + if (root_cmd) { + #ifndef __EMX__ + const int display_strlen = 1024; + char displaystring[display_strlen]; + snprintf(displaystring, display_strlen, "DISPLAY=%s%d", + DisplayString(m_display), m_screennum); + + bexec(root_cmd, displaystring); + #else // __EMX__ + spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", root_cmd, NULL); + #endif // !__EMX__ + + #ifdef DEBUG + fprintf(stderr, "rootcommand:%s\n", root_cmd); + #endif //!DEBUG + + } else if (XrmGetResource(m_database, "rootCommand", + "RootCommand", &value_type, &value)) { +#ifndef __EMX__ + const int display_strlen = 1024; + char displaystring[display_strlen]; + + snprintf(displaystring, display_strlen, "DISPLAY=%s%d", + DisplayString(m_display), m_screennum); + + bexec(value.addr, displaystring); +#else // __EMX__ + spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", value.addr, NULL); +#endif // !__EMX__ + #ifdef DEBUG + fprintf(stderr, "rootcommand:%s\n", value.addr); + #endif + } +#ifdef DEBUG + else + fprintf(stderr, "%s(%d) Didnt find rootCommand!\n", __FILE__, __LINE__); +#endif + +} + +void Theme::loadMisc(void) { + unsigned int screen_width_div2 = WidthOfScreen(ScreenOfDisplay(m_display, m_screennum)) / 2; + XrmValue value; + char *value_type=0; + + if (XrmGetResource(m_database, "bevelWidth", "BevelWidth", + &value_type, &value)) { + if (sscanf(value.addr, "%u", &m_bevel_width) != 1 || + m_bevel_width > screen_width_div2 || + m_bevel_width == 0) + m_bevel_width = 3; + } else + m_bevel_width = 3; + + if (XrmGetResource(m_database, "handleWidth", "HandleWidth", + &value_type, &value)) { + if (sscanf(value.addr, "%u", &m_handle_width) != 1 || + m_handle_width > screen_width_div2 || m_handle_width == 0) + m_handle_width = 6; + } else + m_handle_width = 6; + + if (XrmGetResource(m_database, "borderWidth", "BorderWidth", + &value_type, &value)) { + if (sscanf(value.addr, "%u", &m_border_width) != 1) + m_border_width = 1; + } else + m_border_width = 1; + + + if (XrmGetResource(m_database, "frameWidth", "FrameWidth", + &value_type, &value)) { + if (sscanf(value.addr, "%u", &m_frame_width) != 1 || + m_frame_width > screen_width_div2) + m_frame_width = m_bevel_width; + } else + m_frame_width = m_bevel_width; + + readDatabaseColor("borderColor", "BorderColor", &m_border_color, + BlackPixel(m_display, m_screennum)); +} + + +bool Theme::readDatabaseTexture(char *rname, char *rclass, + BTexture *texture, + unsigned long default_pixel) +{ + XrmValue value; + char *value_type; + bool retval = true;//return true as default + + if (XrmGetResource(m_database, rname, rclass, &value_type, + &value)) + m_imagecontrol->parseTexture(texture, value.addr); + 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); + + if (!readDatabaseColor(colorname, colorclass, texture->getColor(), + default_pixel)) + retval = false; + +#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 retval; + + 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(m_display, m_colormap, &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(m_display, m_colormap, &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); + + if (!readDatabaseColor(colorname, colorclass, texture->getColor(), + default_pixel)) + retval = false; //report failure in loading + + readDatabaseColor(colortoname, colortoclass, texture->getColorTo(), + default_pixel); + + delete [] colorclass; + delete [] colorname; + delete [] colortoclass; + delete [] colortoname; + } + + if (!retval) + fprintf(stderr, "Faild in readTexture\n"); + + return retval; +} + + +bool Theme::readDatabaseColor(char *rname, char *rclass, BColor *color, + unsigned long default_pixel) +{ + XrmValue value; + char *value_type; + + if (XrmGetResource(m_database, rname, rclass, &value_type, + &value)) { + m_imagecontrol->parseColor(color, value.addr); + } else { + // parsing with no color string just deallocates the color, if it has + // been previously allocated + m_imagecontrol->parseColor(color); + color->setPixel(default_pixel); + return false; + } + + return true; +} + + +void Theme::readDatabaseFontSet(char *rname, char *rclass, XFontSet *fontset) { + if (! fontset) return; + + static char *defaultFont = "fixed"; + + Bool load_default = False; + XrmValue value; + char *value_type; + + if (*fontset) + XFreeFontSet(m_display, *fontset); + + if (XrmGetResource(m_database, rname, rclass, &value_type, &value)) { + char *fontname = value.addr; + if (! (*fontset = createFontSet(fontname))) + load_default = True; + } else + load_default = True; + + if (load_default) { + *fontset = createFontSet(defaultFont); + + if (! *fontset) { + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + ScreenSet, ScreenDefaultFontLoadFail, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::LoadStyle(): couldn't load default font.\n")); + throw static_cast<int>(2); + } + } +} + + + +void Theme::readDatabaseFont(char *rname, char *rclass, XFontStruct **font) { + if (! font) return; + + static char *defaultFont = "fixed"; + + Bool load_default = False; + XrmValue value; + char *value_type; + + if (*font) + XFreeFont(m_display, *font); + + if (XrmGetResource(m_database, rname, rclass, &value_type, &value)) { + + if ((*font = XLoadQueryFont(m_display, + value.addr)) == NULL) { + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + ScreenSet, ScreenFontLoadFail, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::LoadStyle(): couldn't load font '%s'\n"), + value.addr); + + load_default = True; + } + } else + load_default = True; + + if (load_default) { + if ((*font = XLoadQueryFont(m_display, + defaultFont)) == NULL) { + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + ScreenSet, ScreenDefaultFontLoadFail, +#else // !NLS + 0, 0, +#endif // NLS + "BScreen::LoadStyle(): couldn't load default font.\n")); + throw static_cast<int>(2); + } + } +} + +void Theme::reconfigure() { + + //Window rootwindow = DefaultRootWindow(m_display); + XGCValues gcv; + unsigned long gc_value_mask = GCForeground; + if (! I18n::instance()->multibyte()) + gc_value_mask |= GCFont; + + XChangeGC(m_display, m_opgc, + GCForeground | GCFunction | GCSubwindowMode, &gcv); + + gcv.foreground = WhitePixel(m_display, m_screennum); + gcv.function = GXinvert; + gcv.subwindow_mode = IncludeInferiors; + XChangeGC(m_display, m_opgc, + GCForeground | GCFunction | GCSubwindowMode, &gcv); + + gcv.foreground = m_windowstyle.l_text_focus.getPixel(); + if (m_windowstyle.font.fontstruct) + gcv.font = m_windowstyle.font.fontstruct->fid; + + XChangeGC(m_display, m_windowstyle.l_text_focus_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_windowstyle.l_text_unfocus.getPixel(); + XChangeGC(m_display, m_windowstyle.l_text_unfocus_gc, + gc_value_mask, &gcv); + + //---- Tab + gcv.foreground = m_windowstyle.tab.l_text_focus.getPixel(); + if (m_windowstyle.tab.font.fontstruct) + gcv.font = m_windowstyle.tab.font.fontstruct->fid; + + XChangeGC(m_display, m_windowstyle.tab.l_text_focus_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_windowstyle.tab.l_text_unfocus.getPixel(); + XChangeGC(m_display, m_windowstyle.tab.l_text_unfocus_gc, + gc_value_mask, &gcv); + + //--- end tab + + gcv.foreground = m_windowstyle.b_pic_focus.getPixel(); + XChangeGC(m_display, m_windowstyle.b_pic_focus_gc, + GCForeground, &gcv); + + gcv.foreground = m_windowstyle.b_pic_unfocus.getPixel(); + XChangeGC(m_display, m_windowstyle.b_pic_unfocus_gc, + GCForeground, &gcv); + + gcv.foreground = m_menustyle.t_text.getPixel(); + if (m_menustyle.titlefont.fontstruct) + gcv.font = m_menustyle.titlefont.fontstruct->fid; + XChangeGC(m_display, m_menustyle.t_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.f_text.getPixel(); + if (m_menustyle.framefont.fontstruct) + gcv.font = m_menustyle.framefont.fontstruct->fid; + + XChangeGC(m_display, m_menustyle.f_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.h_text.getPixel(); + XChangeGC(m_display, m_menustyle.h_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.d_text.getPixel(); + XChangeGC(m_display, m_menustyle.d_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_menustyle.hilite.getColor()->getPixel(); + XChangeGC(m_display, m_menustyle.hilite_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.l_text.getPixel(); + if (m_toolbarstyle.font.fontstruct) + gcv.font = m_toolbarstyle.font.fontstruct->fid; + + XChangeGC(m_display, m_toolbarstyle.l_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.w_text.getPixel(); + XChangeGC(m_display, m_toolbarstyle.w_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.c_text.getPixel(); + XChangeGC(m_display, m_toolbarstyle.c_text_gc, + gc_value_mask, &gcv); + + gcv.foreground = m_toolbarstyle.b_pic.getPixel(); + XChangeGC(m_display, m_toolbarstyle.b_pic_gc, + gc_value_mask, &gcv); + +} + +XFontSet Theme::createFontSet(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(m_display, + fontname, &missing, &nmissing, &def); + if (fs && (! nmissing)) return fs; + +#ifdef HAVE_SETLOCALE + if (! fs) { + if (nmissing) XFreeStringList(missing); + + setlocale(LC_CTYPE, "C"); + fs = XCreateFontSet(m_display, 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(m_display, fs); + + fs = XCreateFontSet(m_display, fontname, + &missing, &nmissing, &def); + delete [] pattern2; + + return fs; +} + +const char *Theme::getFontSize(const char *pattern, int *size) { + const char *p; + const char *p2=0; + 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; + } + } +} + +const char *Theme::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; +}
A src/Theme.hh

@@ -0,0 +1,162 @@

+// Theme.hh for fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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. +// +// A lot of the base code is taken from Screen.hh in Blackbox 0.61.1 +// and Brad Hughes (bhuges@tcac.net) should get alot of credit for it +// And for license-hunters here's the license and copyright for Screen.cc +// Screen.cc - 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 _THEME_HH_ +#define _THEME_HH_ + + +#include "Image.hh" +#include <X11/Xlib.h> +#include <X11/Xresource.h> + +#include "Rotated.hh" // TODO: should bake this into misc.hh some day + +typedef struct FFont +{ + enum FontJustify {Left=0, Right, Center}; + + XFontSet set; + XFontSetExtents *set_extents; + XFontStruct *fontstruct; + FontJustify justify; +} FFont; + +typedef struct LabelStyle +{ + BTexture l_focus, l_unfocus, + t_focus, t_unfocus; + GC l_text_focus_gc, l_text_unfocus_gc; + FFont font; + BColor l_text_focus, l_text_unfocus; +} LabelStyle; + +typedef struct WindowStyle:public LabelStyle { + BColor f_focus, f_unfocus, b_pic_focus, + b_pic_unfocus; + BTexture h_focus, h_unfocus, + b_focus, b_unfocus, b_pressed, g_focus, g_unfocus; + GC b_pic_focus_gc, b_pic_unfocus_gc; + + struct t_tab:public LabelStyle { + BColor border_color; + unsigned int border_width; + unsigned int border_width_2x; + XRotFontStruct *rot_font; + } tab; + +} WindowStyle; + +typedef 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; + FFont font; + +} ToolbarStyle; + +typedef 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; + FFont titlefont, framefont; + int bullet, bullet_pos; +} MenuStyle; + +//singleton class +class Theme +{ +public: + Theme(Display *display, Colormap colormap, int screennum, BImageControl *ic, const char *filename); + ~Theme(); + + void load(const char *filename); + void reconfigure(); + inline WindowStyle *getWindowStyle(void) { return &m_windowstyle; } + inline MenuStyle *getMenuStyle(void) { return &m_menustyle; } + inline ToolbarStyle *getToolbarStyle(void) { return &m_toolbarstyle; } + inline const unsigned int & getBevelWidth(void) const { return m_bevel_width; } + inline const unsigned int & getBorderWidth(void) const { return m_border_width; } + inline const unsigned int & getHandleWidth(void) const { return m_handle_width; } + inline const unsigned int & getFrameWidth(void) const { return m_frame_width; } + inline const GC &getOpGC(void) const { return m_opgc; } + inline const BColor & getBorderColor(void) const { return m_border_color; } +private: + + void loadMenuStyle(); + void loadWindowStyle(); + void loadTabStyle(); + void loadToolbarStyle(); + void loadRootCommand(); + void loadMisc(); + void freeMenuStyle(); + void freeWindowStyle(); + void freeTabStyle(); + void freeToolbarStyle(); + + bool readDatabaseTexture(char *, char *, BTexture *, unsigned long); + bool readDatabaseColor(char *, char *, BColor *, unsigned long); + + void readDatabaseFontSet(char *, char *, XFontSet *); + XFontSet createFontSet(char *); + void readDatabaseFont(char *, char *, XFontStruct **); + + static const char *getFontElement(const char *pattern, char *buf, int bufsiz, ...); + static const char *getFontSize(const char *pattern, int *size); + + + WindowStyle m_windowstyle; + MenuStyle m_menustyle; + ToolbarStyle m_toolbarstyle; + unsigned int m_bevel_width, m_border_width, m_handle_width, m_frame_width; + BColor m_border_color; + GC m_opgc; + BImageControl *m_imagecontrol; + Display *m_display; + XrmDatabase m_database; + Colormap m_colormap; + int m_screennum; +}; + + +#endif //_THEME_HH_
A src/Timer.cc

@@ -0,0 +1,82 @@

+// Timer.cc for Blackbox - An X11 Window Manager +// 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 "BaseDisplay.hh" +#include "Timer.hh" + + +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; + _timeout.tv_usec -= (_timeout.tv_sec * 1000); + _timeout.tv_usec *= 1000; +} + + +void BTimer::setTimeout(timeval t) { + _timeout.tv_sec = t.tv_sec; + _timeout.tv_usec = t.tv_usec; +} + + +void BTimer::start(void) { + gettimeofday(&_start, 0); + + if (! timing) { + timing = True; + display->addTimer(this); + } +} + + +void BTimer::stop(void) { + timing = False; + + display->removeTimer(this); +} + + +void BTimer::fireTimeout(void) { + if (handler) handler->timeout(); +}
A src/Timer.hh

@@ -0,0 +1,87 @@

+// Timer.hh for Blackbox - An X11 Window Manager +// 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 HAVE_CONFIG_H +#include "../config.h" +#endif //HAVE_CONFIG_H + +#ifdef TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +#include <sys/time.h> +# else // !HAVE_SYS_TIME_H +# include <time.h> +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +// forward declaration +class BTimer; +class TimeoutHandler; + +#include "BaseDisplay.hh" + + +class TimeoutHandler { +public: + virtual void timeout(void) = 0; +}; + + +class BTimer { + friend class BaseDisplay; +private: + BaseDisplay *display; + TimeoutHandler *handler; + int timing, once; + + timeval _start, _timeout; + + +protected: + void fireTimeout(void); + + +public: + 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_ +
A src/Toolbar.cc

@@ -0,0 +1,1415 @@

+// Toolbar.cc for Blackbox - an X11 Window manager +// 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 "i18n.hh" +#include "fluxbox.hh" +#include "Clientmenu.hh" +#include "Icon.hh" +#include "Rootmenu.hh" +#include "Screen.hh" +#include "Toolbar.hh" +#include "Window.hh" +#include "Workspace.hh" +#include "Workspacemenu.hh" + +#include <X11/Xutil.h> +#include <X11/keysym.h> + +#ifdef STDC_HEADERS +# include <string.h> +#endif // STDC_HEADERS + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +# else // !HAVE_SYS_TIME_H +# include <time.h> +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +#include <iostream> +#include "misc.hh" + +using namespace std; + +Toolbar::Toolbar(BScreen *scrn) { + screen = scrn; + fluxbox = Fluxbox::instance(); + + // get the clock updating every minute + clock_timer = new BTimer(fluxbox, this); + timeval now; + gettimeofday(&now, 0); + clock_timer->setTimeout((60 - (now.tv_sec % 60)) * 1000); + clock_timer->start(); + + hide_handler.toolbar = this; + hide_timer = new BTimer(fluxbox, &hide_handler); + hide_timer->setTimeout(fluxbox->getAutoRaiseDelay()); + hide_timer->fireOnce(True); + + image_ctrl = screen->getImageControl(); + + editing = False; + on_top = screen->isToolbarOnTop(); + hidden = do_auto_hide = screen->doToolbarAutoHide(); + + new_workspace_name = new_name_pos = 0; + frame.grab_x = frame.grab_y = 0; + + toolbarmenu = new Toolbarmenu(this); + + display = fluxbox->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(); + 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(), + create_mask, &attrib); + fluxbox->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); + fluxbox->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); + fluxbox->saveToolbarSearch(frame.window_label, this); + + frame.clock = + XCreateWindow(display, frame.window, 0, 0, 1, 1, 0, screen->getDepth(), + InputOutput, screen->getVisual(), create_mask, &attrib); + fluxbox->saveToolbarSearch(frame.clock, this); + + frame.psbutton = + XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), + InputOutput, screen->getVisual(), create_mask, &attrib); + fluxbox->saveToolbarSearch(frame.psbutton, this); + + frame.nsbutton = + XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), + InputOutput, screen->getVisual(), create_mask, &attrib); + fluxbox->saveToolbarSearch(frame.nsbutton, this); + + frame.pwbutton = + XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), + InputOutput, screen->getVisual(), create_mask, &attrib); + fluxbox->saveToolbarSearch(frame.pwbutton, this); + + frame.nwbutton = + XCreateWindow(display ,frame.window, 0, 0, 1, 1, 0, screen->getDepth(), + InputOutput, screen->getVisual(), create_mask, &attrib); + fluxbox->saveToolbarSearch(frame.nwbutton, this); + + frame.base = frame.label = frame.wlabel = frame.clk = frame.button = + frame.pbutton = None; + + if (Fluxbox::instance()->useIconBar()) + iconbar = new IconBar(screen, frame.window_label); + else + iconbar = 0; + + reconfigure(); + + XMapSubwindows(display, frame.window); + XMapWindow(display, frame.window); +} + + +Toolbar::~Toolbar(void) { + XUnmapWindow(display, frame.window); + + 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); + + + fluxbox->removeToolbarSearch(frame.window); + + fluxbox->removeToolbarSearch(frame.workspace_label); + fluxbox->removeToolbarSearch(frame.window_label); + fluxbox->removeToolbarSearch(frame.clock); + fluxbox->removeToolbarSearch(frame.psbutton); + fluxbox->removeToolbarSearch(frame.nsbutton); + fluxbox->removeToolbarSearch(frame.pwbutton); + fluxbox->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; + if (iconbar) + delete iconbar; +} + +void Toolbar::addIcon(FluxboxWindow *w) { + if (iconbar) + Fluxbox::instance()->saveToolbarSearch(iconbar->addIcon(w), this); +} + +void Toolbar::delIcon(FluxboxWindow *w) { + if (iconbar) + Fluxbox::instance()->removeToolbarSearch(iconbar->delIcon(w)); +} + +void Toolbar::reconfigure(void) { + frame.bevel_w = screen->getBevelWidth(); + frame.width = screen->getWidth() * screen->getToolbarWidthPercent() / 100; + + I18n *i18n = I18n::instance(); + + if (i18n->multibyte()) + frame.height = + screen->getToolbarStyle()->font.set_extents->max_ink_extent.height; + else + frame.height = screen->getToolbarStyle()->font.fontstruct->ascent + + screen->getToolbarStyle()->font.fontstruct->descent; + frame.button_w = frame.height; + frame.height += 2; + frame.label_h = frame.height; + frame.height += (frame.bevel_w * 2); + + switch (screen->getToolbarPlacement()) { + case TopLeft: + frame.x = 0; + frame.y = 0; + frame.x_hidden = 0; + frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.height; + break; + + case BottomLeft: + frame.x = 0; + frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); + frame.x_hidden = 0; + frame.y_hidden = screen->getHeight() - screen->getBevelWidth() + - screen->getBorderWidth(); + break; + + case TopCenter: + frame.x = (screen->getWidth() - frame.width) / 2; + frame.y = 0; + frame.x_hidden = frame.x; + frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.height; + break; + + case BottomCenter: + default: + frame.x = (screen->getWidth() - frame.width) / 2; + frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); + frame.x_hidden = frame.x; + frame.y_hidden = screen->getHeight() - screen->getBevelWidth() + - screen->getBorderWidth(); + break; + + case TopRight: + frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); + frame.y = 0; + frame.x_hidden = frame.x; + frame.y_hidden = screen->getBevelWidth() - screen->getBorderWidth() + - frame.height; + break; + + case BottomRight: + frame.x = screen->getWidth() - frame.width - screen->getBorderWidth2x(); + frame.y = screen->getHeight() - frame.height - screen->getBorderWidth2x(); + frame.x_hidden = frame.x; + frame.y_hidden = screen->getHeight() - screen->getBevelWidth() + - screen->getBorderWidth(); + break; + } + +#ifdef HAVE_STRFTIME + time_t ttmp = time(NULL); + struct tm *tt = 0; + + if (ttmp != -1) { + tt = localtime(&ttmp); + if (tt) { + char t[1024], *time_string = (char *) 0; + int len = strftime(t, 1024, screen->getStrftimeFormat(), tt); + + time_string = new char[len + 1]; + + memset(time_string, '0', len); + *(time_string + len) = '\0'; + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getToolbarStyle()->font.set, time_string, len, + &ink, &logical); + frame.clock_w = logical.width; + } else + frame.clock_w = XTextWidth(screen->getToolbarStyle()->font.fontstruct, + time_string, 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.fontstruct, + i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeLength, +#else // !NLS + 0, 0, +#endif // NLS + "00:00000"), + strlen(i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeLength, +#else // !NLS + 0, 0, +#endif // NLS + "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++) { + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getToolbarStyle()->font.set, + screen->getWorkspace(i)->getName(), + strlen(screen->getWorkspace(i)->getName()), + &ink, &logical); + w = logical.width; + } else + w = XTextWidth(screen->getToolbarStyle()->font.fontstruct, + screen->getWorkspace(i)->getName(), + strlen(screen->getWorkspace(i)->getName())); + + w += (frame.bevel_w * 4); + + if (w > frame.workspace_label_w) frame.workspace_label_w = w; + } + + 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; + + frame.window_label_w = + (frame.width - (frame.clock_w + (frame.button_w * 4) + + frame.workspace_label_w + (frame.bevel_w * 8) + 6)); + + if (hidden) + XMoveResizeWindow(display, frame.window, frame.x_hidden, frame.y_hidden, + frame.width, frame.height); + else + 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.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, 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); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.base = None; + XSetWindowBackground(display, frame.window, + 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); + + tmp = frame.label; + texture = &(screen->getToolbarStyle()->window); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.label = None; + XSetWindowBackground(display, frame.window_label, + 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); + + tmp = frame.wlabel; + texture = &(screen->getToolbarStyle()->label); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.wlabel = None; + XSetWindowBackground(display, frame.workspace_label, + 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); + + tmp = frame.clk; + 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); + + tmp = frame.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); + XSetWindowBackground(display, frame.nwbutton, frame.button_pixel); + } else { + frame.button = + image_ctrl->renderImage(frame.button_w, frame.button_w, texture); + + XSetWindowBackgroundPixmap(display, frame.psbutton, frame.button); + XSetWindowBackgroundPixmap(display, frame.nsbutton, frame.button); + XSetWindowBackgroundPixmap(display, frame.pwbutton, frame.button); + XSetWindowBackgroundPixmap(display, frame.nwbutton, frame.button); + } + if (tmp) image_ctrl->removeImage(tmp); + + tmp = frame.pbutton; + 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()); + XSetWindowBorderWidth(display, frame.window, screen->getBorderWidth()); + + XClearWindow(display, frame.window); + XClearWindow(display, frame.workspace_label); + XClearWindow(display, frame.window_label); + XClearWindow(display, frame.clock); + XClearWindow(display, frame.psbutton); + XClearWindow(display, frame.nsbutton); + XClearWindow(display, frame.pwbutton); + XClearWindow(display, frame.nwbutton); + + redrawWindowLabel(); + redrawWorkspaceLabel(); + redrawPrevWorkspaceButton(); + redrawNextWorkspaceButton(); + redrawPrevWindowButton(); + redrawNextWindowButton(); + checkClock(True); + + toolbarmenu->reconfigure(); + + //iconbar, no iconbar? + if (Fluxbox::instance()->useIconBar()) { + if (!iconbar) { + iconbar = new IconBar(screen, frame.window_label); + if (screen->getIconCount()) { + LinkedListIterator<FluxboxWindow> it(screen->getIconList()); + for(; it.current(); it++) + addIcon(it.current()); + } + + } else + iconbar->reconfigure(); + } else { + if (iconbar) { + LinkedListIterator<FluxboxWindow> it(screen->getIconList()); + for (; it.current(); it++) + delIcon(it.current()); + delete iconbar; + iconbar = 0; + } + } +} + + +#ifdef HAVE_STRFTIME +void Toolbar::checkClock(Bool redraw) { +#else // !HAVE_STRFTIME +void Toolbar::checkClock(Bool redraw, Bool date) { +#endif // HAVE_STRFTIME + time_t tmp = 0; + struct tm *tt = 0; + + if ((tmp = time(NULL)) != -1) { + if (! (tt = localtime(&tmp))) { + cerr<<__FILE__<<"("<<__LINE__<<"): ! localtime(&tmp)"<<endl; + return; + } + if (tt->tm_min != frame.minute || tt->tm_hour != frame.hour) { + frame.hour = tt->tm_hour; + frame.minute = tt->tm_min; + XClearWindow(display, frame.clock); + redraw = True; + } + } else + cerr<<__FILE__<<"("<<__LINE__<<"): time(null)<0"<<endl; + + + if (redraw) { +#ifdef HAVE_STRFTIME + char t[1024]; + if (! strftime(t, 1024, screen->getStrftimeFormat(), tt)) + return; +#else // !HAVE_STRFTIME + char t[9]; + if (date) { + // format the date... with special consideration for y2k ;) + if (screen->getDateFormat() == Blackbox::B_EuropeanDate) + sprintf(t, + i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeDateFormatEu, +#else // !NLS + 0, 0, +#endif // NLS + "%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->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeDateFormat, +#else // !NLS + 0, 0, +#endif // NLS + "%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->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeTimeFormat24, +#else // !NLS + 0, 0, +#endif // NLS + " %02d:%02d "), + frame.hour, frame.minute); + else + sprintf(t, + i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeTimeFormat12, +#else // !NLS + 0, 0, +#endif // NLS + "%02d:%02d %sm"), + ((frame.hour > 12) ? frame.hour - 12 : + ((frame.hour == 0) ? 12 : frame.hour)), frame.minute, + ((frame.hour >= 12) ? + i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeTimeFormatP, +#else // !NLS + 0, 0, +#endif // NLS + "p") : + i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarNoStrftimeTimeFormatA, +#else // !NLS + 0, 0, +#endif // NLS + "a"))); + } +#endif // HAVE_STRFTIME + + int dx = (frame.bevel_w * 2), dlen = strlen(t); + unsigned int l; + I18n *i18n = I18n::instance(); + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getToolbarStyle()->font.set, + t, dlen, &ink, &logical); + l = logical.width; + } else + l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, 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()->font.set, + t, dlen, &ink, &logical); + l = logical.width; + } else + l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, t, dlen); + l += (frame.bevel_w * 4); + + if (l < frame.clock_w) + break; + } + + } + + switch (screen->getToolbarStyle()->font.justify) { + case FFont::Right: + dx += frame.clock_w - l; + break; + + case FFont::Center: + dx += (frame.clock_w - l) / 2; + break; + default: + break; + } + + if (i18n->multibyte()) { + XmbDrawString(display, frame.clock, + screen->getToolbarStyle()->font.set, + screen->getToolbarStyle()->c_text_gc, dx, 1 - + screen->getToolbarStyle()->font.set_extents->max_ink_extent.y, + t, dlen); + } else { + XDrawString(display, frame.clock, + screen->getToolbarStyle()->c_text_gc, dx, + screen->getToolbarStyle()->font.fontstruct->ascent + 1, t, dlen); + } + } +} + + +void Toolbar::redrawWindowLabel(Bool redraw) { + if (Fluxbox::instance()->getFocusedWindow()) { + if (redraw) + XClearWindow(display, frame.window_label); + + FluxboxWindow *foc = Fluxbox::instance()->getFocusedWindow(); + if (foc->getScreen() != screen) + return; + + int dx = (frame.bevel_w * 2), dlen = strlen(*foc->getTitle()); + unsigned int l; + I18n *i18n = I18n::instance(); + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getToolbarStyle()->font.set, *foc->getTitle(), dlen, + &ink, &logical); + l = logical.width; + } else + l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, *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()->font.set, + *foc->getTitle(), dlen, &ink, &logical); + l = logical.width; + } else + l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, *foc->getTitle(), dlen); + + l += (frame.bevel_w * 4); + + if (l < frame.window_label_w) + break; + } + } + switch (screen->getToolbarStyle()->font.justify) { + case FFont::Right: + dx += frame.window_label_w - l; + break; + + case FFont::Center: + dx += (frame.window_label_w - l) / 2; + break; + default: + break; + } + + if (i18n->multibyte()) + XmbDrawString(display, frame.window_label, + screen->getToolbarStyle()->font.set, + screen->getToolbarStyle()->w_text_gc, dx, 1 - + screen->getToolbarStyle()->font.set_extents->max_ink_extent.y, + *foc->getTitle(), dlen); + else + XDrawString(display, frame.window_label, + screen->getToolbarStyle()->w_text_gc, dx, + screen->getToolbarStyle()->font.fontstruct->ascent + 1, + *foc->getTitle(), dlen); + } else + XClearWindow(display, frame.window_label); +} + + +void Toolbar::redrawWorkspaceLabel(Bool redraw) { + if (screen->getCurrentWorkspace()->getName()) { + + if (redraw) + XClearWindow(display, frame.workspace_label); + /* DrawString( + display, frame.label, screen->getToolbarStyle()->l_text_gc, + &screen->getToolbarStyle()->font, + frame.workspace_label_w, frame.width, + frame.bevel_w, + const_cast<char *>(screen->getCurrentWorkspace()->getName()));*/ + + int dx = (frame.bevel_w * 2), dlen = + strlen(screen->getCurrentWorkspace()->getName()); + unsigned int l; + I18n *i18n = I18n::instance(); + + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getToolbarStyle()->font.set, + screen->getCurrentWorkspace()->getName(), dlen, + &ink, &logical); + l = logical.width; + } else + l = XTextWidth(screen->getToolbarStyle()->font.fontstruct, + 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()->font.set, + screen->getCurrentWorkspace()->getName(), dlen, + &ink, &logical); + l = logical.width; + } else { + l = XTextWidth(screen->getWindowStyle()->font.fontstruct, + screen->getCurrentWorkspace()->getName(), dlen); + } + + l += (frame.bevel_w * 4); + + if (l < frame.workspace_label_w) + break; + } + } + + switch (screen->getToolbarStyle()->font.justify) { + case FFont::Right: + dx += frame.workspace_label_w - l; + break; + + case FFont::Center: + dx += (frame.workspace_label_w - l) / 2; + break; + default: + break; + } + + if (i18n->multibyte()) { + XmbDrawString(display, frame.workspace_label, + screen->getToolbarStyle()->font.set, + screen->getToolbarStyle()->l_text_gc, dx, 1 - + screen->getToolbarStyle()->font.set_extents->max_ink_extent.y, + (char *) screen->getCurrentWorkspace()->getName(), dlen); + } else { + XDrawString(display, frame.workspace_label, + screen->getToolbarStyle()->l_text_gc, dx, + screen->getToolbarStyle()->font.fontstruct->ascent + 1, + (char *) screen->getCurrentWorkspace()->getName(), dlen); + } + } +} + + +void Toolbar::redrawPrevWorkspaceButton(Bool pressed, Bool redraw) { + if (redraw) { + if (pressed) { + if (frame.pbutton) + XSetWindowBackgroundPixmap(display, frame.psbutton, frame.pbutton); + else + XSetWindowBackground(display, frame.psbutton, frame.pbutton_pixel); + } else { + if (frame.button) + XSetWindowBackgroundPixmap(display, frame.psbutton, frame.button); + else + XSetWindowBackground(display, frame.psbutton, frame.button_pixel); + } + XClearWindow(display, frame.psbutton); + } + + int hh = frame.button_w / 2, hw = frame.button_w / 2; + + XPoint pts[3]; + pts[0].x = hw - 2; pts[0].y = hh; + 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, + pts, 3, Convex, CoordModePrevious); +} + + +void Toolbar::redrawNextWorkspaceButton(Bool pressed, Bool redraw) { + if (redraw) { + if (pressed) { + if (frame.pbutton) + XSetWindowBackgroundPixmap(display, frame.nsbutton, frame.pbutton); + else + XSetWindowBackground(display, frame.nsbutton, frame.pbutton_pixel); + } else { + if (frame.button) + XSetWindowBackgroundPixmap(display, frame.nsbutton, frame.button); + else + XSetWindowBackground(display, frame.nsbutton, frame.button_pixel); + } + XClearWindow(display, frame.nsbutton); + } + + int hh = frame.button_w / 2, hw = frame.button_w / 2; + + XPoint pts[3]; + pts[0].x = hw - 2; pts[0].y = hh - 2; + 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, + pts, 3, Convex, CoordModePrevious); +} + + +void Toolbar::redrawPrevWindowButton(Bool pressed, Bool redraw) { + if (redraw) { + if (pressed) { + if (frame.pbutton) + XSetWindowBackgroundPixmap(display, frame.pwbutton, frame.pbutton); + else + XSetWindowBackground(display, frame.pwbutton, frame.pbutton_pixel); + } else { + if (frame.button) + XSetWindowBackgroundPixmap(display, frame.pwbutton, frame.button); + else + XSetWindowBackground(display, frame.pwbutton, frame.button_pixel); + } + XClearWindow(display, frame.pwbutton); + } + + int hh = frame.button_w / 2, hw = frame.button_w / 2; + + XPoint pts[3]; + pts[0].x = hw - 2; pts[0].y = hh; + 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, + pts, 3, Convex, CoordModePrevious); +} + + +void Toolbar::redrawNextWindowButton(Bool pressed, Bool redraw) { + if (redraw) { + if (pressed) { + if (frame.pbutton) + XSetWindowBackgroundPixmap(display, frame.nwbutton, frame.pbutton); + else + XSetWindowBackground(display, frame.nwbutton, frame.pbutton_pixel); + } else { + if (frame.button) + XSetWindowBackgroundPixmap(display, frame.nwbutton, frame.button); + else + XSetWindowBackground(display, frame.nwbutton, frame.button_pixel); + } + XClearWindow(display, frame.nwbutton); + } + + int hh = frame.button_w / 2, hw = frame.button_w / 2; + + XPoint pts[3]; + pts[0].x = hw - 2; pts[0].y = hh - 2; + 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, + pts, 3, Convex, CoordModePrevious); +} + + +void Toolbar::edit(void) { + Window window; + int foo; + + editing = True; //mark for editing + + //workspace labe already got intput focus ? + if (XGetInputFocus(display, &window, &foo) && + window == frame.workspace_label) + return; + + //set input focus to workspace label + XSetInputFocus(display, frame.workspace_label, + ((screen->isSloppyFocus() || screen->isSemiSloppyFocus()) ? + RevertToPointerRoot : RevertToParent), CurrentTime); + + XClearWindow(display, frame.workspace_label); //clear workspace text + + fluxbox->setNoFocus(True); + if (fluxbox->getFocusedWindow()) //disable focus on current focused window + fluxbox->getFocusedWindow()->setFocusFlag(False); + + XDrawRectangle(display, frame.workspace_label, + screen->getWindowStyle()->l_text_focus_gc, + frame.workspace_label_w / 2, 0, 1, + frame.label_h - 1); +} + + +void Toolbar::buttonPressEvent(XButtonEvent *be) { + FluxboxWindow *fluxboxwin=0; + if (be->button == 1) { + if (be->window == frame.psbutton) + redrawPrevWorkspaceButton(True, True); + else if (be->window == frame.nsbutton) + redrawNextWorkspaceButton(True, True); + else if (be->window == frame.pwbutton) + redrawPrevWindowButton(True, True); + else if (be->window == frame.nwbutton) + redrawNextWindowButton(True, True); + else if ( iconbar ) { + if ( (fluxboxwin = iconbar->findWindow(be->window)) ) + fluxboxwin->deiconify(); + } +#ifndef HAVE_STRFTIME + else if (be->window == frame.clock) { + XClearWindow(display, frame.clock); + checkClock(True, True); + } +#endif // HAVE_STRFTIME + else if (! on_top) { + Window w[1] = { frame.window }; + screen->raiseWindows(w, 1); + } + } else if (be->button == 2 && (! on_top)) { + XLowerWindow(display, frame.window); + } else if (be->button == 3) { + if (! toolbarmenu->isVisible()) { + int x, y; + + x = be->x_root - (toolbarmenu->getWidth() / 2); + y = be->y_root - (toolbarmenu->getHeight() / 2); + + if (x < 0) + x = 0; + else if (x + toolbarmenu->getWidth() > screen->getWidth()) + x = screen->getWidth() - toolbarmenu->getWidth(); + + if (y < 0) + y = 0; + else if (y + toolbarmenu->getHeight() > screen->getHeight()) + y = screen->getHeight() - toolbarmenu->getHeight(); + + toolbarmenu->move(x, y); + toolbarmenu->show(); + } else + toolbarmenu->hide(); + + } + +} + + +void Toolbar::buttonReleaseEvent(XButtonEvent *re) { + if (re->button == 1) { + if (re->window == frame.psbutton) { + redrawPrevWorkspaceButton(False, True); + + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) + screen->prevWorkspace(); + } else if (re->window == frame.nsbutton) { + redrawNextWorkspaceButton(False, True); + + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) + screen->nextWorkspace(); + } else if (re->window == frame.pwbutton) { + redrawPrevWindowButton(False, True); + + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) + screen->prevFocus(); + } else if (re->window == frame.nwbutton) { + redrawNextWindowButton(False, True); + + if (re->x >= 0 && re->x < (signed) frame.button_w && + re->y >= 0 && re->y < (signed) frame.button_w) + screen->nextFocus(); + } else if (re->window == frame.window_label) + screen->raiseFocus(); +#ifndef HAVE_STRFTIME + else if (re->window == frame.clock) { + XClearWindow(display, frame.clock); + checkClock(True); + } +#endif // HAVE_STRFTIME + } else if (re->button == 4) //mousewheel scroll up + screen->nextWorkspace(); + else if (re->button == 5) //mousewheel scroll down + screen->prevWorkspace(); +} + + +void Toolbar::enterNotifyEvent(XCrossingEvent *) { + if (! do_auto_hide) + return; + + if (hidden) { + if (! hide_timer->isTiming()) hide_timer->start(); + } else { + if (hide_timer->isTiming()) hide_timer->stop(); + } +} + +void Toolbar::leaveNotifyEvent(XCrossingEvent *) { + if (! do_auto_hide) + return; + + if (hidden) { + if (hide_timer->isTiming()) hide_timer->stop(); + } else if (! toolbarmenu->isVisible()) { + if (! hide_timer->isTiming()) hide_timer->start(); + } +} + + +void Toolbar::exposeEvent(XExposeEvent *ee) { + if (ee->window == frame.clock) checkClock(True); + else if (ee->window == frame.workspace_label && (! editing)) + redrawWorkspaceLabel(); + else if (ee->window == frame.window_label) redrawWindowLabel(); + else if (ee->window == frame.psbutton) redrawPrevWorkspaceButton(); + else if (ee->window == frame.nsbutton) redrawNextWorkspaceButton(); + else if (ee->window == frame.pwbutton) redrawPrevWindowButton(); + else if (ee->window == frame.nwbutton) redrawNextWindowButton(); + else if (iconbar)//try iconbar + iconbar->exposeEvent(ee); +} + + +void Toolbar::keyPressEvent(XKeyEvent *ke) { + if (ke->window == frame.workspace_label && editing) { + fluxbox->grab(); + + if (! new_workspace_name) { + new_workspace_name = new char[1024]; + new_name_pos = new_workspace_name; + + if (! new_workspace_name) return; + } + + KeySym ks; + char keychar[1]; + XLookupString(ke, keychar, 1, &ks, 0); + + if (ks == XK_Return || ks == XK_Escape) { + *(new_name_pos) = 0; + + editing = False; + + fluxbox->setNoFocus(False); + if (fluxbox->getFocusedWindow()) { + fluxbox->getFocusedWindow()->setInputFocus(); + fluxbox->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 + // Blackbox::LoadRC() method. + if (*new_workspace_name) { + if (ks == XK_Return) //change workspace name if keypress = Return + 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() + 1); + screen->getWorkspacemenu()->update(); + } + + delete [] new_workspace_name; + new_workspace_name = new_name_pos = 0; + + 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)) { + if (ks == XK_BackSpace) { + if (new_name_pos != new_workspace_name) { + *(--new_name_pos) = 0; + } else { + *new_workspace_name = 0; + } + } else { + *(new_name_pos++) = *keychar; + *(new_name_pos) = 0; + } + + XClearWindow(display, frame.workspace_label); + int l = strlen(new_workspace_name), tw, x; + I18n *i18n = I18n::instance(); + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getToolbarStyle()->font.set, + new_workspace_name, l, &ink, &logical); + tw = logical.width; + } else + tw = XTextWidth(screen->getToolbarStyle()->font.fontstruct, + new_workspace_name, l); + + x = (frame.workspace_label_w - tw) / 2; + + if (x < (signed) frame.bevel_w) x = frame.bevel_w; + + if (i18n->multibyte()) + XmbDrawString(display, frame.workspace_label, + screen->getWindowStyle()->font.set, + screen->getWindowStyle()->l_text_focus_gc, x, 1 - + screen->getWindowStyle()->font.set_extents->max_ink_extent.y, + new_workspace_name, l); + else + XDrawString(display, frame.workspace_label, + screen->getWindowStyle()->l_text_focus_gc, x, + screen->getToolbarStyle()->font.fontstruct->ascent + 1, + new_workspace_name, l); + + XDrawRectangle(display, frame.workspace_label, + screen->getWindowStyle()->l_text_focus_gc, x + tw, 0, 1, + frame.label_h - 1); + } + + fluxbox->ungrab(); + } +} + + +void Toolbar::timeout(void) { + checkClock(True); + + 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) + XMoveWindow(toolbar->display, toolbar->frame.window, + toolbar->frame.x_hidden, toolbar->frame.y_hidden); + else + XMoveWindow(toolbar->display, toolbar->frame.window, + toolbar->frame.x, toolbar->frame.y); +} + + +Toolbarmenu::Toolbarmenu(Toolbar *tb) : Basemenu(tb->screen) { + toolbar = tb; + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarToolbarTitle, +#else // !NLS + 0, 0, +#endif // NLS + "Toolbar")); + setInternalMenu(); + + placementmenu = new Placementmenu(this); + + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTitle, +#else // !NLS + 0, 0, +#endif // NLS + "Placement"), + placementmenu); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonAlwaysOnTop, +#else // !NLS + 0, 0, +#endif // NLS + "Always on top"), + 1); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonAutoHide, +#else // !NLS + 0, 0, +#endif // NLS + "Auto hide"), + 2); + insert(i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarEditWkspcName, +#else // !NLS + 0, 0, +#endif // NLS + "Edit current workspace name"), + 3); + + update(); + + if (toolbar->isOnTop()) + setItemSelected(1, True); + if (toolbar->doAutoHide()) + setItemSelected(2, True); +} + + +Toolbarmenu::~Toolbarmenu(void) { + delete placementmenu; +} + + +void Toolbarmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + if (! item) return; + + switch (item->function()) { + case 1: // always on top + { + Bool change = ((toolbar->isOnTop()) ? False : True); + toolbar->on_top = change; + setItemSelected(1, change); + + if (toolbar->isOnTop()) toolbar->screen->raiseWindows((Window *) 0, 0); + break; + } + + case 2: // auto hide + { + Bool change = ((toolbar->doAutoHide()) ? False : True); + toolbar->do_auto_hide = change; + setItemSelected(2, change); + +#ifdef SLIT + toolbar->screen->getSlit()->reposition(); +#endif // SLIT + break; + } + + case 3: // edit current workspace name + toolbar->edit(); //set edit mode + hide(); //dont show menu while editing name + + break; + } + } +} + + +void Toolbarmenu::internal_hide(void) { + Basemenu::internal_hide(); + if (toolbar->doAutoHide() && ! toolbar->isEditing()) + toolbar->hide_handler.timeout(); +} + + +void Toolbarmenu::reconfigure(void) { + placementmenu->reconfigure(); + + Basemenu::reconfigure(); +} + + +Toolbarmenu::Placementmenu::Placementmenu(Toolbarmenu *tm) + : Basemenu(tm->toolbar->screen) { + toolbarmenu = tm; + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + ToolbarSet, ToolbarToolbarPlacement, +#else // !NLS + 0, 0, +#endif // NLS + "Toolbar Placement")); + setInternalMenu(); + setMinimumSublevels(3); + + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Top Left"), + Toolbar::TopLeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomLeft, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Left"), + Toolbar::BottomLeft); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Top Center"), + Toolbar::TopCenter); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomCenter, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Center"), + Toolbar::BottomCenter); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementTopRight, +#else // !NLS + 0, 0, +#endif // NLS + "Top Right"), + Toolbar::TopRight); + insert(i18n->getMessage( +#ifdef NLS + CommonSet, CommonPlacementBottomRight, +#else // !NLS + 0, 0, +#endif // NLS + "Bottom Right"), + Toolbar::BottomRight); + + update(); +} + + +void Toolbarmenu::Placementmenu::itemSelected(int button, int index) { + if (button == 1) { + BasemenuItem *item = find(index); + if (! item) + return; + + toolbarmenu->toolbar->screen->saveToolbarPlacement(item->function()); + hide(); + toolbarmenu->toolbar->reconfigure(); + +#ifdef SLIT + // reposition the slit as well to make sure it doesn't intersect the + // toolbar + toolbarmenu->toolbar->screen->getSlit()->reposition(); +#endif // SLIT + + } +}
A src/Toolbar.hh

@@ -0,0 +1,163 @@

+// Toolbar.hh for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> + + + + +#include "Basemenu.hh" +#include "LinkedList.hh" +#include "Timer.hh" +#include "IconBar.hh" + + +// forward declaration +class Toolbar; + +class Toolbarmenu : public Basemenu { +private: + class Placementmenu : public Basemenu { + private: + Toolbarmenu *toolbarmenu; + + protected: + virtual void itemSelected(int, int); + + public: + Placementmenu(Toolbarmenu *); + }; + + Toolbar *toolbar; + Placementmenu *placementmenu; + + friend class Placementmenu; + friend class Toolbar; + + +protected: + virtual void itemSelected(int, int); + virtual void internal_hide(void); + +public: + Toolbarmenu(Toolbar *); + ~Toolbarmenu(void); + + inline Basemenu *getPlacementmenu(void) { return placementmenu; } + + void reconfigure(void); +}; + + +class Toolbar : public TimeoutHandler { +private: + Bool on_top, editing, hidden, do_auto_hide; + 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); + } hide_handler; + + Fluxbox *fluxbox; + BImageControl *image_ctrl; + BScreen *screen; + BTimer *clock_timer, *hide_timer; + Toolbarmenu *toolbarmenu; + class IconBar *iconbar; + + char *new_workspace_name, *new_name_pos; + + friend class HideHandler; + friend class Toolbarmenu; + friend class Toolbarmenu::Placementmenu; + + +public: + Toolbar(BScreen *); + virtual ~Toolbar(void); + void addIcon(FluxboxWindow *w); + void delIcon(FluxboxWindow *w); + + inline Toolbarmenu *getMenu(void) { return toolbarmenu; } + //inline Window getWindowLabel(void) { return frame.window_label; } + 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 const Window &getWindowID(void) 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); } + + 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); + +#ifdef HAVE_STRFTIME + void checkClock(Bool = False); +#else // HAVE_STRFTIME + void checkClock(Bool = False, Bool = False); +#endif // HAVE_STRFTIME + + virtual void timeout(void); + + enum { TopLeft = 1, BottomLeft, TopCenter, + BottomCenter, TopRight, BottomRight }; +}; + + +#endif // __Toolbar_hh
A src/Window.cc

@@ -0,0 +1,3312 @@

+// Window.cc for fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) + +// Window.cc for Blackbox - an X11 Window manager +// 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 "i18n.hh" +#include "fluxbox.hh" +#include "Icon.hh" +#include "Screen.hh" +#include "Toolbar.hh" +#include "Window.hh" +#include "Windowmenu.hh" +#include "Workspace.hh" + + +#ifdef SLIT +# include "Slit.hh" +#endif // SLIT + +#include <X11/Xatom.h> +#include <X11/keysym.h> + +#ifdef STDC_HEADERS +# include <string.h> +#endif // STDC_HEADERS + +#ifdef DEBUG +# ifdef HAVE_STDIO_H +# include <stdio.h> +# endif // HAVE_STDIO_H +#endif // DEBUG + +#include "misc.hh" + +using namespace std; + +FluxboxWindow::FluxboxWindow(Window w, BScreen *s) { + +#ifdef DEBUG + fprintf(stderr, + I18n::instance()-> + getMessage( +# ifdef NLS + WindowSet, WindowCreating, +# else // !NLS + 0, 0, +# endif // NLS + "FluxboxWindow::FluxboxWindow(): creating 0x%lx\n"), + w); +#endif // DEBUG + + Fluxbox *fluxbox = Fluxbox::instance(); + display = fluxbox->getXDisplay(); + + moving = resizing = shaded = maximized = visible = iconic = false; + transient = focused = stuck = modal = send_focus_message = managed = false; + + blackbox_attrib.workspace = workspace_number = window_number = -1; + + blackbox_attrib.flags = blackbox_attrib.attrib = blackbox_attrib.stack = 0l; + blackbox_attrib.premax_x = blackbox_attrib.premax_y = 0; + blackbox_attrib.premax_w = blackbox_attrib.premax_h = 0; + //use tab as default + decorations.tab = true; + client.window = w; + tab = 0; + frame.window = frame.plate = frame.title = frame.handle = None; + frame.right_grip = frame.left_grip = None; + + frame.utitle = frame.ftitle = frame.uhandle = frame.fhandle = None; + frame.ulabel = frame.flabel = frame.ubutton = frame.fbutton = None; + frame.pbutton = frame.ugrip = frame.fgrip = None; + + //get decorations + vector<Fluxbox::Titlebar> dir = fluxbox->getTitlebarLeft(); + for (char c=0; c<2; c++) { + for (unsigned int i=0; i<dir.size(); i++) { + switch (dir[i]) { + case Fluxbox::Shade: + decorations.shade = true; + break; + case Fluxbox::Maximize: + decorations.maximize = true; + break; + case Fluxbox::Minimize: + decorations.iconify = true; + break; + case Fluxbox::Stick: + decorations.sticky = true; + break; + case Fluxbox::Close: + decorations.close = true; + break; + case Fluxbox::Menu: + decorations.menu = true; + break; + default: + break; + } + } + //next right + dir = fluxbox->getTitlebarRight(); + } + + decorations.menu = true; //override menu option + + decorations.titlebar = decorations.border = decorations.handle = true; + functions.resize = functions.move = functions.iconify = functions.maximize = true; + functions.close = decorations.close = false; + + client.wm_hint_flags = client.normal_hint_flags = 0; + client.transient_for = client.transient = 0; + client.title = 0; + client.title_len = 0; + client.icon_title = 0; + client.mwm_hint = (MwmHints *) 0; + client.blackbox_hint = (BlackboxHints *) 0; + + windowmenu = 0; + lastButtonPressTime = 0; + timer = 0; + screen = 0; + image_ctrl = 0; + + fluxbox->grab(); + if (! validateClient()) + return; + + // fetch client size and placement + XWindowAttributes wattrib; + if ((! XGetWindowAttributes(display, client.window, &wattrib)) || + (! wattrib.screen) || wattrib.override_redirect) { +#ifdef DEBUG + fprintf(stderr, + I18n::instance()-> + getMessage( +# ifdef NLS + WindowSet, WindowXGetWindowAttributesFail, +# else // !NLS + 0, 0, +# endif // NLS + "FluxboxWindow::FluxboxWindow(): XGetWindowAttributes " + "failed\n")); +#endif // DEBUG + + delete this; + + fluxbox->ungrab(); + return; + } + + if (s) + screen = s; + else + screen = fluxbox->searchScreen(RootWindowOfScreen(wattrib.screen)); + + if (! screen) { +#ifdef DEBUG + fprintf(stderr, + I18n::instance()-> + getMessage( +# ifdef NLS + WindowSet, WindowCannotFindScreen, +# else // !NLS + 0, 0, +# endif // NLS + "FluxboxWindow::FluxboxWindow(): can't find screen\n" + " for root window 0x%lx\n"), + RootWindowOfScreen(wattrib.screen)); +#endif // DEBUG + delete this; + + fluxbox->ungrab(); + return; + } + + image_ctrl = screen->getImageControl(); + + client.x = wattrib.x; + client.y = wattrib.y; + client.width = wattrib.width; + client.height = wattrib.height; + client.old_bw = wattrib.border_width; + + timer = new BTimer(fluxbox, this); + timer->setTimeout(fluxbox->getAutoRaiseDelay()); + timer->fireOnce(true); + + getBlackboxHints(); + if (! client.blackbox_hint) + getMWMHints(); + + // get size, aspect, minimum/maximum size and other hints set by the + // client + getWMProtocols(); + getWMHints(); + getWMNormalHints(); + +#ifdef SLIT + if (client.initial_state == WithdrawnState) { + screen->getSlit()->addClient(client.window); + delete this; + + fluxbox->ungrab(); + return; + } +#endif // SLIT + + managed = true; + fluxbox->saveWindowSearch(client.window, this); + + // determine if this is a transient window + Window win; + if (XGetTransientForHint(display, client.window, &win)) { + if (win && (win != client.window)) { + FluxboxWindow *tr; + if ((tr = fluxbox->searchWindow(win))) { + + while (tr->client.transient) + tr = tr->client.transient; + + client.transient_for = tr; + tr->client.transient = this; + stuck = client.transient_for->stuck; + transient = true; + } else if (win == client.window_group) { + if ((tr = fluxbox->searchGroup(win, this))) { + + while (tr->client.transient) + tr = tr->client.transient; + + client.transient_for = tr; + tr->client.transient = this; + stuck = client.transient_for->stuck; + transient = true; + } + } + } + + if (win == screen->getRootWindow()) modal = true; + } + + // adjust the window decorations based on transience and window sizes + if (transient) { + decorations.maximize = decorations.handle = + decorations.border = functions.maximize = false; + } + + if ((client.normal_hint_flags & PMinSize) && + (client.normal_hint_flags & PMaxSize) && + client.max_width <= client.min_width && + client.max_height <= client.min_height) { + decorations.maximize = decorations.handle = + functions.resize = functions.maximize = false; + decorations.tab = false; //no tab for this window + } + + upsize(); + + bool place_window = true; + if (fluxbox->isStartup() || transient || + client.normal_hint_flags & (PPosition|USPosition)) { + setGravityOffsets(); + + if ((fluxbox->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.window = createToplevelWindow(frame.x, frame.y, frame.width, + frame.height, + screen->getBorderWidth()); //create frame window + + fluxbox->saveWindowSearch(frame.window, this); //save frame window + + frame.plate = createChildWindow(frame.window); //Create plate window + fluxbox->saveWindowSearch(frame.plate, this); //save plate window + + if (decorations.titlebar) { //have titlebar decorations? + frame.title = createChildWindow(frame.window); //create titlebar win + fluxbox->saveWindowSearch(frame.title, this); //save titlebar win + frame.label = createChildWindow(frame.title); //create label win in titlebar + fluxbox->saveWindowSearch(frame.label, this); //save label win + } + + if (decorations.handle) { //have handle decorations ? + frame.handle = createChildWindow(frame.window); //create handle win + fluxbox->saveWindowSearch(frame.handle, this); //save handle win + + frame.left_grip = // create left handle + createChildWindow(frame.handle, fluxbox->getLowerLeftAngleCursor()); + fluxbox->saveWindowSearch(frame.left_grip, this); //save left handle + + frame.right_grip = // create right handle + createChildWindow(frame.handle, fluxbox->getLowerRightAngleCursor()); + fluxbox->saveWindowSearch(frame.right_grip, this); //save right handle + } + + associateClientWindow(); + + if (! (screen->isSloppyFocus() || screen->isSemiSloppyFocus())) { + XGrabButton(display, Button1, AnyModifier, + frame.plate, True, ButtonPressMask, + GrabModeSync, GrabModeSync, None, None); + XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame.plate); + + } else + XUngrabButton(display, Button1, AnyModifier, frame.plate); + + XGrabButton(display, Button1, Mod1Mask, frame.window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, fluxbox->getMoveCursor()); + + //----grab with "all" modifiers + grabButton(display, Button1, frame.window, fluxbox->getMoveCursor()); + + XGrabButton(display, Button2, Mod1Mask, frame.window, True, + ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, None); + + XGrabButton(display, Button3, Mod1Mask, frame.window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, fluxbox->getLowerRightAngleCursor()); + + //---grab with "all" modifiers + grabButton(display, Button3, frame.window, fluxbox->getLowerRightAngleCursor()); + + positionWindows(); + + //use tab? delayed this so that tabs wont "flicker" when creating windows + if (decorations.tab && fluxbox->useTabs()) + tab = new Tab(this, 0, 0); + + XRaiseWindow(display, frame.plate); + XMapSubwindows(display, frame.plate); + if (decorations.titlebar) + XMapSubwindows(display, frame.title); + + XMapSubwindows(display, frame.window); + + if (decorations.menu) + windowmenu = new Windowmenu(this); + + decorate(); + + if (workspace_number < 0 || workspace_number >= screen->getCount()) + screen->getCurrentWorkspace()->addWindow(this, place_window); + else + screen->getWorkspace(workspace_number)->addWindow(this, place_window); + + configure(frame.x, frame.y, frame.width, frame.height); + + if (shaded) { + shaded = false; + shade(); + } + + if (maximized && functions.maximize) { + int m = maximized; + maximized = false; + + maximize(m); + } + + setFocusFlag(false); +/* +#ifdef GNOME + //tell the creator of this window that we are a gnome compilant windowmanager + { + XChangeProperty(display, screen->getRootWindow(), + screen->getBaseDisplay()->getGnomeSupportingWMCheckAtom(), + XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&client.window, 1); + XChangeProperty(display, client.window, + screen->getBaseDisplay()->getGnomeSupportingWMCheckAtom(), + XA_CARDINAL, 32, PropModeReplace, + (unsigned char *)&client.window, 1); + } +#endif +*/ + fluxbox->ungrab(); + #ifdef DEBUG + fprintf(stderr, "%s(%d): FluxboxWindow(this=%p)\n", __FILE__, __LINE__, this); + #endif +} + + +FluxboxWindow::~FluxboxWindow(void) { + Fluxbox *fluxbox = Fluxbox::instance(); + + + if (moving || resizing) { + screen->hideGeometry(); + XUngrabPointer(display, CurrentTime); + } + + if (workspace_number != -1 && window_number != -1) + screen->getWorkspace(workspace_number)->removeWindow(this); + else if (iconic) + screen->removeIcon(this); + + if (timer) { + if (timer->isTiming()) timer->stop(); + delete timer; + } + + if (windowmenu) + delete windowmenu; + + if (client.title) + delete [] client.title; + + if (client.icon_title) + delete [] client.icon_title; + + if (tab) + delete tab; + + if (client.mwm_hint) + XFree(client.mwm_hint); + + if (client.blackbox_hint) + XFree(client.blackbox_hint); + + + if (client.window_group) + fluxbox->removeGroupSearch(client.window_group); + + if (transient && client.transient_for) + client.transient_for->client.transient = client.transient; + if (client.transient) + client.transient->client.transient_for = client.transient_for; + + while ( !buttonlist.empty()) { //destroy all buttons on titlebar + fluxbox->removeWindowSearch(buttonlist.back().win); + XDestroyWindow(display, buttonlist.back().win); + buttonlist.pop_back(); + } + + 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); + + fluxbox->removeWindowSearch(frame.label); + fluxbox->removeWindowSearch(frame.title); + XDestroyWindow(display, frame.label); + XDestroyWindow(display, frame.title); + } + + 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); + + fluxbox->removeWindowSearch(frame.handle); + fluxbox->removeWindowSearch(frame.right_grip); + fluxbox->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.pbutton) + image_ctrl->removeImage(frame.pbutton); + + + if (frame.plate) { //NOTE + fluxbox->removeWindowSearch(frame.plate); + XDestroyWindow(display, frame.plate); + } + + if (frame.window) { + fluxbox->removeWindowSearch(frame.window); + XDestroyWindow(display, frame.window); + } + + if (managed) { + fluxbox->removeWindowSearch(client.window); + screen->removeNetizen(client.window); + } + //TODO: Move this to Workspace::removeWindow + if (client.transient_for) + fluxbox->setFocusedWindow(client.transient_for); + #ifdef DEBUG + fprintf(stderr, "%s(%d): ~FluxboxWindow(this=%p) done\n", __FILE__, __LINE__, this); + #endif +} + + +Window FluxboxWindow::createToplevelWindow(int x, int y, unsigned int width, + unsigned int height, + unsigned int borderwidth) +{ + XSetWindowAttributes attrib_create; + unsigned long create_mask = CWBackPixmap | CWBorderPixel | CWColormap | + CWOverrideRedirect | CWEventMask; + + attrib_create.background_pixmap = None; + attrib_create.colormap = screen->getColormap(); + attrib_create.override_redirect = True; + attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | EnterWindowMask; + + return (XCreateWindow(display, screen->getRootWindow(), x, y, width, height, + borderwidth, screen->getDepth(), InputOutput, + screen->getVisual(), create_mask, + &attrib_create)); +} + + +Window FluxboxWindow::createChildWindow(Window parent, Cursor cursor) { + XSetWindowAttributes attrib_create; + unsigned long create_mask = CWBackPixmap | CWBorderPixel | + CWEventMask; + + attrib_create.background_pixmap = None; + attrib_create.event_mask = ButtonPressMask | ButtonReleaseMask | + ButtonMotionMask | ExposureMask | + EnterWindowMask | LeaveWindowMask; + + if (cursor) { + create_mask |= CWCursor; + attrib_create.cursor = cursor; + } + + return (XCreateWindow(display, parent, 0, 0, 1, 1, 0, + screen->getDepth(), InputOutput, screen->getVisual(), + create_mask, &attrib_create)); +} + + +void FluxboxWindow::associateClientWindow(void) { + XSetWindowBorderWidth(display, client.window, 0); + getWMName(); + getWMIconName(); + + XChangeSaveSet(display, client.window, SetModeInsert); + XSetWindowAttributes attrib_set; + + XSelectInput(display, frame.plate, NoEventMask); + XReparentWindow(display, client.window, frame.plate, 0, 0); + XSelectInput(display, frame.plate, SubstructureRedirectMask); + + XFlush(display); + + 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 (Fluxbox::instance()->hasShapeExtensions()) { + XShapeSelectInput(display, client.window, ShapeNotifyMask); + + int foo; + unsigned int ufoo; + + XShapeQueryExtents(display, client.window, &frame.shaped, &foo, &foo, + &ufoo, &ufoo, &foo, &foo, &foo, &ufoo, &ufoo); + + if (frame.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 + screen->getBorderWidth(); + num++; + } + + XShapeCombineRectangles(display, frame.window, ShapeBounding, 0, 0, + xrect, num, ShapeUnion, Unsorted); + } + } +#endif // SHAPE + //create the buttons + if (decorations.iconify) + createButton(Fluxbox::Minimize, FluxboxWindow::iconifyPressed_cb, FluxboxWindow::iconifyButton_cb, FluxboxWindow::iconifyDraw_cb); + if (decorations.maximize) + createButton(Fluxbox::Maximize, FluxboxWindow::maximizePressed_cb, FluxboxWindow::maximizeButton_cb, + FluxboxWindow::maximizeDraw_cb); + if (decorations.close) + createButton(Fluxbox::Close, FluxboxWindow::closePressed_cb, + FluxboxWindow::closeButton_cb, FluxboxWindow::closeDraw_cb); + if (decorations.sticky) + createButton(Fluxbox::Stick, FluxboxWindow::stickyPressed_cb, + FluxboxWindow::stickyButton_cb, FluxboxWindow::stickyDraw_cb); + + if (decorations.menu)//TODO + createButton(Fluxbox::Menu, 0, 0, 0); + + if (decorations.shade) + createButton(Fluxbox::Shade, 0, FluxboxWindow::shadeButton_cb, FluxboxWindow::shadeDraw_cb); + + if (frame.ubutton) { + for (unsigned int i=0; i<buttonlist.size(); i++) + XSetWindowBackgroundPixmap(display, buttonlist[i].win, frame.ubutton); + + } else { + for (unsigned int i=0; i<buttonlist.size(); i++) + XSetWindowBackground(display, buttonlist[i].win, frame.ubutton_pixel); + } +} + + +void FluxboxWindow::decorate(void) { + + if (tab) + tab->decorate(); + + 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); + 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); + 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.titlebar) { + tmp = frame.ftitle; + texture = &(screen->getWindowStyle()->t_focus); + 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); + 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(display, frame.title, + screen->getBorderColor()->getPixel()); + + decorateLabel(); + + } + + if (decorations.border) { + frame.fborder_pixel = screen->getWindowStyle()->f_focus.getPixel(); + frame.uborder_pixel = screen->getWindowStyle()->f_unfocus.getPixel(); + } + + if (decorations.handle) { + tmp = frame.fhandle; + texture = &(screen->getWindowStyle()->h_focus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.fhandle = None; + frame.fhandle_pixel = texture->getColor()->getPixel(); + } else + frame.fhandle = + image_ctrl->renderImage(frame.width, frame.handle_h, texture); + if (tmp) image_ctrl->removeImage(tmp); + + tmp = frame.uhandle; + texture = &(screen->getWindowStyle()->h_unfocus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.uhandle = None; + frame.uhandle_pixel = texture->getColor()->getPixel(); + } else + frame.uhandle = + image_ctrl->renderImage(frame.width, frame.handle_h, texture); + if (tmp) + image_ctrl->removeImage(tmp); + + tmp = frame.fgrip; + texture = &(screen->getWindowStyle()->g_focus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.fgrip = None; + frame.fgrip_pixel = texture->getColor()->getPixel(); + } else + frame.fgrip = + image_ctrl->renderImage(frame.grip_w, frame.grip_h, texture); + if (tmp) + image_ctrl->removeImage(tmp); + + tmp = frame.ugrip; + texture = &(screen->getWindowStyle()->g_unfocus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.ugrip = None; + frame.ugrip_pixel = texture->getColor()->getPixel(); + } else + frame.ugrip = + image_ctrl->renderImage(frame.grip_w, frame.grip_h, texture); + if (tmp) image_ctrl->removeImage(tmp); + + XSetWindowBorder(display, frame.handle, + screen->getBorderColor()->getPixel()); + XSetWindowBorder(display, frame.left_grip, + screen->getBorderColor()->getPixel()); + XSetWindowBorder(display, frame.right_grip, + screen->getBorderColor()->getPixel()); + } + + XSetWindowBorder(display, frame.window, + screen->getBorderColor()->getPixel()); +} + + +void FluxboxWindow::decorateLabel(void) { + Pixmap tmp = frame.flabel; + BTexture *texture = &(screen->getWindowStyle()->l_focus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.flabel = None; + frame.flabel_pixel = texture->getColor()->getPixel(); + } else + frame.flabel = image_ctrl->renderImage(frame.label_w, frame.label_h, texture); + + if (tmp) image_ctrl->removeImage(tmp); + + tmp = frame.ulabel; + texture = &(screen->getWindowStyle()->l_unfocus); + if (texture->getTexture() == (BImage_Flat | BImage_Solid)) { + frame.ulabel = None; + frame.ulabel_pixel = texture->getColor()->getPixel(); + } else + frame.ulabel = image_ctrl->renderImage(frame.label_w, frame.label_h, texture); + + if (tmp) image_ctrl->removeImage(tmp); +} + +void FluxboxWindow::createButton(int type, ButtonEventProc pressed, ButtonEventProc released, ButtonDrawProc draw) { + Button b; + b.win = createChildWindow(frame.title); + Fluxbox::instance()->saveWindowSearch(b.win, this); + b.type = type; + b.used = true; + b.draw = draw; + b.pressed = pressed; + b.released = released; + buttonlist.push_back(b); +} + +Window FluxboxWindow::findTitleButton(int type) { + for (unsigned int i=0; i<buttonlist.size(); i++) + if (buttonlist[i].type == type) + return buttonlist[i].win; + + return 0; +} +void FluxboxWindow::stickyButton_cb(FluxboxWindow *t, XButtonEvent *be) { + t->stick(); + FluxboxWindow::stickyDraw_cb(t, be->window, false); +} + +void FluxboxWindow::stickyPressed_cb(FluxboxWindow *t, XButtonEvent *be) { + FluxboxWindow::stickyDraw_cb(t, be->window, true); +} + +void FluxboxWindow::iconifyButton_cb(FluxboxWindow *t, XButtonEvent *be) { + t->iconify(); + FluxboxWindow::iconifyDraw_cb(t, be->window, false); +} + +void FluxboxWindow::iconifyPressed_cb(FluxboxWindow *t, XButtonEvent *be) { + t->screen->getWorkspace(t->workspace_number)->lowerWindow(t); + FluxboxWindow::iconifyDraw_cb(t, be->window, true); +} + +void FluxboxWindow::maximizeButton_cb(FluxboxWindow *t, XButtonEvent *be) { + FluxboxWindow::maximizeDraw_cb(t, be->window, false); + t->maximize(be->button); +} + +void FluxboxWindow::maximizePressed_cb(FluxboxWindow *t, XButtonEvent *be) { + FluxboxWindow::maximizeDraw_cb(t, be->window, true); +} + +void FluxboxWindow::closeButton_cb(FluxboxWindow *t, XButtonEvent *be) { + t->close(); + FluxboxWindow::closeDraw_cb(t, be->window, false); +} + +void FluxboxWindow::closePressed_cb(FluxboxWindow *t, XButtonEvent *be) { + FluxboxWindow::closeDraw_cb(t, be->window, true); +} + +void FluxboxWindow::shadeButton_cb(FluxboxWindow *t, XButtonEvent *be) { + FluxboxWindow::shadeDraw_cb(t, be->window, false); + t->shade(); + if (t->tab) + t->tab->shade(); +} + +void FluxboxWindow::stickyDraw_cb(FluxboxWindow *t, Window w, bool pressed) { + t->drawButtonBase(w, pressed); + if (t->stuck) { + XFillRectangle(t->display, w, + ((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc : + t->screen->getWindowStyle()->b_pic_unfocus_gc), + t->frame.button_w/2-t->frame.button_w/4, t->frame.button_h/2-t->frame.button_h/4, + t->frame.button_w/2, t->frame.button_h/2); + } else { + XFillRectangle(t->display, w, + ((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc : + t->screen->getWindowStyle()->b_pic_unfocus_gc), + t->frame.button_w/2, t->frame.button_h/2, + t->frame.button_w/5, t->frame.button_h/5); + } +} + +void FluxboxWindow::iconifyDraw_cb(FluxboxWindow *t, Window w, bool pressed) { + t->drawButtonBase(w, pressed); + XDrawRectangle(t->display, w, + ((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc : + t->screen->getWindowStyle()->b_pic_unfocus_gc), + 2, t->frame.button_h - 5, t->frame.button_w - 5, 2); + +} + +void FluxboxWindow::maximizeDraw_cb(FluxboxWindow *t, Window w, bool pressed) { + t->drawButtonBase(w, pressed); + XDrawRectangle(t->display, w, + ((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc : + t->screen->getWindowStyle()->b_pic_unfocus_gc), + 2, 2, t->frame.button_w - 5, t->frame.button_h - 5); + XDrawLine(t->display, w, + ((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc : + t->screen->getWindowStyle()->b_pic_unfocus_gc), + 2, 3, t->frame.button_w - 3, 3); +} + +void FluxboxWindow::closeDraw_cb(FluxboxWindow *t, Window w, bool pressed) { + t->drawButtonBase(w, pressed); + XDrawLine(t->display, w, + ((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc : + t->screen->getWindowStyle()->b_pic_unfocus_gc), 2, 2, + t->frame.button_w - 3, t->frame.button_h - 3); + XDrawLine(t->display, w, + ((t->focused) ? t->screen->getWindowStyle()->b_pic_focus_gc : + t->screen->getWindowStyle()->b_pic_unfocus_gc), 2, + t->frame.button_h - 3, + t->frame.button_w - 3, 2); +} + +void FluxboxWindow::shadeDraw_cb(FluxboxWindow *t, Window w, bool pressed) { + t->drawButtonBase(w, pressed); +} + +void FluxboxWindow::grabButton(Display *display, unsigned int button, + Window window, Cursor cursor) { + + //numlock + XGrabButton(display, button, Mod1Mask|Mod2Mask, window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, cursor); + //scrolllock + XGrabButton(display, button, Mod1Mask|Mod5Mask, window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, cursor); + + //capslock + XGrabButton(display, button, Mod1Mask|LockMask, window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, cursor); + + //capslock+numlock + XGrabButton(display, Button1, Mod1Mask|LockMask|Mod2Mask, window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, cursor); + + //capslock+scrolllock + XGrabButton(display, button, Mod1Mask|LockMask|Mod5Mask, window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, cursor); + + //capslock+numlock+scrolllock + XGrabButton(display, button, Mod1Mask|LockMask|Mod2Mask|Mod5Mask, window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, cursor); + + //numlock+scrollLock + XGrabButton(display, button, Mod1Mask|Mod2Mask|Mod5Mask, window, True, + ButtonReleaseMask | ButtonMotionMask, GrabModeAsync, + GrabModeAsync, None, cursor); + +} + +void FluxboxWindow::drawButtonBase(Window w, bool pressed) { + if (! pressed) { + if (focused) { + if (frame.fbutton) + XSetWindowBackgroundPixmap(display, w, frame.fbutton); + else + XSetWindowBackground(display, w, frame.fbutton_pixel); + } else { + if (frame.ubutton) + XSetWindowBackgroundPixmap(display, w, frame.ubutton); + else + XSetWindowBackground(display, w, frame.ubutton_pixel); + } + } else { + if (frame.pbutton) + XSetWindowBackgroundPixmap(display, w, frame.pbutton); + else + XSetWindowBackground(display, w, frame.pbutton_pixel); + } + XClearWindow(display, w); + +} + +void FluxboxWindow::positionButtons(bool redecorate_label) { + unsigned int bw = frame.button_w + frame.bevel_w + 1, + by = frame.bevel_w + 1, lx = by, lw = frame.width - by; + Fluxbox *fluxbox = Fluxbox::instance(); + vector<Fluxbox::Titlebar> left = fluxbox->getTitlebarLeft(); + vector<Fluxbox::Titlebar> right = fluxbox->getTitlebarRight(); + + //left side buttons + for (unsigned int i=0; i<left.size(); i++) { + Window w = findTitleButton(left[i]); //get Window of button + if (w) { + XMoveResizeWindow(display, w, lx, by, + frame.button_w, frame.button_h); + XMapWindow(display, w); + XClearWindow(display, w); + lx += bw; + lw -= bw; + } + } + + int bx = frame.width - bw; + + //right side buttons + for (int i=right.size()-1; i>=0; i--) { + Window w = findTitleButton(right[i]); //get window of button + if (w) { + XMoveResizeWindow(display, w, bx, by, + frame.button_w, frame.button_h); + XMapWindow(display, w); + XClearWindow(display, w); + bx -= bw; + lw -= bw; + } + } + + //Draw the label + frame.label_w = lw - by; + XMoveResizeWindow(display, frame.label, lx, frame.bevel_w, + frame.label_w, frame.label_h); + if (redecorate_label) + decorateLabel(); + if (tab) { + tab->setPosition(); + tab->draw(false); + } + redrawLabel(); + redrawAllButtons(); +} + + +void FluxboxWindow::reconfigure(void) { + upsize(); + + if (Fluxbox::instance()->useTabs()) { + //no tab and we allowed to use tab? then create it + if (!tab && decorations.tab) { + tab = new Tab(this, 0, 0); + if (current_state == IconicState) + tab->iconify(); + else if (current_state == WithdrawnState) + tab->withdraw(); + } + } else { + if (tab) { //got a tab? then destroy it + delete tab; + tab=0; + } + } + + client.x = frame.x + frame.mwm_border_w + screen->getBorderWidth(); + client.y = frame.y + frame.y_border + frame.mwm_border_w + + screen->getBorderWidth(); + + if (client.title) { + if (I18n::instance()->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getWindowStyle()->font.set, + client.title, client.title_len, &ink, &logical); + client.title_text_w = logical.width; + } else { + client.title_text_w = XTextWidth(screen->getWindowStyle()->font.fontstruct, + client.title, client.title_len); + } + + client.title_text_w += (frame.bevel_w * 4); + } + + + positionWindows(); + decorate(); + + + XClearWindow(display, frame.window); + setFocusFlag(focused); + + configure(frame.x, frame.y, frame.width, frame.height); + + if (! (screen->isSloppyFocus() || screen->isSemiSloppyFocus())) { + XGrabButton(display, Button1, AnyModifier, frame.plate, True, ButtonPressMask, + GrabModeSync, GrabModeSync, None, None); + XUngrabButton(display, Button1, Mod1Mask|Mod2Mask|Mod3Mask, frame.plate); + } else + XUngrabButton(display, Button1, AnyModifier, frame.plate); + + if (windowmenu) { + windowmenu->move(windowmenu->getX(), frame.y + frame.title_h); + windowmenu->reconfigure(); + } + + +} + + +void FluxboxWindow::positionWindows(void) { + XResizeWindow(display, frame.window, frame.width, + ((shaded) ? frame.title_h : frame.height)); + XSetWindowBorderWidth(display, frame.window, screen->getBorderWidth()); + XSetWindowBorderWidth(display, frame.plate, screen->getFrameWidth() * + decorations.border); + XMoveResizeWindow(display, frame.plate, 0, frame.y_border, + client.width, client.height); + XMoveResizeWindow(display, client.window, 0, 0, client.width, client.height); + + if (decorations.titlebar) { + XSetWindowBorderWidth(display, frame.title, screen->getBorderWidth()); + XMoveResizeWindow(display, frame.title, -screen->getBorderWidth(), + -screen->getBorderWidth(), frame.width, frame.title_h); + + positionButtons(); + } else if (frame.title) + XUnmapWindow(display, frame.title); + + if (decorations.handle) { + XSetWindowBorderWidth(display, frame.handle, screen->getBorderWidth()); + XSetWindowBorderWidth(display, frame.left_grip, screen->getBorderWidth()); + XSetWindowBorderWidth(display, frame.right_grip, screen->getBorderWidth()); + + XMoveResizeWindow(display, frame.handle, -screen->getBorderWidth(), + frame.y_handle - screen->getBorderWidth(), + frame.width, frame.handle_h); + XMoveResizeWindow(display, frame.left_grip, -screen->getBorderWidth(), + -screen->getBorderWidth(), frame.grip_w, frame.grip_h); + XMoveResizeWindow(display, frame.right_grip, + frame.width - frame.grip_w - screen->getBorderWidth(), + -screen->getBorderWidth(), frame.grip_w, frame.grip_h); + XMapSubwindows(display, frame.handle); + } else if (frame.handle) + XUnmapWindow(display, frame.handle); + if (tab) + tab->setPosition(); +} + + +void FluxboxWindow::getWMName(void) { + if (client.title) { + delete [] client.title; + client.title = 0; + } + + XTextProperty text_prop; + char **list; + int num; + I18n *i18n = I18n::instance(); + + if (XGetWMName(display, client.window, &text_prop)) { + if (text_prop.value && text_prop.nitems > 0) { + if (text_prop.encoding != XA_STRING) { + + text_prop.nitems = strlen((char *) text_prop.value); + + if ((XmbTextPropertyToTextList(display, &text_prop, + &list, &num) == Success) && + (num > 0) && *list) { + client.title = bstrdup(*list); + XFreeStringList(list); + } else + client.title = bstrdup((char *) text_prop.value); + + } else + client.title = bstrdup((char *) text_prop.value); + + XFree((char *) text_prop.value); + } else + client.title = bstrdup(i18n->getMessage( +#ifdef NLS + WindowSet, WindowUnnamed, +#else // !NLS + 0, 0, +#endif // + "Unnamed")); + } else { + client.title = bstrdup(i18n->getMessage( +#ifdef NLS + WindowSet, WindowUnnamed, +#else // !NLS + 0, 0, +#endif // + "Unnamed")); + } + + client.title_len = strlen(client.title); + + if (i18n->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(screen->getWindowStyle()->font.set, + client.title, client.title_len, &ink, &logical); + client.title_text_w = logical.width; + } else { + client.title_len = strlen(client.title); + client.title_text_w = XTextWidth(screen->getWindowStyle()->font.fontstruct, + client.title, client.title_len); + } + + client.title_text_w += (frame.bevel_w * 4); +} + + +void FluxboxWindow::getWMIconName(void) { + if (client.icon_title) { + delete [] client.icon_title; + client.icon_title = (char *) 0; + } + + XTextProperty text_prop; + char **list; + int num; + + if (XGetWMIconName(display, client.window, &text_prop)) { + if (text_prop.value && text_prop.nitems > 0) { + if (text_prop.encoding != XA_STRING) { + text_prop.nitems = strlen((char *) text_prop.value); + + if ((XmbTextPropertyToTextList(display, &text_prop, + &list, &num) == Success) && + (num > 0) && *list) { + client.icon_title = bstrdup(*list); + XFreeStringList(list); + } else + client.icon_title = bstrdup((char *) text_prop.value); + } else + client.icon_title = bstrdup((char *) text_prop.value); + + XFree((char *) text_prop.value); + } else + client.icon_title = bstrdup(client.title); + } else + client.icon_title = bstrdup(client.title); +} + + +void FluxboxWindow::getWMProtocols(void) { + Atom *proto; + int num_return = 0; + Fluxbox *fluxbox = Fluxbox::instance(); + + if (XGetWMProtocols(display, client.window, &proto, &num_return)) { + for (int i = 0; i < num_return; ++i) { + if (proto[i] == fluxbox->getWMDeleteAtom()) + functions.close = decorations.close = true; + else if (proto[i] == fluxbox->getWMTakeFocusAtom()) + send_focus_message = true; + else if (proto[i] == fluxbox->getFluxboxStructureMessagesAtom()) + screen->addNetizen(new Netizen(screen, client.window)); + } + + XFree(proto); + } +} + + +void FluxboxWindow::getWMHints(void) { + XWMHints *wmhint = XGetWMHints(display, client.window); + if (! wmhint) { + visible = true; + iconic = false; + focus_mode = F_Passive; + client.window_group = None; + client.initial_state = NormalState; + } else { + client.wm_hint_flags = wmhint->flags; + if (wmhint->flags & InputHint) { + if (wmhint->input == true) { + if (send_focus_message) + focus_mode = F_LocallyActive; + else + focus_mode = F_Passive; + } else { + if (send_focus_message) + focus_mode = F_GloballyActive; + else + focus_mode = F_NoInput; + } + } else + focus_mode = F_Passive; + + if (wmhint->flags & StateHint) + client.initial_state = wmhint->initial_state; + else + client.initial_state = NormalState; + + if (wmhint->flags & WindowGroupHint) { + if (! client.window_group) { + client.window_group = wmhint->window_group; + Fluxbox::instance()->saveGroupSearch(client.window_group, this); + } + } else + client.window_group = None; + + XFree(wmhint); + } +} + + +void FluxboxWindow::getWMNormalHints(void) { + long icccm_mask; + XSizeHints sizehint; + if (! XGetWMNormalHints(display, client.window, &sizehint, &icccm_mask)) { + 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.min_aspect_x = client.min_aspect_y = + client.max_aspect_x = client.max_aspect_y = 1; + client.win_gravity = NorthWestGravity; + } else { + client.normal_hint_flags = sizehint.flags; + + if (sizehint.flags & PMinSize) { + client.min_width = sizehint.min_width; + client.min_height = sizehint.min_height; + } else + client.min_width = client.min_height = 1; + + if (sizehint.flags & PMaxSize) { + client.max_width = sizehint.max_width; + client.max_height = sizehint.max_height; + } else { + client.max_width = screen->getWidth(); + client.max_height = screen->getHeight(); + } + + if (sizehint.flags & PResizeInc) { + client.width_inc = sizehint.width_inc; + client.height_inc = sizehint.height_inc; + } else + client.width_inc = client.height_inc = 1; + + if (sizehint.flags & PAspect) { + client.min_aspect_x = sizehint.min_aspect.x; + client.min_aspect_y = sizehint.min_aspect.y; + client.max_aspect_x = sizehint.max_aspect.x; + client.max_aspect_y = sizehint.max_aspect.y; + } else + client.min_aspect_x = client.min_aspect_y = + client.max_aspect_x = client.max_aspect_y = 1; + + if (sizehint.flags & PBaseSize) { + client.base_width = sizehint.base_width; + client.base_height = sizehint.base_height; + } else + client.base_width = client.base_height = 0; + + if (sizehint.flags & PWinGravity) + client.win_gravity = sizehint.win_gravity; + else + client.win_gravity = NorthWestGravity; + } +} + + +void FluxboxWindow::getMWMHints(void) { + int format; + Atom atom_return; + unsigned long num, len; + Fluxbox *fluxbox = Fluxbox::instance(); + if (XGetWindowProperty(display, client.window, + fluxbox->getMotifWMHintsAtom(), 0, + PropMwmHintsElements, false, + fluxbox->getMotifWMHintsAtom(), &atom_return, + &format, &num, &len, + (unsigned char **) &client.mwm_hint) == Success && + client.mwm_hint) + if (num == PropMwmHintsElements) { + 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.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; + } + + if (client.mwm_hint->flags & MwmHintsFunctions) + if (client.mwm_hint->functions & MwmFuncAll) + functions.resize = functions.move = functions.iconify = + functions.maximize = functions.close = true; + else { + functions.resize = functions.move = functions.iconify = + functions.maximize = functions.close = false; + + if (client.mwm_hint->functions & MwmFuncResize) + functions.resize = true; + if (client.mwm_hint->functions & MwmFuncMove) + functions.move = true; + if (client.mwm_hint->functions & MwmFuncIconify) + functions.iconify = true; + if (client.mwm_hint->functions & MwmFuncMaximize) + functions.maximize = true; + if (client.mwm_hint->functions & MwmFuncClose) + functions.close = true; + } + } +} + + +void FluxboxWindow::getBlackboxHints(void) { + int format; + Atom atom_return; + unsigned long num, len; + Fluxbox *fluxbox = Fluxbox::instance(); + + if (XGetWindowProperty(display, client.window, + fluxbox->getFluxboxHintsAtom(), 0, + PropBlackboxHintsElements, false, + fluxbox->getFluxboxHintsAtom(), &atom_return, + &format, &num, &len, + (unsigned char **) &client.blackbox_hint) == Success && + client.blackbox_hint) + if (num == PropBlackboxHintsElements) { + if (client.blackbox_hint->flags & AttribShaded) + shaded = (client.blackbox_hint->attrib & AttribShaded); + + if ((client.blackbox_hint->flags & AttribMaxHoriz) && + (client.blackbox_hint->flags & AttribMaxVert)) + maximized = ((client.blackbox_hint->attrib & + (AttribMaxHoriz | AttribMaxVert)) ? 1 : 0); + else if (client.blackbox_hint->flags & AttribMaxVert) + maximized = ((client.blackbox_hint->attrib & AttribMaxVert) ? 2 : 0); + else if (client.blackbox_hint->flags & AttribMaxHoriz) + maximized = ((client.blackbox_hint->attrib & AttribMaxHoriz) ? 3 : 0); + + if (client.blackbox_hint->flags & AttribOmnipresent) + stuck = (client.blackbox_hint->attrib & AttribOmnipresent); + + if (client.blackbox_hint->flags & AttribWorkspace) + workspace_number = client.blackbox_hint->workspace; + + + if (client.blackbox_hint->flags & AttribDecoration) { + switch (client.blackbox_hint->decoration) { + case DecorNone: + decorations.titlebar = decorations.border = decorations.handle = + decorations.iconify = decorations.maximize = + decorations.menu = false; + functions.resize = functions.move = functions.iconify = + functions.maximize = false; + + break; + + default: + case DecorNormal: + decorations.titlebar = decorations.border = decorations.handle = + decorations.iconify = decorations.maximize = + decorations.menu = true; + functions.resize = functions.move = functions.iconify = + functions.maximize = true; + + break; + + case DecorTiny: + decorations.titlebar = decorations.iconify = decorations.menu = + functions.move = functions.iconify = true; + decorations.border = decorations.handle = decorations.maximize = + functions.resize = functions.maximize = false; + + break; + + case DecorTool: + decorations.titlebar = decorations.menu = functions.move = true; + decorations.iconify = decorations.border = decorations.handle = + decorations.maximize = functions.resize = functions.maximize = + functions.iconify = false; + + break; + } + + reconfigure(); + } + } +} + + +void FluxboxWindow::configure(int dx, int dy, + unsigned int dw, unsigned int dh) { + bool send_event = (frame.x != dx || frame.y != dy); + + if ((dw != frame.width) || (dh != frame.height)) { + if ((((signed) frame.width) + dx) < 0) dx = 0; + if ((((signed) frame.height) + dy) < 0) dy = 0; + + frame.x = dx; + frame.y = dy; + frame.width = dw; + frame.height = dh; + + downsize(); + +#ifdef SHAPE + if (Fluxbox::instance()->hasShapeExtensions() && frame.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 + screen->getBorderWidth(); + num++; + } + + XShapeCombineRectangles(display, frame.window, ShapeBounding, 0, 0, + xrect, num, ShapeUnion, Unsorted); + } +#endif // SHAPE + + XMoveResizeWindow(display, frame.window, frame.x, frame.y, + frame.width, frame.height); + positionWindows(); + decorate(); + setFocusFlag(focused); + redrawAllButtons(); + shaded = false; + } else { + frame.x = dx; + frame.y = dy; + + XMoveWindow(display, frame.window, frame.x, frame.y); + //move the tab and the chain + if (tab) + tab->setPosition(); + + if (! moving) send_event = true; + } + + if (send_event && ! moving) { + client.x = dx + frame.mwm_border_w + screen->getBorderWidth(); + client.y = dy + frame.y_border + frame.mwm_border_w + + screen->getBorderWidth(); + + XEvent event; + event.type = ConfigureNotify; + + event.xconfigure.display = display; + event.xconfigure.event = client.window; + event.xconfigure.window = client.window; + 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; + + XSendEvent(display, client.window, True, NoEventMask, &event); + + screen->updateNetizenConfigNotify(&event); + } +} + + +bool FluxboxWindow::setInputFocus(void) { + if (((signed) (frame.x + frame.width)) < 0) { + if (((signed) (frame.y + frame.y_border)) < 0) + configure(screen->getBorderWidth(), screen->getBorderWidth(), + frame.width, frame.height); + else if (frame.y > (signed) screen->getHeight()) + configure(screen->getBorderWidth(), screen->getHeight() - frame.height, + frame.width, frame.height); + else + configure(screen->getBorderWidth(), frame.y + screen->getBorderWidth(), + frame.width, frame.height); + } else if (frame.x > (signed) screen->getWidth()) { + if (((signed) (frame.y + frame.y_border)) < 0) + configure(screen->getWidth() - frame.width, screen->getBorderWidth(), + 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 + configure(screen->getWidth() - frame.width, + frame.y + screen->getBorderWidth(), frame.width, frame.height); + } + + Fluxbox *fluxbox = Fluxbox::instance(); + + fluxbox->grab(); + if (! validateClient()) return false; + + bool ret = false; + + if (client.transient && modal) + ret = client.transient->setInputFocus(); + else { + if (! focused) { + if (focus_mode == F_LocallyActive || focus_mode == F_Passive) + XSetInputFocus(display, client.window, + RevertToPointerRoot, CurrentTime); + else + XSetInputFocus(display, screen->getRootWindow(), + RevertToNone, CurrentTime); + + fluxbox->setFocusedWindow(this); + + if (send_focus_message) { + XEvent ce; + ce.xclient.type = ClientMessage; + ce.xclient.message_type = fluxbox->getWMProtocolsAtom(); + ce.xclient.display = display; + ce.xclient.window = client.window; + ce.xclient.format = 32; + ce.xclient.data.l[0] = fluxbox->getWMTakeFocusAtom(); + ce.xclient.data.l[1] = fluxbox->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->isSemiSloppyFocus()) + && screen->doAutoRaise()) + timer->start(); + + ret = true; + } + } + + fluxbox->ungrab(); + + return ret; +} + +//------------ setTab -------------- +// Enables or disables the tab on the window +//---------------------------------- +void FluxboxWindow::setTab(bool flag) { + if (flag) { + if (!tab) + tab = new Tab(this, 0, 0); + } else if (tab) { + delete tab; + tab = 0; + } + decorations.tab = flag; +} + +void FluxboxWindow::iconify(void) { + if (iconic) return; + + if (windowmenu) + windowmenu->hide(); + + setState(IconicState); + + XSelectInput(display, client.window, NoEventMask); + XUnmapWindow(display, client.window); + XSelectInput(display, client.window, + PropertyChangeMask | StructureNotifyMask | FocusChangeMask); + + XUnmapWindow(display, frame.window); + visible = false; + iconic = true; + + screen->getWorkspace(workspace_number)->removeWindow(this); + + if (transient && client.transient_for) { + if (! client.transient_for->iconic) + client.transient_for->iconify(); + } + screen->addIcon(this); + + if (tab) //if this window got a tab then iconify it too + tab->iconify(); + + if (client.transient) + if (! client.transient->iconic) + client.transient->iconify(); +} + + +void FluxboxWindow::deiconify(bool reassoc, bool raise) { + if (iconic || reassoc) + screen->reassociateWindow(this, -1, false); + else if (workspace_number != screen->getCurrentWorkspace()->getWorkspaceID()) + return; + + setState(NormalState); + + 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 (iconic && screen->doFocusNew()) setInputFocus(); + + visible = true; + iconic = false; + + if (reassoc && client.transient) client.transient->deiconify(true, false); + + if (tab) + tab->deiconify(); + + if (raise) { + screen->getWorkspace(workspace_number)->raiseWindow(this); + if (tab) + tab->raise(); + } +} + + +void FluxboxWindow::close(void) { + Fluxbox *fluxbox = Fluxbox::instance(); + XEvent ce; + ce.xclient.type = ClientMessage; + ce.xclient.message_type = fluxbox->getWMProtocolsAtom(); + ce.xclient.display = display; + ce.xclient.window = client.window; + ce.xclient.format = 32; + ce.xclient.data.l[0] = fluxbox->getWMDeleteAtom(); + ce.xclient.data.l[1] = CurrentTime; + 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); +} + + +void FluxboxWindow::withdraw(void) { + visible = false; + iconic = false; + + setState(WithdrawnState); + XUnmapWindow(display, frame.window); + + XSelectInput(display, client.window, NoEventMask); + XUnmapWindow(display, client.window); + XSelectInput(display, client.window, + PropertyChangeMask | StructureNotifyMask | FocusChangeMask); + + if (windowmenu) + windowmenu->hide(); + + if (tab) + tab->withdraw(); +} + + +void FluxboxWindow::maximize(unsigned int button) { + if (! maximized) { + int dx, dy; + unsigned int dw, dh; + + blackbox_attrib.premax_x = frame.x; + blackbox_attrib.premax_y = frame.y; + blackbox_attrib.premax_w = frame.width; + blackbox_attrib.premax_h = frame.height; + + dw = screen->getWidth(); + dw -= screen->getBorderWidth2x(); + dw -= frame.mwm_border_w * 2; + dw -= client.base_width; + + dh = screen->getHeight(); + dh -= screen->getBorderWidth2x(); + dh -= frame.mwm_border_w * 2; + dh -= ((frame.handle_h + screen->getBorderWidth()) * decorations.handle); + dh -= client.base_height; + dh -= frame.y_border; + + if (! screen->doFullMax()) + dh -= screen->getToolbar()->getExposedHeight() + + screen->getBorderWidth(); + + 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; + + dw -= (dw % client.width_inc); + dw += client.base_width; + dh -= (dh % client.height_inc); + dh += client.base_height; + + dw += frame.mwm_border_w * 2; + + dh += frame.y_border; + dh += (frame.handle_h + screen->getBorderWidth()); + dh += frame.mwm_border_w * 2; + + dx = ((screen->getWidth() - dw) / 2) - screen->getBorderWidth(); + + if (screen->doFullMax()) { + dy = ((screen->getHeight() - dh) / 2) - screen->getBorderWidth(); + } else { + dy = (((screen->getHeight() - screen->getToolbar()->getExposedHeight()) + - dh) / 2) - screen->getBorderWidth(); + + switch (screen->getToolbarPlacement()) { + case Toolbar::TopLeft: + case Toolbar::TopCenter: + case Toolbar::TopRight: + dy += screen->getToolbar()->getExposedHeight() + + screen->getBorderWidth(); + break; + } + } + + if (decorations.tab && Fluxbox::instance()->useTabs()) { // Want to se the tabs + switch(screen->getTabPlacement()) { + case Tab::PTop: + dy += Fluxbox::instance()->getTabHeight(); + dh -= Fluxbox::instance()->getTabHeight() + screen->getBorderWidth(); + break; + case Tab::PLeft: + if (screen->isTabRotateVertical()) { + dx += Fluxbox::instance()->getTabHeight(); + dw -= Fluxbox::instance()->getTabHeight(); + } else { + dx += Fluxbox::instance()->getTabWidth(); + dw -= Fluxbox::instance()->getTabWidth(); + } + break; + case Tab::PRight: + if (screen->isTabRotateVertical()) + dw -= Fluxbox::instance()->getTabHeight(); + else + dw -= Fluxbox::instance()->getTabWidth(); + break; + case Tab::PBottom: + dh -= Fluxbox::instance()->getTabHeight() + screen->getBorderWidth(); + break; + default: + dy += Fluxbox::instance()->getTabHeight(); + dh -= Fluxbox::instance()->getTabHeight() + screen->getBorderWidth(); + break; + } + } + + if (button == 2) { //expand max width + dw = frame.width; + dx = frame.x; + } else if (button == 3) { //expand max height + dh = frame.height; + dy = frame.y; + } + + switch(button) { + case 1: + blackbox_attrib.flags |= AttribMaxHoriz | AttribMaxVert; + blackbox_attrib.attrib |= AttribMaxHoriz | AttribMaxVert; + + break; + + case 2: + blackbox_attrib.flags |= AttribMaxVert; + blackbox_attrib.attrib |= AttribMaxVert; + + break; + + case 3: + blackbox_attrib.flags |= AttribMaxHoriz; + blackbox_attrib.attrib |= AttribMaxHoriz; + + break; + } + + if (shaded) { + blackbox_attrib.flags ^= AttribShaded; + blackbox_attrib.attrib ^= AttribShaded; + shaded = false; + } + + maximized = true; + + configure(dx, dy, dw, dh); + if (tab) + tab->raise(); + screen->getWorkspace(workspace_number)->raiseWindow(this); + setState(current_state); + } else { + maximized = false; + + blackbox_attrib.flags &= ! (AttribMaxHoriz | AttribMaxVert); + blackbox_attrib.attrib &= ! (AttribMaxHoriz | AttribMaxVert); + + configure(blackbox_attrib.premax_x, blackbox_attrib.premax_y, + blackbox_attrib.premax_w, blackbox_attrib.premax_h); + + blackbox_attrib.premax_x = blackbox_attrib.premax_y = 0; + blackbox_attrib.premax_w = blackbox_attrib.premax_h = 0; + + redrawAllButtons(); + setState(current_state); + } + if (tab) //resize all the windows in the tab group + tab->resize(); +} + + +void FluxboxWindow::setWorkspace(int n) { + workspace_number = n; + + blackbox_attrib.flags |= AttribWorkspace; + blackbox_attrib.workspace = workspace_number; +} + + +void FluxboxWindow::shade(void) { + if (decorations.titlebar) + if (shaded) { + XResizeWindow(display, frame.window, frame.width, frame.height); + shaded = false; + blackbox_attrib.flags ^= AttribShaded; + blackbox_attrib.attrib ^= AttribShaded; + + setState(NormalState); + } else { + XResizeWindow(display, frame.window, frame.width, frame.title_h); + shaded = true; + blackbox_attrib.flags |= AttribShaded; + blackbox_attrib.attrib |= AttribShaded; + + setState(IconicState); + } +} + + +void FluxboxWindow::stick(void) { + + if (tab) //if it got a tab then do tab's stick on all of the objects in the list + tab->stick(); //this window will stick too. + else if (stuck) { + blackbox_attrib.flags ^= AttribOmnipresent; + blackbox_attrib.attrib ^= AttribOmnipresent; + + stuck = false; + + if (! iconic) + screen->reassociateWindow(this, -1, true); + + + } else { + stuck = true; + + blackbox_attrib.flags |= AttribOmnipresent; + blackbox_attrib.attrib |= AttribOmnipresent; + + } + + setState(current_state); +} + + +void FluxboxWindow::setFocusFlag(bool focus) { + focused = focus; + + if (decorations.titlebar) { + if (focused) { + if (frame.ftitle) + XSetWindowBackgroundPixmap(display, frame.title, frame.ftitle); + else + XSetWindowBackground(display, frame.title, frame.ftitle_pixel); + } else { + if (frame.utitle) + XSetWindowBackgroundPixmap(display, frame.title, frame.utitle); + else + XSetWindowBackground(display, frame.title, frame.utitle_pixel); + } + XClearWindow(display, frame.title); + + redrawLabel(); + redrawAllButtons(); + } + + if (decorations.handle) { + if (focused) { + if (frame.fhandle) + XSetWindowBackgroundPixmap(display, frame.handle, frame.fhandle); + else + XSetWindowBackground(display, frame.handle, frame.fhandle_pixel); + + if (frame.fgrip) { + XSetWindowBackgroundPixmap(display, frame.right_grip, frame.fgrip); + XSetWindowBackgroundPixmap(display, frame.left_grip, frame.fgrip); + } else { + XSetWindowBackground(display, frame.right_grip, frame.fgrip_pixel); + XSetWindowBackground(display, frame.left_grip, frame.fgrip_pixel); + } + } else { + if (frame.uhandle) + XSetWindowBackgroundPixmap(display, frame.handle, frame.uhandle); + else + XSetWindowBackground(display, frame.handle, frame.uhandle_pixel); + + if (frame.ugrip) { + XSetWindowBackgroundPixmap(display, frame.right_grip, frame.ugrip); + XSetWindowBackgroundPixmap(display, frame.left_grip, frame.ugrip); + } else { + XSetWindowBackground(display, frame.right_grip, frame.ugrip_pixel); + XSetWindowBackground(display, frame.left_grip, frame.ugrip_pixel); + } + } + XClearWindow(display, frame.handle); + XClearWindow(display, frame.right_grip); + XClearWindow(display, frame.left_grip); + } + + if (tab) + tab->focus(); + + if (decorations.border) { + if (focused) + XSetWindowBorder(display, frame.plate, frame.fborder_pixel); + else + XSetWindowBorder(display, frame.plate, frame.uborder_pixel); + } + + if ((screen->isSloppyFocus() || screen->isSemiSloppyFocus()) && + screen->doAutoRaise()) + timer->stop(); +} + + +void FluxboxWindow::installColormap(bool install) { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->grab(); + if (! validateClient()) return; + + int i = 0, ncmap = 0; + Colormap *cmaps = XListInstalledColormaps(display, client.window, &ncmap); + XWindowAttributes wattrib; + if (cmaps) { + 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; + break; //end for-loop (we dont need to check more) + } + } + // otherwise, install the window's colormap + if (install) + XInstallColormap(display, wattrib.colormap); + } else { + for (i = 0; i < ncmap; i++) // uninstall the window's colormap + if (*(cmaps + i) == wattrib.colormap) + XUninstallColormap(display, wattrib.colormap); // we found the colormap to uninstall + } + } + + XFree(cmaps); + } + + fluxbox->ungrab(); +} + + +void FluxboxWindow::setState(unsigned long new_state) { + current_state = new_state; + Fluxbox *fluxbox = Fluxbox::instance(); + unsigned long state[2]; + state[0] = (unsigned long) current_state; + state[1] = (unsigned long) None; + XChangeProperty(display, client.window, fluxbox->getWMStateAtom(), + fluxbox->getWMStateAtom(), 32, PropModeReplace, + (unsigned char *) state, 2); + + XChangeProperty(display, client.window, fluxbox->getFluxboxAttributesAtom(), + fluxbox->getFluxboxAttributesAtom(), 32, PropModeReplace, + (unsigned char *) &blackbox_attrib, PropBlackboxAttributesElements); +} + + +bool FluxboxWindow::getState(void) { + current_state = 0; + + Atom atom_return; + bool ret = false; + int foo; + unsigned long *state, ulfoo, nitems; + Fluxbox *fluxbox = Fluxbox::instance(); + if ((XGetWindowProperty(display, client.window, fluxbox->getWMStateAtom(), + 0l, 2l, false, fluxbox->getWMStateAtom(), + &atom_return, &foo, &nitems, &ulfoo, + (unsigned char **) &state) != Success) || + (! state)) { + fluxbox->ungrab(); + return false; + } + + if (nitems >= 1) { + current_state = static_cast<unsigned long>(state[0]); + ret = true; + } + + XFree(static_cast<void *>(state)); + + return ret; +} + + +void FluxboxWindow::setGravityOffsets(void) { + // translate x coordinate + switch (client.win_gravity) { + // handle Westward gravity + case NorthWestGravity: + case WestGravity: + case SouthWestGravity: + default: + frame.x = client.x; + break; + + // handle Eastward gravity + case NorthEastGravity: + case EastGravity: + case SouthEastGravity: + frame.x = (client.x + client.width) - frame.width; + break; + + // no x translation desired - default + case StaticGravity: + case ForgetGravity: + case CenterGravity: + frame.x = client.x - frame.mwm_border_w + screen->getBorderWidth(); + } + + // translate y coordinate + switch (client.win_gravity) { + // handle Northbound gravity + case NorthWestGravity: + case NorthGravity: + case NorthEastGravity: + default: + frame.y = client.y; + break; + + // handle Southbound gravity + case SouthWestGravity: + case SouthGravity: + case SouthEastGravity: + frame.y = (client.y + client.height) - frame.height; + break; + + // no y translation desired - default + case StaticGravity: + case ForgetGravity: + case CenterGravity: + frame.y = client.y - frame.y_border - frame.mwm_border_w - + screen->getBorderWidth(); + break; + } +} + + +void FluxboxWindow::restoreAttributes(void) { + if (! getState()) current_state = NormalState; + + Atom atom_return; + int foo; + unsigned long ulfoo, nitems; + Fluxbox *fluxbox = Fluxbox::instance(); + + BlackboxAttributes *net; + if (XGetWindowProperty(display, client.window, + fluxbox->getFluxboxAttributesAtom(), 0l, + PropBlackboxAttributesElements, false, + fluxbox->getFluxboxAttributesAtom(), &atom_return, &foo, + &nitems, &ulfoo, (unsigned char **) &net) == + Success && net && nitems == PropBlackboxAttributesElements) { + blackbox_attrib.flags = net->flags; + blackbox_attrib.attrib = net->attrib; + blackbox_attrib.workspace = net->workspace; + blackbox_attrib.stack = net->stack; + blackbox_attrib.premax_x = net->premax_x; + blackbox_attrib.premax_y = net->premax_y; + blackbox_attrib.premax_w = net->premax_w; + blackbox_attrib.premax_h = net->premax_h; + + XFree(static_cast<void *>(net)); + } else + return; + + if (blackbox_attrib.flags & AttribShaded && + blackbox_attrib.attrib & AttribShaded) { + int save_state = + ((current_state == IconicState) ? NormalState : current_state); + + shaded = false; + shade(); + if (tab) + tab->shade(); + + current_state = save_state; + } + + if (((int) blackbox_attrib.workspace != screen->getCurrentWorkspaceID()) && + ((int) blackbox_attrib.workspace < screen->getCount())) { + screen->reassociateWindow(this, blackbox_attrib.workspace, true); + + if (current_state == NormalState) current_state = WithdrawnState; + } else if (current_state == WithdrawnState) + current_state = NormalState; + + if (blackbox_attrib.flags & AttribOmnipresent && + blackbox_attrib.attrib & AttribOmnipresent) { + stuck = false; + stick(); + + current_state = NormalState; + } + + if ((blackbox_attrib.flags & AttribMaxHoriz) || + (blackbox_attrib.flags & AttribMaxVert)) { + int x = blackbox_attrib.premax_x, y = blackbox_attrib.premax_y; + unsigned int w = blackbox_attrib.premax_w, h = blackbox_attrib.premax_h; + maximized = false; + + int m; + if ((blackbox_attrib.flags & AttribMaxHoriz) && + (blackbox_attrib.flags & AttribMaxVert)) + m = ((blackbox_attrib.attrib & (AttribMaxHoriz | AttribMaxVert)) ? + 1 : 0); + else if (blackbox_attrib.flags & AttribMaxVert) + m = ((blackbox_attrib.attrib & AttribMaxVert) ? 2 : 0); + else if (blackbox_attrib.flags & AttribMaxHoriz) + m = ((blackbox_attrib.attrib & AttribMaxHoriz) ? 3 : 0); + else + m = 0; + + if (m) maximize(m); + + blackbox_attrib.premax_x = x; + blackbox_attrib.premax_y = y; + blackbox_attrib.premax_w = w; + blackbox_attrib.premax_h = h; + } + + setState(current_state); +} + + +void FluxboxWindow::restoreGravity(void) { + // restore x coordinate + switch (client.win_gravity) { + // handle Westward gravity + case NorthWestGravity: + case WestGravity: + case SouthWestGravity: + default: + client.x = frame.x; + break; + + // handle Eastward gravity + case NorthEastGravity: + case EastGravity: + case SouthEastGravity: + client.x = (frame.x + frame.width) - client.width; + break; + } + + // restore y coordinate + switch (client.win_gravity) { + // handle Northbound gravity + case NorthWestGravity: + case NorthGravity: + case NorthEastGravity: + default: + client.y = frame.y; + break; + + // handle Southbound gravity + case SouthWestGravity: + case SouthGravity: + case SouthEastGravity: + client.y = (frame.y + frame.height) - client.height; + break; + } +} + + +void FluxboxWindow::redrawLabel(void) { + if (focused) { + if (frame.flabel) + XSetWindowBackgroundPixmap(display, frame.label, frame.flabel); + else + XSetWindowBackground(display, frame.label, frame.flabel_pixel); + } else { + if (frame.ulabel) + XSetWindowBackgroundPixmap(display, frame.label, frame.ulabel); + else + XSetWindowBackground(display, frame.label, frame.ulabel_pixel); + } + + GC gc = ((focused) ? screen->getWindowStyle()->l_text_focus_gc : + screen->getWindowStyle()->l_text_unfocus_gc); + + DrawString(display, frame.label, gc, + &screen->getWindowStyle()->font, + client.title_text_w, frame.label_w, + frame.bevel_w, client.title); + + +} + + +void FluxboxWindow::redrawAllButtons(void) { + for (unsigned int i=0; i<buttonlist.size(); i++) + if (buttonlist[i].draw) + buttonlist[i].draw(this, buttonlist[i].win, false); + +} + +void FluxboxWindow::mapRequestEvent(XMapRequestEvent *re) { + if (re->window == client.window) { +#ifdef DEBUG + fprintf(stderr, + I18n::instance()->getMessage( +#ifdef NLS + WindowSet, WindowMapRequest, +#else // !NLS + 0, 0, +#endif // NLS + "FluxboxWindow::mapRequestEvent() for 0x%lx\n"), + client.window); +#endif // DEBUG + Fluxbox *fluxbox = Fluxbox::instance(); + + fluxbox->grab(); + if (! validateClient()) return; + + bool get_state_ret = getState(); + if (! (get_state_ret && fluxbox->isStartup())) { + if ((client.wm_hint_flags & StateHint) && + (! (current_state == NormalState || current_state == IconicState))) + current_state = client.initial_state; + else + current_state = NormalState; + } else if (iconic) + current_state = NormalState; + + switch (current_state) { + case IconicState: + iconify(); + + break; + + case WithdrawnState: + withdraw(); + + break; + + case NormalState: + case InactiveState: + case ZoomState: + default: + deiconify(false); + + break; + } + + fluxbox->ungrab(); + } +} + + +void FluxboxWindow::mapNotifyEvent(XMapEvent *ne) { + + if ((ne->window == client.window) && (! ne->override_redirect) && (visible)) { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->grab(); + if (! validateClient()) + return; + + if (decorations.titlebar) + positionButtons(); + + setState(NormalState); + + redrawAllButtons(); + + if (transient || screen->doFocusNew()) + setInputFocus(); + else + setFocusFlag(false); + + + visible = true; + iconic = false; + + fluxbox->ungrab(); + } +} + + +void FluxboxWindow::unmapNotifyEvent(XUnmapEvent *ue) { + if (ue->window == client.window) { +#ifdef DEBUG + fprintf(stderr, + I18n::instance()->getMessage( +#ifdef NLS + WindowSet, WindowUnmapNotify, +#else // !NLS + 0, 0, +#endif // NLS + "FluxboxWindow::unmapNotifyEvent() for 0x%lx\n"), + client.window); +#endif // DEBUG + + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->grab(); + if (! validateClient()) return; + + XChangeSaveSet(display, client.window, SetModeDelete); + XSelectInput(display, client.window, NoEventMask); + + XDeleteProperty(display, client.window, fluxbox->getWMStateAtom()); + XDeleteProperty(display, client.window, fluxbox->getFluxboxAttributesAtom()); + + XUnmapWindow(display, frame.window); + XUnmapWindow(display, client.window); + + XEvent dummy; + if (! XCheckTypedWindowEvent(display, client.window, ReparentNotify, + &dummy)) { +#ifdef DEBUG + fprintf(stderr, + I18n::instance()->getMessage( +#ifdef NLS + WindowSet, WindowUnmapNotifyReparent, +#else // !NLS + 0, 0, +#endif // NLS + "FluxboxWindow::unmapNotifyEvent(): reparent 0x%lx to " + "root.\n"), client.window); +#endif // DEBUG + + restoreGravity(); + XReparentWindow(display, client.window, screen->getRootWindow(), + client.x, client.y); + } + + XFlush(display); + + fluxbox->ungrab(); + + delete this; + } +} + + +void FluxboxWindow::destroyNotifyEvent(XDestroyWindowEvent *de) { + if (de->window == client.window) { + #ifdef DEBUG + fprintf(stderr,"%s(%d): DestroyNotifyEvent this=%p\n", __FILE__, __LINE__, this); + #endif + XUnmapWindow(display, frame.window); + delete this; + } +} + + +void FluxboxWindow::propertyNotifyEvent(Atom atom) { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->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: + // determine if this is a transient window + Window win; + if (XGetTransientForHint(display, client.window, &win)) { + if (win && (win != client.window)) + if ((client.transient_for = fluxbox->searchWindow(win))) { + client.transient_for->client.transient = this; + stuck = client.transient_for->stuck; + transient = true; + } else if (win == client.window_group) { + //jr This doesn't look quite right... + if ((client.transient_for = fluxbox->searchGroup(win, this))) { + client.transient_for->client.transient = this; + stuck = client.transient_for->stuck; + transient = true; + } + } + + if (win == screen->getRootWindow()) modal = true; + } + + // adjust the window decorations based on transience + if (transient) + decorations.maximize = decorations.handle = + decorations.border = functions.maximize = false; + + reconfigure(); + + break; + + case XA_WM_HINTS: + getWMHints(); + break; + + case XA_WM_ICON_NAME: + getWMIconName(); + if (iconic) screen->iconUpdate(); + break; + + case XA_WM_NAME: + getWMName(); + + if (decorations.titlebar) + redrawLabel(); + + if (! iconic) + screen->getWorkspace(workspace_number)->update(); + + break; + + case XA_WM_NORMAL_HINTS: { + getWMNormalHints(); + + if ((client.normal_hint_flags & PMinSize) && + (client.normal_hint_flags & PMaxSize)) { + if (client.max_width <= client.min_width && + client.max_height <= client.min_height) + decorations.maximize = decorations.handle = + functions.resize = functions.maximize = false; + else + decorations.maximize = decorations.handle = + functions.resize = functions.maximize = true; + } + + int x = frame.x, y = frame.y; + unsigned int w = frame.width, h = frame.height; + + upsize(); + + if ((x != frame.x) || (y != frame.y) || + (w != frame.width) || (h != frame.height)) + reconfigure(); + + break; + } + + default: + if (atom == fluxbox->getWMProtocolsAtom()) { + getWMProtocols(); + + } + + break; + } + + fluxbox->ungrab(); +} + + +void FluxboxWindow::exposeEvent(XExposeEvent *ee) { + if (frame.label == ee->window && decorations.titlebar) + redrawLabel(); + else + redrawAllButtons(); + +} + + +void FluxboxWindow::configureRequestEvent(XConfigureRequestEvent *cr) { + if (cr->window == client.window) { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->grab(); + if (! validateClient()) + return; + + 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 & CWX) + cx = cr->x - frame.mwm_border_w - screen->getBorderWidth(); + + if (cr->value_mask & CWY) + cy = cr->y - frame.y_border - frame.mwm_border_w - + screen->getBorderWidth(); + + if (cr->value_mask & CWWidth) + cw = cr->width + (frame.mwm_border_w * 2); + + if (cr->value_mask & CWHeight) + ch = cr->height + frame.y_border + (frame.mwm_border_w * 2) + + (screen->getBorderWidth() * decorations.handle) + frame.handle_h; + + if (frame.x != cx || frame.y != cy || + frame.width != cw || frame.height != ch) { + configure(cx, cy, cw, ch); + if (tab) + tab->resize(); + } + if (cr->value_mask & CWStackMode) { + switch (cr->detail) { + case Above: + case TopIf: + default: + if (iconic) + deiconify(); +//!!TODO check this and the line below.. +// if (tab) +// tab->raise(); + screen->getWorkspace(workspace_number)->raiseWindow(this); + break; + + case Below: + case BottomIf: + if (iconic) + deiconify(); + +// if (tab) +// tab->raise(); + screen->getWorkspace(workspace_number)->lowerWindow(this); + break; + } + } + + fluxbox->ungrab(); + } +} + + +void FluxboxWindow::buttonPressEvent(XButtonEvent *be) { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->grab(); + + if (! validateClient()) + return; + + + if (be->button == 1 || (be->button == 3 && be->state == Mod1Mask)) { + if ((! focused) && (! screen->isSloppyFocus())) //check focus + setInputFocus(); + + //Redraw buttons + for (unsigned int i=0; i<buttonlist.size(); i++) { + if (be->window == buttonlist[i].win && buttonlist[i].draw) + buttonlist[i].draw(this, be->window, true); + } + + if (frame.plate == be->window) { + + if (windowmenu && windowmenu->isVisible()) //hide menu if its visible + windowmenu->hide(); + //raise tab first, if there is any, so the focus on windows get + //right and dont "hide" the tab behind other windows + if (tab) + tab->raise(); + + screen->getWorkspace(workspace_number)->raiseWindow(this); + + XAllowEvents(display, ReplayPointer, be->time); + + } else { + if (frame.title == be->window || frame.label == be->window) { + if (((be->time - lastButtonPressTime) <= + fluxbox->getDoubleClickInterval()) || + (be->state & ControlMask)) { + lastButtonPressTime = 0; + shade(); + if (tab) //shade windows in the tablist too + tab->shade(); + } else + lastButtonPressTime = be->time; + } + + /* + if (be->window == frame.title) + fprintf(stderr, "title\n"); + else if (be->window == frame.label) + fprintf(stderr, "label\n"); + else if (be->window == frame.plate) + fprintf(stderr, "plate\n"); + else if (be->window == frame.handle) + fprintf(stderr, "handle\n"); + else if (be->window == frame.window) + fprintf(stderr, "window\n"); + else + fprintf(stderr, "unknown window\n"); + */ + + frame.grab_x = be->x_root - frame.x - screen->getBorderWidth(); + frame.grab_y = be->y_root - frame.y - screen->getBorderWidth(); + + if (windowmenu && windowmenu->isVisible()) + windowmenu->hide(); + //raise tab first if there is any + if (tab) + tab->raise(); + screen->getWorkspace(workspace_number)->raiseWindow(this); + } + /*} else if (be->button == 2 && (be->window != frame.iconify_button) && + (be->window != frame.close_button)) { + screen->getWorkspace(workspace_number)->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.y + frame.title_h; + } else if (frame.handle == be->window) { + mx = be->x_root - (windowmenu->getWidth() / 2); + my = frame.y + frame.y_handle - windowmenu->getHeight(); + } else { + bool buttonproc=false; + + if (buttonproc) + mx = be->x_root - (windowmenu->getWidth() / 2); + + if (be->y <= (signed) frame.bevel_w) + my = frame.y + frame.y_border; + else + my = be->y_root - (windowmenu->getHeight() / 2); + } + + if (mx > (signed) (frame.x + frame.width - windowmenu->getWidth())) + mx = frame.x + frame.width - windowmenu->getWidth(); + 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(); + if (my < (signed) (frame.y + ((decorations.titlebar) ? frame.title_h : + frame.y_border))) + my = frame.y + + ((decorations.titlebar) ? frame.title_h : frame.y_border); + + if (windowmenu) { + if (! windowmenu->isVisible()) { // if not window menu is visible then show it + windowmenu->move(mx, my); + windowmenu->show(); + XRaiseWindow(display, windowmenu->getWindowID()); + XRaiseWindow(display, windowmenu->getSendToMenu()->getWindowID()); + XRaiseWindow(display, windowmenu->getSendGroupToMenu()->getWindowID()); + } else //else hide menu + windowmenu->hide(); + } + + } else if (be->button == 4) { //scroll to tab right + if (tab && tab->next()) { + tab->next()->getWindow()->setInputFocus(); + screen->getWorkspace(workspace_number)->raiseWindow(tab->next()->getWindow()); + } + } else if (be->button == 5) { //scroll to tab left + if (tab && tab->prev()) { + tab->prev()->getWindow()->setInputFocus(); + screen->getWorkspace(workspace_number)->raiseWindow(tab->prev()->getWindow()); + } + } + + fluxbox->ungrab(); +} + + +void FluxboxWindow::buttonReleaseEvent(XButtonEvent *re) { + Fluxbox *fluxbox = Fluxbox::instance(); + fluxbox->grab(); + + if (! validateClient()) + return; + + if (moving) { + moving = false; + + fluxbox->maskWindowEvents(0, (FluxboxWindow *) 0); + + if (! screen->doOpaqueMove()) { + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.move_x, frame.move_y, frame.resize_w, + frame.resize_h); + + configure(frame.move_x, frame.move_y, frame.width, frame.height); + fluxbox->ungrab(); + } else + configure(frame.x, frame.y, frame.width, frame.height); + + screen->hideGeometry(); + XUngrabPointer(display, CurrentTime); + } else if (resizing) { + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w, frame.resize_h); + + screen->hideGeometry(); + + if (re->window == frame.left_grip) + left_fixsize(); + else + right_fixsize(); + + resizing = false; + configure(frame.resize_x, frame.resize_y, + frame.resize_w - screen->getBorderWidth2x(), + frame.resize_h - screen->getBorderWidth2x()); + + if (tab) + tab->resize(); + + fluxbox->ungrab(); + XUngrabPointer(display, CurrentTime); + } else if (re->window == frame.window) { + if (re->button == 2 && re->state == Mod1Mask) + XUngrabPointer(display, CurrentTime); + } else { + if ((re->x >= 0) && ((unsigned) re->x <= frame.button_w) && + (re->y >= 0) && ((unsigned) re->y <= frame.button_h)) { + for (unsigned int i=0; i<buttonlist.size(); i++) { + if (re->window == buttonlist[i].win && + buttonlist[i].released) { + buttonlist[i].released(this, re); + break; + } + } + } + redrawAllButtons(); + } + + fluxbox->ungrab(); +} + + +void FluxboxWindow::motionNotifyEvent(XMotionEvent *me) { + Fluxbox *fluxbox = Fluxbox::instance(); + if ((me->state & Button1Mask) && functions.move && + (frame.title == me->window || frame.label == me->window || + frame.handle == me->window || frame.window == me->window)) { + + if (! moving) { + XGrabPointer(display, me->window, False, Button1MotionMask | + ButtonReleaseMask, GrabModeAsync, GrabModeAsync, + None, fluxbox->getMoveCursor(), CurrentTime); + + if (windowmenu && windowmenu->isVisible()) + windowmenu->hide(); + + moving = true; + + fluxbox->maskWindowEvents(client.window, this); + + if (! screen->doOpaqueMove()) { + fluxbox->grab(); + + frame.move_x = frame.x; + frame.move_y = frame.y; + frame.resize_w = frame.width + screen->getBorderWidth2x(); + frame.resize_h = ((shaded) ? frame.title_h : frame.height) + + screen->getBorderWidth2x(); + + screen->showPosition(frame.x, frame.y); + + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.move_x, frame.move_y, + frame.resize_w, frame.resize_h); + } + } else { + int dx = me->x_root - frame.grab_x, dy = me->y_root - frame.grab_y; + + dx -= screen->getBorderWidth(); + dy -= screen->getBorderWidth(); + + if (screen->getEdgeSnapThreshold()) { + int drx = screen->getWidth() - (dx + frame.snap_w); + + if (dx > 0 && dx < drx && dx < screen->getEdgeSnapThreshold()) + dx = 0; + else if (drx > 0 && drx < screen->getEdgeSnapThreshold()) + 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() + + screen->getBorderWidth(); + dbby = screen->getHeight(); + break; + + default: + dtty = 0; + dbby = screen->getToolbar()->getY(); + break; + } + + dty = dy - dtty; + dby = dbby - (dy + frame.snap_h); + + if (dy > 0 && dty < screen->getEdgeSnapThreshold()) + dy = dtty; + else if (dby > 0 && dby < screen->getEdgeSnapThreshold()) + dy = dbby - frame.snap_h; + } + + if (! screen->doOpaqueMove()) { + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.move_x, frame.move_y, frame.resize_w, + frame.resize_h); + + frame.move_x = dx; + frame.move_y = dy; + + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.move_x, frame.move_y, frame.resize_w, + frame.resize_h); + } else + configure(dx, dy, frame.width, frame.height); + + screen->showPosition(dx, dy); + } + } else if (functions.resize && + (((me->state & Button1Mask) && (me->window == frame.right_grip || + me->window == frame.left_grip)) || + me->window == frame.window)) { + bool left = (me->window == frame.left_grip); + + if (! resizing) { + XGrabPointer(display, me->window, false, ButtonMotionMask | + ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, + ((left) ? fluxbox->getLowerLeftAngleCursor() : + fluxbox->getLowerRightAngleCursor()), + CurrentTime); + + resizing = true; + + fluxbox->grab(); + + int gx, gy; + frame.grab_x = me->x - screen->getBorderWidth(); + frame.grab_y = me->y - screen->getBorderWidth2x(); + frame.resize_x = frame.x; + frame.resize_y = frame.y; + frame.resize_w = frame.width + screen->getBorderWidth2x(); + frame.resize_h = frame.height + screen->getBorderWidth2x(); + + if (left) + left_fixsize(&gx, &gy); + else + right_fixsize(&gx, &gy); + + screen->showGeometry(gx, gy); + + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w, frame.resize_h); + } else if (resizing) { + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w, frame.resize_h); + + int gx, gy; + + frame.resize_h = frame.height + (me->y - frame.grab_y); + if (frame.resize_h < 1) + frame.resize_h = 1; + + if (left) { + 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 { + frame.resize_w = frame.width + (me->x - frame.grab_x); + if (frame.resize_w < 1) + frame.resize_w = 1; + + right_fixsize(&gx, &gy); + } + + XDrawRectangle(display, screen->getRootWindow(), screen->getOpGC(), + frame.resize_x, frame.resize_y, + frame.resize_w, frame.resize_h); + + screen->showGeometry(gx, gy); + } + } +} + + +#ifdef SHAPE +void FluxboxWindow::shapeEvent(XShapeEvent *) { + Fluxbox *fluxbox = Fluxbox::instance(); + if (fluxbox->hasShapeExtensions()) { + if (frame.shaped) { + fluxbox->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 + screen->getBorderWidth(); + num++; + } + + XShapeCombineRectangles(display, frame.window, ShapeBounding, 0, 0, + xrect, num, ShapeUnion, Unsorted); + fluxbox->ungrab(); + } + } +} +#endif // SHAPE + + +bool FluxboxWindow::validateClient(void) { + XSync(display, false); + + XEvent e; + if (XCheckTypedWindowEvent(display, client.window, DestroyNotify, &e) || + XCheckTypedWindowEvent(display, client.window, UnmapNotify, &e)) { + XPutBackEvent(display, &e); + Fluxbox::instance()->ungrab(); + + return false; + } + + return true; +} + + +void FluxboxWindow::restore(void) { + XChangeSaveSet(display, client.window, SetModeDelete); + XSelectInput(display, client.window, NoEventMask); + + restoreGravity(); + + XUnmapWindow(display, frame.window); + XUnmapWindow(display, client.window); + + XSetWindowBorderWidth(display, client.window, client.old_bw); + XReparentWindow(display, client.window, screen->getRootWindow(), + client.x, client.y); + XMapWindow(display, client.window); + + XFlush(display); +} + + +void FluxboxWindow::timeout(void) { + if (tab) + tab->raise(); + screen->getWorkspace(workspace_number)->raiseWindow(this); +} + + +void FluxboxWindow::changeBlackboxHints(BlackboxHints *net) { + if ((net->flags & AttribShaded) && + ((blackbox_attrib.attrib & AttribShaded) != + (net->attrib & AttribShaded))) + shade(); + + if ((net->flags & (AttribMaxVert | AttribMaxHoriz)) && + ((blackbox_attrib.attrib & (AttribMaxVert | AttribMaxHoriz)) != + (net->attrib & (AttribMaxVert | AttribMaxHoriz)))) { + if (maximized) { + maximize(0); + } else { + int m = 0; + + if ((net->flags & AttribMaxHoriz) && (net->flags & AttribMaxVert)) + m = ((net->attrib & (AttribMaxHoriz | AttribMaxVert)) ? 1 : 0); + else if (net->flags & AttribMaxVert) + m = ((net->attrib & AttribMaxVert) ? 2 : 0); + else if (net->flags & AttribMaxHoriz) + m = ((net->attrib & AttribMaxHoriz) ? 3 : 0); + + maximize(m); + } + } + + if ((net->flags & AttribOmnipresent) && + ((blackbox_attrib.attrib & AttribOmnipresent) != + (net->attrib & AttribOmnipresent))) + stick(); + + if ((net->flags & AttribWorkspace) && + (workspace_number != (signed) net->workspace)) { + screen->reassociateWindow(this, net->workspace, true); + + if (screen->getCurrentWorkspaceID() != (signed) net->workspace) + withdraw(); + else + deiconify(); + } + + if (net->flags & AttribDecoration) { + switch (net->decoration) { + case DecorNone: + decorations.titlebar = decorations.border = decorations.handle = + decorations.iconify = decorations.maximize = + decorations.menu = false; + functions.resize = functions.move = functions.iconify = + functions.maximize = false; + + break; + + default: + case DecorNormal: + decorations.titlebar = decorations.border = decorations.handle = + decorations.iconify = decorations.maximize = + decorations.menu = true; + functions.resize = functions.move = functions.iconify = + functions.maximize = true; + + break; + + case DecorTiny: + decorations.titlebar = decorations.iconify = decorations.menu = + functions.move = functions.iconify = true; + decorations.border = decorations.handle = decorations.maximize = + functions.resize = functions.maximize = false; + + break; + + case DecorTool: + decorations.titlebar = decorations.menu = functions.move = true; + decorations.iconify = decorations.border = decorations.handle = + decorations.maximize = functions.resize = functions.maximize = + functions.iconify = false; + + break; + } + + reconfigure(); + } +} + + +void FluxboxWindow::upsize(void) { + // convert client.width/height into frame sizes + + frame.bevel_w = screen->getBevelWidth(); + frame.mwm_border_w = screen->getFrameWidth() * decorations.border; + + if (I18n::instance()->multibyte()) { + frame.title_h = (screen->getWindowStyle()->font.set_extents-> + max_ink_extent.height + + (frame.bevel_w * 2) + 2) * decorations.titlebar; + } else + frame.title_h = (screen->getWindowStyle()->font.fontstruct->ascent + + screen->getWindowStyle()->font.fontstruct->descent + + (frame.bevel_w * 2) + 2) * decorations.titlebar; + + frame.label_h = (frame.title_h - (frame.bevel_w * 2)) * decorations.titlebar; + frame.button_w = frame.button_h = frame.label_h - 2; + + frame.y_border = (frame.title_h + screen->getBorderWidth()) * decorations.titlebar; + frame.border_h = client.height + (frame.mwm_border_w * 2); + + frame.y_handle = frame.y_border + frame.border_h + + (screen->getBorderWidth() * decorations.handle); + frame.handle_h = decorations.handle * screen->getHandleWidth(); + + frame.grip_w = (frame.button_h * 2) * decorations.handle; + frame.grip_h = screen->getHandleWidth() * decorations.handle; + + frame.width = client.width + (frame.mwm_border_w * 2); + frame.height = frame.y_handle + frame.handle_h; + + frame.snap_w = frame.width + screen->getBorderWidth2x(); + frame.snap_h = frame.height + screen->getBorderWidth2x(); +} + + +void FluxboxWindow::downsize(void) { + // convert frame.width/height into client sizes + + frame.y_handle = frame.height - frame.handle_h; + frame.border_h = frame.y_handle - frame.y_border - + (screen->getBorderWidth() * decorations.handle); + + client.x = frame.x + frame.mwm_border_w + screen->getBorderWidth(); + client.y = frame.y + frame.y_border + frame.mwm_border_w + + screen->getBorderWidth(); + + client.width = frame.width - (frame.mwm_border_w * 2); + client.height = frame.height - frame.y_border - + (frame.mwm_border_w * 2) - frame.handle_h - + (screen->getBorderWidth() * decorations.handle); + + frame.y_handle = frame.border_h + frame.y_border + screen->getBorderWidth(); + + frame.snap_w = frame.width + screen->getBorderWidth2x(); + frame.snap_h = frame.height + screen->getBorderWidth2x(); +} + + +void FluxboxWindow::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) - + screen->getBorderWidth2x(); + int dy = frame.resize_h - frame.y_border - client.base_height - + frame.handle_h - (screen->getBorderWidth() * 3) - (frame.mwm_border_w * 2); + + 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; + + dx /= client.width_inc; + dy /= client.height_inc; + + 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) + screen->getBorderWidth2x(); + frame.resize_h = dy + frame.y_border + frame.handle_h + + (frame.mwm_border_w * 2) + (screen->getBorderWidth() * 3); +} + + +void FluxboxWindow::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 - + (frame.mwm_border_w * 2); + int dy = frame.resize_h - frame.y_border - client.base_height - + frame.handle_h - (screen->getBorderWidth() * 3) - (frame.mwm_border_w * 2); + + 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; + + dx /= client.width_inc; + dy /= client.height_inc; + + 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) + screen->getBorderWidth2x(); + frame.resize_x = frame.x + frame.width - frame.resize_w + + screen->getBorderWidth2x(); + frame.resize_h = dy + frame.y_border + frame.handle_h + + (frame.mwm_border_w * 2) + (screen->getBorderWidth() * 3); +}
A src/Window.hh

@@ -0,0 +1,321 @@

+// Window.hh for Blackbox - an X11 Window manager +// 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. + +// +//Changes for Fluxbox made by Henrik Kinnunen (fluxgen@linuxmail.org) +// See LICENSE for copyright and license + +#ifndef _WINDOW_HH_ +#define _WINDOW_HH_ + +#include <X11/Xlib.h> +#include <X11/Xutil.h> + +#ifdef SHAPE +# include <X11/extensions/shape.h> +#endif // SHAPE + +// forward declaration +class FluxboxWindow; +class Tab; + +#include "fluxbox.hh" + +#include <vector> +#include <string> +#ifndef _BASEDISPLAY_HH_ +#include "BaseDisplay.hh" +#endif +#ifndef _TIMER_HH_ +#include "Timer.hh" +#endif +#ifndef _WINDOWMENU_HH_ +#include "Windowmenu.hh" +#endif + +#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) +//names for buttons +#define NAME_STICKY "sticky" +#define NAME_MAXIMIZE "maximize" +#define NAME_MINIMIZE "minimize" +#define NAME_SHADE "shade" +#define NAME_CLOSE "close" +#define NAME_ICONIFY "iconify" +#define NAME_MENU "menu" +#define NAME_NONE "none" + + +#define PropMwmHintsElements 3 + +class FluxboxWindow : public TimeoutHandler { +public: + FluxboxWindow(Window, BScreen * = (BScreen *) 0); + virtual ~FluxboxWindow(void); + + inline const bool isTransient(void) const + { return ((transient) ? true : false); } + inline const bool hasTransient(void) const + { return ((client.transient) ? true : false); } + inline const bool &isFocused(void) const { return focused; } + inline const bool &isVisible(void) const { return visible; } + inline const bool &isIconic(void) const { return iconic; } + inline const bool &isShaded(void) const { return shaded; } + inline const bool &isMaximized(void) const { return maximized; } + inline const bool &isIconifiable(void) const { return functions.iconify; } + inline const bool &isMaximizable(void) const { return functions.maximize; } + inline const bool &isResizable(void) const { return functions.resize; } + inline const bool &isClosable(void) const { return functions.close; } + inline const bool &isStuck(void) const { return stuck; } + inline const bool &hasTitlebar(void) const { return decorations.titlebar; } + inline const bool hasTab(void) const { return (tab!=0 ? true : false); } + + inline BScreen *getScreen(void) { return screen; } + inline Tab *getTab(void) { return tab; } + inline FluxboxWindow *getTransient(void) { return client.transient; } + inline FluxboxWindow *getTransientFor(void) { return client.transient_for; } + + 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 + { return frame.title_h; } + + inline void setWindowNumber(int n) { window_number = n; } + + bool validateClient(void); + bool setInputFocus(void); + void setTab(bool flag); + void setFocusFlag(bool); + void iconify(void); + void deiconify(bool = true, bool = true); + void close(void); + void withdraw(void); + void maximize(unsigned int); + void shade(void); + void stick(void); + void unstick(void); + void reconfigure(void); + void installColormap(bool); + void restore(void); + void configure(int dx, int dy, unsigned int dw, unsigned int dh); + void setWorkspace(int n); + void changeBlackboxHints(BlackboxHints *); + void restoreAttributes(void); + + 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); + + // 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; + +private: + BImageControl *image_ctrl; + //Fluxbox *fluxbox; + + bool moving, resizing, shaded, maximized, visible, iconic, transient, + focused, stuck, modal, send_focus_message, managed; + BScreen *screen; + BTimer *timer; + Display *display; + BlackboxAttributes blackbox_attrib; + + Time lastButtonPressTime; + Windowmenu *windowmenu; + + int focus_mode, window_number, workspace_number; + unsigned long current_state; + + struct _client { + FluxboxWindow *transient_for, // which window are we a transient for? + *transient; // which window is our transient? + Window window, window_group; + + char *title, *icon_title; + int x, y, old_bw, title_len; + unsigned int width, height, title_text_w, + min_width, min_height, max_width, max_height, width_inc, height_inc, + min_aspect_x, min_aspect_y, max_aspect_x, max_aspect_y, + base_width, base_height, win_gravity; + unsigned long initial_state, normal_hint_flags, wm_hint_flags; + + MwmHints *mwm_hint; + BlackboxHints *blackbox_hint; + } client; + + struct _decorations { + bool titlebar, handle, border, iconify, + maximize, close, menu, sticky, shade, tab; + } decorations; + + struct _functions { + bool resize, move, iconify, maximize, close; + } functions; + + bool usetab; + Tab *tab; + //Tab is also a friend + friend class Tab; + + typedef void (*ButtonDrawProc)(FluxboxWindow *, Window, bool); + typedef void (*ButtonEventProc)(FluxboxWindow *, XButtonEvent *); + + struct Button { + int type; + Window win; + bool used; + ButtonEventProc pressed; + ButtonEventProc released; + ButtonDrawProc draw; + }; + + std::vector<Button> buttonlist; + + struct _frame { + //different bool because of XShapeQueryExtension + Bool shaped; + 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, plate, title, label, handle, + right_grip, left_grip; + + int x, y, resize_x, resize_y, move_x, move_y, grab_x, grab_y, + y_border, y_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, + bevel_w, resize_w, resize_h, snap_w, snap_h; + } frame; + + enum { F_NoInput = 0, F_Passive, F_LocallyActive, F_GloballyActive }; + + void createButton(int type, ButtonEventProc, ButtonEventProc, ButtonDrawProc); + Window findTitleButton(int type); +protected: + //event callbacks + static void stickyButton_cb(FluxboxWindow *, XButtonEvent *); + static void stickyPressed_cb(FluxboxWindow *, XButtonEvent *); + static void iconifyButton_cb(FluxboxWindow *, XButtonEvent *); + static void iconifyPressed_cb(FluxboxWindow *, XButtonEvent *); + static void maximizeButton_cb(FluxboxWindow *, XButtonEvent *); + static void maximizePressed_cb(FluxboxWindow *, XButtonEvent *); + static void closeButton_cb(FluxboxWindow *, XButtonEvent *); + static void closePressed_cb(FluxboxWindow *, XButtonEvent *); + static void shadeButton_cb(FluxboxWindow *, XButtonEvent *); + //draw callbacks + static void stickyDraw_cb(FluxboxWindow *, Window, bool); + static void iconifyDraw_cb(FluxboxWindow *, Window, bool); + static void maximizeDraw_cb(FluxboxWindow *, Window, bool); + static void closeDraw_cb(FluxboxWindow *, Window, bool); + static void shadeDraw_cb(FluxboxWindow *, Window, bool); + + static void grabButton(Display *display, unsigned int button, Window window, Cursor cursor); + //button base draw... background + void drawButtonBase(Window, bool); + + bool getState(void); + Window createToplevelWindow(int, int, unsigned int, unsigned int, + unsigned int); + Window createChildWindow(Window, Cursor = None); + + void getWMName(void); + void getWMIconName(void); + void getWMNormalHints(void); + void getWMProtocols(void); + void getWMHints(void); + void getMWMHints(void); + void getBlackboxHints(void); + void setNetWMAttributes(void); + void associateClientWindow(void); + void decorate(void); + void decorateLabel(void); + void positionButtons(bool redecorate_label = false); + void positionWindows(void); + + void redrawLabel(void); + void redrawAllButtons(void); + + void restoreGravity(void); + void setGravityOffsets(void); + void setState(unsigned long); + void upsize(void); + void downsize(void); + void right_fixsize(int * = 0, int * = 0); + void left_fixsize(int * = 0, int * = 0); + + +}; + + +#endif // __Window_hh
A src/Windowmenu.cc

@@ -0,0 +1,323 @@

+// Windowmenu.cc for Blackbox - an X11 Window manager +// 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 "i18n.hh" +#include "fluxbox.hh" +#include "Screen.hh" +#include "Window.hh" +#include "Windowmenu.hh" +#include "Workspace.hh" + +#ifdef STDC_HEADERS +# include <string.h> +#endif // STDC_HEADERS + + +Windowmenu::Windowmenu(FluxboxWindow *win) : Basemenu(win->getScreen()) { + window = win; + screen = window->getScreen(); + + setTitleVisibility(False); + setMovable(False); + setInternalMenu(); + + I18n *i18n = I18n::instance(); + + sendToMenu = new SendtoWorkspacemenu(this); + sendGroupToMenu = new SendGroupToWorkspacemenu(this); + + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuSendTo, +#else // !NLS + 0, 0, +#endif // NLS + "Send To ..."), + sendToMenu); + + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuSendGroupTo, +#else // !NLS + 0, 0, +#endif // NLS + "Send Group To ..."), + sendGroupToMenu); + + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuShade, +#else // !NLS + 0, 0, +#endif // NLS + "Shade"), + BScreen::WindowShade); + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuIconify, +#else // !NLS + 0, 0, +#endif // NLS + "Iconify"), + BScreen::WindowIconify); + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuMaximize, +#else // !NLS + 0, 0, +#endif // NLS + "Maximize"), + BScreen::WindowMaximize); + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuRaise, +#else // !NLS + 0, 0, +#endif // NLS + "Raise"), + BScreen::WindowRaise); + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuLower, +#else // !NLS + 0, 0, +#endif // NLS + "Lower"), + BScreen::WindowLower); + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuStick, +#else // !NLS + 0, 0, +#endif // NLS + "Stick"), + BScreen::WindowStick); + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuKillClient, +#else // !NLS + 0, 0, +#endif // NLS + "Kill Client"), + BScreen::WindowKill); + insert(i18n->getMessage( +#ifdef NLS + WindowmenuSet, WindowmenuClose, +#else // !NLS + 0, 0, +#endif // NLS + "Close"), + BScreen::WindowClose); + + //TODO: nls + insert("Tab", BScreen::WindowTab); + + update(); + + setItemEnabled(1, window->hasTitlebar()); + setItemEnabled(2, window->isIconifiable()); + setItemEnabled(3, window->isMaximizable()); + setItemEnabled(8, window->isClosable()); + setItemEnabled(9, window->hasTab()); +} + + +Windowmenu::~Windowmenu(void) { + delete sendToMenu; + delete sendGroupToMenu; +} + + +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()); + + Basemenu::show(); +} + + +void Windowmenu::itemSelected(int button, int index) { + BasemenuItem *item = find(index); + + switch (item->function()) { + case BScreen::WindowShade: + hide(); + if (window->getTab()) + window->getTab()->shade(); + window->shade(); + break; + + case BScreen::WindowIconify: + hide(); + window->iconify(); + break; + + case BScreen::WindowMaximize: + hide(); + window->maximize((unsigned int) button); + break; + + case BScreen::WindowClose: + hide(); + window->close(); + break; + + case BScreen::WindowRaise: + hide(); + screen->getWorkspace(window->getWorkspaceNumber())->raiseWindow(window); + break; + + case BScreen::WindowLower: + hide(); + screen->getWorkspace(window->getWorkspaceNumber())->lowerWindow(window); + break; + + case BScreen::WindowStick: + hide(); + window->stick(); + break; + + case BScreen::WindowKill: + hide(); + XKillClient(screen->getBaseDisplay()->getXDisplay(), + window->getClientWindow()); + break; + case BScreen::WindowTab: + hide(); + window->setTab(!window->hasTab()); + break; + } +} + + +void Windowmenu::reconfigure(void) { + setItemEnabled(1, window->hasTitlebar()); + setItemEnabled(2, window->isIconifiable()); + setItemEnabled(3, window->isMaximizable()); + setItemEnabled(8, window->isClosable()); + + sendToMenu->reconfigure(); + sendGroupToMenu->reconfigure(); + + Basemenu::reconfigure(); +} + + +Windowmenu::SendtoWorkspacemenu::SendtoWorkspacemenu(Windowmenu *w) + : Basemenu(w->screen) +{ + windowmenu = w; + + setTitleVisibility(False); + setMovable(False); + setInternalMenu(); + update(); +} + + +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 (button == 1) windowmenu->window->withdraw(); + windowmenu->screen->reassociateWindow(windowmenu->window, index, True); + if (windowmenu->window->getTab()) { + windowmenu->window->getTab()->disconnect(); + windowmenu->window->getTab()->setPosition(); + } + if (button == 2) windowmenu->screen->changeWorkspaceID(index); + } + hide(); +} + + +void Windowmenu::SendtoWorkspacemenu::update(void) { + int i, r = getCount(); + + if (getCount() != 0) + for (i = 0; i < r; ++i) + remove(0); + + for (i = 0; i < windowmenu->screen->getCount(); ++i) + insert(windowmenu->screen->getWorkspace(i)->getName()); + + Basemenu::update(); +} + + +void Windowmenu::SendtoWorkspacemenu::show(void) { + update(); + + Basemenu::show(); +} + +void Windowmenu::SendGroupToWorkspacemenu::itemSelected(int button, int index) { + if (button > 2) + return; + + if (index <= getWindowMenu()->screen->getCount()) { + if (index == getWindowMenu()->screen->getCurrentWorkspaceID()) + return; + if (getWindowMenu()->window->isStuck()) + getWindowMenu()->window->stick(); + + if (button == 1) { + if (getWindowMenu()->window->hasTab()) { + for (Tab *first = Tab::getFirst(getWindowMenu()->window->getTab()); + first!=0; first=first->next()) { + first->withdraw(); + first->getWindow()->withdraw(); + getWindowMenu()->screen->reassociateWindow(first->getWindow(), index, True); + + } + } else { + getWindowMenu()->window->withdraw(); + getWindowMenu()->screen->reassociateWindow(getWindowMenu()->window, index, True); + } + + } + + if (button == 2) + getWindowMenu()->screen->changeWorkspaceID(index); + } + hide(); +} + +Windowmenu::SendGroupToWorkspacemenu::SendGroupToWorkspacemenu(Windowmenu *w):SendtoWorkspacemenu(w) +{ + +} + +
A src/Windowmenu.hh

@@ -0,0 +1,88 @@

+// Windowmenu.hh for Blackbox - an X11 Window manager +// 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 _WINDOWMENU_HH_ +#define _WINDOWMENU_HH_ + +// forward declaration +class Windowmenu; +class SendtoWorkspaceMenu; + +class Fluxbox; +class FluxboxWindow; +class Toolbar; + +#include "Basemenu.hh" + + +class Windowmenu : public Basemenu { +private: + FluxboxWindow *window; + BScreen *screen; + + + class SendtoWorkspacemenu : public Basemenu { + private: + Windowmenu *windowmenu; + + protected: + virtual void itemSelected(int, int); + + public: + SendtoWorkspacemenu(Windowmenu *); + inline Windowmenu *getWindowMenu() const { return windowmenu; } + void update(void); + + virtual void show(void); + }; + + class SendGroupToWorkspacemenu : public SendtoWorkspacemenu { + protected: + virtual void itemSelected(int, int); + public: + SendGroupToWorkspacemenu(Windowmenu *); + + }; + + SendtoWorkspacemenu *sendToMenu; + SendGroupToWorkspacemenu *sendGroupToMenu; + + friend class SendtoWorkspacemenu; + friend class SendGroupToWorkspacemenu; + +protected: + virtual void itemSelected(int, int); + + +public: + Windowmenu(FluxboxWindow *); + virtual ~Windowmenu(void); + + inline Basemenu *getSendToMenu(void) { return static_cast<Basemenu *>(sendToMenu); } + inline Basemenu *getSendGroupToMenu(void) { return static_cast<Basemenu *>(sendGroupToMenu); } + void reconfigure(void); + void setClosable(void); + + virtual void show(void); +}; + + +#endif // __Windowmenu_hh
A src/Workspace.cc

@@ -0,0 +1,512 @@

+// Workspace.cc for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> +#include <X11/Xatom.h> + +#include "i18n.hh" +#include "fluxbox.hh" +#include "Clientmenu.hh" +#include "Screen.hh" +#include "Toolbar.hh" +#include "Window.hh" +#include "Workspace.hh" +#include "Windowmenu.hh" + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef STDC_HEADERS +# include <string.h> +#endif // STDC_HEADERS + +#define MIN(x,y) ((x < y) ? x : y) +#define MAX(x,y) ((x > y) ? x : y) + + +Workspace::Workspace(BScreen *scrn, int i) { + screen = scrn; + + cascade_x = cascade_y = 32; + + id = i; + + stackingList = new LinkedList<FluxboxWindow>; + windowList = new LinkedList<FluxboxWindow>; + clientmenu = new Clientmenu(this); + + lastfocus = (FluxboxWindow *) 0; + + char *tmp; + name = (char *) 0; + screen->getNameOfWorkspace(id, &tmp); + setName(tmp); + + if (tmp) + delete [] tmp; +} + + +Workspace::~Workspace(void) { + delete stackingList; + delete windowList; + delete clientmenu; + + if (name) + delete [] name; +} + + +const int Workspace::addWindow(FluxboxWindow *w, Bool place) { + if (! w) return -1; + + if (place) placeWindow(w); + + w->setWorkspace(id); + w->setWindowNumber(windowList->count()); + + stackingList->insert(w, 0); + windowList->insert(w); + + clientmenu->insert((const char **) w->getTitle()); + clientmenu->update(); + + screen->updateNetizenWindowAdd(w->getClientWindow(), id); + + raiseWindow(w); + + return w->getWindowNumber(); +} + + +const int Workspace::removeWindow(FluxboxWindow *w) { + if (! w) return -1; + + stackingList->remove(w); + + if (w->isFocused()) { + if (screen->isSloppyFocus()) + Fluxbox::instance()->setFocusedWindow((FluxboxWindow *) 0); + else if (w->isTransient() && w->getTransientFor() && + w->getTransientFor()->isVisible()) + w->getTransientFor()->setInputFocus(); + else { + + FluxboxWindow *top = stackingList->first(); + + if (! top || ! top->setInputFocus()) { + Fluxbox::instance()->setFocusedWindow((FluxboxWindow *) 0); + XSetInputFocus(Fluxbox::instance()->getXDisplay(), + screen->getToolbar()->getWindowID(), + RevertToParent, CurrentTime); + } + } + } + + if (lastfocus == w) + lastfocus = (FluxboxWindow *) 0; + + windowList->remove(w->getWindowNumber()); + clientmenu->remove(w->getWindowNumber()); + clientmenu->update(); + + screen->updateNetizenWindowDel(w->getClientWindow()); + + LinkedListIterator<FluxboxWindow> it(windowList); + for (int i = 0; it.current(); it++, i++) + it.current()->setWindowNumber(i); + + return windowList->count(); +} + + +void Workspace::showAll(void) { + LinkedListIterator<FluxboxWindow> it(stackingList); + for (; it.current(); it++) + it.current()->deiconify(False, False); +} + + +void Workspace::hideAll(void) { + LinkedList<FluxboxWindow> lst; + + LinkedListIterator<FluxboxWindow> it(stackingList); + for (; it.current(); it++) + lst.insert(it.current(), 0); + + LinkedListIterator<FluxboxWindow> it2(&lst); + for (; it2.current(); it2++) + if (! it2.current()->isStuck()) + it2.current()->withdraw(); +} + + +void Workspace::removeAll(void) { + LinkedListIterator<FluxboxWindow> it(windowList); + for (; it.current(); it++) + it.current()->iconify(); +} + + +void Workspace::raiseWindow(FluxboxWindow *w) { + FluxboxWindow *win = (FluxboxWindow *) 0, *bottom = w; + + while (bottom->isTransient() && bottom->getTransientFor()) + bottom = bottom->getTransientFor(); + + int i = 1; + win = bottom; + while (win->hasTransient() && win->getTransient()) { + win = win->getTransient(); + + i++; + } + + Window *nstack = new Window[i], *curr = nstack; + Workspace *wkspc; + + win = bottom; + while (True) { + *(curr++) = win->getFrameWindow(); + screen->updateNetizenWindowRaise(win->getClientWindow()); + + if (! win->isIconic()) { + wkspc = screen->getWorkspace(win->getWorkspaceNumber()); + wkspc->stackingList->remove(win); + wkspc->stackingList->insert(win, 0); + } + + if (! win->hasTransient() || ! win->getTransient()) + break; + + win = win->getTransient(); + } + + screen->raiseWindows(nstack, i); + + delete [] nstack; +} + + +void Workspace::lowerWindow(FluxboxWindow *w) { + FluxboxWindow *win = (FluxboxWindow *) 0, *bottom = w; + + while (bottom->isTransient() && bottom->getTransientFor()) + bottom = bottom->getTransientFor(); + + int i = 1; + win = bottom; + while (win->hasTransient() && win->getTransient()) { + win = win->getTransient(); + + i++; + } + + Window *nstack = new Window[i], *curr = nstack; + Workspace *wkspc; + + while (True) { + *(curr++) = win->getFrameWindow(); + screen->updateNetizenWindowLower(win->getClientWindow()); + + if (! win->isIconic()) { + wkspc = screen->getWorkspace(win->getWorkspaceNumber()); + wkspc->stackingList->remove(win); + wkspc->stackingList->insert(win); + } + + if (! win->getTransientFor()) + break; + + win = win->getTransientFor(); + } + + Fluxbox::instance()->grab(); + + XLowerWindow(screen->getBaseDisplay()->getXDisplay(), *nstack); + XRestackWindows(screen->getBaseDisplay()->getXDisplay(), nstack, i); + + Fluxbox::instance()->ungrab(); + + delete [] nstack; +} + + +void Workspace::reconfigure(void) { + clientmenu->reconfigure(); + + LinkedListIterator<FluxboxWindow> it(windowList); + for (; it.current(); it++) + if (it.current()->validateClient()) + it.current()->reconfigure(); +} + + +FluxboxWindow *Workspace::getWindow(int index) { + if ((index >= 0) && (index < windowList->count())) + return windowList->find(index); + else + return 0; +} + + +const int Workspace::getCount(void) { + return windowList->count(); +} + + +void Workspace::update(void) { + clientmenu->update(); + screen->getToolbar()->redrawWindowLabel(True); +} + + +Bool Workspace::isCurrent(void) { + return (id == screen->getCurrentWorkspaceID()); +} + + +Bool Workspace::isLastWindow(FluxboxWindow *w) { + return (w == windowList->last()); +} + +void Workspace::setCurrent(void) { + screen->changeWorkspaceID(id); +} + + +void Workspace::setName(char *new_name) { + if (name) + delete [] name; + + if (new_name) { + name = bstrdup(new_name); + } else { + name = new char[128]; + sprintf(name, I18n::instance()-> + getMessage( +#ifdef NLS + WorkspaceSet, WorkspaceDefaultNameFormat, +#else // !NLS + 0, 0, +#endif // NLS + "Workspace %d"), id + 1); + } + + screen->updateWorkspaceNamesAtom(); + + clientmenu->setLabel(name); + clientmenu->update(); +} + + +void Workspace::shutdown(void) { + while (windowList->count()) { + windowList->first()->restore(); + delete windowList->first(); + } +} + + +void Workspace::placeWindow(FluxboxWindow *win) { + Bool placed = False; + LinkedListIterator<FluxboxWindow> it(windowList); + int win_w = win->getWidth() + (screen->getBorderWidth2x() * 2), + win_h = win->getHeight() + (screen->getBorderWidth2x() * 2), +#ifdef SLIT + slit_x = screen->getSlit()->getX() - screen->getBorderWidth(), + slit_y = screen->getSlit()->getY() - screen->getBorderWidth(), + slit_w = screen->getSlit()->getWidth() + + (screen->getBorderWidth2x() * 2), + slit_h = screen->getSlit()->getHeight() + + (screen->getBorderWidth2x() * 2), +#endif // SLIT + toolbar_x = screen->getToolbar()->getX() - screen->getBorderWidth(), + toolbar_y = screen->getToolbar()->getY() - screen->getBorderWidth(), + toolbar_w = screen->getToolbar()->getWidth() + + (screen->getBorderWidth2x() * 2), + toolbar_h = screen->getToolbar()->getHeight() + + (screen->getBorderWidth2x() * 2), + place_x = 0, place_y = 0, change_x = 1, change_y = 1; + + if (screen->getColPlacementDirection() == BScreen::BottomTop) + change_y = -1; + if (screen->getRowPlacementDirection() == BScreen::RightLeft) + change_x = -1; + + register int test_x, test_y, curr_w, curr_h; + + switch (screen->getPlacementPolicy()) { + case BScreen::RowSmartPlacement: { + test_y = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); + if (screen->getColPlacementDirection() == BScreen::BottomTop) + test_y = screen->getHeight() - win_h - test_y; + + while (((screen->getColPlacementDirection() == BScreen::BottomTop) ? + test_y > 0 : test_y + win_h < (signed) screen->getHeight()) && + ! placed) { + test_x = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); + if (screen->getRowPlacementDirection() == BScreen::RightLeft) + test_x = screen->getWidth() - win_w - test_x; + + while (((screen->getRowPlacementDirection() == BScreen::RightLeft) ? + test_x > 0 : test_x + win_w < (signed) screen->getWidth()) && + ! placed) { + placed = True; + + it.reset(); + for (; it.current() && placed; it++) { + curr_w = it.current()->getWidth() + screen->getBorderWidth2x() + + screen->getBorderWidth2x(); + curr_h = + ((it.current()->isShaded()) ? it.current()->getTitleHeight() : + it.current()->getHeight()) + + screen->getBorderWidth2x() + screen->getBorderWidth2x(); + + if (it.current()->getXFrame() < test_x + win_w && + it.current()->getXFrame() + curr_w > test_x && + it.current()->getYFrame() < test_y + win_h && + it.current()->getYFrame() + curr_h > test_y) + placed = False; + } + + if ((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; + } + + test_y += change_y; + } + + break; } + + case BScreen::ColSmartPlacement: { + test_x = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); + if (screen->getRowPlacementDirection() == BScreen::RightLeft) + test_x = screen->getWidth() - win_w - test_x; + + while (((screen->getRowPlacementDirection() == BScreen::RightLeft) ? + test_x > 0 : test_x + win_w < (signed) screen->getWidth()) && + ! placed) { + test_y = screen->getBorderWidth() + screen->getEdgeSnapThreshold(); + if (screen->getColPlacementDirection() == BScreen::BottomTop) + test_y = screen->getHeight() - win_h - test_y; + + while (((screen->getColPlacementDirection() == BScreen::BottomTop) ? + test_y > 0 : test_y + win_h < (signed) screen->getHeight()) && + ! placed) { + placed = True; + + it.reset(); + for (; it.current() && placed; it++) { + curr_w = it.current()->getWidth() + screen->getBorderWidth2x() + + screen->getBorderWidth2x(); + curr_h = + ((it.current()->isShaded()) ? it.current()->getTitleHeight() : + it.current()->getHeight()) + + screen->getBorderWidth2x() + screen->getBorderWidth2x(); + + if (it.current()->getXFrame() < test_x + win_w && + it.current()->getXFrame() + curr_w > test_x && + it.current()->getYFrame() < test_y + win_h && + it.current()->getYFrame() + curr_h > test_y) + placed = False; + } + + if ((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; + } + + test_x += change_x; + } + + break; } + } + + if (! placed) { + if (((unsigned) cascade_x > (screen->getWidth() / 2)) || + ((unsigned) cascade_y > (screen->getHeight() / 2))) + cascade_x = cascade_y = 32; + + place_x = cascade_x; + place_y = cascade_y; + + cascade_x += win->getTitleHeight(); + cascade_y += win->getTitleHeight(); + } + + 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; + + win->configure(place_x, place_y, win->getWidth(), win->getHeight()); +}
A src/Workspace.hh

@@ -0,0 +1,90 @@

+// Workspace.hh for Blackbox - an X11 Window manager +// 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 <X11/Xlib.h> + +class BScreen; +class Clientmenu; +class Workspace; +class FluxboxWindow; + +#include "LinkedList.hh" + + +class Workspace { +private: + BScreen *screen; + FluxboxWindow *lastfocus; + Clientmenu *clientmenu; + + LinkedList<FluxboxWindow> *stackingList, *windowList; + + char *name; + int id, cascade_x, cascade_y; + + +protected: + void placeWindow(FluxboxWindow *); + + +public: + Workspace(BScreen *, int = 0); + ~Workspace(void); + + inline BScreen *getScreen(void) { return screen; } + + inline FluxboxWindow *getLastFocusedWindow(void) { return lastfocus; } + + 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(FluxboxWindow *w) { lastfocus = w; } + + FluxboxWindow *getWindow(int); + + Bool isCurrent(void); + Bool isLastWindow(FluxboxWindow *); + + const int addWindow(FluxboxWindow *, Bool = False); + const int removeWindow(FluxboxWindow *); + const int getCount(void); + + void showAll(void); + void hideAll(void); + void removeAll(void); + void raiseWindow(FluxboxWindow *); + void lowerWindow(FluxboxWindow *); + void reconfigure(); + void update(); + void setCurrent(void); + void setName(char *); + void shutdown(void); +}; + + +#endif // _WORKSPACE_HH_ +
A src/Workspacemenu.cc

@@ -0,0 +1,84 @@

+// Workspacemenu.cc for Blackbox - an X11 Window manager +// 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 "i18n.hh" +#include "fluxbox.hh" +#include "Screen.hh" +#include "Toolbar.hh" +#include "Workspacemenu.hh" +#include "Workspace.hh" + + +Workspacemenu::Workspacemenu(BScreen *scrn) : Basemenu(scrn) { + screen = scrn; + + setInternalMenu(); + I18n *i18n = I18n::instance(); + + setLabel(i18n->getMessage( +#ifdef NLS + WorkspacemenuSet, WorkspacemenuWorkspacesTitle, +#else // !NLS + 0, 0, +#endif // NLS + "Workspaces")); + + insert(i18n->getMessage( +#ifdef NLS + WorkspacemenuSet, WorkspacemenuNewWorkspace, +#else // !NLS + 0, 0, +#endif // NLS + "New Workspace")); + insert(i18n->getMessage( +#ifdef NLS + WorkspacemenuSet, WorkspacemenuRemoveLast, +#else // !NLS + 0, 0, +#endif // NLS + "Remove Last")); +} + + +void Workspacemenu::itemSelected(int button, int index) { + if (button == 1) { + if (index == 0) + screen->addWorkspace(); + else if (index == 1) + screen->removeLastWorkspace(); + else if ((screen->getCurrentWorkspace()->getWorkspaceID() != + (index - 2)) && ((index - 2) < screen->getCount())) + screen->changeWorkspaceID(index - 2); + + if (! (screen->getWorkspacemenu()->isTorn() || isTorn())) + hide(); + } +}
A src/Workspacemenu.hh

@@ -0,0 +1,48 @@

+// WorkspaceMenu.hh for Blackbox - an X11 Window manager +// 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 _WORKSPACEMENU_HH_ +#define _WORKSPACEMENU_HH_ + +// forward declaration +class Workspacemenu; + +class Toolbar; + +#include "Basemenu.hh" + + +class Workspacemenu : public Basemenu { +private: + BScreen *screen; + + +protected: + virtual void itemSelected(int, int); + + +public: + Workspacemenu(BScreen *); +}; + + +#endif // _WORKSPACEMENU_HH_ +
A src/bsd-snprintf.c

@@ -0,0 +1,788 @@

+/************************************************************** + * Original: + * Patrick Powell Tue Apr 11 09:48:21 PDT 1995 + * A bombproof version of doprnt (dopr) included. + * Sigh. This sort of thing is always nasty do deal with. Note that + * the version here does not include floating point... + * + * snprintf() is used instead of sprintf() as it does limit checks + * for string length. This covers a nasty loophole. + * + * The other functions are there to prevent NULL pointers from + * causing nast effects. + * + * More Recently: + * Brandon Long <blong@fiction.net> 9/15/96 for mutt 0.43 + * This was ugly. It is still ugly. I opted out of floating point + * numbers, but the formatter understands just about everything + * from the normal C string format, at least as far as I can tell from + * the Solaris 2.5 printf(3S) man page. + * + * Brandon Long <blong@fiction.net> 10/22/97 for mutt 0.87.1 + * Ok, added some minimal floating point support, which means this + * probably requires libm on most operating systems. Don't yet + * support the exponent (e,E) and sigfig (g,G). Also, fmtint() + * was pretty badly broken, it just wasn't being exercised in ways + * which showed it, so that's been fixed. Also, formated the code + * to mutt conventions, and removed dead code left over from the + * original. Also, there is now a builtin-test, just compile with: + * gcc -DTEST_SNPRINTF -o snprintf snprintf.c -lm + * and run snprintf for results. + * + * Thomas Roessler <roessler@guug.de> 01/27/98 for mutt 0.89i + * The PGP code was using unsigned hexadecimal formats. + * Unfortunately, unsigned formats simply didn't work. + * + * Michael Elkins <me@cs.hmc.edu> 03/05/98 for mutt 0.90.8 + * The original code assumed that both snprintf() and vsnprintf() were + * missing. Some systems only have snprintf() but not vsnprintf(), so + * the code is now broken down under HAVE_SNPRINTF and HAVE_VSNPRINTF. + * + **************************************************************/ + +#include "config.h" + +#if !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) + +#include <string.h> +# include <ctype.h> +#include <sys/types.h> + +/* Define this as a fall through, HAVE_STDARG_H is probably already set */ + +#define HAVE_VARARGS_H + +/* varargs declarations: */ + +#if defined(HAVE_STDARG_H) +# include <stdarg.h> +# define HAVE_STDARGS /* let's hope that works everywhere (mj) */ +# define VA_LOCAL_DECL va_list ap +# define VA_START(f) va_start(ap, f) +# define VA_SHIFT(v,t) ; /* no-op for ANSI */ +# define VA_END va_end(ap) +#else +# if defined(HAVE_VARARGS_H) +# include <varargs.h> +# undef HAVE_STDARGS +# define VA_LOCAL_DECL va_list ap +# define VA_START(f) va_start(ap) /* f is ignored! */ +# define VA_SHIFT(v,t) v = va_arg(ap,t) +# define VA_END va_end(ap) +# else +/*XX ** NO VARARGS ** XX*/ +# endif +#endif + +/*int snprintf (char *str, size_t count, const char *fmt, ...);*/ +/*int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);*/ + +static void dopr (char *buffer, size_t maxlen, const char *format, + va_list args); +static void fmtstr (char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max); +static void fmtint (char *buffer, size_t *currlen, size_t maxlen, + long value, int base, int min, int max, int flags); +static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, + long double fvalue, int min, int max, int flags); +static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c ); + +/* + * dopr(): poor man's version of doprintf + */ + +/* format read states */ +#define DP_S_DEFAULT 0 +#define DP_S_FLAGS 1 +#define DP_S_MIN 2 +#define DP_S_DOT 3 +#define DP_S_MAX 4 +#define DP_S_MOD 5 +#define DP_S_CONV 6 +#define DP_S_DONE 7 + +/* format flags - Bits */ +#define DP_F_MINUS (1 << 0) +#define DP_F_PLUS (1 << 1) +#define DP_F_SPACE (1 << 2) +#define DP_F_NUM (1 << 3) +#define DP_F_ZERO (1 << 4) +#define DP_F_UP (1 << 5) +#define DP_F_UNSIGNED (1 << 6) + +/* Conversion Flags */ +#define DP_C_SHORT 1 +#define DP_C_LONG 2 +#define DP_C_LDOUBLE 3 + +#define char_to_int(p) (p - '0') +#define MAX(p,q) ((p >= q) ? p : q) + +static void dopr (char *buffer, size_t maxlen, const char *format, va_list args) +{ + char ch; + long value; + long double fvalue; + char *strvalue; + int min; + int max; + int state; + int flags; + int cflags; + size_t currlen; + + state = DP_S_DEFAULT; + currlen = flags = cflags = min = 0; + max = -1; + ch = *format++; + + while (state != DP_S_DONE) + { + if ((ch == '\0') || (currlen >= maxlen)) + state = DP_S_DONE; + + switch(state) + { + case DP_S_DEFAULT: + if (ch == '%') + state = DP_S_FLAGS; + else + dopr_outch (buffer, &currlen, maxlen, ch); + ch = *format++; + break; + case DP_S_FLAGS: + switch (ch) + { + case '-': + flags |= DP_F_MINUS; + ch = *format++; + break; + case '+': + flags |= DP_F_PLUS; + ch = *format++; + break; + case ' ': + flags |= DP_F_SPACE; + ch = *format++; + break; + case '#': + flags |= DP_F_NUM; + ch = *format++; + break; + case '0': + flags |= DP_F_ZERO; + ch = *format++; + break; + default: + state = DP_S_MIN; + break; + } + break; + case DP_S_MIN: + if (isdigit((unsigned char)ch)) + { + min = 10*min + char_to_int (ch); + ch = *format++; + } + else if (ch == '*') + { + min = va_arg (args, int); + ch = *format++; + state = DP_S_DOT; + } + else + state = DP_S_DOT; + break; + case DP_S_DOT: + if (ch == '.') + { + state = DP_S_MAX; + ch = *format++; + } + else + state = DP_S_MOD; + break; + case DP_S_MAX: + if (isdigit((unsigned char)ch)) + { + if (max < 0) + max = 0; + max = 10*max + char_to_int (ch); + ch = *format++; + } + else if (ch == '*') + { + max = va_arg (args, int); + ch = *format++; + state = DP_S_MOD; + } + else + state = DP_S_MOD; + break; + case DP_S_MOD: + /* Currently, we don't support Long Long, bummer */ + switch (ch) + { + case 'h': + cflags = DP_C_SHORT; + ch = *format++; + break; + case 'l': + cflags = DP_C_LONG; + ch = *format++; + break; + case 'L': + cflags = DP_C_LDOUBLE; + ch = *format++; + break; + default: + break; + } + state = DP_S_CONV; + break; + case DP_S_CONV: + switch (ch) + { + case 'd': + case 'i': + if (cflags == DP_C_SHORT) + value = va_arg (args, short int); + else if (cflags == DP_C_LONG) + value = va_arg (args, long int); + else + value = va_arg (args, int); + fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + break; + case 'o': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned short int); + else if (cflags == DP_C_LONG) + value = va_arg (args, unsigned long int); + else + value = va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 8, min, max, flags); + break; + case 'u': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned short int); + else if (cflags == DP_C_LONG) + value = va_arg (args, unsigned long int); + else + value = va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 10, min, max, flags); + break; + case 'X': + flags |= DP_F_UP; + case 'x': + flags |= DP_F_UNSIGNED; + if (cflags == DP_C_SHORT) + value = va_arg (args, unsigned short int); + else if (cflags == DP_C_LONG) + value = va_arg (args, unsigned long int); + else + value = va_arg (args, unsigned int); + fmtint (buffer, &currlen, maxlen, value, 16, min, max, flags); + break; + case 'f': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, long double); + else + fvalue = va_arg (args, double); + /* um, floating point? */ + fmtfp (buffer, &currlen, maxlen, fvalue, min, max, flags); + break; + case 'E': + flags |= DP_F_UP; + case 'e': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, long double); + else + fvalue = va_arg (args, double); + break; + case 'G': + flags |= DP_F_UP; + case 'g': + if (cflags == DP_C_LDOUBLE) + fvalue = va_arg (args, long double); + else + fvalue = va_arg (args, double); + break; + case 'c': + dopr_outch (buffer, &currlen, maxlen, va_arg (args, int)); + break; + case 's': + strvalue = va_arg (args, char *); + if (max < 0) + max = maxlen; /* ie, no max */ + fmtstr (buffer, &currlen, maxlen, strvalue, flags, min, max); + break; + case 'p': + strvalue = va_arg (args, void *); + fmtint (buffer, &currlen, maxlen, (long) strvalue, 16, min, max, flags); + break; + case 'n': + if (cflags == DP_C_SHORT) + { + short int *num; + num = va_arg (args, short int *); + *num = currlen; + } + else if (cflags == DP_C_LONG) + { + long int *num; + num = va_arg (args, long int *); + *num = currlen; + } + else + { + int *num; + num = va_arg (args, int *); + *num = currlen; + } + break; + case '%': + dopr_outch (buffer, &currlen, maxlen, ch); + break; + case 'w': + /* not supported yet, treat as next char */ + ch = *format++; + break; + default: + /* Unknown, skip */ + break; + } + ch = *format++; + state = DP_S_DEFAULT; + flags = cflags = min = 0; + max = -1; + break; + case DP_S_DONE: + break; + default: + /* hmm? */ + break; /* some picky compilers need this */ + } + } + if (currlen < maxlen - 1) + buffer[currlen] = '\0'; + else + buffer[maxlen - 1] = '\0'; +} + +static void fmtstr (char *buffer, size_t *currlen, size_t maxlen, + char *value, int flags, int min, int max) +{ + int padlen, strln; /* amount to pad */ + int cnt = 0; + + if (value == 0) + { + value = "<NULL>"; + } + + for (strln = 0; value[strln]; ++strln); /* strlen */ + padlen = min - strln; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justify */ + + while ((padlen > 0) && (cnt < max)) + { + dopr_outch (buffer, currlen, maxlen, ' '); + --padlen; + ++cnt; + } + while (*value && (cnt < max)) + { + dopr_outch (buffer, currlen, maxlen, *value++); + ++cnt; + } + while ((padlen < 0) && (cnt < max)) + { + dopr_outch (buffer, currlen, maxlen, ' '); + ++padlen; + ++cnt; + } +} + +/* Have to handle DP_F_NUM (ie 0x and 0 alternates) */ + +static void fmtint (char *buffer, size_t *currlen, size_t maxlen, + long value, int base, int min, int max, int flags) +{ + int signvalue = 0; + unsigned long uvalue; + char convert[20]; + int place = 0; + int spadlen = 0; /* amount to space pad */ + int zpadlen = 0; /* amount to zero pad */ + int caps = 0; + + if (max < 0) + max = 0; + + uvalue = value; + + if(!(flags & DP_F_UNSIGNED)) + { + if( value < 0 ) { + signvalue = '-'; + uvalue = -value; + } + else + if (flags & DP_F_PLUS) /* Do a sign (+/i) */ + signvalue = '+'; + else + if (flags & DP_F_SPACE) + signvalue = ' '; + } + + if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ + + do { + convert[place++] = + (caps? "0123456789ABCDEF":"0123456789abcdef") + [uvalue % (unsigned)base ]; + uvalue = (uvalue / (unsigned)base ); + } while(uvalue && (place < 20)); + if (place == 20) place--; + convert[place] = 0; + + zpadlen = max - place; + spadlen = min - MAX (max, place) - (signvalue ? 1 : 0); + if (zpadlen < 0) zpadlen = 0; + if (spadlen < 0) spadlen = 0; + if (flags & DP_F_ZERO) + { + zpadlen = MAX(zpadlen, spadlen); + spadlen = 0; + } + if (flags & DP_F_MINUS) + spadlen = -spadlen; /* Left Justifty */ + +#ifdef DEBUG_SNPRINTF + dprint (1, (debugfile, "zpad: %d, spad: %d, min: %d, max: %d, place: %d\n", + zpadlen, spadlen, min, max, place)); +#endif + + /* Spaces */ + while (spadlen > 0) + { + dopr_outch (buffer, currlen, maxlen, ' '); + --spadlen; + } + + /* Sign */ + if (signvalue) + dopr_outch (buffer, currlen, maxlen, signvalue); + + /* Zeros */ + if (zpadlen > 0) + { + while (zpadlen > 0) + { + dopr_outch (buffer, currlen, maxlen, '0'); + --zpadlen; + } + } + + /* Digits */ + while (place > 0) + dopr_outch (buffer, currlen, maxlen, convert[--place]); + + /* Left Justified spaces */ + while (spadlen < 0) { + dopr_outch (buffer, currlen, maxlen, ' '); + ++spadlen; + } +} + +static long double abs_val (long double value) +{ + long double result = value; + + if (value < 0) + result = -value; + + return result; +} + +static long double pow10 (int exp) +{ + long double result = 1; + + while (exp) + { + result *= 10; + exp--; + } + + return result; +} + +static long round (long double value) +{ + long intpart; + + intpart = value; + value = value - intpart; + if (value >= 0.5) + intpart++; + + return intpart; +} + +static void fmtfp (char *buffer, size_t *currlen, size_t maxlen, + long double fvalue, int min, int max, int flags) +{ + int signvalue = 0; + long double ufvalue; + char iconvert[20]; + char fconvert[20]; + int iplace = 0; + int fplace = 0; + int padlen = 0; /* amount to pad */ + int zpadlen = 0; + int caps = 0; + long intpart; + long fracpart; + + /* + * AIX manpage says the default is 0, but Solaris says the default + * is 6, and sprintf on AIX defaults to 6 + */ + if (max < 0) + max = 6; + + ufvalue = abs_val (fvalue); + + if (fvalue < 0) + signvalue = '-'; + else + if (flags & DP_F_PLUS) /* Do a sign (+/i) */ + signvalue = '+'; + else + if (flags & DP_F_SPACE) + signvalue = ' '; + +#if 0 + if (flags & DP_F_UP) caps = 1; /* Should characters be upper case? */ +#endif + + intpart = ufvalue; + + /* + * Sorry, we only support 9 digits past the decimal because of our + * conversion method + */ + if (max > 9) + max = 9; + + /* We "cheat" by converting the fractional part to integer by + * multiplying by a factor of 10 + */ + fracpart = round ((pow10 (max)) * (ufvalue - intpart)); + + if (fracpart >= pow10 (max)) + { + intpart++; + fracpart -= pow10 (max); + } + +#ifdef DEBUG_SNPRINTF + dprint (1, (debugfile, "fmtfp: %f =? %d.%d\n", fvalue, intpart, fracpart)); +#endif + + /* Convert integer part */ + do { + iconvert[iplace++] = + (caps? "0123456789ABCDEF":"0123456789abcdef")[intpart % 10]; + intpart = (intpart / 10); + } while(intpart && (iplace < 20)); + if (iplace == 20) iplace--; + iconvert[iplace] = 0; + + /* Convert fractional part */ + do { + fconvert[fplace++] = + (caps? "0123456789ABCDEF":"0123456789abcdef")[fracpart % 10]; + fracpart = (fracpart / 10); + } while(fracpart && (fplace < 20)); + if (fplace == 20) fplace--; + fconvert[fplace] = 0; + + /* -1 for decimal point, another -1 if we are printing a sign */ + padlen = min - iplace - max - 1 - ((signvalue) ? 1 : 0); + zpadlen = max - fplace; + if (zpadlen < 0) + zpadlen = 0; + if (padlen < 0) + padlen = 0; + if (flags & DP_F_MINUS) + padlen = -padlen; /* Left Justifty */ + + if ((flags & DP_F_ZERO) && (padlen > 0)) + { + if (signvalue) + { + dopr_outch (buffer, currlen, maxlen, signvalue); + --padlen; + signvalue = 0; + } + while (padlen > 0) + { + dopr_outch (buffer, currlen, maxlen, '0'); + --padlen; + } + } + while (padlen > 0) + { + dopr_outch (buffer, currlen, maxlen, ' '); + --padlen; + } + if (signvalue) + dopr_outch (buffer, currlen, maxlen, signvalue); + + while (iplace > 0) + dopr_outch (buffer, currlen, maxlen, iconvert[--iplace]); + + /* + * Decimal point. This should probably use locale to find the correct + * char to print out. + */ + dopr_outch (buffer, currlen, maxlen, '.'); + + while (fplace > 0) + dopr_outch (buffer, currlen, maxlen, fconvert[--fplace]); + + while (zpadlen > 0) + { + dopr_outch (buffer, currlen, maxlen, '0'); + --zpadlen; + } + + while (padlen < 0) + { + dopr_outch (buffer, currlen, maxlen, ' '); + ++padlen; + } +} + +static void dopr_outch (char *buffer, size_t *currlen, size_t maxlen, char c) +{ + if (*currlen < maxlen) + buffer[(*currlen)++] = c; +} +#endif /* !defined(HAVE_SNPRINTF) || !defined(HAVE_VSNPRINTF) */ + +#ifndef HAVE_VSNPRINTF +int vsnprintf (char *str, size_t count, const char *fmt, va_list args) +{ + str[0] = 0; + dopr(str, count, fmt, args); + return(strlen(str)); +} +#endif /* !HAVE_VSNPRINTF */ + +#ifndef HAVE_SNPRINTF +/* VARARGS3 */ +#ifdef HAVE_STDARGS +int snprintf (char *str,size_t count,const char *fmt,...) +#else +int snprintf (va_alist) va_dcl +#endif +{ +#ifndef HAVE_STDARGS + char *str; + size_t count; + char *fmt; +#endif + VA_LOCAL_DECL; + + VA_START (fmt); + VA_SHIFT (str, char *); + VA_SHIFT (count, size_t ); + VA_SHIFT (fmt, char *); + (void) vsnprintf(str, count, fmt, ap); + VA_END; + return(strlen(str)); +} + +#ifdef TEST_SNPRINTF +#ifndef LONG_STRING +#define LONG_STRING 1024 +#endif +int main (void) +{ + char buf1[LONG_STRING]; + char buf2[LONG_STRING]; + char *fp_fmt[] = { + "%-1.5f", + "%1.5f", + "%123.9f", + "%10.5f", + "% 10.5f", + "%+22.9f", + "%+4.9f", + "%01.3f", + "%4f", + "%3.1f", + "%3.2f", + NULL + }; + double fp_nums[] = { -1.5, 134.21, 91340.2, 341.1234, 0203.9, 0.96, 0.996, + 0.9996, 1.996, 4.136, 0}; + char *int_fmt[] = { + "%-1.5d", + "%1.5d", + "%123.9d", + "%5.5d", + "%10.5d", + "% 10.5d", + "%+22.33d", + "%01.3d", + "%4d", + NULL + }; + long int_nums[] = { -1, 134, 91340, 341, 0203, 0}; + int x, y; + int fail = 0; + int num = 0; + + printf ("Testing snprintf format codes against system sprintf...\n"); + + for (x = 0; fp_fmt[x] != NULL ; x++) + for (y = 0; fp_nums[y] != 0 ; y++) + { + snprintf (buf1, sizeof (buf1), fp_fmt[x], fp_nums[y]); + sprintf (buf2, fp_fmt[x], fp_nums[y]); + if (strcmp (buf1, buf2)) + { + printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", + fp_fmt[x], buf1, buf2); + fail++; + } + num++; + } + + for (x = 0; int_fmt[x] != NULL ; x++) + for (y = 0; int_nums[y] != 0 ; y++) + { + snprintf (buf1, sizeof (buf1), int_fmt[x], int_nums[y]); + sprintf (buf2, int_fmt[x], int_nums[y]); + if (strcmp (buf1, buf2)) + { + printf("snprintf doesn't match Format: %s\n\tsnprintf = %s\n\tsprintf = %s\n", + int_fmt[x], buf1, buf2); + fail++; + } + num++; + } + printf ("%d tests failed out of %d.\n", fail, num); +} +#endif /* SNPRINTF_TEST */ + +#endif /* !HAVE_SNPRINTF */
A src/bsd-snprintf.h

@@ -0,0 +1,17 @@

+#ifndef _BSD_SNPRINTF_H +#define _BSD_SNPRINTF_H + +#include "config.h" + +#include <sys/types.h> /* For size_t */ + +#ifndef HAVE_SNPRINTF +int snprintf(char *str, size_t count, const char *fmt, ...); +#endif /* !HAVE_SNPRINTF */ + +#ifndef HAVE_VSNPRINTF +int vsnprintf(char *str, size_t count, const char *fmt, va_list args); +#endif /* !HAVE_SNPRINTF */ + + +#endif /* _BSD_SNPRINTF_H */
A src/fluxbox.cc

@@ -0,0 +1,2560 @@

+// fluxbox.cc for Fluxbox. +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) + +// blackbox.cc for blackbox - an X11 Window manager +// 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 <X11/Xlib.h> +#include <X11/Xutil.h> +#include <X11/Xresource.h> +#include <X11/Xatom.h> +#include <X11/keysym.h> + +#ifdef SHAPE +#include <X11/extensions/shape.h> +#endif // SHAPE + +#include "i18n.hh" +#include "fluxbox.hh" +#include "Basemenu.hh" +#include "Clientmenu.hh" +#include "Rootmenu.hh" +#include "Screen.hh" + +#ifdef SLIT +#include "Slit.hh" +#endif // SLIT + +#include "Toolbar.hh" +#include "Window.hh" +#include "Workspace.hh" +#include "Workspacemenu.hh" + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +#endif // STDC_HEADERS + +#ifdef HAVE_UNISTD_H +# include <sys/types.h> +# include <unistd.h> +#endif // HAVE_UNISTD_H + +#ifdef HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif // HAVE_SYS_PARAM_H + +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif // MAXPATHLEN + +#ifdef HAVE_SYS_SELECT_H +# include <sys/select.h> +#endif // HAVE_SYS_SELECT_H + +#ifdef HAVE_SIGNAL_H +# include <signal.h> +#endif // HAVE_SIGNAL_H + +#ifdef HAVE_SYS_SIGNAL_H +# include <sys/signal.h> +#endif // HAVE_SYS_SIGNAL_H + +#ifdef HAVE_SYS_STAT_H +# include <sys/types.h> +# include <sys/stat.h> +#endif // HAVE_SYS_STAT_H + +#ifdef TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +# else // !HAVE_SYS_TIME_H +# include <time.h> +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +#ifdef HAVE_LIBGEN_H +# include <libgen.h> +#endif // HAVE_LIBGEN_H + +#include <iostream> +#include <string> + +#ifndef HAVE_BASENAME +static inline char *basename (char *); +static inline char *basename (char *s) { + char *save = s; + + while (*s) if (*s++ == '/') save = s; + + return save; +} +#endif // HAVE_BASENAME + +#define RC_PATH "fluxbox" +#define RC_INIT_FILE "init" + +using namespace std; +// 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; +} + +//------------- expandFilename ---------------------- +// if ~ then expand it to home of user +// returns expanded filename +// (note: the function creates new memory for the string) +//--------------------------------------------------- +char *Fluxbox::expandFilename(char *filename) { + char retval[strlen(filename)+strlen(getenv("HOME"))+2]; //2 extra byte just to be safe + retval[0]=0; //mark end + if (filename[0]=='~') { + strcat(retval, getenv("HOME")); + strcat(retval, &filename[1]); + } else + return bstrdup(filename); //return unmodified value + + return bstrdup(retval); //return modified value +} + +//static singleton var +Fluxbox *Fluxbox::singleton=0; + +//------------ instance --------------------- +//returns singleton object of blackbox class +//since we only need to create one instance of Fluxbox +//------------------------------------------- +Fluxbox *Fluxbox::instance(int m_argc, char **m_argv, char *dpy_name, char *rc) { + return singleton; +} + + +Fluxbox::Fluxbox(int m_argc, char **m_argv, char *dpy_name, char *rc) + : BaseDisplay(m_argv[0], dpy_name) +{ + + //singleton pointer + singleton = this; + grab(); + + if (! XSupportsLocale()) + fprintf(stderr, "X server does not support locale\n"); + + if (XSetLocaleModifiers("") == NULL) + fprintf(stderr, "cannot set locale modifiers\n"); + +// Set default values to member variables + + argc = m_argc; + argv = m_argv; + rc_file = rc; + key=0; + + no_focus = False; + resource.titlebar_file = resource.menu_file = resource.style_file = resource.keys_file = + resource.root_cmd = 0; + resource.auto_raise_delay.tv_sec = resource.auto_raise_delay.tv_usec = 0; + + focused_window = masked_window = (FluxboxWindow *) 0; + masked = None; + /*resource.tabtype.listtype = TabType::Vertical; + resource.tabtype.listpos = TabType::Top; + resource.tabtype.pos = TabType::Right; + */ + + windowSearchList = new LinkedList<WindowSearch>; + menuSearchList = new LinkedList<MenuSearch>; + +#ifdef SLIT + slitSearchList = new LinkedList<SlitSearch>; + #ifdef KDE + //For KDE dock applets + kwm1_dockwindow = XInternAtom(getXDisplay(), "KWM_DOCKWINDOW", False); //KDE v1.x + kwm2_dockwindow = XInternAtom(getXDisplay(), "_KDE_NET_WM_SYSTEM_TRAY_WINDOW_FOR", False); //KDE v2.x + #endif //KDE + +#endif // SLIT + + toolbarSearchList = new LinkedList<ToolbarSearch>; + tabSearchList = new LinkedList<TabSearch>; + groupSearchList = new LinkedList<WindowSearch>; + + menuTimestamps = new LinkedList<MenuTimestamp>; + + XrmInitialize(); + load_rc(); + +#ifdef HAVE_GETPID + fluxbox_pid = XInternAtom(getXDisplay(), "_BLACKBOX_PID", False); +#endif // HAVE_GETPID + + screenList = new LinkedList<BScreen>; + int i; + + //allocate screens + for (i = 0; i < getNumberOfScreens(); i++) { + BScreen *screen = new BScreen(this, i); + + if (! screen->isScreenManaged()) { + delete screen; + continue; + } + + screenList->insert(screen); + } + I18n *i18n = I18n::instance(); + if (! screenList->count()) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + blackboxSet, blackboxNoManagableScreens, +#else // !NLS + 0, 0, +#endif // NLS + "Fluxbox::Fluxbox: no managable screens found, aborting.\n")); + + throw static_cast<int>(3); + } + + XSynchronize(getXDisplay(), False); + XSync(getXDisplay(), False); + + reconfigure_wait = reread_menu_wait = False; + + timer = new BTimer(this, this); + timer->setTimeout(0); + timer->fireOnce(True); + + //create keybindings handler and load keys file + key = new Keys(resource.keys_file); + + ungrab(); +} + + +Fluxbox::~Fluxbox(void) { + + while (screenList->count()) + delete screenList->remove(0); + + while (menuTimestamps->count()) { + MenuTimestamp *ts = menuTimestamps->remove(0); + + if (ts->filename) + delete [] ts->filename; + + delete ts; + } + + delete key; + key = 0; + + if (resource.root_cmd) + delete [] resource.root_cmd; + + if (resource.menu_file) + delete [] resource.menu_file; + + if (resource.style_file) + delete [] resource.style_file; + + if (resource.titlebar_file) + delete resource.titlebar_file; + + if (resource.keys_file) + delete resource.keys_file; + + delete timer; + + delete screenList; + delete menuTimestamps; + + delete windowSearchList; + delete menuSearchList; + delete toolbarSearchList; + delete tabSearchList; + delete groupSearchList; + +#ifdef SLIT + delete slitSearchList; +#endif // SLIT +} + + +void Fluxbox::process_event(XEvent *e) { + + 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: + { + last_time = e->xbutton.time; + + FluxboxWindow *win = (FluxboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + + #ifdef SLIT + Slit *slit = (Slit *) 0; + #endif // SLIT + + Toolbar *tbar = (Toolbar *) 0; + Tab *tab = 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 if ((tab = searchTab(e->xbutton.window))) { + tab->buttonPressEvent(&e->xbutton); + } else { + LinkedListIterator<BScreen> it(screenList); + + for (; it.current(); it++) { + BScreen *screen = it.current(); + + + //if ( e->xbutton.button == 1 && + // (win = screen->getIconBar()->findWindow(e->xbutton.window)) ) { + // win->deiconify(); + + 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->getWorkspacemenu()->getWidth() - + screen->getBorderWidth(); + + if (my + screen->getWorkspacemenu()->getHeight() > + screen->getHeight()) + my = screen->getHeight() - + 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() - + screen->getRootmenu()->getWidth() - + screen->getBorderWidth(); + + if (my + screen->getRootmenu()->getHeight() > + screen->getHeight()) + my = screen->getHeight() - + screen->getRootmenu()->getHeight() - + screen->getBorderWidth(); + + screen->getRootmenu()->move(mx, my); + + if (! screen->getRootmenu()->isVisible()) { + checkMenu(); + screen->getRootmenu()->show(); + } + + } + + } + } + } + + break; + } + + case ButtonRelease: + { + last_time = e->xbutton.time; + FluxboxWindow *win = (FluxboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + Tab *tab = 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); + else if ((tab = searchTab(e->xbutton.window))) + tab->buttonReleaseEvent(&e->xbutton); + break; + } + + case ConfigureRequest: + { + FluxboxWindow *win = (FluxboxWindow *) 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::instance()-> + getMessage( +# ifdef NLS + blackboxSet, blackboxMapRequest, +# else // !NLS + 0, 0, +# endif // NLS + "Fluxbox::process_event(): MapRequest for 0x%lx\n"), + e->xmaprequest.window); +#endif // DEBUG + #ifdef SLIT + #ifdef KDE + //Check and see if client is KDE dock applet. + //If so add to Slit + bool iskdedockapp = False; + Atom ajunk; + int ijunk; + unsigned long *data = (unsigned long *) 0, uljunk; + + // Check if KDE v2.x dock applet + if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window, + getKWM2DockwindowAtom(), 0l, 1l, False, + XA_WINDOW, &ajunk, &ijunk, &uljunk, + &uljunk, (unsigned char **) &data) == Success) { + + if (data) + iskdedockapp = True; + XFree((char *) data); + + } + + // Check if KDE v1.x dock applet + if (!iskdedockapp) { + if (XGetWindowProperty(getXDisplay(), e->xmaprequest.window, + getKWM1DockwindowAtom(), 0l, 1l, False, + getKWM1DockwindowAtom(), &ajunk, &ijunk, &uljunk, + &uljunk, (unsigned char **) &data) == Success) { + iskdedockapp = (data && data[0] != 0); + XFree((char *) data); + } + } + + if (iskdedockapp) { + XSelectInput(getXDisplay(), e->xmaprequest.window, StructureNotifyMask); + LinkedListIterator<BScreen> it(screenList); + for (; it.current() == screenList->last(); it++) { + BScreen *screen = it.current(); + screen->getSlit()->addClient(e->xmaprequest.window); + } + return; + } + #endif //KDE + #endif // SLIT + + FluxboxWindow *win = searchWindow(e->xmaprequest.window); + + if (! win) + win = new FluxboxWindow(e->xmaprequest.window); + + + if ((win = searchWindow(e->xmaprequest.window))) + win->mapRequestEvent(&e->xmaprequest); + + break; + } + + case MapNotify: + { + FluxboxWindow *win = searchWindow(e->xmap.window); + + if (win) + win->mapNotifyEvent(&e->xmap); + + break; + } + + case UnmapNotify: + { + FluxboxWindow *win = (FluxboxWindow *) 0; + +#ifdef SLIT + Slit *slit = (Slit *) 0; +#endif // SLIT + + if ((win = searchWindow(e->xunmap.window))) { + win->unmapNotifyEvent(&e->xunmap); + +#ifdef SLIT + } else if ((slit = searchSlit(e->xunmap.window))) { + slit->removeClient(e->xunmap.window); +#endif // SLIT + + } + + break; + } + + case DestroyNotify: + { + FluxboxWindow *win = (FluxboxWindow *) 0; + +#ifdef SLIT + Slit *slit = 0; +#endif // SLIT + + if ((win = searchWindow(e->xdestroywindow.window))) { + win->destroyNotifyEvent(&e->xdestroywindow); +#ifdef SLIT + } else if ((slit = searchSlit(e->xdestroywindow.window))) { + slit->removeClient(e->xdestroywindow.window, False); +#endif // SLIT + } + + break; + } + + case MotionNotify: + { + last_time = e->xmotion.time; + + FluxboxWindow *win = 0; + Basemenu *menu = 0; + Tab *tab = 0; + + if ((win = searchWindow(e->xmotion.window))) + win->motionNotifyEvent(&e->xmotion); + else if ((menu = searchMenu(e->xmotion.window))) + menu->motionNotifyEvent(&e->xmotion); + else if ((tab = searchTab(e->xmotion.window))) + tab->motionNotifyEvent(&e->xmotion); + + break; + } + + case PropertyNotify: + { + last_time = e->xproperty.time; + + if (e->xproperty.state != PropertyDelete) { + FluxboxWindow *win = searchWindow(e->xproperty.window); + + if (win) + win->propertyNotifyEvent(e->xproperty.atom); + } + + break; + } + + case EnterNotify: + { + last_time = e->xcrossing.time; + + BScreen *screen = (BScreen *) 0; + FluxboxWindow *win = (FluxboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + Tab *tab = (Tab *) 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() || + win->getScreen()->isSemiSloppyFocus()) && + (! 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); + else if ((tab = searchTab(e->xcrossing.window))) { + win = tab->getWindow(); + if (win->getScreen()->isSloppyFocus() && (! win->isFocused()) && + (! no_focus)) { + win->getScreen()->getWorkspace(win->getWorkspaceNumber())->raiseWindow(win); + + grab(); + + if (((! sa.leave) || sa.inferior) && win->isVisible() && + win->setInputFocus()) + win->installColormap(True); + + ungrab(); + } + } + +#ifdef SLIT + else if ((slit = searchSlit(e->xcrossing.window))) + slit->enterNotifyEvent(&e->xcrossing); +#endif // SLIT + + break; + } + + case LeaveNotify: + { + last_time = e->xcrossing.time; + + FluxboxWindow *win = (FluxboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + // Tab *tab = 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); + // else if ((tab = searchTab(e->xcrossing.window))) + // tab->leaveNotifyEvent(&e->xcrossing); +#ifdef SLIT + else if ((slit = searchSlit(e->xcrossing.window))) + slit->leaveNotifyEvent(&e->xcrossing); +#endif // SLIT + + break; + } + + case Expose: + { + FluxboxWindow *win = (FluxboxWindow *) 0; + Basemenu *menu = (Basemenu *) 0; + Toolbar *tbar = (Toolbar *) 0; + Tab *tab = 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); + else if ((tab = searchTab(e->xexpose.window))) + tab->exposeEvent(&e->xexpose); + break; + } + + case KeyPress: + { + Toolbar *tbar = searchToolbar(e->xkey.window); + BScreen *screen = searchScreen(e->xkey.window); + + if (tbar && tbar->isEditing()) + tbar->keyPressEvent(&e->xkey); + else if (screen) { + #ifdef DEBUG + cerr<<"KeyEvent"<<endl; + #endif + //find action + Keys::KeyAction action = key->getAction(&e->xkey); + #ifdef DEBUG + const char *actionstr = key->getActionStr(action); + if (actionstr) + cerr<<"KeyAction("<<actionstr<<")"<<endl; + #endif + if (action==Keys::lastKeygrab) //if action not found end case + break; + + switch (action) { + case Keys::grabWorkspace1: + screen->changeWorkspaceID(0); + break; + case Keys::grabWorkspace2: + screen->changeWorkspaceID(1); + break; + case Keys::grabWorkspace3: + screen->changeWorkspaceID(2); + break; + case Keys::grabWorkspace4: + screen->changeWorkspaceID(3); + break; + case Keys::grabWorkspace5: + screen->changeWorkspaceID(4); + break; + case Keys::grabWorkspace6: + screen->changeWorkspaceID(5); + break; + case Keys::grabWorkspace7: + screen->changeWorkspaceID(6); + break; + case Keys::grabWorkspace8: + screen->changeWorkspaceID(7); + break; + case Keys::grabWorkspace9: + screen->changeWorkspaceID(8); + break; + case Keys::grabWorkspace10: + screen->changeWorkspaceID(9); + break; + case Keys::grabWorkspace11: + screen->changeWorkspaceID(10); + break; + case Keys::grabWorkspace12: + screen->changeWorkspaceID(11); + break; + case Keys::grabNextWorkspace: + screen->nextWorkspace(); + break; + case Keys::grabPrevWorkspace: + screen->prevWorkspace(); + break; + /*case Keys::grabUpWorkspace: + break; + case Keys::grabDownWorkspace: + break; + case Keys::grabLeftWorkspace: + break; + case Keys::grabRightWorkspace: + break; + */ + case Keys::grabKillWindow: //kill the current window + break; + case Keys::grabNextWindow: //activate next window + screen->nextFocus(); + break; + case Keys::grabPrevWindow: //activate prev window + screen->prevFocus(); + break; + case Keys::grabNextTab: + if (focused_window && focused_window->getTab()) { + Tab *tab = focused_window->getTab(); + if (tab->next()) { + screen->getCurrentWorkspace()->raiseWindow( + tab->next()->getWindow()); + tab->next()->getWindow()->setInputFocus(); + } + } + break; + case Keys::grabPrevTab: + if (focused_window && focused_window->getTab()) { + Tab *tab = focused_window->getTab(); + if (tab->prev()) { + screen->getCurrentWorkspace()->raiseWindow( + tab->prev()->getWindow()); + tab->prev()->getWindow()->setInputFocus(); + } + } + break; + case Keys::grabExecute: //execute command on keypress + { + #ifndef __EMX__ + char displaystring[MAXPATHLEN]; + sprintf(displaystring, "DISPLAY=%s", + DisplayString(getXDisplay())); + sprintf(displaystring + strlen(displaystring) - 1, "%d", + screen->getScreenNumber()); + #ifdef DEBUG + cerr<<__FILE__<<"("<<__LINE__<<"): Executing:"<<key->getExecCommand().c_str()<<endl; + #endif + + bexec(key->getExecCommand().c_str(), displaystring); + #else + spawnlp(P_NOWAIT, "cmd.exe", "cmd.exe", "/c", item->exec(), NULL); + #endif // !__EMX__ + + break; + } + default: //try to see if its a window action + doWindowAction(action); + } + } + 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; + + FluxboxWindow *win = searchWindow(e->xfocus.window); + if (win && ! win->isFocused()) + setFocusedWindow(win); + + break; + } + + case FocusOut: + break; + + case ClientMessage: + { + if (e->xclient.format == 32) { + if (e->xclient.message_type == getWMChangeStateAtom()) { + FluxboxWindow *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 == getFluxboxChangeWorkspaceAtom()) { + BScreen *screen = searchScreen(e->xclient.window); + + if (screen && e->xclient.data.l[0] >= 0 && + e->xclient.data.l[0] < screen->getCount()) + screen->changeWorkspaceID(e->xclient.data.l[0]); + + } else if (e->xclient.message_type == getFluxboxChangeWindowFocusAtom()) { + FluxboxWindow *win = searchWindow(e->xclient.window); + + if (win && win->isVisible() && win->setInputFocus()) + win->installColormap(True); + } else if (e->xclient.message_type == getFluxboxCycleWindowFocusAtom()) { + 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 == getFluxboxChangeAttributesAtom()) { + + FluxboxWindow *win = searchWindow(e->xclient.window); + + if (win && win->validateClient()) { + BlackboxHints 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->changeBlackboxHints(&net); + } + } + } + + break; + } + + + default: + { + +#ifdef SHAPE + if (e->type == getShapeEventBase()) { + XShapeEvent *shape_event = (XShapeEvent *) e; + FluxboxWindow *win = (FluxboxWindow *) 0; + + if ((win = searchWindow(e->xany.window)) || + (shape_event->kind != ShapeBounding)) + win->shapeEvent(shape_event); + } +#endif // SHAPE + + } + } +} + +void Fluxbox::doWindowAction(Keys::KeyAction action) { + if (!focused_window) + return; + + switch (action) { + case Keys::grabIconify: + focused_window->iconify(); + break; + case Keys::grabRaise: + focused_window->getScreen()->getWorkspace(focused_window->getWorkspaceNumber())->raiseWindow(focused_window); + break; + case Keys::grabLower: + XLowerWindow(getXDisplay(), focused_window->getFrameWindow()); + break; + case Keys::grabClose: + focused_window->close(); + break; + case Keys::grabShade: + focused_window->shade(); + break; + case Keys::grabMaximize: + focused_window->maximize(0); + break; + case Keys::grabStick: + focused_window->stick(); + break; + case Keys::grabVertMax: + //!!TODO: fix this + if (focused_window->isResizable()) { + int w = focused_window->getWidth(); + int x = focused_window->getXFrame(); + int y = focused_window->getYFrame(); + focused_window->maximize(0); + focused_window->configure(x, y, w, focused_window->getHeight()); + } + break; + case Keys::grabHorizMax: + //!!TODO: fix this + if (focused_window->isResizable()) { + int h = focused_window->getHeight(); + int x = focused_window->getXFrame(); + int y = focused_window->getYFrame(); + focused_window->maximize(0); + focused_window->configure(x, y, focused_window->getWidth(), h); + } + break; + case Keys::grabNudgeRight: + focused_window->configure( + focused_window->getXFrame()+1, focused_window->getYFrame(), + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabNudgeLeft: + focused_window->configure( + focused_window->getXFrame()-1, focused_window->getYFrame(), + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabNudgeUp: + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame()-1, + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabNudgeDown: + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame()+1, + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabBigNudgeRight: + focused_window->configure( + focused_window->getXFrame()+10, focused_window->getYFrame(), + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabBigNudgeLeft: + focused_window->configure( + focused_window->getXFrame()-10, focused_window->getYFrame(), + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabBigNudgeUp: + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame()-10, + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabBigNudgeDown: + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame()+10, + focused_window->getWidth(), focused_window->getHeight()); + break; + case Keys::grabHorizInc: + if (focused_window->isResizable()) + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame(), + focused_window->getWidth()+10, focused_window->getHeight()); + break; + case Keys::grabVertInc: + if (focused_window->isResizable()) + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame(), + focused_window->getWidth(), focused_window->getHeight()+10); + break; + case Keys::grabHorizDec: + if (focused_window->isResizable()) + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame(), + focused_window->getWidth()-10, focused_window->getHeight()); + break; + case Keys::grabVertDec: + if (focused_window->isResizable()) + focused_window->configure( + focused_window->getXFrame(), focused_window->getYFrame(), + focused_window->getWidth(), focused_window->getHeight()-10); + break; + default: + break; + } + +} + +Bool Fluxbox::handleSignal(int sig) { + switch (sig) { + case SIGHUP: + reconfigure(); + break; + + case SIGUSR1: + reload_rc(); + break; + + case SIGUSR2: + rereadMenu(); + break; + + case SIGSEGV: + case SIGFPE: + case SIGINT: + case SIGTERM: + shutdown(); + + default: + return False; + } + + return True; +} + + +BScreen *Fluxbox::searchScreen(Window window) { + BScreen *screen = (BScreen *) 0; + LinkedListIterator<BScreen> it(screenList); + + for (; it.current(); it++) { + if (it.current()) + if (it.current()->getRootWindow() == window) { + screen = it.current(); + return screen; + } + } + + return (BScreen *) 0; +} + + +FluxboxWindow *Fluxbox::searchWindow(Window window) { + LinkedListIterator<WindowSearch> it(windowSearchList); + + for (; it.current(); it++) { + WindowSearch *tmp = it.current(); + if (tmp && tmp->getWindow() == window) + return tmp->getData(); + } + + return (FluxboxWindow *) 0; +} + + +FluxboxWindow *Fluxbox::searchGroup(Window window, FluxboxWindow *win) { + FluxboxWindow *w = (FluxboxWindow *) 0; + LinkedListIterator<WindowSearch> it(groupSearchList); + + for (; it.current(); it++) { + WindowSearch *tmp = it.current(); + if (tmp) + if (tmp->getWindow() == window) { + w = tmp->getData(); + if (w->getClientWindow() != win->getClientWindow()) + return win; + } + } + + return (FluxboxWindow *) 0; +} + + +Basemenu *Fluxbox::searchMenu(Window window) { + Basemenu *menu = (Basemenu *) 0; + LinkedListIterator<MenuSearch> it(menuSearchList); + + for (; it.current(); it++) { + MenuSearch *tmp = it.current(); + + if (tmp) + if (tmp->getWindow() == window) { + menu = tmp->getData(); + return menu; + } + } + + return (Basemenu *) 0; +} + + +Toolbar *Fluxbox::searchToolbar(Window window) { + Toolbar *tbar = (Toolbar *) 0; + LinkedListIterator<ToolbarSearch> it(toolbarSearchList); + + for (; it.current(); it++) { + ToolbarSearch *tmp = it.current(); + + if (tmp) + if (tmp->getWindow() == window) { + tbar = tmp->getData(); + return tbar; + } + } + + return (Toolbar *) 0; +} + +Tab *Fluxbox::searchTab(Window window) { + LinkedListIterator<TabSearch> it(tabSearchList); + + for (; it.current(); it++) { + TabSearch *tmp = it.current(); + if (tmp && tmp->getWindow() == window) + return tmp->getData(); + } + + return 0; +} + + +#ifdef SLIT +Slit *Fluxbox::searchSlit(Window window) { + Slit *s = (Slit *) 0; + LinkedListIterator<SlitSearch> it(slitSearchList); + + for (; it.current(); it++) { + SlitSearch *tmp = it.current(); + + if (tmp) + if (tmp->getWindow() == window) { + s = tmp->getData(); + return s; + } + } + + return (Slit *) 0; +} +#endif // SLIT + + +void Fluxbox::saveWindowSearch(Window window, FluxboxWindow *data) { + windowSearchList->insert(new WindowSearch(window, data)); + +#ifdef GNOME + /* + Window *wl=0; + int num=0; + + num = windowSearchList->count(); + wl = new Window[num]; + // Fill in array of window ID's + LinkedListIterator<WindowSearch> it(windowSearchList); + + for (unsigned int i=0; it.current(); it++, i++) + wl[i] = it.current()->getWindow(); + + //set property + XChangeProperty(getXDisplay(), DefaultRootWindow(getXDisplay()), getGnomeClientListAtom(), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)(wl), num); + + delete wl; + */ +#endif + +} + + +void Fluxbox::saveGroupSearch(Window window, FluxboxWindow *data) { + groupSearchList->insert(new WindowSearch(window, data)); +} + + +void Fluxbox::saveMenuSearch(Window window, Basemenu *data) { + menuSearchList->insert(new MenuSearch(window, data)); +} + + +void Fluxbox::saveToolbarSearch(Window window, Toolbar *data) { + toolbarSearchList->insert(new ToolbarSearch(window, data)); +} + + +void Fluxbox::saveTabSearch(Window window, Tab *data) { + tabSearchList->insert(new TabSearch(window, data)); +} + +#ifdef SLIT +void Fluxbox::saveSlitSearch(Window window, Slit *data) { + slitSearchList->insert(new SlitSearch(window, data)); +} +#endif // SLIT + + +void Fluxbox::removeWindowSearch(Window window) { + LinkedListIterator<WindowSearch> it(windowSearchList); + for (; it.current(); it++) { + WindowSearch *tmp = it.current(); + + if (tmp) + if (tmp->getWindow() == window) { + windowSearchList->remove(tmp); + delete tmp; + break; + } + } +} + + +void Fluxbox::removeGroupSearch(Window window) { + LinkedListIterator<WindowSearch> it(groupSearchList); + for (; it.current(); it++) { + WindowSearch *tmp = it.current(); + + if (tmp) + if (tmp->getWindow() == window) { + groupSearchList->remove(tmp); + delete tmp; + break; + } + } +} + + +void Fluxbox::removeMenuSearch(Window window) { + LinkedListIterator<MenuSearch> it(menuSearchList); + for (; it.current(); it++) { + MenuSearch *tmp = it.current(); + + if (tmp) + if (tmp->getWindow() == window) { + menuSearchList->remove(tmp); + delete tmp; + break; + } + } +} + + +void Fluxbox::removeToolbarSearch(Window window) { + LinkedListIterator<ToolbarSearch> it(toolbarSearchList); + for (; it.current(); it++) { + ToolbarSearch *tmp = it.current(); + if (tmp) + if (tmp->getWindow() == window) { + toolbarSearchList->remove(tmp); + delete tmp; + break; + } + } +} + + +void Fluxbox::removeTabSearch(Window window) { + LinkedListIterator<TabSearch> it(tabSearchList); + for (; it.current(); it++) { + TabSearch *tmp = it.current(); + if (tmp && tmp->getWindow() == window) { + tabSearchList->remove(tmp); + delete tmp; + break; + } + } +} + +#ifdef SLIT +void Fluxbox::removeSlitSearch(Window window) { + LinkedListIterator<SlitSearch> it(slitSearchList); + for (; it.current(); it++) { + SlitSearch *tmp = it.current(); + + if (tmp) + if (tmp->getWindow() == window) { + slitSearchList->remove(tmp); + delete tmp; + break; + } + } +} +#endif // SLIT + + +void Fluxbox::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 Fluxbox::shutdown(void) { + BaseDisplay::shutdown(); + + XSetInputFocus(getXDisplay(), PointerRoot, None, CurrentTime); + + LinkedListIterator<BScreen> it(screenList); + for (; it.current(); it++) + it.current()->shutdown(); + + XSync(getXDisplay(), False); + + save_rc(); +} + +//save_rc +//saves resources +void Fluxbox::save_rc(void) { + + XrmDatabase new_blackboxrc = (XrmDatabase) 0; + char rc_string[1024]; + + char *dbfile = getRcFilename(); //note: dbfile memory will be release @ end of function + + load_rc(); + + sprintf(rc_string, "session.iconbar: %s", resource.iconbar ? "true" : "false"); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.tabs: %s", resource.tabs ? "true" : "false"); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.menuFile: %s", resource.menu_file); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.titlebarFile: %s", resource.titlebar_file); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.keyFile: %s", resource.keys_file); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.colorsPerChannel: %d", + resource.colors_per_channel); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.doubleClickInterval: %lu", + resource.double_click_interval); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.autoRaiseDelay: %lu", + ((resource.auto_raise_delay.tv_sec * 1000) + + (resource.auto_raise_delay.tv_usec / 1000))); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.cacheLife: %lu", resource.cache_life / 60000); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.cacheMax: %lu", resource.cache_max); + XrmPutLineResource(&new_blackboxrc, rc_string); + + LinkedListIterator<BScreen> it(screenList); + for (; it.current(); it++) { + BScreen *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; + } + + sprintf(rc_string, "session.screen%d.slit.placement: %s", screen_number, + slit_placement); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.slit.direction: %s", screen_number, + ((screen->getSlitDirection() == Slit::Horizontal) ? "Horizontal" : + "Vertical")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.slit.onTop: %s", screen_number, + ((screen->getSlit()->isOnTop()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.slit.autoHide: %s", screen_number, + ((screen->getSlit()->doAutoHide()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); +#endif // SLIT + + sprintf(rc_string, "session.opaqueMove: %s", + ((screen->doOpaqueMove()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.imageDither: %s", + ((screen->getImageControl()->doDither()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.fullMaximization: %s", screen_number, + ((screen->doFullMax()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.focusNewWindows: %s", screen_number, + ((screen->doFocusNew()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.focusLastWindow: %s", screen_number, + ((screen->doFocusLast()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.rowPlacementDirection: %s", screen_number, + ((screen->getRowPlacementDirection() == BScreen::LeftRight) ? + "LeftToRight" : "RightToLeft")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.colPlacementDirection: %s", screen_number, + ((screen->getColPlacementDirection() == BScreen::TopBottom) ? + "TopToBottom" : "BottomToTop")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + char *placement = (char *) 0; + switch (screen->getPlacementPolicy()) { + case BScreen::CascadePlacement: + placement = "CascadePlacement"; + break; + + case BScreen::ColSmartPlacement: + placement = "ColSmartPlacement"; + break; + + default: + case BScreen::RowSmartPlacement: + placement = "RowSmartPlacement"; + break; + } + sprintf(rc_string, "session.screen%d.windowPlacement: %s", screen_number, + placement); + XrmPutLineResource(&new_blackboxrc, rc_string); +//TODO: This isn't pretty! + char *focus_mode = 0; + if (screen->isSloppyFocus() && screen->doAutoRaise()) + focus_mode = "AutoRaiseSloppyFocus"; + else if (screen->isSloppyFocus()) + focus_mode = "SloppyFocus"; + else if (screen->isSemiSloppyFocus() && screen->doAutoRaise()) + focus_mode = "AutoRaiseSemiSloppyFocus"; + else if (screen->isSemiSloppyFocus()) + focus_mode = "SemiSloppyFocus"; + else + focus_mode = "ClickToFocus"; + + sprintf(rc_string, "session.screen%d.focusModel: %s", screen_number, + focus_mode); + + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.workspaces: %d", screen_number, + screen->getCount()); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.toolbar.onTop: %s", screen_number, + ((screen->getToolbar()->isOnTop()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.toolbar.autoHide: %s", screen_number, + ((screen->getToolbar()->doAutoHide()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, 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_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.tab.placement: %s", screen_number, + Tab::getTabPlacementString(screen->getTabPlacement())); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.tab.alignment: %s", screen_number, + Tab::getTabAlignmentString(screen->getTabAlignment())); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.tab.rotatevertical: %s", screen_number, + ((screen->isTabRotateVertical()) ? "True" : "False")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + load_rc(screen); + + // these are static, but may not be saved in the users resource file, + // 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_blackboxrc, rc_string); +#else // !HAVE_STRFTIME + sprintf(rc_string, "session.screen%d.dateFormat: %s", screen_number, + ((screen->getDateFormat() == B_EuropeanDate) ? + "European" : "American")); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.clockFormat: %d", screen_number, + ((screen->isClock24Hour()) ? 24 : 12)); + XrmPutLineResource(&new_blackboxrc, rc_string); +#endif // HAVE_STRFTIME + + sprintf(rc_string, "session.screen%d.edgeSnapThreshold: %d", screen_number, + screen->getEdgeSnapThreshold()); + XrmPutLineResource(&new_blackboxrc, rc_string); + + sprintf(rc_string, "session.screen%d.toolbar.widthPercent: %d", + screen_number, screen->getToolbarWidthPercent()); + XrmPutLineResource(&new_blackboxrc, 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_blackboxrc, resource_string); + + delete [] resource_string; + delete [] save_string; + } + + XrmDatabase old_blackboxrc = XrmGetFileDatabase(dbfile); + + XrmMergeDatabases(new_blackboxrc, &old_blackboxrc); //merge database together + XrmPutFileDatabase(old_blackboxrc, dbfile); + XrmDestroyDatabase(old_blackboxrc); +// XrmDestroyDatabase(new_blackboxrc); + + //finaly release filename memory + delete [] dbfile; +} + +//getRcFilename +//returns filename of resource file +char *Fluxbox::getRcFilename() { + char *dbfile=0; + + if (!rc_file) { + char *homedir = getenv("HOME"); + const int dbfile_size = strlen(homedir) + strlen("/.") +strlen(RC_PATH) + strlen(RC_INIT_FILE) + 24; + dbfile = new char[dbfile_size]; + snprintf(dbfile, dbfile_size, "%s/.%s/%s", homedir, RC_PATH, RC_INIT_FILE); + + } else + dbfile = bstrdup(rc_file); + + return dbfile; +} + +void Fluxbox::load_rc(void) { + XrmDatabase database = (XrmDatabase) 0; + + //get resource filename + char *dbfile = getRcFilename(); //note: dont forget to free memory + + //load file + database = XrmGetFileDatabase(dbfile); + if (!database) { + cerr<<"Fluxbox: Cant open "<<dbfile<<" !"<<endl; + cerr<<"Using: "<<DEFAULT_INITFILE<<endl; + database = XrmGetFileDatabase(DEFAULT_INITFILE); + } + //destroy dbfile (created by getRcFilename) + delete [] dbfile; + + XrmValue value; + char *value_type; + + if (resource.menu_file) { + delete [] resource.menu_file; + resource.menu_file = 0; + } + //get menu filename + if (XrmGetResource(database, "session.menuFile", "Session.MenuFile", + &value_type, &value)) { + + resource.menu_file = expandFilename(value.addr); // expand ~ to $HOME + } else + resource.menu_file = bstrdup(DEFAULTMENU); + + if (resource.titlebar_file) { + delete resource.titlebar_file; + resource.titlebar_file = 0; + } + + //get titlebar filename + if (XrmGetResource(database, "session.titlebarFile", "Session.TitlebarFile", + &value_type, &value)) { + resource.titlebar_file = expandFilename(value.addr); //expand ~ to home + } else + resource.titlebar_file = bstrdup(DEFAULTTITLEBAR); + + //if already allocated memory for keys_file destroy it + if (resource.keys_file) { + delete resource.keys_file; + resource.keys_file = 0; + } + + //get keys filename + if (XrmGetResource(database, "session.keyFile", "Session.keyFile", + &value_type, &value)) { + resource.keys_file = expandFilename(value.addr); //expand ~ to home + } else + resource.keys_file = bstrdup(DEFAULTKEYSFILE); + + + if (XrmGetResource(database, "session.iconbar", "Session.Iconbar", + &value_type, &value)) { + if (! strncasecmp("true", value.addr, value.size)) + resource.iconbar = true; + else + resource.iconbar = false; + } else + resource.iconbar = true; + + if (XrmGetResource(database, "session.tabs", "Session.Tabs", + &value_type, &value)) { + if (! strncasecmp("true", value.addr, value.size)) + resource.tabs = true; + else + resource.tabs = false; + } else + resource.tabs = true; + + if (XrmGetResource(database, "session.tab.width", "Session.Tab.Width", + &value_type, &value)) { + if (sscanf(value.addr, "%d", &resource.tabwidth) != 1) + resource.tabwidth = 64; // default tab width + else { + if (resource.tabwidth < 5) // are these values sane? + resource.tabwidth = 5; + if (resource.tabwidth > 256) + resource.tabwidth = 256; + } + } else + resource.tabwidth = 64; // default tab width + + if (XrmGetResource(database, "session.tab.height", "Session.Tab.Height", + &value_type, &value)) { + if (sscanf(value.addr, "%d", &resource.tabheight) != 1) + resource.tabheight = 16; // default tab height + else { + if (resource.tabheight < 5) // are these values sane? + resource.tabheight = 5; + if (resource.tabheight > 50) + resource.tabheight = 50; + } + } else + resource.tabheight = 16; // default tab height + + 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 = expandFilename(value.addr); + else + resource.style_file = bstrdup(DEFAULTSTYLE); + + if (resource.root_cmd) { + delete [] resource.root_cmd; + resource.root_cmd = 0; + } + + if (XrmGetResource(database, "session.rootCommand", "Session.RootCommand", &value_type, &value)) + resource.root_cmd = expandFilename(value.addr); + else + resource.root_cmd = 0; + + 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 + resource.double_click_interval = 250; + + if (XrmGetResource(database, "session.autoRaiseDelay", + "Session.AutoRaiseDelay", &value_type, &value)) { + if (sscanf(value.addr, "%lu", &resource.auto_raise_delay.tv_usec) != 1) + resource.auto_raise_delay.tv_usec = 250; + } else + resource.auto_raise_delay.tv_usec = 250; + + 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; + + 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 + resource.cache_max = 200; + + //XrmDestroyDatabase(database); + + loadTitlebar(); +} +//parseTitleArgs +//parses the titlearg configline +vector<string> Fluxbox::parseTitleArgs(const char *arg) { + vector<string> args; + string tmp; + unsigned int i=0; + while ( i<strlen(arg) ) { + for (; arg[i] != ' ' && i<strlen(arg); i++) + tmp+=arg[i]; + i++; + args.push_back(tmp); + tmp=""; + } + + return args; +} + +void Fluxbox::setTitlebar(vector<Fluxbox::Titlebar>& dir, const char *arg) { + vector<string> argv = parseTitleArgs(arg); + for (unsigned int i=0; i<argv.size(); i++) { + if (argv[i]==NAME_STICKY) + dir.push_back(Stick); + else if (argv[i]==NAME_MAXIMIZE) + dir.push_back(Maximize); + else if (argv[i]==NAME_MINIMIZE) + dir.push_back(Minimize); + else if (argv[i]== NAME_CLOSE) + dir.push_back(Close); + else if (argv[i]==NAME_SHADE) + dir.push_back(Shade); + else if (argv[i]==NAME_MENU) + dir.push_back(Menu); + else if(argv[i]==NAME_NONE);//do nothing + else + cerr<<"Fluxbox::Titlebar Unknown type: \""<<argv[i]<<"\""<<endl; + + } +} + +void Fluxbox::loadTitlebar() { + XrmDatabase database; + database = XrmGetFileDatabase(resource.titlebar_file); + if (!database) + cerr<<"Fluxbox: Cant open "<<resource.titlebar_file<<" !"<<endl; + + XrmValue value; + char *value_type; + + //clear titlebar + titlebar.left.clear(); + titlebar.right.clear(); + + if (XrmGetResource(database, "left", "Left", &value_type, &value)) { + setTitlebar(titlebar.left, value.addr); + } else { + cerr<<"Fluxbox: \'Left\' not found in "<<resource.titlebar_file<<endl; + cerr<<"Using default."<<endl; + //default settings + titlebar.left.push_back(Shade); + } + + if (XrmGetResource(database, "right", "Right", &value_type, &value)) { + setTitlebar(titlebar.right, value.addr); + } else { + cerr<<"Fluxbox: \'Right\' not found in "<<resource.titlebar_file<<endl; + cerr<<"Using default."<<endl; + //default settings + titlebar.right.push_back(Stick); + titlebar.right.push_back(Minimize); + titlebar.right.push_back(Maximize); + titlebar.right.push_back(Close); + } + +// XrmDestroyDatabase(database); +} + +void Fluxbox::load_rc(BScreen *screen) { + XrmDatabase database = (XrmDatabase) 0; + + char *dbfile = getRcFilename(); + + database = XrmGetFileDatabase(dbfile); + if (!database) + database = XrmGetFileDatabase(DEFAULT_INITFILE); + + delete [] dbfile; + + 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); + + int i; + for (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; + } + //TODO MOVE THIS!!!!!! + #ifdef GNOME + { + Atom atype; + int aformat; + unsigned long nitems, bytes_remain; + unsigned char *prop; + XGetWindowProperty (screen->getBaseDisplay()->getXDisplay(), + screen->getRootWindow(), + screen->getBaseDisplay()->getGnomeWorkspaceCountAtom(), + 0L, 1L, False, XA_CARDINAL, &atype, &aformat, &nitems, &bytes_remain, &prop); + + long val = screen->getNumberOfWorkspaces(); + fprintf(stderr, "HERE!! %s(%d) num wrkspace(%l)\n", __FILE__, __LINE__, val); + XChangeProperty(screen->getBaseDisplay()->getXDisplay(), screen->getRootWindow(), + screen->getBaseDisplay()->getGnomeWorkspaceCountAtom(), XA_CARDINAL, 32, + PropModeReplace, (unsigned char *)&val, 1); + } + #endif //GNOME + + + 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); + +//TODO: make this nicer? + 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); + screen->saveSemiSloppyFocus(False); + + } else if (! strncasecmp(value.addr, "autoraisesloppyfocus", value.size)) { + screen->saveSemiSloppyFocus(False); + screen->saveSloppyFocus(True); + screen->saveAutoRaise(True); + } else if (! strncasecmp(value.addr, "autoraisesemisloppyfocus", value.size)) { + screen->saveSloppyFocus(False); + screen->saveSemiSloppyFocus(True); + screen->saveAutoRaise(True); + + } else if (! strncasecmp(value.addr, "semisloppyfocus", value.size)) { + screen->saveSloppyFocus(False); + screen->saveSemiSloppyFocus(True); + screen->saveAutoRaise(False); + + } else { + + screen->saveSemiSloppyFocus(False); + screen->saveSloppyFocus(True); + screen->saveAutoRaise(False); + } + } else { + screen->saveSemiSloppyFocus(False); + screen->saveSloppyFocus(True); //TODO: fluxgen, shouldn't this be false? + screen->saveAutoRaise(False); //as click should be default, or? + } + + 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); + + 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); + + sprintf(name_lookup, "session.screen%d.tab.placement", screen_number); + sprintf(class_lookup, "Session.Screen%d.Tab.Placement", screen_number); + if (XrmGetResource(database, name_lookup, class_lookup, + &value_type, &value)) { + screen->saveTabPlacement(Tab::getTabPlacementNum(value.addr)); + } else + screen->saveTabPlacement(Tab::PTop); + + sprintf(name_lookup, "session.screen%d.tab.alignment", screen_number); + sprintf(class_lookup, "Session.Screen%d.Tab.Alignment", screen_number); + if (XrmGetResource(database, name_lookup, class_lookup, + &value_type, &value)) { + screen->saveTabAlignment(Tab::getTabAlignmentNum(value.addr)); + } else + screen->saveTabAlignment(Tab::ALeft); + + sprintf(name_lookup, "session.screen%d.tab.rotatevertical", screen_number); + sprintf(class_lookup, "Session.Screen%d.Tab.RotateVertical", screen_number); + if (XrmGetResource(database, name_lookup, class_lookup, + &value_type, &value)) { + if (! strncasecmp("true", value.addr, value.size)) + screen->saveTabRotateVertical(True); + else + screen->saveTabRotateVertical(False); + } else + screen->saveTabRotateVertical(False); + +} + + +void Fluxbox::reload_rc(void) { + load_rc(); + reconfigure(); +} + + +void Fluxbox::reconfigure(void) { + reconfigure_wait = True; + + if (! timer->isTiming()) timer->start(); +} + + +void Fluxbox::real_reconfigure(void) { + grab(); + + XrmDatabase new_blackboxrc = (XrmDatabase) 0; + char style[MAXPATHLEN + 64]; + + char *dbfile = getRcFilename(); + + sprintf(style, "session.styleFile: %s", resource.style_file); + XrmPutLineResource(&new_blackboxrc, style); + + XrmDatabase old_blackboxrc = XrmGetFileDatabase(dbfile); + + XrmMergeDatabases(new_blackboxrc, &old_blackboxrc); + XrmPutFileDatabase(old_blackboxrc, dbfile); + + if (old_blackboxrc) + XrmDestroyDatabase(old_blackboxrc); + + delete [] dbfile; + + 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; + } + } + + LinkedListIterator<BScreen> it(screenList); + for (; it.current(); it++) { + BScreen *screen = it.current(); + + screen->reconfigure(); + } + + //reconfigure keys + key->reconfigure(resource.keys_file); + + //reconfigure tabs + reconfigureTabs(); + + ungrab(); +} + +//------------- reconfigureTabs ---------- +// Reconfigure all tabs size and increase steps +// --------------------------------------- +void Fluxbox::reconfigureTabs(void) { + //tab reconfiguring + LinkedListIterator<TabSearch> it(tabSearchList); + //setting all to unconfigured + for (; it.current(); it++) { + TabSearch *tmp = it.current(); + if (tmp) + tmp->getData()->setConfigured(false); + } + it.reset(); // resetting list and start configure tabs + //reconfiguring + for (; it.current(); it++) { + TabSearch *tmp = it.current(); + Tab *tab = tmp->getData(); + if (!tab->configured()) { + tab->setConfigured(true); + tab->resizeGroup(); + tab->calcIncrease(); + tab->setPosition(); + } + } +} + +void Fluxbox::checkMenu(void) { + Bool reread = False; + LinkedListIterator<MenuTimestamp> it(menuTimestamps); + for (; it.current() && (! reread); it++) { + struct stat buf; + + if (! stat(it.current()->filename, &buf)) { + if (it.current()->timestamp != buf.st_ctime) + reread = True; + } else + reread = True; + } + + if (reread) rereadMenu(); +} + + +void Fluxbox::rereadMenu(void) { + reread_menu_wait = True; + + if (! timer->isTiming()) timer->start(); +} + + +void Fluxbox::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; + } + } + + LinkedListIterator<BScreen> it(screenList); + for (; it.current(); it++) + it.current()->rereadMenu(); +} + + +void Fluxbox::saveStyleFilename(const char *filename) { + if (resource.style_file) + delete [] resource.style_file; + + resource.style_file = bstrdup(filename); +} + + +void Fluxbox::saveMenuFilename(const char *filename) { + Bool found = False; + + LinkedListIterator<MenuTimestamp> it(menuTimestamps); + for (; it.current() && (! found); it++) + if (! strcmp(it.current()->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 Fluxbox::timeout(void) { + if (reconfigure_wait) + real_reconfigure(); + + if (reread_menu_wait) + real_rereadMenu(); + + reconfigure_wait = reread_menu_wait = False; +} + + +void Fluxbox::setFocusedWindow(FluxboxWindow *win) { + + BScreen *old_screen = (BScreen *) 0, *screen = (BScreen *) 0; + FluxboxWindow *old_win = (FluxboxWindow *) 0; + Toolbar *old_tbar = (Toolbar *) 0, *tbar = (Toolbar *) 0; + Workspace *old_wkspc = (Workspace *) 0, *wkspc = (Workspace *) 0; + + if (focused_window) { + old_win = focused_window; + old_screen = old_win->getScreen(); + + old_tbar = old_screen->getToolbar(); + old_wkspc = old_screen->getWorkspace(old_win->getWorkspaceNumber()); + + 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 = (FluxboxWindow *) 0; + + if (tbar) + tbar->redrawWindowLabel(True); + if (screen) + screen->updateNetizenWindowFocus(); + + if (old_tbar && old_tbar != tbar) + old_tbar->redrawWindowLabel(True); + if (old_screen && old_screen != screen) + old_screen->updateNetizenWindowFocus(); + +}
A src/fluxbox.hh

@@ -0,0 +1,291 @@

+// fluxbox.hh for fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) + +// blackbox.hh for Blackbox - an X11 Window manager +// 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 _FLUXBOX_HH_ +#define _FLUXBOX_HH_ + +#include <X11/Xlib.h> +#include <X11/Xresource.h> + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef TIME_WITH_SYS_TIME +# include <sys/time.h> +# include <time.h> +#else // !TIME_WITH_SYS_TIME +# ifdef HAVE_SYS_TIME_H +# include <sys/time.h> +# else // !HAVE_SYS_TIME_H +# include <time.h> +# endif // HAVE_SYS_TIME_H +#endif // TIME_WITH_SYS_TIME + +//forward declaration +class Fluxbox; + +#ifndef _BASEDISPLAY_HH_ +#include "BaseDisplay.hh" +#endif + +#ifndef _IMAGE_HH_ +#include "Image.hh" +#endif + +#ifndef _LINKEDLIST_HH_ +#include "LinkedList.hh" +#endif + +#ifndef _TIMER_HH_ +#include "Timer.hh" +#endif + +#ifndef _WINDOW_HH_ +#include "Window.hh" +#endif + +#ifndef _TAB_HH_ +#include "Tab.hh" +#endif + +#ifndef _TOOLBAR_HH_ +#include "Toolbar.hh" +#endif + +#ifndef _KEYS_HH_ +#include "Keys.hh" +#endif + +#ifdef SLIT +# include "Slit.hh" +#endif // SLIT + +#include <string> +#include <vector> + +class Fluxbox : public BaseDisplay, public TimeoutHandler { +public: + + + static Fluxbox *instance(int m_argc=0, char **m_argv=0, char *dpy_name=0, char *rc=0); + + inline bool useTabs() const { return resource.tabs; } +// inline TabType &getTabType() { return resource.tabtype; } + inline bool useIconBar() const { return resource.iconbar; } + inline void saveTabs(bool value) { resource.tabs = value; } + inline void saveIconBar(bool value) { resource.iconbar = value; } +#ifdef HAVE_GETPID + inline const Atom &getFluxboxPidAtom(void) const { return fluxbox_pid; } + #ifdef KDE + //For KDE dock applets + inline const Atom &getKWM1DockwindowAtom(void) const { return kwm1_dockwindow; } //KDE v1.x + inline const Atom &getKWM2DockwindowAtom(void) const { return kwm2_dockwindow; } //KDE v2.x + #endif +#endif // HAVE_GETPID + + Basemenu *searchMenu(Window); + + FluxboxWindow *searchGroup(Window, FluxboxWindow *); + FluxboxWindow *searchWindow(Window); + inline FluxboxWindow *getFocusedWindow(void) { return focused_window; } + + + BScreen *searchScreen(Window); + + inline const Time &getDoubleClickInterval(void) const + { return resource.double_click_interval; } + inline const Time &getLastTime(void) const { return last_time; } + + Toolbar *searchToolbar(Window); + Tab *searchTab(Window); + + enum Titlebar{Shade=0, Minimize, Maximize, Close, Stick, Menu, Empty}; + + inline const std::vector<Fluxbox::Titlebar>& getTitlebarRight() { return titlebar.right; } + inline const std::vector<Fluxbox::Titlebar>& getTitlebarLeft() { return titlebar.left; } + inline const char *getStyleFilename(void) const + { return resource.style_file; } + inline const char *getRootCommand() const + { return resource.root_cmd; } + inline const char *getMenuFilename(void) const + { return resource.menu_file; } + + inline const int &getColorsPerChannel(void) const + { return resource.colors_per_channel; } + + inline const timeval &getAutoRaiseDelay(void) const + { return resource.auto_raise_delay; } + + inline const unsigned long &getCacheLife(void) const + { return resource.cache_life; } + inline const unsigned long &getCacheMax(void) const + { return resource.cache_max; } + inline const unsigned int &getTabWidth(void) const { return resource.tabwidth; } + inline const unsigned int &getTabHeight(void) const { return resource.tabheight; } + + + inline void maskWindowEvents(Window w, FluxboxWindow *bw) + { masked = w; masked_window = bw; } + inline void setNoFocus(Bool f) { no_focus = f; } + + void setFocusedWindow(FluxboxWindow *w); + void shutdown(void); + void load_rc(BScreen *); + void loadTitlebar(); + void saveStyleFilename(const char *); + void saveMenuFilename(const char *); + void saveTitlebarFilename(const char *); + void saveMenuSearch(Window, Basemenu *); + void saveWindowSearch(Window, FluxboxWindow *); + void saveToolbarSearch(Window, Toolbar *); + void saveTabSearch(Window, Tab *); + void saveGroupSearch(Window, FluxboxWindow *); + void removeMenuSearch(Window); + void removeWindowSearch(Window); + void removeToolbarSearch(Window); + void removeTabSearch(Window); + void removeGroupSearch(Window); + void restart(const char * = 0); + void reconfigure(void); + void reconfigureTabs(void); + void rereadMenu(void); + void checkMenu(void); + + virtual Bool handleSignal(int); + + virtual void timeout(void); + +#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 + + template <class Z> + 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; } + }; + + +private: + typedef struct MenuTimestamp { + char *filename; + time_t timestamp; + } MenuTimestamp; + + struct resource { + Time double_click_interval; + + char *menu_file, *style_file, *titlebar_file, *keys_file, *root_cmd; + int colors_per_channel; + timeval auto_raise_delay; + unsigned long cache_life, cache_max; + bool tabs, iconbar; + //TabType tabtype; + unsigned int tabwidth, tabheight; + } resource; + + struct titlebar_t { + std::vector<Fluxbox::Titlebar> left; + std::vector<Fluxbox::Titlebar> right; + }; + + titlebar_t titlebar; + std::vector<std::string> parseTitleArgs(const char *arg); + void setTitlebar(std::vector<Fluxbox::Titlebar>& dir, const char *arg); + + typedef DataSearch<FluxboxWindow> WindowSearch; + LinkedList<WindowSearch> *windowSearchList, *groupSearchList; + typedef DataSearch<Basemenu> MenuSearch; + LinkedList<MenuSearch> *menuSearchList; + typedef DataSearch<Toolbar> ToolbarSearch; + LinkedList<ToolbarSearch> *toolbarSearchList; + typedef DataSearch<Tab> TabSearch; + LinkedList<TabSearch> *tabSearchList; + +#ifdef SLIT + typedef DataSearch<Slit> SlitSearch; + LinkedList<SlitSearch> *slitSearchList; + #ifdef KDE + //For KDE dock applets + Atom kwm1_dockwindow; //KDE v1.x + Atom kwm2_dockwindow; //KDE v2.x + #endif//KDE +#endif // SLIT + + LinkedList<MenuTimestamp> *menuTimestamps; + LinkedList<BScreen> *screenList; + + FluxboxWindow *focused_window, *masked_window; + BTimer *timer; + +#ifdef HAVE_GETPID + Atom fluxbox_pid; +#endif // HAVE_GETPID + + Bool no_focus, reconfigure_wait, reread_menu_wait; + Time last_time; + Window masked; + char *rc_file, **argv; + int argc; + Keys *key; + char *expandFilename(char *filename); + void doWindowAction(Keys::KeyAction action); +protected: + Fluxbox(int, char **, char * = 0, char * = 0); + char *getRcFilename(); + void load_rc(void); + void save_rc(void); + void reload_rc(void); + void real_rereadMenu(void); + void real_reconfigure(void); + + virtual void process_event(XEvent *); + //only main should be able to creat new blackbox object + friend int main(int,char **); + static Fluxbox *singleton; //singleton object ( can only be destroyed by main ) + virtual ~Fluxbox(void); + +}; + + +#endif // _FLUXBOX_HH_
A src/i18n.cc

@@ -0,0 +1,126 @@

+// i18n.cc for Blackbox - an X11 Window manager +// 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 "i18n.hh" + +#include <X11/Xlocale.h> + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +# include <stdio.h> +#endif // STDC_HEADERS + +#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif // HAVE_LOCALE_H + + +void NLSInit(const char *catalog) { + I18n *i18n = I18n::instance(); + i18n->openCatalog(catalog); +} + + +I18n::I18n(void) { +#ifdef HAVE_SETLOCALE + locale = setlocale(LC_ALL, ""); + if (! locale) { + fprintf(stderr, "failed to set locale, reverting to \"C\"\n"); +#endif // HAVE_SETLOCALE + locale = "C"; + mb = 0; +#ifdef HAVE_SETLOCALE + } else if (! strcmp(locale, "C") || ! strcmp(locale, "POSIX")) { + mb = 0; + } else { + mb = 1; + // truncate any encoding off the end of the locale + char *l = strchr(locale, '.'); + if (l) *l = '\0'; + } +#endif // HAVE_SETLOCALE + + catalog_filename = (char *) 0; + catalog_fd = (nl_catd) -1; +} + + +I18n::~I18n(void) { + delete catalog_filename; + +#if defined(NLS) && defined(HAVE_CATCLOSE) + if (catalog_fd != (nl_catd) -1) + catclose(catalog_fd); +#endif // HAVE_CATCLOSE +} + +I18n *I18n::instance() { + static I18n singleton; //singleton object + return &singleton; +} + +void I18n::openCatalog(const char *catalog) { +#if defined(NLS) && defined(HAVE_CATOPEN) + 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, MCLoadBySet); +# else // !MCLoadBySet + 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"); + +#else // !HAVE_CATOPEN + catalog_fd = (nl_catd) -1; + catalog_filename = (char *) 0; +#endif // HAVE_CATOPEN +} + + +const char *I18n::getMessage(int set, int msg, const char *s) { +#if defined(NLS) && defined(HAVE_CATGETS) + if (catalog_fd != (nl_catd) -1) + return (const char *) catgets(catalog_fd, set, msg, s); + else +#endif + return s; +}
A src/i18n.hh

@@ -0,0 +1,71 @@

+// i18n.hh for Blackbox - an X11 Window manager +// 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 __i18n_h +#define __i18n_h + +#ifdef NLS +# include "../nls/blackbox-nls.hh" +#endif // NLS + +#ifdef HAVE_LOCALE_H +# include <locale.h> +#endif // HAVE_LOCALE_H + +#ifdef HAVE_NL_TYPES_H +// this is needed for linux libc5 systems +extern "C" { +# include <nl_types.h> +} +#endif // HAVE_NL_TYPES_H + + +class I18n { +private: + char *locale, *catalog_filename; + int mb; + nl_catd catalog_fd; + + +protected: + I18n(void); + +public: + //so old compilators dont complain + ~I18n(void); + + static I18n *instance(); + inline const char *getLocale(void) const { return locale; } + inline const char *getCatalogFilename(void) const { return catalog_filename; } + + inline const int &multibyte(void) const { return mb; } + + inline const nl_catd &getCatalogFd(void) const { return catalog_fd; } + + const char *getMessage(int, int, const char * = 0); + void openCatalog(const char *); +}; + + +//extern I18n *i18n; +extern void NLSInit(const char *); + +#endif // __i18n_h
A src/main.cc

@@ -0,0 +1,272 @@

+// main.cc for Blackbox - an X11 Window manager +// 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 + +#include "../version.h" + +#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif // HAVE_CONFIG_H + +#include "i18n.hh" +#include "fluxbox.hh" + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#ifdef STDC_HEADERS +# include <stdlib.h> +# include <string.h> +#endif // STDC_HEADERS + +#ifdef HAVE_UNISTD_H +#include <sys/types.h> +#endif // HAVE_UNISTD_H + +#ifdef HAVE_SYS_PARAM_H +# include <sys/param.h> +#endif // HAVE_SYS_PARAM_H + +#ifndef MAXPATHLEN +#define MAXPATHLEN 255 +#endif // MAXPATHLEN + +#include <iostream> +using namespace std; + +int main(int argc, char **argv) { + char *session_display = (char *) 0; + char *rc_file = (char *) 0; + + NLSInit("blackbox.cat"); + I18n *i18n = I18n::instance(); + + int i; + for (i = 1; i < argc; ++i) { + if (! strcmp(argv[i], "-rc")) { + // look for alternative rc file to use + + if ((++i) >= argc) { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + mainSet, mainRCRequiresArg, +#else // !NLS + 0, 0, +#endif // NLS + "error: '-rc' requires and argument\n")); + + ::exit(1); + } + + rc_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 + + if ((++i) >= argc) { + fprintf(stderr, + i18n->getMessage( +#ifdef NLS + mainSet, mainDISPLAYRequiresArg, +#else // !NLS + 0, 0, +#endif // NLS + "error: '-display' requires an argument\n")); + + ::exit(1); + } + + session_display = argv[i]; + char dtmp[MAXPATHLEN]; + sprintf(dtmp, "DISPLAY=%s", session_display); + + if (putenv(dtmp)) { + fprintf(stderr, + i18n-> + getMessage( +#ifdef NLS + mainSet, mainWarnDisplaySet, +#else // !NLS + 0, 0, +#endif // NLS + "warning: couldn't set environment variable 'DISPLAY'\n")); + perror("putenv()"); + } + } else if (! strcmp(argv[i], "-version")) { + // print current version string + printf("Fluxbox %s : (c) 2001 Henrik Kinnunen \n\n", + __fluxbox_version); + + ::exit(0); + } else if (! strcmp(argv[i], "-help")) { + // print program usage and command line options + printf(i18n-> + getMessage( +#ifdef NLS + mainSet, mainUsage, +#else // !NLS + 0, 0, +#endif // NLS + "Fluxbox %s : (c) 2001 Henrik Kinnunen\n\n" + " -display <string>\t\tuse display connection.\n" + " -rc <string>\t\t\tuse alternate resource file.\n" + " -version\t\t\tdisplay version and exit.\n" + " -help\t\t\t\tdisplay this help text and exit.\n\n"), + __fluxbox_version); + + // some people have requested that we print out command line options + // as well + printf(i18n-> + getMessage( +#ifdef NLS + mainSet, mainCompileOptions, +#else // !NLS + 0, 0, +#endif // NLS + "Compile time options:\n" + " Debugging:\t\t\t%s\n" + " Interlacing:\t\t\t%s\n" + " Shape:\t\t\t%s\n" + " Slit:\t\t\t\t%s\n" + " 8bpp Ordered Dithering:\t%s\n\n"), +#ifdef DEBUG + i18n->getMessage( +#ifdef NLS + CommonSet, CommonYes, +#else // !NLS + 0, 0, +#endif // NLS + "yes"), +#else // !DEBUG + i18n->getMessage( +#ifdef NLS + CommonSet, CommonNo, +#else // !NLS + 0, 0, +#endif // NLS + "no"), +#endif // DEBUG + +#ifdef INTERLACE + i18n->getMessage( +#ifdef NLS + CommonSet, CommonYes, +#else // !NLS + 0, 0, +#endif // NLS + "yes"), +#else // !INTERLACE + i18n->getMessage( +#ifdef NLS + CommonSet, CommonNo, +#else // !NLS + 0, 0, +#endif // NLS + "no"), +#endif // INTERLACE + +#ifdef SHAPE + i18n->getMessage( +#ifdef NLS + CommonSet, CommonYes, +#else // !NLS + 0, 0, +#endif // NLS + "yes"), +#else // !SHAPE + i18n->getMessage( +#ifdef NLS + CommonSet, CommonNo, +#else // !NLS + 0, 0, +#endif // NLS + "no"), +#endif // SHAPE + +#ifdef SLIT + i18n->getMessage( +#ifdef NLS + CommonSet, CommonYes, +#else // !NLS + 0, 0, +#endif // NLS + "yes"), +#else // !SLIT + i18n->getMessage( +#ifdef NLS + CommonSet, CommonNo, +#else // !NLS + 0, 0, +#endif // NLS + "no"), +#endif // SLIT + +#ifdef ORDEREDPSEUDO + i18n->getMessage( +#ifdef NLS + CommonSet, CommonYes, +#else // !NLS + 0, 0, +#endif // NLS + "yes") +#else // !ORDEREDPSEUDO + i18n->getMessage( +#ifdef NLS + CommonSet, CommonNo, +#else // !NLS + 0, 0, +#endif // NLS + "no") +#endif // ORDEREDPSEUDO + + ); + + ::exit(0); + } + } + +#ifdef __EMX__ + _chdir2(getenv("X11ROOT")); +#endif // __EMX__ + Fluxbox *fluxbox=0; + int exitcode=EXIT_SUCCESS; + try { + + fluxbox = new Fluxbox(argc, argv, session_display, rc_file); + fluxbox->eventLoop(); + + } catch (int _exitcode) { + exitcode=_exitcode; + } catch (...) { + cerr<<"Fluxbox: Unknown error."<<endl; + } + + if (fluxbox) + delete fluxbox; + exit(exitcode); +}
A src/misc.cc

@@ -0,0 +1,478 @@

+// misc.hh for fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 "misc.hh" +#include "i18n.hh" + +#include <stdlib.h> +#include <string.h> +#include <stdio.h> + +// ----- start code stealing ---- + +// ---------------------------------------------------------------------- +// xvertext, Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma) +// ---------------------------------------------------------------------- + +int xv_errno; //TODO: ? + +static char *my_strdup(char *str); + +//------- getTabAlignmentString ---------- +//Routine to mimic `strdup()' (some machines don't have it) +//---------------------------------------- +static char *my_strdup(char *str) +{ + char *s; + + if (str == NULL) return NULL; + + s = (char *)malloc((unsigned)(strlen(str)+1)); + /* this error is highly unlikely ... */ + if (s == NULL) { + fprintf(stderr, "Fatal error: my_strdup(): Couldn't do malloc!\n"); + exit(1); + } + + strcpy(s, str); + return s; +} + +//------- XRotLoadFont ------------------- +// Load the rotated version of a given font +//---------------------------------------- +XRotFontStruct *XRotLoadFont(Display *dpy, char *fontname, float angle) +{ + char val; + XImage *I1, *I2; + Pixmap canvas; + Window root; + int screen; + GC font_gc; + char text[3];/*, errstr[300];*/ + XFontStruct *fontstruct; + XRotFontStruct *rotfont; + int ichar, i, j, index, boxlen = 60, dir; + int vert_w, vert_h, vert_len, bit_w, bit_h, bit_len; + int min_char, max_char; + unsigned char *vertdata, *bitdata; + int ascent, descent, lbearing, rbearing; + int on = 1, off = 0; + + /* make angle positive ... */ + if (angle < 0) do angle += 360; while (angle < 0); + + /* get nearest vertical or horizontal direction ... */ + dir = (int)((angle+45.)/90.)%4; + + /* useful macros ... */ + screen = DefaultScreen(dpy); + root = DefaultRootWindow(dpy); + + /* create the depth 1 canvas bitmap ... */ + canvas = XCreatePixmap(dpy, root, boxlen, boxlen, 1); + + /* create a GC ... */ + font_gc = XCreateGC(dpy, canvas, 0, 0); + XSetBackground(dpy, font_gc, off); + + /* load the font ... */ + fontstruct = XLoadQueryFont(dpy, fontname); + if (fontstruct == NULL) { + xv_errno = XV_NOFONT; + return NULL; + } + + XSetFont(dpy, font_gc, fontstruct->fid); + + /* allocate space for rotated font ... */ + rotfont = (XRotFontStruct *)malloc((unsigned)sizeof(XRotFontStruct)); + if (rotfont == NULL) { + xv_errno = XV_NOMEM; + return NULL; + } + + /* determine which characters are defined in font ... */ + min_char = fontstruct->min_char_or_byte2; + max_char = fontstruct->max_char_or_byte2; + + /* we only want printing characters ... */ + if (min_char<32) min_char = 32; + if (max_char>126) max_char = 126; + + /* some overall font data ... */ + rotfont->name = my_strdup(fontname); + rotfont->dir = dir; + rotfont->min_char = min_char; + rotfont->max_char = max_char; + rotfont->max_ascent = fontstruct->max_bounds.ascent; + rotfont->max_descent = fontstruct->max_bounds.descent; + rotfont->height = rotfont->max_ascent+rotfont->max_descent; + + /* remember xfontstruct for `normal' text ... */ + if (dir == 0) + rotfont->xfontstruct = fontstruct; + else { + /* font needs rotation ... */ + /* loop through each character ... */ + for (ichar = min_char; ichar <= max_char; ichar++) { + index = ichar-fontstruct->min_char_or_byte2; + + /* per char dimensions ... */ + ascent = rotfont->per_char[ichar-32].ascent = + fontstruct->per_char[index].ascent; + descent = rotfont->per_char[ichar-32].descent = + fontstruct->per_char[index].descent; + lbearing = rotfont->per_char[ichar-32].lbearing = + fontstruct->per_char[index].lbearing; + rbearing = rotfont->per_char[ichar-32].rbearing = + fontstruct->per_char[index].rbearing; + rotfont->per_char[ichar-32].width = + fontstruct->per_char[index].width; + + /* some space chars have zero body, but a bitmap can't have ... */ + if (!ascent && !descent) + ascent = rotfont->per_char[ichar-32].ascent = 1; + if (!lbearing && !rbearing) + rbearing = rotfont->per_char[ichar-32].rbearing = 1; + + /* glyph width and height when vertical ... */ + vert_w = rbearing-lbearing; + vert_h = ascent+descent; + + /* width in bytes ... */ + vert_len = (vert_w-1)/8+1; + + XSetForeground(dpy, font_gc, off); + XFillRectangle(dpy, canvas, font_gc, 0, 0, boxlen, boxlen); + + /* draw the character centre top right on canvas ... */ + sprintf(text, "%c", ichar); + XSetForeground(dpy, font_gc, on); + XDrawImageString(dpy, canvas, font_gc, boxlen/2 - lbearing, + boxlen/2 - descent, text, 1); + + /* reserve memory for first XImage ... */ + vertdata = (unsigned char *) malloc((unsigned)(vert_len*vert_h)); + if (vertdata == NULL) { + xv_errno = XV_NOMEM; + return NULL; + } + + /* create the XImage ... */ + I1 = XCreateImage(dpy, DefaultVisual(dpy, screen), 1, XYBitmap, + 0, (char *)vertdata, vert_w, vert_h, 8, 0); + + if (I1 == NULL) { + xv_errno = XV_NOXIMAGE; + return NULL; + } + + I1->byte_order = I1->bitmap_bit_order = MSBFirst; + + /* extract character from canvas ... */ + XGetSubImage(dpy, canvas, boxlen/2, boxlen/2-vert_h, + vert_w, vert_h, 1, XYPixmap, I1, 0, 0); + I1->format = XYBitmap; + + /* width, height of rotated character ... */ + if (dir == 2) { + bit_w = vert_w; + bit_h = vert_h; + } else { + bit_w = vert_h; + bit_h = vert_w; + } + + /* width in bytes ... */ + bit_len = (bit_w-1)/8 + 1; + + rotfont->per_char[ichar-32].glyph.bit_w = bit_w; + rotfont->per_char[ichar-32].glyph.bit_h = bit_h; + + /* reserve memory for the rotated image ... */ + bitdata = (unsigned char *)calloc((unsigned)(bit_h*bit_len), 1); + if (bitdata == NULL) { + xv_errno = XV_NOMEM; + return NULL; + } + + /* create the image ... */ + I2 = XCreateImage(dpy, DefaultVisual(dpy, screen), 1, XYBitmap, 0, + (char *)bitdata, bit_w, bit_h, 8, 0); + + if (I2 == NULL) { + xv_errno = XV_NOXIMAGE; + return NULL; + } + + I2->byte_order = I2->bitmap_bit_order = MSBFirst; + + /* map vertical data to rotated character ... */ + for (j = 0; j < bit_h; j++) { + for (i = 0; i < bit_w; i++) { + /* map bits ... */ + if (dir == 1) { + val = vertdata[i*vert_len + (vert_w-j-1)/8] & + (128>>((vert_w-j-1)%8)); + } else if (dir == 2) { + val = vertdata[(vert_h-j-1)*vert_len + + (vert_w-i-1)/8] & (128>>((vert_w-i-1)%8)); + } else { + val = vertdata[(vert_h-i-1)*vert_len + j/8] & + (128>>(j%8)); + } + if (val) { + bitdata[j*bit_len + i/8] = bitdata[j*bit_len + i/8] | + (128>>(i%8)); + } + } + } + + /* create this character's bitmap ... */ + rotfont->per_char[ichar-32].glyph.bm = + XCreatePixmap(dpy, root, bit_w, bit_h, 1); + + /* put the image into the bitmap ... */ + XPutImage(dpy, rotfont->per_char[ichar-32].glyph.bm, + font_gc, I2, 0, 0, 0, 0, bit_w, bit_h); + + /* free the image and data ... */ + XDestroyImage(I1); + XDestroyImage(I2); + /* free((char *)bitdata); -- XDestroyImage does this + free((char *)vertdata);*/ + } + XFreeFont(dpy, fontstruct); + } + + /* free pixmap and GC ... */ + XFreePixmap(dpy, canvas); + XFreeGC(dpy, font_gc); + + return rotfont; +} + +//------- XRotUnloadFont ----------------- +// Free the resources associated with a +// rotated font +//---------------------------------------- +void XRotUnloadFont(Display *dpy, XRotFontStruct *rotfont) +{ + int ichar; + + if (rotfont->dir == 0) + XFreeFont(dpy, rotfont->xfontstruct); + else { + /* loop through each character, freeing its pixmap ... */ + for (ichar = rotfont->min_char-32; ichar <= rotfont->max_char-32; + ichar++) + XFreePixmap(dpy, rotfont->per_char[ichar].glyph.bm); + } + /* rotfont should never be referenced again ... */ + free((char *)rotfont->name); + free((char *)rotfont); +} + +//------- XRotTextWidth ------------------ +// Returns the width of a rotated string +//---------------------------------------- +unsigned int XRotTextWidth(XRotFontStruct *rotfont, char *str, int len) +{ + int i, width = 0, ichar; + + if (str == NULL) + return 0; + + if (rotfont->dir == 0) + width = XTextWidth(rotfont->xfontstruct, str, strlen(str)); + else { + for (i = 0; i<len; i++) { + ichar = str[i]-32; + + /* make sure it's a printing character ... */ + if (ichar >= 0 && ichar<95) + width += rotfont->per_char[ichar].width; + } + } + return width; +} + + +//------- XRotDrawString ----------------- +// A front end to XRotDrawString : mimics XDrawString +//---------------------------------------- +void XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawable, + GC gc, int x, int y, char *str, int len) +{ + static GC my_gc = 0; + int i, xp, yp, dir, ichar; + + if (str == NULL || len<1) + return; + + dir = rotfont->dir; + if (my_gc == 0) + my_gc = XCreateGC(dpy, drawable, 0, 0); + + XCopyGC(dpy, gc, GCForeground|GCBackground, my_gc); + + /* a horizontal string is easy ... */ + if (dir == 0) { + XSetFillStyle(dpy, my_gc, FillSolid); + XSetFont(dpy, my_gc, rotfont->xfontstruct->fid); + XDrawString(dpy, drawable, my_gc, x, y, str, len); + return; + } + + /* vertical or upside down ... */ + + XSetFillStyle(dpy, my_gc, FillStippled); + + /* loop through each character in string ... */ + for (i = 0; i<len; i++) { + ichar = str[i]-32; + + /* make sure it's a printing character ... */ + if (ichar >= 0 && ichar<95) { + /* suitable offset ... */ + if (dir == 1) { + xp = x-rotfont->per_char[ichar].ascent; + yp = y-rotfont->per_char[ichar].rbearing; + } else if (dir == 2) { + xp = x-rotfont->per_char[ichar].rbearing; + yp = y-rotfont->per_char[ichar].descent+1; + } else { + xp = x-rotfont->per_char[ichar].descent+1; + yp = y+rotfont->per_char[ichar].lbearing; + } + + /* draw the glyph ... */ + XSetStipple(dpy, my_gc, rotfont->per_char[ichar].glyph.bm); + + XSetTSOrigin(dpy, my_gc, xp, yp); + + XFillRectangle(dpy, drawable, my_gc, xp, yp, + rotfont->per_char[ichar].glyph.bit_w, + rotfont->per_char[ichar].glyph.bit_h); + + /* advance position ... */ + if (dir == 1) + y -= rotfont->per_char[ichar].width; + else if (dir == 2) + x -= rotfont->per_char[ichar].width; + else + y += rotfont->per_char[ichar].width; + } + } +} + +// ---- stop code stealing ---- + +void DrawString(Display *display, Window w, GC gc, FFont *font, + unsigned int text_w, unsigned int size_w, + unsigned int bevel_w, char *text) { +//Draw title string + + unsigned int l = text_w; + int dlen=strlen(text); + int dx=bevel_w*2; + + if (text_w > size_w) { + for (; dlen >= 0; dlen--) { + if (I18n::instance()->multibyte()) { + XRectangle ink, logical; + XmbTextExtents(font->set, text, dlen, + &ink, &logical); + l = logical.width; + } else + l = XTextWidth(font->fontstruct, text, dlen); + + l += (dx * 4); + + if (l < size_w) + break; + } + } + + switch (font->justify) { + case FFont::Right: + dx += size_w - l; + break; + + case FFont::Center: + dx += (size_w - l) / 2; + break; + default: + break; + } + + //Draw title to m_tabwin + + XClearWindow(display, w); + + if (I18n::instance()->multibyte()) { + XmbDrawString(display, w, + font->set, gc, dx, 1 - font->set_extents->max_ink_extent.y, + text, dlen); + } else { + XDrawString(display, w, + gc, dx, font->fontstruct->ascent + 1, + text, dlen); + } + +} + + +void DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font, + unsigned int align, unsigned int text_w, + unsigned int size_w, unsigned int size_h, + unsigned int bevel_w, char *text) { + + unsigned int l = text_w; + int dlen = strlen(text); + int dx = bevel_w * 2; + + if (text_w > size_w) { + for (; dlen >= 0; dlen--) { + l = XRotTextWidth(font, text, dlen); + + l += (dx * 4); + + if (l < size_h) + break; + } + } + + if (align == FFont::Right) + size_h = l; + else if (align == FFont::Center) + size_h = (size_h + l) / 2; + else + size_h -= (dx * 4); + + // To get it in the "center" of the tab + size_w = (size_w + XRotTextWidth(font, "/", 1)) / 2; + + //Draw title to m_tabwin + XClearWindow(display, w); + XRotDrawString(display, font, w, gc, size_w, size_h, text, dlen); +}
A src/misc.hh

@@ -0,0 +1,60 @@

+// misc.hh for fluxbox +// Copyright (c) 2001 Henrik Kinnunen (fluxgen@linuxmail.org) +// +// 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 + +#include <X11/Xlib.h> +#include "Theme.hh" + +#ifndef _MISC_HH_ +#define _MISC_HH_ + +// ---- start code stealing ----- + +// ---------------------------------------------------------------------- +// xvertext, Copyright (c) 1992 Alan Richardson (mppa3@uk.ac.sussex.syma) +// ---------------------------------------------------------------------- + +#define XV_NOFONT 1 // no such font on X server +#define XV_NOMEM 2 // couldn't do malloc +#define XV_NOXIMAGE 3 // couldn't create an XImage + +unsigned int XRotTextWidth(XRotFontStruct *rotfont, char *str, int len); +void XRotDrawString(Display *dpy, XRotFontStruct *rotfont, Drawable drawable, + GC gc, int x, int y, char *str, int len); + +//int xv_errno; //TODO: ? + +// --- stop code stealing --- + +void DrawString(Display *display, Window w, GC gc, FFont *font, + unsigned int text_w, unsigned int size_w, + unsigned int bevel_w, char *text); + +void DrawRotString(Display *display, Window w, GC gc, XRotFontStruct *font, + unsigned int align, unsigned int text_w, + unsigned int size_w, unsigned int size_h, + unsigned int bevel_w, char *text); + +#endif //_MISC_HH_
A stamp-h.in

@@ -0,0 +1,1 @@

+timestamp
A util/Makefile.am

@@ -0,0 +1,17 @@

+# util/Makefile.am for Blackbox 0.61.x - an X11 Window manager + +CPPFLAGS= @CPPFLAGS@ @DEBUG@ @NLS@ @TIMEDCACHE@ @NEWWMSPEC@ @INTERLACE@ \ +@ORDEREDPSEUDO@ + +bin_SCRIPTS = bsetbg +bin_PROGRAMS = bsetroot +bsetroot_SOURCES = bsetroot.cc bsetroot.hh +bsetroot_LDADD = ../src/BaseDisplay.o ../src/LinkedList.o ../src/Timer.o ../src/Image.o ../src/i18n.o +MAINTAINERCLEANFILES = Makefile.in +EXTRA_DIST=bsetbg + +distclean-local: + rm -f *\~ + +bsetroot.o: bsetroot.cc ../config.h bsetroot.hh ../src/BaseDisplay.hh \ + ../src/LinkedList.hh ../src/Timer.hh ../src/Image.hh
A util/Makefile.in

@@ -0,0 +1,369 @@

+# Makefile.in generated automatically by automake 1.4 from Makefile.am + +# 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. + +# util/Makefile.am for Blackbox 0.61.x - an X11 Window manager + + +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 = : +host_alias = @host_alias@ +host_triplet = @host@ +AS = @AS@ +CC = @CC@ +CXX = @CXX@ +DEBUG = @DEBUG@ +DLLTOOL = @DLLTOOL@ +GNOME = @GNOME@ +INTERLACE = @INTERLACE@ +KDE = @KDE@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +MAKEINFO = @MAKEINFO@ +NEWWMSPEC = @NEWWMSPEC@ +NLS = @NLS@ +OBJDUMP = @OBJDUMP@ +ORDEREDPSEUDO = @ORDEREDPSEUDO@ +PACKAGE = @PACKAGE@ +RANLIB = @RANLIB@ +SHAPE = @SHAPE@ +SLIT = @SLIT@ +TIMEDCACHE = @TIMEDCACHE@ +VERSION = @VERSION@ +gencat_cmd = @gencat_cmd@ +regex_cmd = @regex_cmd@ + +CPPFLAGS = @CPPFLAGS@ @DEBUG@ @NLS@ @TIMEDCACHE@ @NEWWMSPEC@ @INTERLACE@ @ORDEREDPSEUDO@ + + +bin_SCRIPTS = bsetbg +bin_PROGRAMS = bsetroot +bsetroot_SOURCES = bsetroot.cc bsetroot.hh +bsetroot_LDADD = ../src/BaseDisplay.o ../src/LinkedList.o ../src/Timer.o ../src/Image.o ../src/i18n.o +MAINTAINERCLEANFILES = Makefile.in +EXTRA_DIST = bsetbg +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@ +bsetroot_OBJECTS = bsetroot.o +bsetroot_DEPENDENCIES = ../src/BaseDisplay.o ../src/LinkedList.o \ +../src/Timer.o ../src/Image.o ../src/i18n.o +bsetroot_LDFLAGS = +SCRIPTS = $(bin_SCRIPTS) + +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +LTCOMPILE = $(LIBTOOL) --mode=compile $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(LIBTOOL) --mode=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 +SOURCES = $(bsetroot_SOURCES) +OBJECTS = $(bsetroot_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cc .lo .o .s +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu --include-deps util/Makefile + +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 " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(LIBTOOL) --mode=install $(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: + +.c.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.s.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +.S.lo: + $(LIBTOOL) --mode=compile $(COMPILE) -c $< + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + +maintainer-clean-libtool: + +bsetroot: $(bsetroot_OBJECTS) $(bsetroot_DEPENDENCIES) + @rm -f bsetroot + $(CXXLINK) $(bsetroot_LDFLAGS) $(bsetroot_OBJECTS) $(bsetroot_LDADD) $(LIBS) + +install-binSCRIPTS: $(bin_SCRIPTS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_SCRIPTS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + else if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`"; \ + $(INSTALL_SCRIPT) $(srcdir)/$$p $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + else :; fi; fi; \ + done + +uninstall-binSCRIPTS: + @$(NORMAL_UNINSTALL) + list='$(bin_SCRIPTS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed '$(transform)'`; \ + done +.cc.o: + $(CXXCOMPILE) -c $< +.cc.lo: + $(LTCXXCOMPILE) -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 = util + +distdir: $(DISTFILES) + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$/$$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-binPROGRAMS install-binSCRIPTS +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-binSCRIPTS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) $(SCRIPTS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) $(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-libtool mostlyclean-tags \ + mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-libtool clean-tags \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-libtool \ + distclean-tags distclean-generic clean-am \ + distclean-local + -rm -f libtool + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-libtool \ + 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-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile mostlyclean-libtool distclean-libtool \ +clean-libtool maintainer-clean-libtool uninstall-binSCRIPTS \ +install-binSCRIPTS tags 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 mostlyclean-generic \ +distclean-generic clean-generic maintainer-clean-generic clean \ +mostlyclean distclean maintainer-clean + + +distclean-local: + rm -f *\~ + +bsetroot.o: bsetroot.cc ../config.h bsetroot.hh ../src/BaseDisplay.hh \ + ../src/LinkedList.hh ../src/Timer.hh ../src/Image.hh + +# 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:
A util/bsetbg

@@ -0,0 +1,699 @@

+#!/bin/sh + +# Copyright (c) 2000 LordZork Industries (lordzork@lordzork.com) +# +# 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. + + +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 blackbox 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 +} + + +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 <application> image is set using <application> with" + echo " <"'"application options"'"> quote-enclosed \"options\" and" + echo " -center, -c|-tile, -t|-full, -f default fallback option" + echo + echo " -display <string> display to connect to (bsetroot only)" + echo " -mod <x> <y> sets bsetroot modula pattern" + echo " -foreground, -fg <color> modula foreground color" + echo " -background, -bg <color> modula background color" + echo + echo " -gradient <texture> sets bsetroot gradient texture" + echo " -from <color> gradient start color" + echo " -to <color> gradient end color" + echo + echo " -solid <color> 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: <options...> <image>" + exit 0 +} + + +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 +} + + +find_app() +{ + 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 +} + +search_display() +{ + ### display + full="display -geometry 800x600 -window root" + tile="display -window root" + center="display -backdrop -window root" + default=$center + find_app display +} + +search_Esetroot() +{ + ### Esetroot + full="Esetroot -scale" + tile="Esetroot" + center="Esetroot -c" + default=$center + find_app Esetroot +} + +search_wmsetbg() +{ + ### wmsetbg + full="wmsetbg -s -S" + tile="wmsetbg -t" + center="wmsetbg -e" + default=$center + find_app wmsetbg +} + +search_xli() +{ + ### 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 +} + +search_qiv() +{ + ### qiv + full="qiv --root_s" + tile="qiv --root_t" + center="qiv --root" + default=$center + find_app qiv +} + +search_xv() +{ + ### xv + full="xv -max -smooth -root -quit" + tile="xv -root -quit" + center="xv -rmode 5 -root -quit" + default=$center + find_app xv +} + + +rm_tmpfiles() +{ + [ -f $TMPFILE ] && rm -f $TMPFILE + [ -f $TMPFILE2 ] && rm -f $TMPFILE2 +} + + +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 + fi + esac + + case $ARGUMENT in + -r) + echo "$NAME: creating configuration for root (BAD IDEA)..." + ;; + *) + echo "$NAME: $CONFIG not found, creating..." + esac + + rm_tmpfiles + + 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 > $TMPFILE2 + cat "$TMPFILE2" >> $CONFIG + + rm -f $TMPFILE $TMPFILE2 + + if [ -f $CONFIG ]; then + echo "$NAME: default configuration was created in $CONFIG." + else + echo "ERROR: $CONFIG not found!" && exit 1 + fi +} + +check_config_apps() +{ + 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 +} + + +check_config_vars() +{ + 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 +} + + +final_error_check() +{ + 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 + else + error_msg 1 + fi + esac +} + + +check_config() +{ + if [ ! -f $CONFIG ]; then + create_config + fi + + check_old_config + . $CONFIG + check_config_vars + final_error_check +} + + +check_image() +{ + 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 +} + + +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 +} + + +check_bsetroot_args() +{ + 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 +} + + +exec_bsetroot() +{ + case `which bsetroot 2>&1` in + */*bsetroot) + exec bsetroot $ARGS + ;; + *) + error_msg 7 + esac +} + + +check_old_config() +{ + 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 + 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 +} + +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=/tmp/bsetbg.1 +TMPFILE2=/tmp/bsetbg.2 +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 + 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
A util/bsetroot.cc

@@ -0,0 +1,300 @@

+#ifdef HAVE_CONFIG_H +# include "../config.h" +#endif // HAVE_CONFIG_H + +#ifdef STDC_HEADERS +# include <string.h> +# include <stdlib.h> +#endif // STDC_HEADERS + +#ifdef HAVE_STDIO_H +# include <stdio.h> +#endif // HAVE_STDIO_H + +#include "../src/i18n.hh" +#include "bsetroot.hh" + + +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; + int mod_x = 0, mod_y = 0, i = 0; + img_ctrl = new BImageControl*[10]; + for (; i < getNumberOfScreens(); i++) { + img_ctrl[i] = new BImageControl(this, getScreenInfo(i), True); + + } + + for (i = 1; i < argc; i++) { + if (! strcmp("-help", argv[i])) { + usage(); + } else if ((! strcmp("-fg", argv[i])) || + (! strcmp("-foreground", argv[i])) || + (! strcmp("-from", argv[i]))) { + if ((++i) >= argc) usage(1); + + fore = argv[i]; + } else if ((! strcmp("-bg", argv[i])) || + (! strcmp("-background", argv[i])) || + (! strcmp("-to", argv[i]))) { + if ((++i) >= argc) usage(1); + + back = argv[i]; + } else if (! strcmp("-solid", argv[i])) { + if ((++i) >= argc) usage(1); + + fore = argv[i]; + sol = True; + } else if (! strcmp("-mod", argv[i])) { + if ((++i) >= argc) usage(); + + mod_x = atoi(argv[i]); + + if ((++i) >= argc) usage(); + + mod_y = atoi(argv[i]); + + if (mod_x < 1) mod_x = 1; + if (mod_y < 1) mod_y = 1; + + mod = True; + } else if (! strcmp("-gradient", argv[i])) { + if ((++i) >= argc) usage(); + + grad = argv[i]; + grd = True; + } else if (! strcmp("-display", argv[i])) { + // -display passed through tests ealier... we just skip it now + i++; + } else + usage(); + } + + if ((mod + sol + grd) != True) { + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + bsetrootSet, bsetrootMustSpecify, +#else // !NLS + 0, 0, +#endif // NLS + "%s: error: must specify on of: -solid, -mod, -gradient\n"), + getApplicationName()); + + usage(2); + } + + 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(); + else usage(); + display = getXDisplay(); + num_screens = getNumberOfScreens(); +} + + +bsetroot::~bsetroot(void) { + XKillClient(display, AllTemporary); + + if (pixmaps) { + int i; + for (i = 0; i < num_screens; i++) + if (pixmaps[i] != None) { + XSetCloseDownMode(display, RetainTemporary); + break; + } + + delete [] pixmaps; + } + + if (img_ctrl) { + int i = 0; + for (; i < num_screens; i++) + delete img_ctrl[i]; + + delete [] img_ctrl; + } + +} + + +void bsetroot::solid(void) { + register int screen = 0; + + for (; screen < getNumberOfScreens(); screen++) { + BColor c; + + img_ctrl[screen]->parseColor(&c, fore); + if (! c.isAllocated()) c.setPixel(BlackPixel(getXDisplay(), screen)); + + XSetWindowBackground(getXDisplay(), getScreenInfo(screen)->getRootWindow(), + c.getPixel()); + XClearWindow(getXDisplay(), getScreenInfo(screen)->getRootWindow()); + } +} + + +void bsetroot::modula(int x, int y) { + char data[32]; + long pattern; + + register int screen, i; + + pixmaps = new Pixmap[getNumberOfScreens()]; + + for (pattern = 0, screen = 0; screen < getNumberOfScreens(); screen++) { + for (i = 0; i < 16; i++) { + pattern <<= 1; + if ((i % x) == 0) + pattern |= 0x0001; + } + + for (i = 0; i < 16; i++) + if ((i % y) == 0) { + 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, b; + GC gc; + Pixmap bitmap; + XGCValues gcv; + + bitmap = + XCreateBitmapFromData(getXDisplay(), + getScreenInfo(screen)->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)); + + gcv.foreground = f.getPixel(); + gcv.background = b.getPixel(); + + gc = XCreateGC(getXDisplay(), getScreenInfo(screen)->getRootWindow(), + GCForeground | GCBackground, &gcv); + + pixmaps[screen] = + XCreatePixmap(getXDisplay(), getScreenInfo(screen)->getRootWindow(), + 16, 16, getScreenInfo(screen)->getDepth()); + + XCopyPlane(getXDisplay(), bitmap, pixmaps[screen], gc, + 0, 0, 16, 16, 0, 0, 1l); + XSetWindowBackgroundPixmap(getXDisplay(), + getScreenInfo(screen)->getRootWindow(), + pixmaps[screen]); + XClearWindow(getXDisplay(), getScreenInfo(screen)->getRootWindow()); + + XFreeGC(getXDisplay(), gc); + XFreePixmap(getXDisplay(), bitmap); + + if (! (getScreenInfo(screen)->getVisual()->c_class & 1)) { + XFreePixmap(getXDisplay(), pixmaps[screen]); + pixmaps[screen] = None; + } + } +} + + +void bsetroot::gradient(void) { + register int screen; + + pixmaps = new Pixmap[getNumberOfScreens()]; + + for (screen = 0; screen < getNumberOfScreens(); screen++) { + BTexture texture; + img_ctrl[screen]->parseTexture(&texture, grad); + img_ctrl[screen]->parseColor(texture.getColor(), fore); + img_ctrl[screen]->parseColor(texture.getColorTo(), back); + + 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(), + &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; + } + } +} + + +void bsetroot::usage(int exit_code) { + fprintf(stderr, + I18n::instance()-> + getMessage( +#ifdef NLS + bsetrootSet, bsetrootUsage, +#else // !NLS + 0, 0, +#endif // NLS + "%s 2.0 : (c) 1997-1999 Brad Hughes\n\n" + " -display <string> display connection\n" + " -mod <x> <y> modula pattern\n" + " -foreground, -fg <color> modula foreground color\n" + " -background, -bg <color> modula background color\n\n" + " -gradient <texture> gradient texture\n" + " -from <color> gradient start color\n" + " -to <color> gradient end color\n\n" + " -solid <color> 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; + + NLSInit("blackbox.cat"); + + for (; i < argc; i++) { + if (! strcmp(argv[i], "-display")) { + // check for -display option + + if ((++i) >= argc) { + fprintf(stderr, + I18n::instance()->getMessage( +#ifdef NLS + mainSet, mainDISPLAYRequiresArg, +#else // !NLS + 0, 0, +#endif // NLS + "error: '-display' requires an argument\n")); + + ::exit(1); + } + + display_name = argv[i]; + } + } + + bsetroot app(argc, argv, display_name); + + return 0; +}
A util/bsetroot.hh

@@ -0,0 +1,33 @@

+#ifndef __bsetroot2_hh +#define __bsetroot2_hh + +#include "../src/BaseDisplay.hh" +#include "../src/Image.hh" + + +class bsetroot : public BaseDisplay { +public: + bsetroot(int, char **, char * = 0); + ~bsetroot(void); + + inline virtual Bool handleSignal(int) { return False; } + + void gradient(void); + void modula(int, int); + void solid(void); + void usage(int = 0); + +private: + BImageControl **img_ctrl; + Pixmap *pixmaps; + + char *fore, *back, *grad; + Display *display; + int num_screens; +protected: + inline virtual void process_event(XEvent *) { } + +}; + + +#endif // __bsetroot2_hh
A version.h.in

@@ -0,0 +1,1 @@

+#define __fluxbox_version "@VERSION@"