bbtime-0.1.5/0000777000175000001440000000000007562705434006534 5bbtime-0.1.5/README0000644000175000001440000000267306754637455007351 -- README for bbtime 0.0.1 - a tool to display the current time -- in a decorated X11-Window. -- Copyright (c) 1998 by John Kennis -- parts Copyright (c) 1997,1998 by Brad Hughes. -- 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., 675 Mass Ave, Cambridge, MA 02139, USA. -- -- (See the included file COPYING / GPL-2.0) -- This Tool displays the time in an decorated window, simulating the look of the Blackbox toolbar (Blackbox is a Windowmanager for X11). To copy this look a great deal of the code is taken from Blackbox. The files Image.cc (.hh) are taken from the Blackbox, only one class-name was changed. The files LinkedListed.cc (.hh) are taken from Blackbox without any change. Thanks to: Brad Hughes For writing the Blackbox Windowmanager (and with this a great deal of the code for this application). bbtime-0.1.5/AUTHORS0000644000175000001440000000027706755762350007531 Author: John Kennis Thanks to: Brad Hughes For writing the Blackbox Windowmanager (and with this a great deal of the code for this application). bbtime-0.1.5/COPYING0000644000175000001440000004310506713403025007472 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy 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 Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19yy name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. bbtime-0.1.5/ChangeLog0000644000175000001440000000077707562705412010231 version-0.1.5 - Fixed configure script version-0.1.4 - Fixed compilation for gcc-3.0 and up version-0.1.3 - fixed a compile time error version-0.1.2 - menu is now raised on top of other windows version-0.1.1 - fixed segfault error for solaris. - fixed color allocation problem for solaris version-0.1.0 - added support for multiple times - when tool is placed in the slit, the width is at least 64 pixels version-0.0.2 - fixed small bug, time wasn't always redrawn correct version-0.0.1 - first release bbtime-0.1.5/INSTALL0000644000175000001440000000256706754637532007520 To make and install this program : run: ./configure (for configure options see ./configure --help) make make install (as root) The global configuration files can be found in $(datadir)/bbtools (default: /usr/local/share/bbtools). Blackbox users: By default bbtime reads the Blackbox style-file as defined in .blackboxrc and copies as much of the style as possible. The result is a application which looks a lot like the toolbar. Further configuration options can be found in bbtime.style. Most likely you want to change these options, copy this file to somewhere in your homedir (eg blackbox/bbtime.config) and edit it. Edit the file .blackboxrc and add or edit the line: bbtime.configFile: WARNING: You have to define the entire PATH. All style options set be reading the Blackbox-style file can be overridden by placing them in bbtime.config (and changing them). See bbtime.style for all possible options. Make sure the file .bbtoolsrc does not exist, else the configuration style for other Window Managers will be used. Users other Window managers: By default bbtime reads the bbtoolsrc bbtime.nobb config files. If you want to define your personal config-file copy bbtoolsrc to your home-dir as ./.bbtoolsrc Copy bbtime.nobb somewhere in your homedir. Edit .bbtoolsrc so bbtime.configFilex: . WARNING: You have to define the entire PATH. bbtime-0.1.5/Makefile.am0000644000175000001440000000074306755300160010476 CPPFLAGS = @CPPFLAGS@ \ -DDEFAULT_CONF=\"$(datadir)/bbtools/bbtime.conf\" \ -DDEFAULT_NOBB=\"$(datadir)/bbtools/bbtime.nobb\" SUBDIRS = data bin_PROGRAMS = bbtime bbtime_SOURCES = bbtime.cc Image.cc LinkedList.cc \ bbtime.hh Image.hh LinkedList.hh \ resource.cc resource.hh \ Baseresource.cc Baseresource.hh \ Basewindow.cc Basewindow.hh \ Basemenu.cc Basemenu.hh \ timemenu.cc timemenu.hh \ blackboxstyle.hh EXTRA_DIST = BUGS TODO bbtime_LDADD = @X_LIBS@ bbtime-0.1.5/Makefile.in0000644000175000001440000003075507562705432010525 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = . ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ regex_cmd = @regex_cmd@ CPPFLAGS = @CPPFLAGS@ -DDEFAULT_CONF=\"$(datadir)/bbtools/bbtime.conf\" -DDEFAULT_NOBB=\"$(datadir)/bbtools/bbtime.nobb\" SUBDIRS = data bin_PROGRAMS = bbtime bbtime_SOURCES = bbtime.cc Image.cc LinkedList.cc bbtime.hh Image.hh LinkedList.hh resource.cc resource.hh Baseresource.cc Baseresource.hh Basewindow.cc Basewindow.hh Basemenu.cc Basemenu.hh timemenu.cc timemenu.hh blackboxstyle.hh EXTRA_DIST = BUGS TODO bbtime_LDADD = @X_LIBS@ ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = version.h PROGRAMS = $(bin_PROGRAMS) DEFS = @DEFS@ -I. -I$(srcdir) LDFLAGS = @LDFLAGS@ LIBS = @LIBS@ X_CFLAGS = @X_CFLAGS@ X_LIBS = @X_LIBS@ X_EXTRA_LIBS = @X_EXTRA_LIBS@ X_PRE_LIBS = @X_PRE_LIBS@ bbtime_OBJECTS = bbtime.o Image.o LinkedList.o resource.o \ Baseresource.o Basewindow.o Basemenu.o timemenu.o bbtime_DEPENDENCIES = bbtime_LDFLAGS = CXXFLAGS = @CXXFLAGS@ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) CXXLD = $(CXX) CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ CFLAGS = @CFLAGS@ COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ DIST_COMMON = README AUTHORS COPYING ChangeLog INSTALL Makefile.am \ Makefile.in NEWS TODO aclocal.m4 configure configure.in install-sh \ missing mkinstalldirs version.h.in DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) TAR = tar GZIP_ENV = --best SOURCES = $(bbtime_SOURCES) OBJECTS = $(bbtime_OBJECTS) all: all-redirect .SUFFIXES: .SUFFIXES: .S .c .cc .o .s $(srcdir)/Makefile.in: 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): configure.in cd $(srcdir) && $(ACLOCAL) config.status: $(srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(srcdir)/configure: $(srcdir)/configure.in $(ACLOCAL_M4) $(CONFIGURE_DEPENDENCIES) cd $(srcdir) && $(AUTOCONF) version.h: $(top_builddir)/config.status version.h.in cd $(top_builddir) && CONFIG_FILES=$@ CONFIG_HEADERS= $(SHELL) ./config.status mostlyclean-binPROGRAMS: clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) distclean-binPROGRAMS: maintainer-clean-binPROGRAMS: install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(bindir) @list='$(bin_PROGRAMS)'; for p in $$list; do \ if test -f $$p; then \ echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ else :; fi; \ done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) list='$(bin_PROGRAMS)'; for p in $$list; do \ rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ done .c.o: $(COMPILE) -c $< .s.o: $(COMPILE) -c $< .S.o: $(COMPILE) -c $< mostlyclean-compile: -rm -f *.o core *.core clean-compile: distclean-compile: -rm -f *.tab.c maintainer-clean-compile: bbtime: $(bbtime_OBJECTS) $(bbtime_DEPENDENCIES) @rm -f bbtime $(CXXLINK) $(bbtime_LDFLAGS) $(bbtime_OBJECTS) $(bbtime_LDADD) $(LIBS) .cc.o: $(CXXCOMPILE) -c $< # 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 = $(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 $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done for subdir in $(SUBDIRS); do \ if test "$$subdir" = .; then :; else \ test -d $(distdir)/$$subdir \ || mkdir $(distdir)/$$subdir \ || exit 1; \ chmod 777 $(distdir)/$$subdir; \ (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ || exit 1; \ fi; \ done info-am: info: info-recursive dvi-am: dvi: dvi-recursive check-am: all-am check: check-recursive installcheck-am: installcheck: installcheck-recursive install-exec-am: install-binPROGRAMS 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-binPROGRAMS uninstall: uninstall-recursive all-am: Makefile $(PROGRAMS) all-redirect: all-recursive install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: installdirs-recursive installdirs-am: $(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: mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ mostlyclean-tags mostlyclean-generic mostlyclean: mostlyclean-recursive clean-am: clean-binPROGRAMS clean-compile clean-tags clean-generic \ mostlyclean-am clean: clean-recursive distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ distclean-generic clean-am distclean: distclean-recursive -rm -f config.status maintainer-clean-am: maintainer-clean-binPROGRAMS \ maintainer-clean-compile 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-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ mostlyclean-compile distclean-compile clean-compile \ maintainer-clean-compile install-data-recursive \ uninstall-data-recursive install-exec-recursive \ uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ all-recursive check-recursive installcheck-recursive info-recursive \ dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ install-exec install-data-am install-data install-am install \ uninstall-am uninstall all-redirect all-am all installdirs-am \ installdirs mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean # 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: bbtime-0.1.5/NEWS0000644000175000001440000000000006713403025007121 bbtime-0.1.5/TODO0000644000175000001440000000005406773546476007153 update configuration code update image code bbtime-0.1.5/aclocal.m40000644000175000001440000000674207562705432010317 dnl aclocal.m4 generated automatically by aclocal 1.4-p5 dnl Copyright (C) 1994, 1995-8, 1999, 2001 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)]) bbtime-0.1.5/configure0000755000175000001440000026055507562705432010372 #! /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_default_prefix=/usr/local ac_help="$ac_help --enable-debug create debugging code [default=no]" ac_help="$ac_help --with-x use the X Window System" # 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=bbtime.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:562: 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:615: 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:672: 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=bbtime 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 cat >> confdefs.h <> confdefs.h <&6 echo "configure:718: 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:731: 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:744: 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:757: 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:770: 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 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:791: 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 default bbtoolsrc file." 1>&2; exit 1; } fi for ac_func in strftime do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:827: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* 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:855: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done # Check whether --enable-debug or --disable-debug was given. if test "${enable_debug+set}" = set; then enableval="$enable_debug" if test $enableval = "no"; then test "$CFLAGS" = "" && CFLAGS="-O2 -Wall" test "$CXXFLAGS" = "" && CXXFLAGS="-O2 -Wall" test "$LDFLAGS" = "" && LDFLAGS="-s" else test "$CFLAGS" = "" && CFLAGS="-g -Wall -DDEBUG" test "$CXXFLAGS" = "" && CXXFLAGS="-g -Wall -DDEBUG" test "$LDFLAGS" = "" && LDFLAGS="" fi else test "$CFLAGS" = "" && CFLAGS="-O2 -Wall" test "$CXXFLAGS" = "" && CXXFLAGS="-O2 -Wall" test "$LDFLAGS" = "" && LDFLAGS="-s" fi # 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:914: 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:944: 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:995: 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:1027: 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 1038 "configure" #include "confdefs.h" main(){return(0);} EOF if { (eval echo configure:1043: \"$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:1069: 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:1074: 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 <&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:1102: 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:1138: 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:1170: 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 1181 "configure" #include "confdefs.h" int main(){return(0);} EOF if { (eval echo configure:1186: \"$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:1212: 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:1217: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.C <&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no fi fi 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:1245: 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:1288: 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 how to run the C preprocessor""... $ac_c" 1>&6 echo "configure:1342: 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 < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1363: \"$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 < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1380: \"$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 < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1397: \"$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 # 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:1426: 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 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:1493: \"$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 <&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:1675: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && 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 <&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:1740: 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 <&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:1781: 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 <&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:1829: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* 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:1857: \"$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:1878: 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 <&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:1927: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* 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:1955: \"$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:1976: 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 <&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:2019: 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 < /* 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:2047: \"$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:2068: 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 <&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:2111: 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 < /* 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:2139: \"$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:2160: 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 <&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:2212: 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 <&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 CFLAGS="$CFLAGS $X_CFLAGS" CXXFLAGS="$CXXFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS" echo $ac_n "checking for XOpenDisplay in -lX11""... $ac_c" 1>&6 echo "configure:2260: 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 <&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 LDFLAGS="$LDFLAGS -lX11" else echo "$ac_t""no" 1>&6 { echo "configure: error: XOpenDisplay not found in -lX11" 1>&2; exit 1; } fi LDFLAGS="$LDFLAGS $X_EXTRA_LIBS" echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 echo "configure:2304: 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 < #include #include #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2317: \"$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 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 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 < #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:2384: \"$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 malloc.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 echo "configure:2411: checking for $ac_hdr" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" { (eval echo configure:2421: \"$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 <&6 fi done echo $ac_n "checking for working const""... $ac_c" 1>&6 echo "configure:2449: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; } ; return 0; } EOF if { (eval echo configure:2503: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_c_const=no fi rm -f conftest* fi echo "$ac_t""$ac_cv_c_const" 1>&6 if test $ac_cv_c_const = no; then cat >> confdefs.h <<\EOF #define const EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 echo "configure:2524: 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 < #include #include int main() { struct tm *tp; ; return 0; } EOF if { (eval echo configure:2538: \"$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 echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 echo "configure:2559: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF if { (eval echo configure:2572: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* ac_cv_struct_tm=sys/time.h fi rm -f conftest* fi echo "$ac_t""$ac_cv_struct_tm" 1>&6 if test $ac_cv_struct_tm = sys/time.h; then cat >> confdefs.h <<\EOF #define TM_IN_SYS_TIME 1 EOF fi for ac_func in select strstr do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 echo "configure:2596: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < /* Override any gcc2 internal prototype to avoid an error. */ /* 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:2624: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else echo "configure: failed program was:" >&5 cat conftest.$ac_ext >&5 rm -rf conftest* eval "ac_cv_func_$ac_func=no" fi rm -f conftest* fi if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then echo "$ac_t""yes" 1>&6 ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` cat >> confdefs.h <&6 fi done 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 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # 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 </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 "version.h Makefile data/Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g s%@ACLOCAL@%$ACLOCAL%g s%@AUTOCONF@%$AUTOCONF%g s%@AUTOMAKE@%$AUTOMAKE%g s%@AUTOHEADER@%$AUTOHEADER%g s%@MAKEINFO@%$MAKEINFO%g s%@SET_MAKE@%$SET_MAKE%g s%@regex_cmd@%$regex_cmd%g s%@CC@%$CC%g s%@CXX@%$CXX%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 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 <> $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* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF 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 bbtime-0.1.5/configure.in0000644000175000001440000000303407562705357010765 dnl Process this file with autoconf to produce a configure script. AC_INIT(bbtime.cc) AM_INIT_AUTOMAKE(bbtime, 0.1.5) AC_PREFIX_DEFAULT(/usr/local) AC_CHECK_PROGS(regex_cmd, sed) if test x$regex_cmd = "x"; then AC_MSG_ERROR([error. sed is required to build the default bbtoolsrc file.]) fi dnl check for strftime AC_CHECK_FUNCS(strftime) dnl get the debug values right AC_DEFUN(AC_SET_DEBUG, [ test "$CFLAGS" = "" && CFLAGS="-g -Wall -DDEBUG" test "$CXXFLAGS" = "" && CXXFLAGS="-g -Wall -DDEBUG" test "$LDFLAGS" = "" && LDFLAGS="" ]) AC_DEFUN(AC_SET_NODEBUG, [ test "$CFLAGS" = "" && CFLAGS="-O2 -Wall" test "$CXXFLAGS" = "" && CXXFLAGS="-O2 -Wall" test "$LDFLAGS" = "" && LDFLAGS="-s" ]) AC_ARG_ENABLE(debug,[ --enable-debug create debugging code [default=no]], [ if test $enableval = "no"; then AC_SET_NODEBUG else AC_SET_DEBUG fi ], AC_SET_NODEBUG) dnl Checks for programs. dnl needed by configure itsself AC_PROG_CC AC_PROG_CXX AC_PROG_INSTALL AC_PATH_X AC_PATH_XTRA CFLAGS="$CFLAGS $X_CFLAGS" CXXFLAGS="$CXXFLAGS $X_CFLAGS" LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS" dnl Checks for X libraries. AC_CHECK_LIB(X11, XOpenDisplay, LDFLAGS="$LDFLAGS -lX11", AC_MSG_ERROR(XOpenDisplay not found in -lX11)) LDFLAGS="$LDFLAGS $X_EXTRA_LIBS" dnl Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS(malloc.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_HEADER_TIME AC_STRUCT_TM dnl Checks for library functions. AC_CHECK_FUNCS(select strstr) AC_OUTPUT(version.h Makefile data/Makefile) bbtime-0.1.5/install-sh0000755000175000001440000001272106713403025010443 #! /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 bbtime-0.1.5/missing0000755000175000001440000001420206713403025010032 #! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997 Free Software Foundation, Inc. # Franc,ois Pinard , 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 bbtime-0.1.5/mkinstalldirs0000755000175000001440000000133406713403025011243 #! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain # $Id: mkinstalldirs,v 1.10 1996/05/03 07:37:52 friedman 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 bbtime-0.1.5/version.h.in0000644000175000001440000000007306754621212010704 #define BBTOOL "bbtime" #define BBTOOL_VERSION "@VERSION@" bbtime-0.1.5/bbtime.cc0000644000175000001440000003127406756051476010234 // bbtime.cc for bbtime - an tool for display the time in X11. // // Copyright (c) 1998-1999 by John Kennis, jkennis@chello.nl // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "bbtime.hh" #include "version.h" #include ToolWindow::ToolWindow(int argc,char **argv) : Basewindow(argc,argv) { XrmInitialize(); resource = new Resource(this); date=False; selected_friend=0; MakeWindow(False); mbmenu->setHighlight(0); CheckTime(False); Redraw(); } ToolWindow::~ToolWindow() { XUnmapWindow(dpy,framewin); /* destroy pixmaps */ if (pixmap.frame) image_control->removeImage(pixmap.frame); if (pixmap.label) image_control->removeImage(pixmap.label); if (frameGC) XFreeGC(dpy,frameGC); if (menuGC) XFreeGC(dpy,menuGC); if (menuHiBGGC) XFreeGC(dpy,menuHiBGGC); if (menuHiGC) XFreeGC(dpy,menuHiGC); if (menuFrameGC) XFreeGC(dpy,menuFrameGC); /* destroy windows */ XDestroyWindow(dpy,labelwin); XDestroyWindow(dpy,framewin); } void ToolWindow::Reconfigure(void) { /* destroy pixmaps */ image_control->removeImage(pixmap.frame); image_control->removeImage(pixmap.label); mbmenu->ClearMenu(); resource->Reload(); MakeWindow(True); CheckTime(False); XClearWindow(dpy, labelwin); XClearWindow(dpy, framewin); Redraw(); } unsigned int ToolWindow::bevelWidth() { return resource->frame.bevelWidth; } XFontStruct *ToolWindow::titleFont() { return resource->menu.font; } XFontStruct *ToolWindow::menuFont() { return resource->menu.font; } int ToolWindow::MenuJustification() { return resource->menu.justify; } void ToolWindow::saveMenuSearch(Window window,Basemenu *menu) { menuwin=window; } void ToolWindow::removeMenuSearch(Window window) { menuwin= (Window )NULL; } Resource *ToolWindow::getResource() { return resource; } void ToolWindow::MakeWindow(bool reconfigure) { XSetWindowAttributes attrib; XWMHints wmhints; unsigned long create_mask = CWBackPixmap| CWOverrideRedirect |CWCursor|CWEventMask; #ifdef HAVE_STRFTIME time_t ttmp = time(NULL); tt = 0; if (ttmp != -1) { tt = localtime(&ttmp); if (tt) { char t[1024], *time_string = (char *) 0; int i, len = strftime(t, 1024, resource->report.strftimeFormat,tt); time_string = new char[len + 1]; for (i = 0; i < len; i++) *(time_string + i) = '0'; *(time_string + len) = '\0'; label.width = XTextWidth(resource->label.font, time_string, len) + (resource->frame.bevelWidth * 2); delete [] time_string; } else { fprintf(stderr,"can't get the time \n\n"); exit(-1); } } else { fprintf(stderr,"can't get the time \n\n"); exit(-1); } #else // !HAVE_STRFTIME label.width = XTextWidth(resource->label.font, "00:00000", strlen("00:00000")) + (resource->frame.bevelWidth * 2); #endif // HAVE_STRFTIME if (withdrawn&&label.width<64) label.width=64-2*resource->frame.bevelWidth; if (withdrawn) frame.width=64; else frame.width=label.width + 2*resource->frame.bevelWidth; frame.height=resource->label.font->ascent+ resource->label.font->descent+4*resource->frame.bevelWidth; label.height=frame.height-2*resource->frame.bevelWidth; if (resource->position.mask & XNegative) { resource->position.x = display_width + resource->position.x - frame.width; } if (resource->position.mask & YNegative) { resource->position.y = display_height + resource->position.y - frame.height; } if (!withdrawn) { frame.x=resource->position.x; frame.y=resource->position.y; } if (withdrawn) { attrib.override_redirect = False; wmhints.initial_state = WithdrawnState; } else { attrib.override_redirect = True; wmhints.initial_state = NormalState; } attrib.background_pixmap = ParentRelative; pixmap.frame = image_control->renderImage(frame.width, frame.height, &resource->frame.texture); pixmap.label = image_control->renderImage(label.width, label.height, &resource->label.texture); attrib.cursor = cursor; attrib.event_mask = ButtonPressMask | ButtonReleaseMask | ExposureMask | FocusChangeMask | KeyPressMask | StructureNotifyMask; if (!reconfigure) { framewin = XCreateWindow(dpy, root, resource->position.x, resource->position.y, frame.width, frame.height, 0, depth, InputOutput, v, create_mask, &attrib); } else if (!withdrawn) { XMoveResizeWindow(dpy, framewin, resource->position.x, resource->position.y, frame.width, frame.height); } else { XResizeWindow(dpy,framewin,frame.width,frame.height); } wmhints.flags = IconWindowHint | StateHint; wmhints.icon_window = framewin; XSetWMHints(dpy, framewin, &wmhints); if (!shape) { XSetWindowBackgroundPixmap(dpy, framewin, pixmap.frame); } if (!reconfigure) { labelwin = XCreateWindow(dpy, framewin, resource->frame.bevelWidth, resource->frame.bevelWidth, label.width, label.height, 0, depth, InputOutput, v, create_mask, &attrib); } else { XMoveResizeWindow(dpy, labelwin, resource->frame.bevelWidth, resource->frame.bevelWidth, label.width, label.height); } if (!resource->label.transparent) XSetWindowBackgroundPixmap(dpy, labelwin, pixmap.label); if (!reconfigure) { gcv.font = resource->label.font->fid; gcv.foreground = resource->label.textColor.pixel; frameGC = XCreateGC(dpy, framewin,GCFont|GCForeground, &gcv); gcv.font = resource->menu.font->fid; gcv.foreground = resource->menu.texture.color.pixel; menuGC = XCreateGC(dpy, framewin,GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.highlightColor.pixel; gcv.arc_mode = ArcChord; gcv.fill_style = FillSolid; menuHiBGGC = XCreateGC(dpy, framewin,GCForeground| GCFillStyle|GCArcMode, &gcv); gcv.foreground = resource->menu.hitextColor.pixel; menuHiGC = XCreateGC(dpy, framewin, GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.textColor.pixel; menuFrameGC = XCreateGC(dpy, framewin,GCFont|GCForeground, &gcv); mbmenu = new Timemenu(this); mbmenu->Update(); } else { gcv.font = resource->label.font->fid; gcv.foreground = resource->label.textColor.pixel; XChangeGC(dpy, frameGC,GCFont|GCForeground, &gcv); gcv.font = resource->menu.font->fid; gcv.foreground = resource->menu.texture.color.pixel; XChangeGC(dpy, menuGC,GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.highlightColor.pixel; XChangeGC(dpy, menuHiBGGC,GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.hitextColor.pixel; XChangeGC(dpy, menuHiGC, GCFont|GCForeground, &gcv); gcv.foreground = resource->menu.textColor.pixel; XChangeGC(dpy, menuFrameGC,GCFont|GCForeground, &gcv); mbmenu->Reconfigure(); } if (!reconfigure) { XClearWindow(dpy, framewin); XMapWindow(dpy, framewin); XMapSubwindows(dpy, framewin); } } void ToolWindow::CheckTime(bool redraw) { time_t tmp; time_t ctmp; int i; if ((tmp = time(NULL)) != -1) { for (i=0;inumber_of_times;i++) mbmenu->UpdateTime(tmp+resource->timefriend[i].offset,i); ctmp=tmp + resource->timefriend[selected_friend].offset; if (! (tt = localtime(&ctmp))) return; if (tt->tm_min != minute || tt->tm_hour != hour || redraw) { hour = tt->tm_hour; minute = tt->tm_min; XClearWindow(dpy, labelwin); Redraw(); } } } void ToolWindow::Redraw() { #ifdef HAVE_STRFTIME char t[1024]; if (! strftime(t, 1024,resource->report.strftimeFormat, tt)) return; #else // !HAVE_STRFTIME char t[9]; if (date) { // format the date... with special consideration for y2k ;) if (resource->report.euStyle) sprintf(t, "%02d.%02d.%02d", tt->tm_mday, tt->tm_mon + 1, (tt->tm_year >= 100) ? tt->tm_year - 100 : tt->tm_year); else sprintf(t, "%02d/%02d/%02d", tt->tm_mon + 1, tt->tm_mday, (tt->tm_year >= 100) ? tt->tm_year - 100 : tt->tm_year); } else { if (resource->report.clock24Hour) sprintf(t, " %02d:%02d ", hour, minute); else sprintf(t, "%02d:%02d %cm", ((hour > 12) ? hour - 12 : ((hour == 0) ? 12 : hour)), minute, ((hour >= 12) ? 'p' : 'a')); } #endif // HAVE_STRFTIME int len = strlen(t); unsigned int slen = XTextWidth(resource->label.font, t, len); XDrawString(dpy, labelwin, frameGC, (label.width - slen) / 2, (label.height + resource->label.font->ascent - resource->label.font->descent) / 2,t, len); if (mbmenu->Visible() && mbmenu->WaitForUpdate()) mbmenu->Update(); } void ToolWindow::EventLoop(void) { int xfd = ConnectionNumber(dpy); time_t lastTime = time(NULL); bool shutdown=False; lastTime = ((lastTime / 60) * 60); while (! shutdown) { if (XPending(dpy)) { XEvent Event; XNextEvent(dpy, &Event); /* process events */ switch (Event.type) { case Expose: { if (Event.xexpose.window==menuwin) mbmenu->exposeEvent(&Event.xexpose); Redraw(); } break; case ButtonPress: { if (Event.xbutton.window == menuwin) { mbmenu->buttonPressEvent(&Event.xbutton); } else if (Event.xbutton.button == LEFT_BUTTON) { if (Event.xbutton.window == framewin) { if (!(raised)) { XRaiseWindow(dpy,framewin); raised=True; } } if (Event.xbutton.window == labelwin) { if (mbmenu->Visible()) mbmenu->Hide(); else { if (mbmenu->WaitForUpdate()) mbmenu->Update(); mbmenu->Move(frame.x,frame.y,withdrawn); mbmenu->Show(); } } } else if (Event.xbutton.button == MIDDLE_BUTTON) { if (raised) { XLowerWindow(dpy,framewin); raised=False; } } } break; case ButtonRelease: { if (Event.xbutton.window == menuwin) { mbmenu->buttonReleaseEvent(&Event.xbutton); } } break; case MotionNotify: { if (Event.xmotion.window==menuwin) mbmenu->motionNotifyEvent(&Event.xmotion); } break; case EnterNotify: { if (Event.xcrossing.window==menuwin) mbmenu->enterNotifyEvent(&Event.xcrossing); } break; case LeaveNotify: { if (Event.xcrossing.window==menuwin) mbmenu->leaveNotifyEvent(&Event.xcrossing); } case ConfigureNotify: { if (Event.xconfigure.window==framewin && Event.xconfigure.send_event) { Reconfigure(); int parent_x,parent_y; Window parent_root; unsigned int parent_width; unsigned int parent_height; unsigned int parent_border_width; unsigned int parent_depth; XGetGeometry(dpy,Event.xconfigure.above,&parent_root, &parent_x,&parent_y,&parent_width,&parent_height, &parent_border_width,&parent_depth); frame.x=Event.xconfigure.x+parent_x; frame.y=Event.xconfigure.y+parent_y; } } } if (time(NULL) - lastTime > 59) { CheckTime(False); lastTime = time(NULL); } } else { if (time(NULL) - lastTime < 60) { fd_set rfds; FD_ZERO(&rfds); FD_SET(xfd, &rfds); struct timeval tv; tv.tv_sec = 60 - (time(NULL) - lastTime); tv.tv_usec = 0; select(xfd + 1, &rfds, 0, 0, &tv); } else { CheckTime(False); lastTime = time(NULL); } } } } int main(int argc,char **argv) { ToolWindow *AppWindow = new ToolWindow (argc,argv) ; AppWindow->EventLoop(); delete AppWindow; } bbtime-0.1.5/Image.cc0000644000175000001440000007325207553061754010012 // Image.cc adapted for use in bbtools 03-1999 by John Kennis // // // Original notice: // // Image.cc for Blackbox - an X11 Window manager // Copyright (c) 1997 - 1999 by Brad Hughes, bhughes@tcac.net // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #ifdef HAVE_CONFIG_H # include "../config.h" #endif #include "Basewindow.hh" #include "Image.hh" #ifdef HAVE_STDIO_H # include #endif #ifdef HAVE_MALLOC_H # include #else # ifdef STDC_HEADERS # include # endif #endif 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]; cpc = control->getColorsPerChannel(); cpccpc = cpc * cpc; control->getMaskTables(&tr, &tg, &tb, &roff, &goff, &boff); if (control->getVisual()->c_class != TrueColor) control->getColorTable(&colors, &ncolors); } BImage::~BImage(void) { if (red) delete [] red; if (green) delete [] green; if (blue) delete [] blue; } Pixmap BImage::render(const BTexture *texture) { if (texture->texture & BImage_Solid) { return render_solid(texture); } else if (texture->texture & BImage_Gradient) return render_gradient(texture); return None; } Pixmap BImage::render_solid(const BTexture *texture) { Pixmap pixmap = XCreatePixmap(control->getDisplay(), control->getDrawable(), width, height, control->getDepth()); if (pixmap == None) { fprintf(stderr, "BImage::render_solid: error creating pixmap\n"); return None; } XGCValues gcv; GC gc, hgc, lgc; gcv.foreground = texture->color.pixel; gcv.fill_style = FillSolid; gc = XCreateGC(control->getDisplay(), pixmap, GCForeground | GCFillStyle, &gcv); gcv.foreground = texture->hiColor.pixel; hgc = XCreateGC(control->getDisplay(), pixmap, GCForeground, &gcv); gcv.foreground = texture->loColor.pixel; lgc = XCreateGC(control->getDisplay(), pixmap, GCForeground, &gcv); XFillRectangle(control->getDisplay(), pixmap, gc, 0, 0, width, height); if (texture->texture & BImage_Bevel1) { if (texture->texture & BImage_Raised) { XDrawLine(control->getDisplay(), pixmap, lgc, 0, height - 1, width - 1, height - 1); XDrawLine(control->getDisplay(), pixmap, lgc, width - 1, height - 1, width - 1, 0); XDrawLine(control->getDisplay(), pixmap, hgc, 0, 0, width - 1, 0); XDrawLine(control->getDisplay(), pixmap, hgc, 0, height - 1, 0, 0); } else if (texture->texture & BImage_Sunken) { XDrawLine(control->getDisplay(), pixmap, hgc, 0, height - 1, width - 1, height - 1); XDrawLine(control->getDisplay(), pixmap, hgc, width - 1, height - 1, width - 1, 0); XDrawLine(control->getDisplay(), pixmap, lgc, 0, 0, width - 1, 0); XDrawLine(control->getDisplay(), pixmap, lgc, 0, height - 1, 0, 0); } } else if (texture->texture & BImage_Bevel2) { if (texture->texture & BImage_Raised) { XDrawLine(control->getDisplay(), pixmap, lgc, 1, height - 3, width - 3, height - 3); XDrawLine(control->getDisplay(), pixmap, lgc, width - 3, height - 3, width - 3, 1); XDrawLine(control->getDisplay(), pixmap, hgc, 1, 1, width - 3, 1); XDrawLine(control->getDisplay(), pixmap, hgc, 1, height - 3, 1, 1); } else if (texture->texture & BImage_Sunken) { XDrawLine(control->getDisplay(), pixmap, hgc, 1, height - 3, width - 3, height - 3); XDrawLine(control->getDisplay(), pixmap, hgc, width - 3, height - 3, width - 3, 1); XDrawLine(control->getDisplay(), pixmap, lgc, 1, 1, width - 3, 1); XDrawLine(control->getDisplay(), pixmap, lgc, 1, height - 3, 1, 1); } } XFreeGC(control->getDisplay(), gc); XFreeGC(control->getDisplay(), hgc); XFreeGC(control->getDisplay(), lgc); return pixmap; } Pixmap BImage::render_gradient(const BTexture *texture) { int inverted = 0; if (texture->texture & BImage_Sunken) { from = texture->colorTo; to = texture->color; if (! (texture->texture & BImage_Invert)) inverted = 1; } else { from = texture->color; to = texture->colorTo; if (texture>texture & BImage_Invert) inverted = 1; } if (texture->texture & BImage_Diagonal) dgradient(); else if (texture->texture & BImage_Horizontal) hgradient(); else if (texture->texture & BImage_Vertical) vgradient(); if (texture->texture & BImage_Bevel1) bevel1(); else if (texture->texture & BImage_Bevel2) bevel2(); if (inverted) invert(); return renderPixmap(); } XImage *BImage::renderXImage(void) { XImage *image = XCreateImage(control->getDisplay(), control->getVisual(), control->getDepth(), ZPixmap, 0, 0, width, height, 32, 0); if (! image) { fprintf(stderr, "BImage::renderXImage: error creating XImage\n"); return 0; } unsigned char *d = (unsigned char *) malloc(image->bytes_per_line * height); if (! d) { fprintf(stderr, "BImage::renderXImage: error allocating memory for image\n"); XDestroyImage(image); return 0; } register unsigned int x, y, r = 0, g = 0, b = 0, i, off; unsigned char *idata = d, *pd = d, *pr, *pg, *pb; unsigned long pixel; if ((! tr) || (! tg) || (! tb)) { fprintf(stderr, "BImage::renderXImage: error getting color mask tables\n"); XDestroyImage(image); return 0; } if (control->getVisual()->c_class != TrueColor) if ((! colors) || (! ncolors)) { fprintf(stderr, "BImage::renderXImage: error getting pseudo color tables\n"); XDestroyImage(image); return 0; } if (control->doDither()) { short er, eg, eb, *gor, *og, *ob, *gnor, *nog, *nob, *por, *pog, *pob; unsigned short *ort, *ogt, *obt; control->getDitherBuffers(width + 2, &gor, &og, &ob, &gnor, &nog, &nob, &ort, &ogt, &obt); if ((! gor) || (! og) || (! ob) || (! gnor) || (! nog) || (! nob) || (! ort) || (! ogt) || (! obt)) { fprintf(stderr, "BImage::renderXImage: error getting dither information\n"); XDestroyImage(image); return 0; } x = width; por = gor; pog = og; pob = ob; pr = red; pg = green; pb = blue; while (x--) { *(por++) = *(pr++); *(pog++) = *(pg++); *(pob++) = *(pb++); } *por = *pog = *pob = 0; for (y = 0, off = 0; y < height; y++) { if (y < (height - 1)) { for (x = 0, i = off + width; x < width; x++, i++) { *(gnor + x) = *(red + i); *(nog + x) = *(green + i); *(nob + x) = *(blue + i); } i--; *(gnor + x) = *(red + i); *(nog + x) = *(green + i); *(nob + x) = *(blue + i); } for (x = 0; x < width; x++) { if (*(gor + x) > 255) *(gor + x) = 255; else if (*(gor + x) < 0) *(gor + x) = 0; if (*(og + x) > 255) *(og + x) = 255; else if (*(og + x) < 0) *(og + x) = 0; if (*(ob + x) > 255) *(ob + x) = 255; else if (*(ob + x) < 0) *(ob + x) = 0; r = *(tr + *(gor + x)); g = *(tg + *(og + x)); b = *(tb + *(ob + x)); switch (control->getVisual()->c_class) { case StaticColor: case PseudoColor: pixel = (r * cpccpc) + (g * cpc) + b; *idata++ = colors[pixel].pixel; break; case TrueColor: pixel = (r << roff) | (g << goff) | (b << boff); switch (image->byte_order) { case MSBFirst: { switch (image->bits_per_pixel) { case 32: *(idata++) = (pixel >> 24); case 24: *(idata++) = (pixel >> 16); case 16: *(idata++) = (pixel >> 8); default: *(idata++) = (pixel); } break; } case LSBFirst: { *(idata++) = pixel; switch (image->bits_per_pixel) { case 32: *(idata++) = (pixel >> 8); *(idata++) = (pixel >> 16); *(idata++) = (pixel >> 24); break; case 24: *(idata++) = (pixel >> 8); *(idata++) = (pixel >> 16); break; case 16: *(idata++) = (pixel >> 8); break; } break; } } break; default: fprintf(stderr, "BImage::renderXImage: unsupported visual\n"); image->data = (char *) d; XDestroyImage(image); return 0; } er = *(gor + x) - *(ort + *(gor + x)); eg = *(og + x) - *(ogt + *(og + x)); eb = *(ob + x) - *(obt + *(ob + x)); *(gor + x + 1) += er; *(og + x + 1) += eg; *(ob + x + 1) += eb; *(gnor + x) += er; *(nog + x) += eg; *(nob + x) += eb; *(gnor + x + 1) -= (er >> 1) + (er >> 2); *(nog + x + 1) -= (eg >> 1) + (eg >> 2); *(nob + x + 1) -= (eb >> 1) + (eb >> 2); } off += image->width; idata = (pd += image->bytes_per_line); por = gor; gor = gnor; gnor = por; pog = og; og = nog; nog = pog; pob = ob; ob = nob; nob = pob; } } else { for (y = 0, off = 0; y < height; y++) { for (x = 0; x < width; x++, off++) { r = *(tr + *(red + off)); g = *(tg + *(green + off)); b = *(tb + *(blue + off)); switch (control->getVisual()->c_class) { case StaticColor: case PseudoColor: pixel = (r * cpccpc) + (g * cpc) + b; *idata++ = colors[pixel].pixel; break; case TrueColor: pixel = (r << roff) | (g << goff) | (b << boff); switch (image->byte_order) { case MSBFirst: { switch (image->bits_per_pixel) { case 32: *(idata++) = (pixel >> 24); case 24: *(idata++) = (pixel >> 16); case 16: *(idata++) = (pixel >> 8); default: *(idata++) = (pixel); } break; } case LSBFirst: { *(idata++) = pixel; switch (image->bits_per_pixel) { case 32: *(idata++) = (pixel >> 8); *(idata++) = (pixel >> 16); *(idata++) = (pixel >> 24); break; case 24: *(idata++) = (pixel >> 8); *(idata++) = (pixel >> 16); break; case 16: *(idata++) = (pixel >> 8); break; } break; } } break; default: fprintf(stderr, "BImage::renderXImage: unsupported visual\n"); image->data = (char *) d; XDestroyImage(image); return 0; } } idata = (pd += image->bytes_per_line); } } image->data = (char *) d; return image; } Pixmap BImage::renderPixmap(void) { Pixmap pixmap = XCreatePixmap(control->getDisplay(), control->getDrawable(), width, height, control->getDepth()); if (pixmap == None) { fprintf(stderr, "BImage::renderPixmap: error creating pixmap\n"); return None; } XImage *image = renderXImage(); if (! image) { XFreePixmap(control->getDisplay(), pixmap); return None; } XPutImage(control->getDisplay(), pixmap, DefaultGC(control->getDisplay(), control->getScreenNumber()), image, 0, 0, 0, 0, width, height); 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) { float fr = (float) from.red, fg = (float) from.green, fb = (float) from.blue, tr = (float) to.red, tg = (float) to.green, tb = (float) to.blue, w = (float) (width * 2), h = (float) (height * 2), yr = 0.0, yg = 0.0, yb = 0.0, xr, xg, xb, drx, dgx, dbx, dry, dgy, dby; unsigned char *pr = red, *pg = green, *pb = blue; register unsigned int x, y; drx = dry = (tr - fr); dgx = dgy = (tg - fg); dbx = dby = (tb - fb); drx /= w; dgx /= w; dbx /= w; dry /= h; dgy /= h; dby /= h; for (y = 0; y < height; y++) { xr = fr + yr; xg = fg + yg; xb = fb + yb; for (x = 0; x < width; x++) { *(pr++) = (unsigned char) (xr); *(pg++) = (unsigned char) (xg); *(pb++) = (unsigned char) (xb); xr += drx; xg += dgx; xb += dbx; } yr += dry; yg += dgy; yb += dby; } } void BImage::hgradient(void) { float fr, fg, fb, tr, tg, tb, drx, dgx, dbx, xr, xg, xb, w = (float) width; unsigned char *pr, *pg, *pb, *rr, *gg, *bb; register unsigned int x, y; xr = fr = (float) from.red; xg = fg = (float) from.green; xb = fb = (float) from.blue; tr = (float) to.red; tg = (float) to.green; tb = (float) to.blue; drx = (tr - fr) / w; dgx = (tg - fg) / w; dbx = (tb - fb) / w; pr = red; pg = green; pb = blue; // this renders one line of the 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; } // and this copies to the rest of the image for (y = 1; y < height; y++) { rr = red; gg = green; bb = blue; for (x = 0; x < width; x++) { *(pr++) = *(rr++); *(pg++) = *(gg++); *(pb++) = *(bb++); } } } void BImage::vgradient(void) { float fr, fg, fb, tr, tg, tb, dry, dgy, dby, yr, yg, yb, h = (float) height; unsigned char *pr = red, *pg = green, *pb = blue; register unsigned char r, g, b; register unsigned int x, y; yr = fr = (float) from.red; yg = fg = (float) from.green; yb = fb = (float) from.blue; tr = (float) to.red; tg = (float) to.green; tb = (float) to.blue; dry = (tr - fr) / h; dgy = (tg - fg) / h; dby = (tb - fb) / h; for (y = 0; y < height; y++) { yr += dry; yg += dgy; yb += dby; r = (unsigned char) (yr); g = (unsigned char) (yg); b = (unsigned char) (yb); for (x = 0; x < width; x++) { *(pr++) = r; *(pg++) = g; *(pb++) = b; } } } BImageControl::BImageControl(Basewindow *bb) { blackbox = bb; display = blackbox->getDisplay(); screen_depth = blackbox->getDepth(); window = blackbox->getRootWindow(); screen_number = blackbox->getScreenNumber(); colors = 0; colors_per_channel = ncolors = 0; int count; XPixmapFormatValues *pmv = XListPixmapFormats(display, &count); root_colormap = DefaultColormap(display, screen_number); 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; } } if (bits_per_pixel == 0) bits_per_pixel = screen_depth; if (pmv) XFree(pmv); red_offset = green_offset = blue_offset = 0; switch (blackbox->getVisual()->c_class) { case TrueColor: { int i; // compute tables for red channel unsigned long mask = blackbox->getVisual()->red_mask, emask = mask; while (! (mask & 1)) { red_offset++; mask >>= 1; } for (i = 0; i < 256; i++) { rmask_table[i] = (i * mask + 0x7f) / 0xff; rerr_table[i] = ((rmask_table[i] << 8) / (emask >> red_offset)); } // compute tables for green channel emask = mask = blackbox->getVisual()->green_mask; while (! (mask & 1)) { green_offset++; mask >>= 1; } for (i = 0; i < 256; i++) { gmask_table[i] = (i * mask + 0x7f) / 0xff; gerr_table[i] = ((gmask_table[i] << 8) / (emask >> green_offset)); } // compute tables for blue channel emask = mask = blackbox->getVisual()->blue_mask; while (! (mask & 1)) { blue_offset++; mask >>= 1; } for (i = 0; i < 256; i++) { bmask_table[i] = (i * mask + 0x7f) / 0xff; berr_table[i] = ((bmask_table[i] << 8) / (emask >> blue_offset)); } } break; case PseudoColor: case StaticColor: { colors_per_channel = blackbox->getColorsPerChannel(); 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, "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, "BImageControl::BImageControl: error allocating " "colormap\n"); exit(1); } int i = 0, ii, p, r, g, b; unsigned long mask = colors_per_channel - 1; for (i = 0; i < 256; i++) { rmask_table[i] = gmask_table[i] = bmask_table[i] = (i * mask + 0x7f) / 0xff; rerr_table[i] = gerr_table[i] = berr_table[i] = ((rmask_table[i] << 8) / (mask)); } 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; } blackbox->grab(); for (i = 0; i < ncolors; i++) if (! XAllocColor(display, root_colormap, &colors[i])) { fprintf(stderr, "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; blackbox->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(display, root_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(display, root_colormap, &colors[i])) { colors[i].flags = DoRed|DoGreen|DoBlue; break; } } } } } break; } case GrayScale: case StaticGray: fprintf(stderr, "BImageControl::BImageControl: GrayScale/StaticGray " "visual unsupported\n"); break; default: fprintf(stderr, "BImageControl::BImageControl: unsupported visual %d\n", blackbox->getVisual()->c_class); exit(1); } cache = new LinkedList; dither_buf_width = 0; red_err = green_err = blue_err = next_red_err = next_green_err = next_blue_err = 0; } BImageControl::~BImageControl(void) { if (red_err) delete [] red_err; if (green_err) delete [] green_err; if (blue_err) delete [] blue_err; if (next_red_err) delete [] next_red_err; if (next_green_err) delete [] next_green_err; if (next_blue_err) delete [] next_blue_err; if (colors) { unsigned long *pixels = new unsigned long [ncolors]; int i; for (i = 0; i < ncolors; i++) *(pixels + i) = (*(colors + i)).pixel; XFreeColors(display, DefaultColormap(display, screen_number), pixels, ncolors, 0); delete [] colors; } if (cache->count()) { int i, n = cache->count(); fprintf(stderr, "BImageContol::~BImageControl: pixmap cache - " "releasing %d pixmaps\n", n); for (i = 0; i < n; i++) { Cache *tmp = cache->first(); XFreePixmap(display, tmp->pixmap); cache->remove(tmp); delete tmp; } } delete cache; } Bool BImageControl::doDither(void) { return blackbox->hasImageDither(); } Visual *BImageControl::getVisual(void) { return blackbox->getVisual(); } Pixmap BImageControl::searchCache(unsigned int width, unsigned int height, unsigned long texture, const BColor &c1, const BColor &c2) { if (cache->count()) { LinkedListIterator it(cache); for (; it.current(); it++) { if ((it.current()->width == width) && (it.current()->height == height) && (it.current()->texture == texture) && (it.current()->pixel1 == c1.pixel)) if (texture & BImage_Gradient) { if (it.current()->pixel2 == c2.pixel) { 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, const BTexture *texture) { Pixmap pixmap = searchCache(width, height, texture->texture, texture->color, texture->colorTo); 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->texture; tmp->pixel1 = texture->color.pixel; if (texture->texture & BImage_Gradient) tmp->pixel2 = texture->colorTo.pixel; else tmp->pixel2 = 0l; cache->insert(tmp); return pixmap; } return None; } void BImageControl::removeImage(Pixmap pixmap) { if (pixmap) { LinkedListIterator it(cache); for (; it.current(); it++) { if (it.current()->pixmap == pixmap) { Cache *tmp = it.current(); tmp->count--; if (! tmp->count) { XFreePixmap(display, tmp->pixmap); cache->remove(tmp); delete tmp; } return; } } } } unsigned long BImageControl::getColor(const char *colorname, unsigned char *r, unsigned char *g, unsigned char *b) { XColor color; color.pixel = 0; if (! XParseColor(display, DefaultColormap(display, screen_number), colorname, &color)) { fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", colorname); } else if (! XAllocColor(display, DefaultColormap(display, screen_number), &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(display, DefaultColormap(display, screen_number), colorname, &color)) { fprintf(stderr, "BImageControl::getColor: color parse error: \"%s\"\n", colorname); } else if (! XAllocColor(display, DefaultColormap(display, screen_number), &color)) { fprintf(stderr, "BImageControl::getColor: color alloc error: \"%s\"\n", colorname); } return color.pixel; } void BImageControl::getMaskTables(unsigned short **rmt, unsigned short **gmt, unsigned short **bmt, int *roff, int *goff, int *boff) { if (rmt) *rmt = rmask_table; if (gmt) *gmt = gmask_table; if (bmt) *bmt = bmask_table; if (roff) *roff = red_offset; if (goff) *goff = green_offset; if (boff) *boff = blue_offset; } void BImageControl::getColorTable(XColor **c, int *n) { if (c) *c = colors; if (n) *n = ncolors; } void BImageControl::getDitherBuffers(unsigned int w, short **r, short **g, short **b, short **nr, short **ng, short **nb, unsigned short **ret, unsigned short **get, unsigned short **bet) { if (w > dither_buf_width) { if (red_err) delete [] red_err; if (green_err) delete [] green_err; if (blue_err) delete [] blue_err; if (next_red_err) delete [] next_red_err; if (next_green_err) delete [] next_green_err; if (next_blue_err) delete [] next_blue_err; dither_buf_width = w; red_err = new short[dither_buf_width]; green_err = new short[dither_buf_width]; blue_err = new short[dither_buf_width]; next_red_err = new short[dither_buf_width]; next_green_err = new short[dither_buf_width]; next_blue_err = new short[dither_buf_width]; } *r = red_err; *g = green_err; *b = blue_err; *nr = next_red_err; *ng = next_green_err; *nb = next_blue_err; *ret = rerr_table; *get = gerr_table; *bet = berr_table; } void BImageControl::installRootColormap(void) { blackbox->grab(); Bool install = True; int i = 0, ncmap = 0; Colormap *cmaps = XListInstalledColormaps(display, window, &ncmap); if (cmaps) { for (i = 0; i < ncmap; i++) if (*(cmaps + i) == root_colormap) install = False; if (install) XInstallColormap(display, root_colormap); XFree(cmaps); } blackbox->ungrab(); } bbtime-0.1.5/LinkedList.cc0000644000175000001440000001303706713403025011011 /// LinkedList.cc apdated for use in bbtools 23-10-1998 by John Kennis // // // Original notice: // // LinkedList.cc for Blackbox - an X11 Window manager // Copyright (c) 1997, 1998 by Brad Hughes, bhughes@tcac.net // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #include "LinkedList.hh" // ************************************************************************* // Linked List iterator class code // ************************************************************************* __llist_iterator::__llist_iterator(__llist *l) { list = l; reset(); } __llist_iterator::~__llist_iterator(void) { } void *__llist_iterator::current(void) { return ((node) ? node->data : 0); } void __llist_iterator::reset(void) { if (list) node = list->_first; } void __llist_iterator::resetLast(void) { if (list) node = list->_last; } const int __llist_iterator::set(const int index) { if (list) { if (index < list->elements && index >= 0) { node = list->_first; int i; for (i = 0; i < index; i++) node = node->next; return 1; } } node = (__llist_node *) 0; return 0; } void __llist_iterator::operator++(int) { node = ((node) ? node->next : 0); } void __llist_iterator::operator--(int) { node = ((node) ? node->prev : 0); } // ************************************************************************* // Linked List class code // ************************************************************************* __llist::__llist(void *d) { if (! d) { _first = (__llist_node *) 0; _last = (__llist_node *) 0; elements = 0; } else { _first = new __llist_node; _first->data = d; _first->next = (__llist_node *) 0; _first->prev = (__llist_node *) 0; _last = _first; elements = 1; } } __llist::~__llist(void) { int i, r = elements; for (i = 0; i < r; i++) remove(0); } const int __llist::insert(void *d, int index) { if (! _first) { _first = new __llist_node; _first->data = d; _first->next = (__llist_node *) 0; _first->prev = (__llist_node *) 0; _last = _first; } else { // if index is -1... append the data to the end of the list if (index == -1) { __llist_node *nnode = new __llist_node; nnode->data = d; nnode->next = (__llist_node *) 0; nnode->prev = _last; _last->next = nnode; _last = nnode; } else { __llist_node *nnode = new __llist_node, *inode = _first; // otherwise... insert the item at the position specified by index if (index > elements) return -1; int i; for (i = 0; i < index; i++) inode = inode->next; if ((! inode) || inode == _last) { nnode->data = d; nnode->next = (__llist_node *) 0; nnode->prev = _last; _last->next = nnode; _last = nnode; } else { nnode->data = d; nnode->next = inode->next; nnode->prev = inode; inode->next->prev = nnode; inode->next = nnode; } } } return ++elements; } const int __llist::remove(void *d) { // remove list item whose data pointer address matches the pointer address // given __llist_node *rnode = _first; int i; for (i = 0; i < elements; i++) { if (rnode->data == d) { if (rnode->prev) { rnode->prev->next = rnode->next; if (rnode->next) rnode->next->prev = rnode->prev; } else { // we removed the _first item in the list... reflect that removal in // the list internals _first = rnode->next; if (_first) _first->prev = (__llist_node *) 0; } if (rnode == _last) { _last = rnode->prev; if (_last) _last->next = (__llist_node *) 0; } --elements; delete rnode; break; } if (rnode) rnode = rnode->next; else return -1; } return i; } void *__llist::remove(const int index) { if (index < elements && index >= 0) { // remove list item at specified index within the list __llist_node *rnode = _first; void *data_return = 0; int i; for (i = 0; i < index; i++) rnode = rnode->next; if (rnode->prev) { rnode->prev->next = rnode->next; if (rnode->next) rnode->next->prev = rnode->prev; } else { // we removed the _first item in the list... reflect that removal in the // list internals _first = rnode->next; if (_first) _first->prev = (__llist_node *) 0; } if (rnode == _last) { _last = rnode->prev; if (_last) _last->next = (__llist_node *) 0; } --elements; data_return = rnode->data; delete rnode; return data_return; } return (void *) 0; } void *__llist::find(const int index) { if (index < elements && index >= 0) { __llist_node *fnode = _first; int i; for (i = 0; i < index; i++) fnode = fnode->next; return fnode->data; } return (void *) 0; } bbtime-0.1.5/bbtime.hh0000644000175000001440000000444506755576064010252 // bbdate.hh for bbdate - an tool for display the date in X11. // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __MAIN_HH #define __MAIN_HH #include "Image.hh" #include "Basewindow.hh" #include "resource.hh" #include "timemenu.hh" #define LEFT_BUTTON 1 #define MIDDLE_BUTTON 2 #define RIGHT_BUTTON 3 class Resource; class BaseResource; class Basewindow; class Timemenu; class Basemenu; struct PIXMAP { Pixmap frame; Pixmap label; }; struct GEOM { int height; int width; int x; int y; }; class ToolWindow :public Basewindow { public: ToolWindow(int argc,char **argv); ~ToolWindow(void); XGCValues gcv; GC frameGC; Window framewin; Window labelwin; Resource *resource; void MakeWindow(bool); void CheckTime(bool); void EventLoop(void); void Reconfigure(void); void Redraw(void); struct GEOM Frame (void) { return frame; } /* setup menu */ const int Justification(void) const {return B_LeftJustify; } int MenuJustification(void); XFontStruct *titleFont(void); XFontStruct *menuFont(void); unsigned int bevelWidth(void); GC MenuTitleGC(void) {return NULL;/*menuTitleGC;*/} GC MenuHiBGGC(void) {return menuHiBGGC;} GC MenuHiGC(void) {return menuHiGC; } GC MenuFrameGC(void) {return menuFrameGC;} void saveMenuSearch(Window,Basemenu *); void removeMenuSearch(Window window); Resource *getResource(void); void setFriendSelect(int nr) { selected_friend=nr; } private: bool raised; bool date; int selected_friend; int hour,minute; struct tm *tt; Timemenu *mbmenu; PIXMAP pixmap; GEOM frame; GEOM label; }; #endif /* __MAIN_HH */ bbtime-0.1.5/Image.hh0000644000175000001440000001050106713403025007774 // Image.hh adapted for use in bbtools 03-1999 by John Kennis // // // Original notice: // // Image.hh for Blackbox - an X11 Window manager // Copyright (c) 1997 - 1999 by Brad Hughes, bhughes@tcac.net // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __Image_hh #define __Image_hh #include #include // forward declarations class Basewindow; class BImage; class BImageControl; typedef struct BColor { int allocated; unsigned char red, green, blue; unsigned long pixel; }; typedef struct BTexture { BColor color, colorTo, hiColor, loColor; unsigned long texture; }; #include "LinkedList.hh" // bevel options #define BImage_Flat (1<<1) #define BImage_Sunken (1<<2) #define BImage_Raised (1<<3) // textures #define BImage_Solid (1<<4) #define BImage_Gradient (1<<5) // gradients #define BImage_Horizontal (1<<6) #define BImage_Vertical (1<<7) #define BImage_Diagonal (1<<8) // bevel types #define BImage_Bevel1 (1<<9) #define BImage_Bevel2 (1<<10) // inverted image #define BImage_Invert (1<<11) class BImage { private: BImageControl *control; XColor *colors; BColor from, to; int roff, goff, boff, ncolors, cpc, cpccpc; unsigned char *red, *green, *blue; unsigned int width, height; unsigned short *tr, *tg, *tb; protected: Pixmap renderPixmap(void); XImage *renderXImage(void); void invert(void); void bevel1(void); void bevel2(void); void dgradient(void); void hgradient(void); void vgradient(void); public: BImage(BImageControl *, unsigned int, unsigned int); ~BImage(void); Pixmap render(const BTexture * /* texture */); Pixmap render_solid(const BTexture * /* texture */); Pixmap render_gradient(const BTexture * /* texture */); }; class BImageControl { private: Basewindow *blackbox; Colormap root_colormap; Display *display; Window window; XColor *colors; int colors_per_channel, ncolors, screen_number, screen_depth, bits_per_pixel, red_offset, green_offset, blue_offset; unsigned short rmask_table[256], gmask_table[256], bmask_table[256], rerr_table[256], gerr_table[256], berr_table[256]; unsigned int dither_buf_width; short *red_err, *green_err, *blue_err, *next_red_err, *next_green_err, *next_blue_err; typedef struct Cache { Pixmap pixmap; unsigned int count, width, height; unsigned long pixel1, pixel2, texture; } Cache; LinkedList *cache; protected: Pixmap searchCache(unsigned int, unsigned int, unsigned long, const BColor &, const BColor &); public: BImageControl(Basewindow *); ~BImageControl(void); Bool doDither(void); int getScreenNumber(void) { return screen_number; } Colormap getColormap(void) { return root_colormap; } Display *getDisplay(void) { return display; } Pixmap renderImage(unsigned int, unsigned int, const BTexture *); Visual *getVisual(void); Window getDrawable(void) { return window; } int getBitsPerPixel(void) { return bits_per_pixel; } int getDepth(void) { return screen_depth; } int getColorsPerChannel(void) { return colors_per_channel; } unsigned long getColor(const char *); unsigned long getColor(const char *, unsigned char *, unsigned char *, unsigned char *); void installRootColormap(void); void removeImage(Pixmap); void getDitherBuffers(unsigned int, short **, short **, short **, short **, short **, short **, unsigned short **, unsigned short **, unsigned short **); void getMaskTables(unsigned short **, unsigned short **, unsigned short **, int *, int *, int *); void getColorTable(XColor **, int *); }; #endif // __Image_hh bbtime-0.1.5/LinkedList.hh0000644000175000001440000000610107553061627011030 /// LinkedList.hh apdated for use in bbtools 23-10-1998 by John Kennis // // // Original notice: // // // LinkedList.hh for Blackbox - an X11 Window manager // Copyright (c) 1997, 1998 by Brad Hughes, bhughes@tcac.net // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __LinkedList_hh #define __LinkedList_hh typedef struct __llist_node { __llist_node *prev, *next; void *data; } __llist_node; // forward declaration class __llist; class __llist_iterator { private: __llist *list; __llist_node *node; protected: __llist_iterator(__llist *); ~__llist_iterator(void); void *current(void); void reset(void); void resetLast(void); const int set(const int); void operator++(int); void operator--(int); }; class __llist { private: int elements; __llist_node *_first, *_last; friend class __llist_iterator; protected: __llist(void * = 0); ~__llist(void); const int count(void) const { return elements; } const int empty(void) const { return (elements == 0); } void *find(const int); const int insert(void *, int = -1); const int remove(void *); void *remove(const int); void *first(void) { return _first->data; } void *last(void) { return _last->data; } }; template class LinkedListIterator : public __llist_iterator { public: LinkedListIterator(__llist *d = 0) : __llist_iterator(d) { } ~LinkedListIterator(void) { } Z *current(void) { return (Z *) __llist_iterator::current(); } void reset(void) { __llist_iterator::reset(); } void resetLast(void) { __llist_iterator::resetLast(); } const int set(const int i) { return __llist_iterator::set(i); } void operator++(int a) { __llist_iterator::operator++(a); } void operator--(int a) { __llist_iterator::operator--(a); } }; template class LinkedList : public __llist { public: LinkedList(Z *d = 0) : __llist(d) { } ~LinkedList(void) { } const int count(void) const { return __llist::count(); } const int empty(void) const { return __llist::empty(); } Z *find(const int i) { return (Z *) __llist::find(i); } const int insert(Z *d, int i = -1) { return __llist::insert((void *) d, i); } const int remove(Z *d) { return __llist::remove((void *) d); } Z *remove(const int i) { return (Z *) __llist::remove(i); } Z *first(void) { return (Z *) __llist::first(); } Z *last(void) { return (Z *) __llist::last(); } }; #endif // __LinkedList_hh bbtime-0.1.5/resource.cc0000644000175000001440000003636606772502637010626 // resource.cc for bbtime - an tool to display the time in X11. // // Copyright (c) 1998-1999 John Kennis, jkennis@chello.nl // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "resource.hh" #include "blackboxstyle.hh" Resource::Resource(ToolWindow *toolwindow): BaseResource(toolwindow) { report.strftimeFormat=NULL; frame.font=label.font=menu.font=0; frame.texture.color.allocated= frame.texture.colorTo.allocated= frame.texture.hiColor.allocated= frame.texture.loColor.allocated= label.texture.color.allocated= label.texture.colorTo.allocated= label.texture.hiColor.allocated= label.texture.loColor.allocated= menu.texture.color.allocated= menu.texture.colorTo.allocated= menu.texture.hiColor.allocated= menu.texture.loColor.allocated= label.textColor.allocated= menu.textColor.allocated= menu.highlightColor.allocated= menu.hitextColor.allocated= 0; Load(); } Resource::~Resource() { frame.font=0; label.font=0; menu.font=0; Clean(); } void Resource::Clean() { if (label.font) XFreeFont(bbtool->dpy, label.font); if (frame.font) XFreeFont(bbtool->dpy, frame.font); if (menu.font) XFreeFont(bbtool->dpy, menu.font); frame.font=label.font=menu.font=0; } void Resource::LoadBBToolResource(void) { XrmValue value; char *value_type; if (XrmGetResource(resource_db, "bbtime.autoConfig", "Bbtime.Autoconfig", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) { style.auto_config = True; } else style.auto_config = False; } else style.auto_config = False; SizeAndPosition(); Frame(); Show(); Menu(); Label(); TimeInfo(); } void Resource::Menu() { XrmValue value; char *value_type; readDatabaseTexture("bbtime.menu","Bbtime.Menu",BB_MENU,"Menu.Frame", "slategrey","darkslategrey", BImage_Raised|BImage_Diagonal|BImage_Gradient| BImage_Bevel1,&menu.texture); readDatabaseColor("bbtime.menu.highlight.color", "Bbtime.Menu.Highlight.Color", BB_MENU_HIGHLIGHT_COLOR,"Menu.highlightColor", "rgb:c/9/6",&menu.highlightColor); readDatabaseColor("bbtime.menu.textColor","Bbtime.Menu.TextColor", BB_MENU_TEXTCOLOR,"Menu.Frame.TextColor", "LightGrey",&menu.textColor); readDatabaseColor("bbtime.menu.highlight.textColor", "Bbtime.Menu.Highlight.TextColor", BB_MENU_HITEXTCOLOR,"Menu.Frame.HiTextColor", "white",&menu.hitextColor); if (XrmGetResource(resource_db,"bbtime.menuJustify","Bbtime.MenuJustify", &value_type, &value)) { if (! strncasecmp("leftjustify", value.addr, value.size)) menu.justify = ToolWindow::B_LeftJustify; else if (! strncasecmp("rightjustify", value.addr, value.size)) menu.justify = ToolWindow::B_RightJustify; else if (! strncasecmp("centerjustify", value.addr, value.size)) menu.justify = ToolWindow::B_CenterJustify; else menu.justify = ToolWindow::B_LeftJustify; } else if (XrmGetResource(resource_db,BB_MENU_JUSTIFY,"Bbtime.MenuJustify", &value_type, &value)) { if (! strncasecmp("leftjustify", value.addr, value.size)) menu.justify = ToolWindow::B_LeftJustify; else if (! strncasecmp("rightjustify", value.addr, value.size)) menu.justify = ToolWindow::B_RightJustify; else if (! strncasecmp("centerjustify", value.addr, value.size)) menu.justify = ToolWindow::B_CenterJustify; else menu.justify = ToolWindow::B_LeftJustify; } else menu.justify = ToolWindow::B_LeftJustify; const char *defaultFont = "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*"; if (menu.font) { XFreeFont(bbtool->dpy, menu.font); menu.font = 0; } if (XrmGetResource(resource_db, "bbtime.menu.font", "Bbtime.Menu.Font", &value_type, &value)) { if ((menu.font = XLoadQueryFont(bbtool->dpy, value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((menu.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else if (XrmGetResource(resource_db, BB_MENU_FONT, "MenuFont", &value_type, &value)) { if ((menu.font = XLoadQueryFont(bbtool->dpy, value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((menu.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else { if ((menu.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr,"blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } void Resource::Frame() { XrmValue value; char *value_type; readDatabaseTexture("bbtime.frame","Bbtime.Frame",BB_FRAME,"Toolbar", "slategrey","darkslategrey", BImage_Raised|BImage_Gradient|BImage_Vertical| BImage_Bevel1,&frame.texture); if (XrmGetResource(resource_db, "bbtime.bevelWidth","Bbtime.BevelWidth", &value_type, &value)) { if (sscanf(value.addr, "%u", &frame.bevelWidth) != 1) frame.bevelWidth = 4; else if (frame.bevelWidth == 0) frame.bevelWidth = 4; } else if (XrmGetResource(resource_db, BB_BEVELWIDTH,"BevelWidth", &value_type, &value)) { if (sscanf(value.addr, "%u", &frame.bevelWidth) != 1) frame.bevelWidth = 4; else if (frame.bevelWidth == 0) frame.bevelWidth = 4; } else frame.bevelWidth = 4; } void Resource::SizeAndPosition() { XrmValue value; char *value_type; unsigned int w,h; char positionstring[11]; if (!(bbtool->withdrawn)) { if (XrmGetResource(resource_db, "bbtime.withdrawn", "Bbtime.Withdrawn", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->withdrawn = True; else bbtool->withdrawn = False; } else bbtool->withdrawn = False; } if (!(bbtool->shape)) { if (XrmGetResource(resource_db, "bbtime.shape", "Bbtime.Shape", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->shape = True; else bbtool->shape = False; } else bbtool->shape = bbtool->withdrawn; } if (!(bbtool->position)) { if (!(XrmGetResource(resource_db, "bbtime.position","Bbtime.Position", &value_type, &value))) strncpy(positionstring, "-0-0", 5); else strncpy(positionstring, value.addr, strlen(value.addr)+1); } else strncpy(positionstring, bbtool->position, strlen(bbtool->position)+1); position.mask=XParseGeometry(positionstring, &position.x, &position.y, &w, &h); if (!(position.mask & XValue)) position.x=0; if (!(position.mask & YValue)) position.y=0; /* need this to compute the height */ const char *defaultFont = "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*"; if (frame.font) { XFreeFont(bbtool->dpy, frame.font); frame.font = 0; } if (XrmGetResource(resource_db, "bbtime.heightBy.font","Bbtime.heightBy.Font", &value_type, &value)) { if ((frame.font = XLoadQueryFont(bbtool->dpy, value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((frame.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr,"blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else if (XrmGetResource(resource_db, BB_FONT,"TitleFont", &value_type, &value)) { if ((frame.font = XLoadQueryFont(bbtool->dpy, value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((frame.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else { if ((frame.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } void Resource::Label(void) { XrmValue value; char *value_type; /* text-label resources */ if (XrmGetResource(resource_db, "bbtime.label.transparent", "Bbtime.label.Transparent", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) label.transparent = True; else label.transparent = False; } else label.transparent = False; readDatabaseTexture("bbtime.label", "Bbtime.Label",BB_LABEL,"Toolbar.Label", "slategrey","darkslategrey", BImage_Sunken|BImage_Gradient|BImage_Vertical| BImage_Bevel1,&label.texture); readDatabaseColor("bbtime..textColor", "Bbtime.TextColor", BB_LABEL_TEXTCOLOR, "Toolbar.TextColor", "LightGrey",&label.textColor); const char *defaultFont = "-*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-*"; if (label.font) { XFreeFont(bbtool->dpy, label.font); label.font = 0; } if (XrmGetResource(resource_db, "bbtime.label.font", "Bbtime.Label.Font", &value_type, &value)) { if ((label.font = XLoadQueryFont(bbtool->dpy, value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((label.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else if (XrmGetResource(resource_db, BB_FONT, "TitleFont", &value_type, &value)) { if ((label.font = XLoadQueryFont(bbtool->dpy, value.addr)) == NULL) { fprintf(stderr, " blackbox: couldn't load font '%s'\n" " ... reverting to default font.", value.addr); if ((label.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr, "blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } else { if ((label.font = XLoadQueryFont(bbtool->dpy, defaultFont)) == NULL) { fprintf(stderr,"blackbox: couldn't load default font. please check to\n" "make sure the necessary font is installed '%s'\n", defaultFont); exit(2); } } } void Resource::Show() { XrmValue value; char *value_type; if (XrmGetResource(resource_db, "bbtime.show.euStyle", "Bbtime.show.EuStyle", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) { report.euStyle = True; } else report.euStyle = False; } else report.euStyle = False; if (XrmGetResource(resource_db, "bbtime.show.clock24Hour", "Bbtime.show.Clock24Hour", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) { report.clock24Hour = True; } else report.clock24Hour = False; } else report.clock24Hour = False; if (XrmGetResource(resource_db,"bbtime.strftimeFormat", "Bbtime.strftimeFormat",&value_type, &value)) { delete [] report.strftimeFormat; int len=strlen(value.addr); report.strftimeFormat = new char [len +1]; memset(report.strftimeFormat,0,len+1); strncpy(report.strftimeFormat,value.addr,len); } else { delete [] report.strftimeFormat; int len=strlen("%I:%M %p"); report.strftimeFormat = new char [len +1]; memset(report.strftimeFormat,0,len+1); strncpy(report.strftimeFormat,"%I:%M %p",len); } #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; time_len = strftime(t, 1024, report.strftimeFormat,tt); } } #else // !HAVE_STRFTIME time_len=strlen("00:00000"); #endif // HAVE_STRFTIME } void Resource::getTimeInfo(int nr) { XrmValue value; char *value_type; char rname[24]; char rclass[24]; int hour; int minute; sprintf(rname,"bbtime.friend.%d.name",nr); sprintf(rclass,"Bbtime.Friend.%d.Name",nr); if (XrmGetResource(resource_db,rname,rclass,&value_type, &value)) { int len=strlen(value.addr); timefriend[nr].name = new char [len +2 + time_len]; memset(timefriend[nr].name,0,len+2+time_len); strncpy(timefriend[nr].name,value.addr,len); } else { fprintf(stderr,"Can't read name \n"); exit(1); } sprintf(rname,"bbtime.friend.%d.offset",nr); sprintf(rclass,"Bbtime.Friend.%d.Offset",nr); if (XrmGetResource(resource_db, rname,rclass, &value_type, &value)) { if (sscanf(value.addr, "%i:%i", &hour,&minute) != 2) timefriend[nr].offset=0; else { if (hour<0) timefriend[nr].offset=(hour*60-minute)*60; else timefriend[nr].offset=(hour*60+minute)*60; } } else timefriend[nr].offset=0; } void Resource::TimeInfo() { XrmValue value; char *value_type; int i; if (XrmGetResource(resource_db, "bbtime.numberOf.friends", "Bbtime.NumberOf.Friends", &value_type, &value)) { if (sscanf(value.addr, "%i", &number_of_times) != 1) number_of_times = 0; } else number_of_times=0; number_of_times++; timefriend = new struct TIMEINFO [number_of_times+1]; if (XrmGetResource(resource_db,"bbtime.my.name","Bbtime.My.Name", &value_type, &value)) { int len=strlen(value.addr); timefriend[0].name = new char [len +2 + time_len]; memset(timefriend[0].name,0,len+2+time_len); strncpy(timefriend[0].name,value.addr,len); } else { int len=strlen("/me"); timefriend[0].name = new char [len +2 + time_len]; memset(timefriend[0].name,0,len+2+time_len); strncpy(timefriend[0].name,"/me",len); } timefriend[0].offset=0; for (i=1;idefault_config) { ReadDefaultResource(); ResourceType=DEFAULT; } else { if (bbtool->config_filename == NULL) { char *homedir = getenv("HOME"); bbtool->config_filename = new char[strlen(homedir) + 32]; sprintf(bbtool->config_filename, "%s/.bbtoolsrc", homedir); } if ((resource_db = XrmGetFileDatabase(bbtool->config_filename))!=NULL) { /* .bbtoolsrc */ ReadBBtoolResource(); ResourceType=BBTOOLS; } else { /* !bbtools */ delete [] bbtool->config_filename; char *homedir = getenv("HOME"); bbtool->config_filename = new char[strlen(homedir) + 32]; sprintf(bbtool->config_filename, "%s/.blackboxrc", homedir); if ((resource_db = XrmGetFileDatabase(bbtool->config_filename))==NULL) { /* no blackbox, no bbtools */ ReadDefaultResource(); ResourceType=DEFAULT; } else { /* blackbox */ ReadBlackboxResource(); ResourceType=BLACKBOX; } } } if (bbtool->image_dither && bbtool->v->c_class == TrueColor && bbtool->depth >= 24) bbtool->image_dither = False; /* Need to do this here */ bbtool->setupImageControl(); } void BaseResource::Load() { struct stat file_status; LoadBBToolResource(); if ((bbtool->config_filename!=NULL)&(style.auto_config)) { if (stat(bbtool->config_filename,&file_status)!=0) { fprintf(stderr,"Can't use autoconfig"); style.auto_config=false; style.mtime=0; } else style.mtime=file_status.st_mtime; } XrmDestroyDatabase(resource_db); } BaseResource::~BaseResource() { delete [] style.style_filename; delete [] style.conf_filename; } void BaseResource::CopyColor(BColor Color1,BColor *Color2) { Color2->pixel=Color1.pixel; Color2->red=Color1.red; Color2->green=Color1.green; Color2->blue=Color1.blue; Color2->allocated=False; } void BaseResource::CopyTexture(BTexture Texture1,BTexture *Texture2) { CopyColor(Texture1.color,&Texture2->color); CopyColor(Texture1.colorTo,&Texture2->colorTo); CopyColor(Texture1.hiColor,&Texture2->hiColor); CopyColor(Texture1.loColor,&Texture2->loColor); Texture2->texture=Texture1.texture; } void BaseResource::Reload() { struct stat file_status; if ((resource_db = XrmGetFileDatabase(bbtool->config_filename))!=NULL) { switch (ResourceType) { case BBTOOLS: { ReadBBtoolResource(); } break; case DEFAULT: { ReadDefaultResource(); } break; case BLACKBOX: { ReadBlackboxResource(); } break; } LoadBBToolResource(); if ((bbtool->config_filename!=NULL)&(style.auto_config)) { if (stat(bbtool->config_filename,&file_status)!=0) { fprintf(stderr,"Can't use autoconfig"); style.auto_config=false; style.mtime=0; } else style.mtime=file_status.st_mtime; } XrmDestroyDatabase(resource_db); } else { fprintf(stderr,"Can't read resource filename: %s",bbtool->config_filename); exit(2); } } bool BaseResource::ReadResourceFromFilename(char *rname, char *rclass) { struct stat file_status; char *filename=NULL; XrmValue value; char *value_type; if (XrmGetResource(resource_db,rname,rclass, &value_type, &value)) { int len = strlen(value.addr); delete [] filename; filename = new char[len + 1]; memset(filename, 0, len + 1); strncpy(filename, value.addr, len); if (stat(filename,&file_status)!=0) { db=NULL; delete [] filename; return(False); } db = XrmGetFileDatabase(filename); delete [] filename; return(True); } db=NULL; delete [] filename; return(False); } void BaseResource::ReadBBtoolResource() { XrmValue value; char *value_type; if (!ReadResourceFromFilename("bbtime.styleFile","Bbtime.StyleFile")) { /* use default stylefile */ delete [] style.conf_filename; int len=strlen(DEFAULT_CONF); style.conf_filename = new char[len + 1]; memset(style.conf_filename, 0, len + 1); strncpy(style.conf_filename,DEFAULT_CONF, len); if ((resource_db = XrmGetFileDatabase(style.conf_filename))==NULL) { fprintf(stderr,"Could not open default config file: %s\n", style.conf_filename); fprintf(stderr,"Using internal defaults.\n"); return; } else XrmCombineDatabase(db,&resource_db,False); } else XrmCombineDatabase(db,&resource_db,False); if (XrmGetResource(resource_db, "bbtools.colorsPerChannel", "Bbtools.ColorsPerChannel", &value_type, &value)) { if (sscanf(value.addr, "%d", &bbtool->colors_per_channel) != 1) { bbtool->colors_per_channel = 4; } else { if (bbtool->colors_per_channel < 2) bbtool->colors_per_channel = 2; if (bbtool->colors_per_channel > 6) bbtool->colors_per_channel = 6; } } else bbtool->colors_per_channel = 4; if (XrmGetResource(resource_db, "bbtools.imageDither", "Bbtools.ImageDither", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->image_dither = True; else bbtool->image_dither = False; } else bbtool->image_dither = True; } void BaseResource::ReadDefaultResource() { XrmValue value; char *value_type; delete [] style.conf_filename; int len=strlen(DEFAULT_NOBB); style.conf_filename = new char[len + 1]; memset(style.conf_filename, 0, len + 1); strncpy(style.conf_filename,DEFAULT_NOBB, len); if ((db = XrmGetFileDatabase(style.conf_filename))==NULL) { fprintf(stderr,"Could not open default config file: %s\n", style.conf_filename); fprintf(stderr,"Using internal defaults.\n"); } else { XrmCombineDatabase(db,&resource_db,False); if (!ReadResourceFromFilename("bbtime.styleFile","Bbtime.StyleFile")) { fprintf(stderr,"Could not open default style file bbtime.styleFile: in %s\n", style.conf_filename); fprintf(stderr,"Using internal defaults.\n"); } else XrmCombineDatabase(db,&resource_db,False); if (XrmGetResource(resource_db, "bbtools.colorsPerChannel", "Bbtools.ColorsPerChannel", &value_type, &value)) { if (sscanf(value.addr, "%d", &bbtool->colors_per_channel) != 1) { bbtool->colors_per_channel = 4; } else { if (bbtool->colors_per_channel < 2) bbtool->colors_per_channel = 2; if (bbtool->colors_per_channel > 6) bbtool->colors_per_channel = 6; } } else bbtool->colors_per_channel = 4; if (XrmGetResource(resource_db, "bbtools.imageDither", "Bbtools.ImageDither", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->image_dither = True; else bbtool->image_dither = False; } else bbtool->image_dither = True; } } void BaseResource::ReadBlackboxResource() { XrmValue value; char *value_type; if (!ReadResourceFromFilename("session.styleFile","Session.StyleFile")) { fprintf(stderr,"Could not open blackbox style file\n"); } else XrmCombineDatabase(db,&resource_db,False); if (bbtool->bbconfig_filename!=NULL) { if ((db = XrmGetFileDatabase(bbtool->bbconfig_filename))==NULL) { fprintf(stderr,"Could not open config file: %s\n", bbtool->bbconfig_filename); delete [] style.conf_filename; int len=strlen(DEFAULT_CONF); style.conf_filename = new char[len + 1]; memset(style.conf_filename, 0, len + 1); strncpy(style.conf_filename,DEFAULT_CONF, len); if ((db = XrmGetFileDatabase(style.conf_filename))==NULL) { fprintf(stderr,"Could not open default config file: %s\n", style.conf_filename); } else XrmCombineDatabase(db,&resource_db,True); } else XrmCombineDatabase(db,&resource_db,True); } else if (!ReadResourceFromFilename("bbtime.configFile","Bbtime.ConfigFile")) { delete [] style.conf_filename; int len=strlen(DEFAULT_CONF); style.conf_filename = new char[len + 1]; memset(style.conf_filename, 0, len + 1); strncpy(style.conf_filename,DEFAULT_CONF, len); if ((db = XrmGetFileDatabase(style.conf_filename))==NULL) { fprintf(stderr,"Could not open default config file: %s\n", style.conf_filename); } else XrmCombineDatabase(db,&resource_db,True); } else XrmCombineDatabase(db,&resource_db,True); if (XrmGetResource(resource_db, "session.colorsPerChannel", "Session.ColorsPerChannel", &value_type, &value)) { if (sscanf(value.addr, "%d", &bbtool->colors_per_channel) != 1) { bbtool->colors_per_channel = 4; } else { if (bbtool->colors_per_channel < 2) bbtool->colors_per_channel = 2; if (bbtool->colors_per_channel > 6) bbtool->colors_per_channel = 6; } } else bbtool->colors_per_channel = 4; if (XrmGetResource(resource_db, "session.imageDither", "session.ImageDither", &value_type, &value)) { if (! strncasecmp("true", value.addr, value.size)) bbtool->image_dither = True; else bbtool->image_dither = False; } } void BaseResource::readDatabaseTexture(char *rname, char *rclass, char *bbrname,char *bbrclass, BColor defaultcolor,BColor defaultcolorto, unsigned long defaulttexture, BTexture *texture) { XrmValue value; char *value_type; texture->texture = 0; if (!XrmGetResource(resource_db, rname, rclass, &value_type,&value)) if (!XrmGetResource(resource_db,bbrname,bbrclass,&value_type,&value)) texture->texture=defaulttexture; if (texture->texture==0) { if (strstr(value.addr, "Solid")) { texture->texture |= BImage_Solid; } else if (strstr(value.addr, "Gradient")) { texture->texture |= BImage_Gradient; if (strstr(value.addr, "Diagonal")) { texture->texture |= BImage_Diagonal; } else if (strstr(value.addr, "Horizontal")) { texture->texture |= BImage_Horizontal; } else if (strstr(value.addr, "Vertical")) { texture->texture |= BImage_Vertical; } else texture->texture |= BImage_Diagonal; } else texture->texture |= BImage_Solid; if (strstr(value.addr, "Raised")) texture->texture |= BImage_Raised; else if (strstr(value.addr, "Sunken")) texture->texture |= BImage_Sunken; else if (strstr(value.addr, "Flat")) texture->texture |= BImage_Flat; else texture->texture |= BImage_Raised; if (! (texture->texture & BImage_Flat)) if (strstr(value.addr, "Bevel")) if (strstr(value.addr, "Bevel1")) texture->texture |= BImage_Bevel1; else if (strstr(value.addr, "Bevel2")) texture->texture |= BImage_Bevel2; else texture->texture |= BImage_Bevel1; } if (texture->texture & BImage_Solid) { int clen = strlen(rclass) + 8, nlen = strlen(rname) + 8; char *colorclass = new char[clen], *colorname = new char[nlen]; sprintf(colorclass, "%s.Color", rclass); sprintf(colorname, "%s.color", rname); char *bbcolorclass=0; char *bbcolorname=0; if (bbrclass&&bbrname) { clen = strlen(bbrclass) + 8, nlen = strlen(bbrname) + 8; bbcolorclass = new char[clen]; bbcolorname = new char[nlen]; sprintf(bbcolorclass, "%s.Color", bbrclass); sprintf(bbcolorname, "%s.color", bbrname); } if (!readDatabaseColor(colorname, colorclass,bbcolorname,bbcolorclass, &(texture->color))) CopyColor(defaultcolor,&(texture->color)); delete [] colorclass; delete [] colorname; delete [] bbcolorclass; delete [] bbcolorname; if ((! texture->color.allocated) || (texture->texture & BImage_Flat)) return; XColor xcol; xcol.red = (unsigned int) (texture->color.red + (texture->color.red >> 1)); if (xcol.red >= 0xff) xcol.red = 0xffff; else xcol.red *= 0xff; xcol.green = (unsigned int) (texture->color.green + (texture->color.green >> 1)); if (xcol.green >= 0xff) xcol.green = 0xffff; else xcol.green *= 0xff; xcol.blue = (unsigned int) (texture->color.blue + (texture->color.blue >> 1)); if (xcol.blue >= 0xff) xcol.blue = 0xffff; else xcol.blue *= 0xff; if (! XAllocColor(bbtool->dpy, bbtool->image_control->getColormap(), &xcol)) xcol.pixel = 0; texture->hiColor.pixel = xcol.pixel; xcol.red = (unsigned int) ((texture->color.red >> 2) + (texture->color.red >> 1)) * 0xff; xcol.green = (unsigned int) ((texture->color.green >> 2) + (texture->color.green >> 1)) * 0xff; xcol.blue = (unsigned int) ((texture->color.blue >> 2) + (texture->color.blue >> 1)) * 0xff; if (! XAllocColor(bbtool->dpy, bbtool->image_control->getColormap(), &xcol)) xcol.pixel = 0; texture->loColor.pixel = xcol.pixel; } else if (texture->texture & 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); char *bbcolorclass=0; char *bbcolorname=0; char *bbcolortoclass=0; char *bbcolortoname=0; if (bbrclass&&bbrname) { clen = strlen(bbrclass) + 10; nlen = strlen(bbrname) + 10; bbcolorclass = new char[clen]; bbcolorname = new char[nlen]; bbcolortoclass = new char[clen]; bbcolortoname = new char[nlen]; sprintf(bbcolorclass, "%s.Color", bbrclass); sprintf(bbcolorname, "%s.color", bbrname); sprintf(bbcolortoclass, "%s.ColorTo", bbrclass); sprintf(bbcolortoname, "%s.colorTo", bbrname); } if (!readDatabaseColor(colorname, colorclass,bbcolorname,bbcolorclass, &(texture->color))) CopyColor(defaultcolor,&texture->color); if (!readDatabaseColor(colortoname, colortoclass,bbcolortoname, bbcolortoclass,&(texture->colorTo))) CopyColor(defaultcolorto,&texture->colorTo); delete [] colorclass; delete [] colorname; delete [] bbcolorclass; delete [] bbcolorname; delete [] colortoclass; delete [] colortoname; delete [] bbcolortoclass; delete [] bbcolortoname; } } void BaseResource::readDatabaseColor(char *rname, char *rclass, char *bbrname, char *bbrclass,char * default_color, BColor *color) { XrmValue value; char *value_type; if (color->allocated) { XFreeColors(bbtool->dpy, bbtool->image_control->getColormap(), &(color->pixel), 1, 0); color->allocated = False; } if (XrmGetResource(resource_db, rname, rclass, &value_type,&value)) { color->pixel = bbtool->image_control->getColor(value.addr, &color->red, &color->green, &color->blue); color->allocated = 1; } else if (bbrname && bbrclass) { if (XrmGetResource(resource_db, bbrname, bbrclass, &value_type, &value)) { color->pixel = bbtool->image_control->getColor(value.addr, &color->red, &color->green, &color->blue); color->allocated = 1; } else if (default_color) { color->pixel = bbtool->image_control->getColor(default_color, &color->red, &color->green, &color->blue); color->allocated = 1; } } else if (default_color) { color->pixel = bbtool->image_control->getColor(default_color, &color->red, &color->green, &color->blue); color->allocated = 1; } } bool BaseResource::readDatabaseColor(char *rname, char *rclass, char *bbrname, char *bbrclass, BColor *color) { XrmValue value; char *value_type; if (color->allocated) { XFreeColors(bbtool->dpy, bbtool->image_control->getColormap(), &(color->pixel), 1, 0); color->allocated = False; } if (XrmGetResource(resource_db, rname, rclass, &value_type,&value)) { color->pixel = bbtool->image_control->getColor(value.addr, &color->red, &color->green, &color->blue); color->allocated = 1; return true; } if (bbrname && bbrclass) { if (XrmGetResource(resource_db, bbrname, bbrclass, &value_type, &value)) { color->pixel = bbtool->image_control->getColor(value.addr, &color->red, &color->green, &color->blue); color->allocated = 1; return true; } return false; } return false; } void BaseResource::readDatabaseTexture(char *rname, char *rclass, char *bbrname,char *bbrclass, char *defaultcolor, char *defaultcolorto, unsigned long defaulttexture, BTexture *texture) { XrmValue value; char *value_type; texture->texture = 0; if (!XrmGetResource(resource_db, rname, rclass, &value_type,&value)) if (!XrmGetResource(resource_db,bbrname,bbrclass,&value_type,&value)) texture->texture=defaulttexture; if (texture->texture==0) { if (strstr(value.addr, "Solid")) { texture->texture |= BImage_Solid; } else if (strstr(value.addr, "Gradient")) { texture->texture |= BImage_Gradient; if (strstr(value.addr, "Diagonal")) { texture->texture |= BImage_Diagonal; } else if (strstr(value.addr, "Horizontal")) { texture->texture |= BImage_Horizontal; } else if (strstr(value.addr, "Vertical")) { texture->texture |= BImage_Vertical; } else texture->texture |= BImage_Diagonal; } else texture->texture |= BImage_Solid; if (strstr(value.addr, "Raised")) texture->texture |= BImage_Raised; else if (strstr(value.addr, "Sunken")) texture->texture |= BImage_Sunken; else if (strstr(value.addr, "Flat")) texture->texture |= BImage_Flat; else texture->texture |= BImage_Raised; if (! (texture->texture & BImage_Flat)) if (strstr(value.addr, "Bevel")) if (strstr(value.addr, "Bevel1")) texture->texture |= BImage_Bevel1; else if (strstr(value.addr, "Bevel2")) texture->texture |= BImage_Bevel2; else texture->texture |= BImage_Bevel1; } if (texture->texture & BImage_Solid) { int clen = strlen(rclass) + 8, nlen = strlen(rname) + 8; char *colorclass = new char[clen], *colorname = new char[nlen]; sprintf(colorclass, "%s.Color", rclass); sprintf(colorname, "%s.color", rname); char *bbcolorclass=0; char *bbcolorname=0; if (bbrclass&&bbrname) { clen = strlen(bbrclass) + 8, nlen = strlen(bbrname) + 8; bbcolorclass = new char[clen]; bbcolorname = new char[nlen]; sprintf(bbcolorclass, "%s.Color", bbrclass); sprintf(bbcolorname, "%s.color", bbrname); } readDatabaseColor(colorname, colorclass,bbcolorname,bbcolorclass, defaultcolor,&(texture->color)); delete [] colorclass; delete [] colorname; delete [] bbcolorclass; delete [] bbcolorname; if ((! texture->color.allocated) || (texture->texture & BImage_Flat)) return; XColor xcol; xcol.red = (unsigned int) (texture->color.red + (texture->color.red >> 1)); if (xcol.red >= 0xff) xcol.red = 0xffff; else xcol.red *= 0xff; xcol.green = (unsigned int) (texture->color.green + (texture->color.green >> 1)); if (xcol.green >= 0xff) xcol.green = 0xffff; else xcol.green *= 0xff; xcol.blue = (unsigned int) (texture->color.blue + (texture->color.blue >> 1)); if (xcol.blue >= 0xff) xcol.blue = 0xffff; else xcol.blue *= 0xff; if (! XAllocColor(bbtool->dpy, bbtool->image_control->getColormap(), &xcol)) xcol.pixel = 0; texture->hiColor.pixel = xcol.pixel; xcol.red = (unsigned int) ((texture->color.red >> 2) + (texture->color.red >> 1)) * 0xff; xcol.green = (unsigned int) ((texture->color.green >> 2) + (texture->color.green >> 1)) * 0xff; xcol.blue = (unsigned int) ((texture->color.blue >> 2) + (texture->color.blue >> 1)) * 0xff; if (! XAllocColor(bbtool->dpy, bbtool->image_control->getColormap(), &xcol)) xcol.pixel = 0; texture->loColor.pixel = xcol.pixel; } else if (texture->texture & 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); char *bbcolorclass=0; char *bbcolorname=0; char *bbcolortoclass=0; char *bbcolortoname=0; if (bbrclass&&bbrname) { clen = strlen(bbrclass) + 10; nlen = strlen(bbrname) + 10; bbcolorclass = new char[clen]; bbcolorname = new char[nlen]; bbcolortoclass = new char[clen]; bbcolortoname = new char[nlen]; sprintf(bbcolorclass, "%s.Color", bbrclass); sprintf(bbcolorname, "%s.color", bbrname); sprintf(bbcolortoclass, "%s.ColorTo", bbrclass); sprintf(bbcolortoname, "%s.colorTo", bbrname); } readDatabaseColor(colorname, colorclass,bbcolorname,bbcolorclass, defaultcolor,&(texture->color)); readDatabaseColor(colortoname, colortoclass,bbcolortoname,bbcolortoclass, defaultcolorto,&(texture->colorTo)); delete [] colorclass; delete [] colorname; delete [] bbcolorclass; delete [] bbcolorname; delete [] colortoclass; delete [] colortoname; delete [] bbcolortoclass; delete [] bbcolortoname; } } bbtime-0.1.5/Baseresource.hh0000644000175000001440000000244306713403025011402 #ifndef __BASERESOURCE_HH #define __BASERESOURCE_HH class ToolWindow; class BImageControl; struct STYLE { bool auto_config; char *conf_filename; char *style_filename; time_t mtime; }; class BaseResource { public: BaseResource(ToolWindow *); virtual ~BaseResource(void); void CopyColor(BColor ,BColor *); void CopyTexture(BTexture ,BTexture *); void Reload(void); STYLE style; protected: void Load(void); void readDatabaseTexture(char *, char *,char *,char *, BColor ,BColor ,unsigned long, BTexture *); void readDatabaseTexture(char *, char *,char *,char *, char *, char *,unsigned long, BTexture *texture); void readDatabaseColor(char *, char *, char *,char *, char *, BColor *); bool readDatabaseColor(char *, char *, char *,char *, BColor *); ToolWindow *bbtool; XrmDatabase resource_db; XrmDatabase db; time_t mtime; bool auto_config; virtual void LoadBBToolResource(void) = 0; private: bool ReadResourceFromFilename(char *, char *); void ReadBBtoolResource(void); void ReadDefaultResource(void); void ReadBlackboxResource(void); int ResourceType; }; #endif /* __BASERESOURCE_HH */ bbtime-0.1.5/Basewindow.cc0000644000175000001440000001072306755762400011063 // Basewindow.cc for bbtools. // // Copyright (c) 1998-1999 by John Kennis, jkennis@chello.nl // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "Basewindow.hh" #include "resource.hh" Basewindow::Basewindow(int argc,char **argv) { display_name=NULL; config_filename=NULL; position=NULL; withdrawn=False; shape=False; server_grabs=0; ParseOptions(argc,argv); dpy=NULL; dpy=XOpenDisplay(display_name); if (dpy==NULL) { fprintf(stderr,"Error can't open display %s\n",display_name); exit(1); } screen=DefaultScreen(dpy); v=DefaultVisual(dpy,screen); root=RootWindow(dpy,screen); depth=DefaultDepth(dpy,screen); display_height=DisplayHeight(dpy,screen); display_width=DisplayWidth(dpy,screen); xres = WidthOfScreen(ScreenOfDisplay(dpy, screen)); yres = HeightOfScreen(ScreenOfDisplay(dpy, screen)); MakeCursor(); } Basewindow::~Basewindow() { } void Basewindow::MakeCursor(void) { cursor = XCreateFontCursor(dpy, XC_left_ptr); XDefineCursor(dpy, root, cursor); } void Basewindow::setupImageControl() { image_control = new BImageControl(this); image_control->installRootColormap(); } void Basewindow::grab(void) { if (! server_grabs++); XGrabServer(dpy); XSync(dpy, False); } void Basewindow::ungrab(void) { if (! --server_grabs); XUngrabServer(dpy); if (server_grabs < 0) server_grabs = 0; } void Basewindow::ParseOptions(int argc,char **argv) { int i; for(i=1;i] [-config ]\n",BBTOOL); fprintf(stderr," [-spooldir] [-version] [-help]\n"); fprintf(stderr," [[-position] | [-pos]] \n\n"); fprintf(stderr,"-d[isplay] X server to connect to\n"); fprintf(stderr,"-c[onfig] Alternate config file\n"); fprintf(stderr,"-bb[config] Alternate Blackbox config file\n"); fprintf(stderr,"-def[ault] Fall back on default configuration\n"); fprintf(stderr,"-v[ersion] Display version number\n"); fprintf(stderr,"-h[elp] Display this help\n"); fprintf(stderr,"-p[osition] Set position of window\n"); fprintf(stderr," = [+]|[-]x[+]|[-]y\n"); fprintf(stderr,"-w[withdrawn] Place bbtool in the Slit\n"); fprintf(stderr,"-s[hape] Don't display groundplate\n\n"); } bbtime-0.1.5/Basewindow.hh0000644000175000001440000000535406755762420011103 // Basewindow.hh for bbtools // // Copyright (c) 1998-1999 by John Kennis, jkennis@chello.nl // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __BASEWINDOW_HH #define __BASEWINDOW_HH #include #include #include #include #include #include #include #include #include #include #include #include "version.h" #include "Image.hh" //#include "resource.hh" class BImageControl; class Resource; class Basewindow { public: Basewindow(int, char**); virtual ~Basewindow(); /* compatible with BImageControl */ Display *getDisplay(void) { return dpy; } int getDepth(void) { return depth; } int getScreenNumber(void) { return screen; } Window getRootWindow(void) { return root; } Visual *getVisual(void) { return v; } void grab(void); void ungrab(void); int getColorsPerChannel(void) { return colors_per_channel; } Bool hasImageDither(void) { return image_dither; } void setupImageControl(void); enum { B_LeftJustify = 1, B_RightJustify, B_CenterJustify }; BImageControl *imageControl(void) {return image_control;} const BColor &borderColor(void) { return border_color; } Cursor sessionCursor(void) { return cursor;} unsigned int xRes(void) {return xres;} unsigned int yRes(void) {return yres;} Display *dpy; Visual *v; unsigned int depth; BImageControl *image_control; BColor border_color; int colors_per_channel; bool image_dither; char *position; char *config_filename; char *nobb_filename; char *bbconfig_filename; char *spooldir; bool default_config; bool withdrawn; bool shape; protected: virtual void ParseOptions(int argc,char **argv); Cursor cursor; GC menuGC; GC menuHiBGGC; GC menuHiGC; GC menuFrameGC; unsigned int xres; unsigned int yres; int screen; Window root; Window menuwin; char *display_name; int display_height; int display_width; private: int server_grabs; void MakeCursor(void); void Usage(void); }; #endif /* __BASEWINDOW_HH */ bbtime-0.1.5/Basemenu.cc0000644000175000001440000006120106755300250010504 // Basemenu.cc adapted for use in bbtools 5-3-1999 by John Kennis // // // Original notice: // // // Basemenu.cc for Blackbox - an X11 Window manager // Copyright (c) 1997, 1998 by Brad Hughes, bhughes@tcac.net // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef _GNU_SOURCE #define _GNU_SOURCE #endif #ifdef HAVE_CONFIG_H # include "../config.h" #endif #include "bbtime.hh" #include "Basemenu.hh" #if HAVE_STDIO_H # include #endif #if STDC_HEADERS # include #endif // ************************************************************************* // Basemenu constructor and destructor // ************************************************************************* Basemenu::Basemenu(ToolWindow *ctrl) { blackbox = ctrl; image_ctrl = blackbox->imageControl(); display = blackbox->getDisplay(); parent = (Basemenu *) 0; alignment = MenuAlignDontCare; title_vis = movable = hidable = True; shifted = default_menu = moving = user_moved = visible = False; menu.x = menu.y = menu.x_shift = menu.y_shift = menu.x_move = menu.y_move = 0; always_highlight = which_sub = which_press = which_sbl = -1; menu.iframe_pixmap = menu.title_pixmap = None; menu.bevel_w = blackbox->bevelWidth(); menu.width = menu.title_h = menu.item_w = menu.iframe_h = blackbox->titleFont()->ascent + blackbox->titleFont()->descent + (menu.bevel_w * 2); menu.label = 0; menu.sublevels = menu.persub = 0; menu.item_h = blackbox->menuFont()->ascent + blackbox->menuFont()->descent + (menu.bevel_w); menu.height = menu.title_h + 1 + menu.iframe_h; unsigned long attrib_mask = CWBackPixmap|CWBackPixel|CWBorderPixel| CWOverrideRedirect|CWCursor|CWEventMask; XSetWindowAttributes attrib; attrib.background_pixmap = None; attrib.background_pixel = attrib.border_pixel = blackbox->borderColor().pixel; attrib.override_redirect = True; attrib.cursor = blackbox->sessionCursor(); attrib.event_mask = ButtonPressMask | ButtonReleaseMask | ButtonMotionMask | ExposureMask; menu.frame = XCreateWindow(display, blackbox->getRootWindow(), menu.x, menu.y, menu.width, menu.height, 1, blackbox->getDepth(), InputOutput, blackbox->getVisual(), attrib_mask, &attrib); blackbox->saveMenuSearch(menu.frame, this); attrib_mask = CWBackPixmap|CWBackPixel|CWBorderPixel|CWCursor|CWEventMask; attrib.background_pixel = blackbox->borderColor().pixel; attrib.event_mask |= EnterWindowMask|LeaveWindowMask; menu.title = XCreateWindow(display, menu.frame, 0, 0, menu.width, menu.height, 0, blackbox->getDepth(), InputOutput, blackbox->getVisual(), attrib_mask, &attrib); blackbox->saveMenuSearch(menu.title, this); menu.iframe = XCreateWindow(display, menu.frame, 0, menu.title_h + 1, menu.width, menu.iframe_h, 0, blackbox->getDepth(), InputOutput, blackbox->getVisual(), attrib_mask, &attrib); blackbox->saveMenuSearch(menu.iframe, this); menuitems = new LinkedList; // 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.frame); 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); menu.title_pixmap = None; } if (menu.iframe_pixmap) { image_ctrl->removeImage(menu.iframe_pixmap); menu.iframe_pixmap = None; } blackbox->removeMenuSearch(menu.title); XDestroyWindow(display, menu.title); blackbox->removeMenuSearch(menu.iframe); XDestroyWindow(display, menu.iframe); blackbox->removeMenuSearch(menu.frame); XDestroyWindow(display, menu.frame); } // ************************************************************************* // insertion and removal methods // ************************************************************************* int Basemenu::insert(char *label, int function, char *exec, int pos) { BasemenuItem *item = new BasemenuItem(label, function, exec); menuitems->insert(item, pos); return menuitems->count(); } int Basemenu::insert(char *label, Basemenu *submenu, int pos) { BasemenuItem *item = new BasemenuItem(label, submenu); menuitems->insert(item, pos); submenu->parent = this; submenu->setMovable(True); submenu->setHidable(False); return menuitems->count(); } int Basemenu::insert(char **ulabel, int pos) { BasemenuItem *item = new BasemenuItem(ulabel); menuitems->insert(item, pos); return menuitems->count(); } int Basemenu::remove(int index) { BasemenuItem *item = menuitems->remove(index); if (! default_menu) { if (item->submenu()) { Basemenu *tmp = (Basemenu *) item->submenu(); delete tmp; } if (item->label()) { delete [] item->label(); } if (item->exec()) { delete [] item->exec(); } } delete item; if (which_sub == index) which_sub = -1; if (always_highlight == index) always_highlight = -1; return menuitems->count(); } // ************************************************************************* // Menu maintainence and utility methods // ************************************************************************* void Basemenu::Update(void) { menu.item_h = blackbox->menuFont()->ascent + blackbox->menuFont()->descent + menu.bevel_w; if (title_vis) menu.item_w = (menu.bevel_w * 2) + XTextWidth(blackbox->titleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); else menu.item_w = 1; int ii = 0; LinkedListIterator it(menuitems); for (; it.current(); it++) { BasemenuItem *itmp = it.current(); if (itmp->u) ii = (menu.bevel_w * 2) + (menu.item_h * 2) + XTextWidth(blackbox->menuFont(), *itmp->u, strlen(*itmp->u)); else if (itmp->l) ii = (menu.bevel_w * 2) + (menu.item_h * 2) + XTextWidth(blackbox->menuFont(), itmp->l, strlen(itmp->l)); else ii = 0; menu.item_w = ((menu.item_w < (unsigned int) ii) ? ii : menu.item_w); } if (menuitems->count()) { menu.sublevels = 1; while ((((menu.item_h + 1) * (menuitems->count() + 1) / menu.sublevels) + menu.title_h + 1) > blackbox->yRes()) menu.sublevels++; menu.persub = menuitems->count() / menu.sublevels; if (menuitems->count() % menu.sublevels) menu.sublevels++; } else { menu.sublevels = 0; menu.persub = 0; } menu.width = (menu.sublevels * (menu.item_w)); if (! menu.width) menu.width = menu.item_w; menu.title_h = blackbox->titleFont()->ascent + blackbox->titleFont()->descent + (menu.bevel_w * 2); menu.iframe_h = ((menu.item_h + 1) * menu.persub); menu.height = ((title_vis) ? menu.title_h + 1 : 0) + menu.iframe_h; if (! menu.iframe_h) menu.iframe_h = 1; if (menu.height < 1) menu.height = 1; Pixmap tmp; if (title_vis) { tmp = menu.title_pixmap; menu.title_pixmap = image_ctrl->renderImage(menu.width, menu.title_h, &(blackbox->getResource()->menu.texture)); if (tmp) image_ctrl->removeImage(tmp); XSetWindowBackgroundPixmap(display, menu.title, menu.title_pixmap); XClearWindow(display, menu.title); } tmp = menu.iframe_pixmap; menu.iframe_pixmap = image_ctrl->renderImage(menu.width, menu.iframe_h, &(blackbox->getResource()->menu.texture)); if (tmp) image_ctrl->removeImage(tmp); XSetWindowBackgroundPixmap(display, menu.iframe, menu.iframe_pixmap); XResizeWindow(display, menu.frame, menu.width, menu.height); if (title_vis) XResizeWindow(display, menu.title, menu.width, menu.title_h); XMoveResizeWindow(display, menu.iframe, 0, ((title_vis) ? menu.title_h + 1 : 0), menu.width, menu.iframe_h); XClearWindow(display, menu.frame); XClearWindow(display, menu.title); XClearWindow(display, menu.iframe); if (title_vis) switch (blackbox->Justification()) { case ToolWindow::B_LeftJustify: { XDrawString(display, menu.title, blackbox->MenuTitleGC(), menu.bevel_w, blackbox->titleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case ToolWindow::B_RightJustify: { int off = menu.bevel_w + XTextWidth(blackbox->titleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); XDrawString(display, menu.title, blackbox->MenuTitleGC(), menu.width - off, blackbox->titleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case ToolWindow::B_CenterJustify: { int ins = (menu.width - (XTextWidth(blackbox->titleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))))) / 2; XDrawString(display, menu.title, blackbox->MenuTitleGC(), ins, blackbox->titleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } } int i = 0; for (i = 0; i < menuitems->count(); i++) if (i == which_sub) { drawItem(i, (i == always_highlight), True, 0); drawSubmenu(i); } else drawItem(i, (i == always_highlight), False, 0); if (parent && visible) parent->drawSubmenu(parent->which_sub); XMapSubwindows(display, menu.frame); } void Basemenu::Show(void) { XMapSubwindows(display, menu.frame); XMapWindow(display, menu.frame); visible = True; } void Basemenu::Hide(void) { if (which_sub != -1) { BasemenuItem *tmp = menuitems->find(which_sub); tmp->submenu()->Hide(); } user_moved = visible = False; which_sub = which_press = which_sub = -1; if (parent) { parent->drawItem(parent->which_sub, (parent->always_highlight == parent->which_sub), False, True); hidable = False; parent->which_sub = -1; } XUnmapWindow(display, menu.frame); } void Basemenu::Move(int x, int y) { menu.x = x; menu.y = y; XMoveWindow(display, menu.frame, x, y); if (which_sub != -1) drawSubmenu(which_sub); } void Basemenu::drawSubmenu(int index, Bool) { if (which_sub != -1 && which_sub != index) { BasemenuItem *itmp = menuitems->find(which_sub); if (! itmp->submenu()->userMoved()) itmp->submenu()->Hide(); } if (index >= 0 && index < menuitems->count()) { BasemenuItem *item = menuitems->find(index); if (item->submenu() && visible && (! item->submenu()->userMoved())) { drawItem(index, False, True); int sbl = index / menu.persub, i = index - (sbl * menu.persub), x = (((shifted) ? menu.x_shift : menu.x) + (menu.item_w * (sbl + 1)) + 1), y; if (alignment == MenuAlignTop) y = (((shifted) ? menu.y_shift : menu.y) + ((title_vis) ? menu.title_h + 1 : 0) - ((item->submenu()->title_vis) ? item->submenu()->menu.title_h + 1 : 0)); else y = (((shifted) ? menu.y_shift : menu.y) + ((menu.item_h + 1) * i) + ((title_vis) ? menu.title_h + 1 : 0) - ((item->submenu()->title_vis) ? item->submenu()->menu.title_h + 1 : 0)); if (alignment == MenuAlignBottom && (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()->Width()) > blackbox->xRes()) x = ((shifted) ? menu.x_shift : menu.x) - item->submenu()->Width() - 1; if (x < 0) x = 0; if ((y + item->submenu()->Height()) > blackbox->yRes()) y = blackbox->yRes() - item->submenu()->Height() - 1; if (y < 0) y = 0; item->submenu()->Move(x, y); if (! item->submenu()->visible) item->submenu()->Show(); 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 frame, Bool highlight, Bool clear) { if (index < 0 || index > menuitems->count()) return; int sbl = index / menu.persub, i = index - (sbl * menu.persub), ix = (sbl * menu.item_w), iy = (i * (menu.item_h + 1)), tx = 0; BasemenuItem *item = menuitems->find(index); if (! item) return; switch(blackbox->MenuJustification()) { case ToolWindow::B_LeftJustify: tx = ix + menu.bevel_w + menu.item_h + 1; break; case ToolWindow::B_RightJustify: tx = ix + menu.item_w - (menu.item_h + menu.bevel_w + XTextWidth(blackbox->menuFont(), ((item->ulabel()) ? *item->ulabel() : item->label()), strlen((item->ulabel()) ? *item->ulabel() : item->label()))); break; case ToolWindow::B_CenterJustify: tx = ix + ((menu.item_w + 1 - XTextWidth(blackbox->menuFont(), ((item->ulabel()) ? *item->ulabel() : item->label()), strlen((item->ulabel()) ? *item->ulabel() : item->label()))) / 2); break; } if (clear) { XClearArea(display, menu.iframe, ix, iy, menu.item_w, menu.item_h + 1, False); } if (frame) XFillArc(display, menu.iframe, blackbox->MenuHiBGGC(), ix + 1, iy + 1, menu.item_h - 1, menu.item_h - 2, 0, 360 * 64); if (highlight) { XFillArc(display, menu.iframe, blackbox->MenuHiBGGC(), ix + 1, iy + 1, menu.item_h - 1, menu.item_h - 2, 90 * 64, 180 * 64); XFillArc(display, menu.iframe, blackbox->MenuHiBGGC(), ix + menu.item_w - menu.item_h - 2, iy + 1, menu.item_h - 1, menu.item_h - 2, 270 * 64, 180 * 64); XFillRectangle(display, menu.iframe, blackbox->MenuHiBGGC(), ix + ((menu.item_h + 1) / 2), iy + 1, menu.item_w - menu.item_h - 2, menu.item_h - 1); if (item->ulabel()) XDrawString(display, menu.iframe, blackbox->MenuHiGC(), tx, iy + blackbox->menuFont()->ascent + (menu.bevel_w / 2) + 1, *item->ulabel(), strlen(*item->ulabel())); else if (item->label()) XDrawString(display, menu.iframe, blackbox->MenuHiGC(), tx, iy + blackbox->menuFont()->ascent + (menu.bevel_w / 2) + 1, item->label(), strlen(item->label())); if (item->submenu()) XDrawArc(display, menu.iframe, blackbox->MenuHiGC(), ix + (menu.item_h / 4) + 1, iy + (menu.item_h / 4) + 1, menu.item_h / 2, menu.item_h / 2, 0, 360 * 64); } else { if (item->ulabel()) XDrawString(display, menu.iframe, blackbox->MenuFrameGC(), tx, iy + blackbox->menuFont()->ascent + (menu.bevel_w / 2) + 1, *item->ulabel(), strlen(*item->ulabel())); else if (item->label()) XDrawString(display, menu.iframe, blackbox->MenuFrameGC(), tx, iy + blackbox->menuFont()->ascent + (menu.bevel_w / 2) + 1, item->label(), strlen(item->label())); if (item->submenu()) XDrawArc(display, menu.iframe, blackbox->MenuFrameGC(), ix + (menu.item_h / 4) + 1, iy + (menu.item_h / 4) + 1, menu.item_h / 2, menu.item_h / 2, 0, 360 * 64); } } void Basemenu::setMenuLabel(char *l) { if (menu.label) delete [] menu.label; if (l) { menu.label = new char[strlen(l) + 1]; sprintf(menu.label, "%s", l); } else menu.label = 0; } void Basemenu::setHighlight(int index) { if (always_highlight != -1) drawItem(always_highlight, False, False, True); if (index >= 0 && index < menuitems->count()) { always_highlight = index; drawItem(always_highlight, True); } else always_highlight = -1; } // ************************************************************************* // Menu event handling // ************************************************************************* void Basemenu::buttonPressEvent(XButtonEvent *be) { if (be->window == menu.title) { if (be->x >= 0 && be->x <= (signed) menu.width && be->y >= 0 && be->y <= (signed) menu.title_h) { } } else if (be->window == menu.iframe) { int sbl = (be->x / menu.item_w), i = (be->y / (menu.item_h + 1)); 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, False, True); } } } void Basemenu::buttonReleaseEvent(XButtonEvent *re) { if (re->window == menu.title) { if (moving) { XUngrabPointer(display, CurrentTime); 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 && hidable) Hide(); } else if (re->window == menu.iframe && re->x >= 0 && re->x < (signed) menu.width && re->y >= 0 && re->y < (signed) menu.iframe_h) { if (re->button == 3 && hidable) { Hide(); } else { int sbl = (re->x / menu.item_w), i = (re->y / (menu.item_h + 1)), ix = sbl * menu.item_w, iy = i * (menu.item_h + 1), w = (sbl * menu.persub) + i, p = (which_sbl * menu.persub) + which_press; if (w < menuitems->count() && w >= 0) { drawItem(p, (p == always_highlight), (p == which_sub), True); if (p == 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); } } else XUngrabPointer(display, CurrentTime); } void Basemenu::motionNotifyEvent(XMotionEvent *me) { if (me->window == menu.title && (me->state & Button1Mask)) { if (movable) { if (! moving) { if (XGrabPointer(display, menu.title, False, PointerMotionMask| ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, blackbox->sessionCursor(), CurrentTime) == GrabSuccess) { moving = hidable = user_moved = True; if (parent) { parent->drawItem(parent->which_sub, (parent->which_sub == parent->always_highlight), False, True); parent->which_sub = -1; } menu.x_move = me->x; menu.y_move = me->y; if (which_sub != -1) drawSubmenu(which_sub); } else moving = False; } else { int dx = me->x_root - menu.x_move, dy = me->y_root - menu.y_move; menu.x = dx; menu.y = dy; XMoveWindow(display, menu.frame, dx, dy); if (which_sub != -1) drawSubmenu(which_sub); } } } else if ((! (me->state & Button1Mask)) && me->window == menu.iframe && me->x >= 0 && me->x < (signed) menu.width && me->y >= 0 && me->y < (signed) menu.iframe_h) { int sbl = (me->x / menu.item_w), i = (me->y / (menu.item_h + 1)), 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, (p == always_highlight), False, True); if (item->submenu()) if (item->submenu()->Visible() && (! item->submenu()->userMoved())) { item->submenu()->Hide(); which_sub = -1; } } which_press = i; which_sbl = sbl; BasemenuItem *itmp = menuitems->find(w); if (itmp->submenu()) drawSubmenu(w); else drawItem(w, False, True); } } } void Basemenu::exposeEvent(XExposeEvent *ee) { if (ee->window == menu.title) { switch (blackbox->Justification()) { case ToolWindow::B_LeftJustify: { XDrawString(display, menu.title, blackbox->MenuTitleGC(), menu.bevel_w, blackbox->titleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case ToolWindow::B_RightJustify: { int off = XTextWidth(blackbox->titleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))) + menu.bevel_w; XDrawString(display, menu.title, blackbox->MenuTitleGC(), menu.width - off, blackbox->titleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } case ToolWindow::B_CenterJustify: { int ins = (menu.width - (XTextWidth(blackbox->titleFont(), ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))))) / 2; XDrawString(display, menu.title, blackbox->MenuTitleGC(), ins, blackbox->titleFont()->ascent + menu.bevel_w, ((menu.label) ? menu.label : "Blackbox Menu"), strlen(((menu.label) ? menu.label : "Blackbox Menu"))); break; } } } else if (ee->window == menu.iframe) { LinkedListIterator 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 + 1)), // 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 + 1)); 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, (always_highlight == index), (which_sub == index)); } } } } void Basemenu::enterNotifyEvent(XCrossingEvent *ce) { if (ce->window == menu.iframe) { XGrabPointer(display, menu.iframe, False, PointerMotionMask| LeaveWindowMask|ButtonPressMask|ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, blackbox->sessionCursor(), CurrentTime); menu.x_shift = menu.x, menu.y_shift = menu.y; if (menu.x + menu.width > blackbox->xRes()) { menu.x_shift = blackbox->xRes() - menu.width - 1; shifted = True; } if (menu.y + menu.height > blackbox->yRes()) { menu.y_shift = blackbox->yRes() - menu.height - 1; shifted = True; } if (shifted) XMoveWindow(display, menu.frame, menu.x_shift, menu.y_shift); if (which_sub != -1) { BasemenuItem *tmp = menuitems->find(which_sub); if (tmp->submenu()->Visible()) { int sbl = (ce->x / menu.item_w), i = (ce->y / (menu.item_h + 1)), w = (sbl * menu.persub) + i; if (w != which_sub && (! tmp->submenu()->userMoved())) { tmp->submenu()->Hide(); drawItem(which_sub, (w == always_highlight), False, True); which_sub = -1; } } } } } void Basemenu::leaveNotifyEvent(XCrossingEvent *ce) { if (ce->window == menu.iframe) { if (which_press != -1 && which_sbl != -1 && menuitems->count() > 0) { int p = (which_sbl * menu.persub) + which_press; drawItem(p, (p == always_highlight), (p == which_sub), True); which_sbl = which_press = -1; } if (! (ce->state & Button1Mask)) XUngrabPointer(display, CurrentTime); if (shifted) { XMoveWindow(display, menu.frame, menu.x, menu.y); shifted = False; } } } // ************************************************************************* // Resource reconfiguration // ************************************************************************* void Basemenu::Reconfigure(void) { XSetWindowBackground(display, menu.frame, blackbox->borderColor().pixel); XSetWindowBorder(display, menu.frame, blackbox->borderColor().pixel); menu.bevel_w = blackbox->bevelWidth(); Update(); } bbtime-0.1.5/Basemenu.hh0000644000175000001440000001000207553061657010523 // Basemenu.hh adapted for use in bbmail 5-3-1999 by John Kennis // // // Original notice: // // Basemenu.hh for Blackbox - an X11 Window manager // Copyright (c) 1997, 1998 by Brad Hughes, bhughes@tcac.net // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __Basemenu_hh #define __Basemenu_hh #include // forward declarations class Basemenu; class BasemenuItem; class ToolWindow; class BImageControl; #include "LinkedList.hh" class Basemenu { private: LinkedList *menuitems; ToolWindow *blackbox; Basemenu *parent; BImageControl *image_ctrl; Bool moving, visible, movable, user_moved, default_menu, title_vis, shifted, hidable; Display *display; int which_sub, which_press, which_sbl, alignment, always_highlight; struct MENU { Pixmap iframe_pixmap, title_pixmap; Window frame, iframe, title; char *label; int x, y, x_move, y_move, x_shift, y_shift, sublevels, persub; unsigned int width, height, title_h, iframe_h, item_w, item_h, bevel_w, bevel_h; }; struct MENU menu; void drawSubmenu(int, Bool = False); void drawItem(int, Bool = False, Bool = False, Bool = False); protected: BasemenuItem *find(int index) { return menuitems->find(index); } void setTitleVisibility(Bool b) { title_vis = b; } void setMovable(Bool b) { movable = b; } void setHidable(Bool b) { hidable = b; } void setAlignment(int a) { alignment = a; } virtual void itemSelected(int, int) = 0; public: Basemenu(ToolWindow *); virtual ~Basemenu(void); void buttonPressEvent(XButtonEvent *); void buttonReleaseEvent(XButtonEvent *); void motionNotifyEvent(XMotionEvent *); void enterNotifyEvent(XCrossingEvent *); void leaveNotifyEvent(XCrossingEvent *); void exposeEvent(XExposeEvent *); void Reconfigure(void); Bool hasSubmenu(int); int insert(char *, int = 0, char * = 0, int = -1); int insert(char **, int = -1); int insert(char *, Basemenu *, int = -1); int remove(int); Bool userMoved(void) { return user_moved; } Window WindowID(void) { return menu.frame; } unsigned int Width(void) { return menu.width; } unsigned int Height(void) { return menu.height; } unsigned int titleHeight(void) { return menu.title_h; } int X(void) { return menu.x; } int Y(void) { return menu.y; } int Visible(void) { return visible; } const char *Label(void) const { return menu.label; } int Count(void) { return menuitems->count(); } void setMenuLabel(char *n); virtual void Show(void); void Hide(void); void Move(int, int); void Update(void); void defaultMenu(void) { default_menu = True; } void setHighlight(int = -1); enum { MenuAlignDontCare = 1, MenuAlignTop, MenuAlignBottom }; }; class BasemenuItem { private: Basemenu *s; char **u, *l, *e; int f; friend class Basemenu; protected: public: BasemenuItem(char *lp, int fp, char *ep = 0) { l = lp; e = ep; s = 0; f = fp; u = 0; } BasemenuItem(char *lp, Basemenu *mp) { l = lp; s = mp; e = 0; f = 0; u = 0; } BasemenuItem(char **up) { u = up; l = e = 0; f = 0; s = 0; } ~BasemenuItem(void) { /* the item doesn't delete any data it holds */ } char *exec(void) { return e; } char *label(void) { return l; } char **ulabel(void) { return u; } int function(void) { return f; } Basemenu *submenu(void) { return s; } }; #endif // __Basemenu_hh bbtime-0.1.5/timemenu.cc0000644000175000001440000001001706773546233010604 // timemenu.cc for bbtime - an tool for display the time. // // Copyright (c) 1998,1999 by John Kennis, jkennis@chello.nl // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #include "timemenu.hh" Timemenu::Timemenu(ToolWindow *toolwindow) : Basemenu(toolwindow) { int i; bbtool=toolwindow; setTitleVisibility(False); setMovable(False); setHidable(False); setAlignment(Basemenu::MenuAlignBottom); defaultMenu(); word_length = new int [bbtool->getResource()->number_of_times]; for (i=0;igetResource()->number_of_times;i++) { insert(bbtool->getResource()->timefriend[i].name); word_length[i]=strlen(bbtool->getResource()->timefriend[i].name); } insert("Reconfigure"); } Timemenu::~Timemenu(void) { delete [] word_length; } void Timemenu::ClearMenu() { int i; for (i=0;i<=bbtool->getResource()->number_of_times;i++) remove(0); delete [] word_length; } void Timemenu::Reconfigure() { int i; word_length = new int [bbtool->getResource()->number_of_times]; for (i=0;igetResource()->number_of_times;i++) { insert(bbtool->getResource()->timefriend[i].name,0); word_length[i]=strlen(bbtool->getResource()->timefriend[i].name); } insert("Reconfigure"); Basemenu::Reconfigure(); } void Timemenu::Move(int x, int y, bool withdrawn) { if (!withdrawn) { y= y - Height() -1; if ((x+Width())>bbtool->xRes()) x=bbtool->xRes()-Width(); if (y<0) y=bbtool->Frame().height - 1; Basemenu::Move(x, y); } else { x= x - Width() - 6; if (x<0) x=x + Width() + 12; if (y<0) y=0; Basemenu::Move(x, y); } } /* quick and dirty */ void Timemenu::UpdateTime( time_t tmp,int number) { struct tm *tx=0; bbtool->getResource()->timefriend[number].name[word_length[number]]='\0'; if (! (tx = localtime(&tmp))) return; #ifdef HAVE_STRFTIME char t[1024]; if (! strftime(t, 1024,bbtool->getResource()->report.strftimeFormat, tx)) return; #else // !HAVE_STRFTIME char t[9]; if (date) { // format the date... with special consideration for y2k ;) if (resource->report.euStyle) sprintf(t, "%02d.%02d.%02d", tx->tm_mday, tx->tm_mon + 1, (tx->tm_year >= 100) ? tx->tm_year - 100 : tx->tm_year); else sprintf(t, "%02d/%02d/%02d", tx->tm_mon + 1, tx->tm_mday, (tx->tm_year >= 100) ? tx->tm_year - 100 : tx->tm_year); } else { if (resource->report.clock24Hour) sprintf(t, " %02d:%02d ", hour, minute); else sprintf(t, "%02d:%02d %cm", ((hour > 12) ? hour - 12 : ((hour == 0) ? 12 : hour)), minute, ((hour >= 12) ? 'p' : 'a')); } #endif // HAVE_STRFTIME strcat(bbtool->getResource()->timefriend[number].name," "); strcat(bbtool->getResource()->timefriend[number].name,t); wait_for_update=True; } void Timemenu::Update() { wait_for_update=False; Basemenu::Update(); } void Timemenu::itemSelected(int button, int index) { if (button == 1) { if (index < bbtool->getResource()->number_of_times) { bbtool->setFriendSelect(index); bbtool->CheckTime(True); setHighlight(index); } else if (index == bbtool->getResource()->number_of_times) { bbtool->Reconfigure(); } Hide(); // bbtool->EnvelopePushed(False); bbtool->Redraw(); } } void Timemenu::Show(void) { XRaiseWindow(bbtool->getDisplay(), WindowID()); Basemenu::Show(); } bbtime-0.1.5/timemenu.hh0000644000175000001440000000277006774226326010624 // timemenu.hh for bbtime - an tool for display the time in X11. // // Copyright (c) 1998,1999 by John Kennis, jkennis@chello.nl // // 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., 675 Mass Ave, Cambridge, MA 02139, USA. // // (See the included file COPYING / GPL-2.0) // #ifndef __TIMEMENU_HH #define __TIMEMENU_HH #include "Basemenu.hh" #include "bbtime.hh" class Basemenu; class ToolWindow; class Timemenu : public Basemenu { public: Timemenu(ToolWindow *); ~Timemenu(void); void UpdateTime(time_t, int); void Update(void); bool WaitForUpdate(void) {return wait_for_update;} void Move(int ,int, bool); void Reconfigure(void); void ClearMenu(void); void Clean(void); virtual void Show(void); protected: virtual void itemSelected(int, int); private: ToolWindow *bbtool; int *word_length; bool wait_for_update; }; #endif /* __TIMEMENU_HH */ bbtime-0.1.5/blackboxstyle.hh0000644000175000001440000000317306755276644011654 // blackboxstyle.hh for bbtools. // // Copyright (c) 1998-1999 by John Kennis, jkennis@chello.nl // // 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., 675 mass ave, cambridge, ma 02139, usa. // // (see the included file copying / gpl-2.0) // #ifndef __BLACKBOXSTYLE_HH #define __BLACKBOXSTYLE_HH /* bbdate.frame */ #define BB_FRAME "toolbar" /* bbdate.label */ #define BB_LABEL "toolbar.label" /* bbdate.textColor */ #define BB_LABEL_TEXTCOLOR "toolbar.textColor" /* bbdate.bevelWidth */ #define BB_BEVELWIDTH "bevelWidth" /* bbdate.*.font */ #define BB_FONT "titleFont" /* bbmail.menu.frame */ #define BB_MENU "menu.frame" /* bbmail.menu.highlight.color */ #define BB_MENU_HIGHLIGHT_COLOR "menu.frame.highlightColor" /* bbmail.menu.textColor */ #define BB_MENU_TEXTCOLOR "menu.frame.textColor" /* bbmail.menu.highlight.textColor */ #define BB_MENU_HITEXTCOLOR "menu.frame.hiTextColor" /* bbmail.menuJustify */ #define BB_MENU_JUSTIFY "menuJustify" /* bbmail.menuFont */ #define BB_MENU_FONT "menuFont" #endif /* __BLACKBOXSTYLE_HH */ bbtime-0.1.5/BUGS0000644000175000001440000000004506713403025007116 - bbdate doesn't stay on top anymore bbtime-0.1.5/data/0000777000175000001440000000000007562705434007445 5bbtime-0.1.5/data/Makefile.in0000644000175000001440000001225207562705434011430 # Makefile.in generated automatically by automake 1.4-p5 from Makefile.am # Copyright (C) 1994, 1995-8, 1999, 2001 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. SHELL = @SHELL@ srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ bindir = @bindir@ sbindir = @sbindir@ libexecdir = @libexecdir@ datadir = @datadir@ sysconfdir = @sysconfdir@ sharedstatedir = @sharedstatedir@ localstatedir = @localstatedir@ libdir = @libdir@ infodir = @infodir@ mandir = @mandir@ includedir = @includedir@ oldincludedir = /usr/include DESTDIR = pkgdatadir = $(datadir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ top_builddir = .. ACLOCAL = @ACLOCAL@ AUTOCONF = @AUTOCONF@ AUTOMAKE = @AUTOMAKE@ AUTOHEADER = @AUTOHEADER@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ $(AM_INSTALL_PROGRAM_FLAGS) INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ transform = @program_transform_name@ NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : CC = @CC@ CXX = @CXX@ MAKEINFO = @MAKEINFO@ PACKAGE = @PACKAGE@ VERSION = @VERSION@ regex_cmd = @regex_cmd@ configdir = $(datadir)/bbtools CLEANFILES = bbtoolsrc config_DATA = bbtoolsrc.in bbtime.conf bbtime.style bbtime.nobb README.bbtime EXTRA_DIST = $(config_DATA) mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs CONFIG_CLEAN_FILES = DATA = $(config_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: 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-configDATA: $(config_DATA) @$(NORMAL_INSTALL) $(mkinstalldirs) $(DESTDIR)$(configdir) @list='$(config_DATA)'; for p in $$list; do \ if test -f $(srcdir)/$$p; then \ echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(configdir)/$$p"; \ $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(configdir)/$$p; \ else if test -f $$p; then \ echo " $(INSTALL_DATA) $$p $(DESTDIR)$(configdir)/$$p"; \ $(INSTALL_DATA) $$p $(DESTDIR)$(configdir)/$$p; \ fi; fi; \ done uninstall-configDATA: @$(NORMAL_UNINSTALL) list='$(config_DATA)'; for p in $$list; do \ rm -f $(DESTDIR)$(configdir)/$$p; \ done tags: TAGS 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 $$d/$$file $(distdir)/$$file; \ else \ test -f $(distdir)/$$file \ || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ || cp -p $$d/$$file $(distdir)/$$file || :; \ fi; \ done info-am: info: info-am dvi-am: dvi: dvi-am check-am: all-am check: check-am installcheck-am: installcheck: installcheck-am install-exec-am: install-exec: install-exec-am install-data-am: install-configDATA install-data: install-data-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am install: install-am uninstall-am: uninstall-configDATA uninstall: uninstall-am all-am: Makefile $(DATA) all-local all-redirect: all-am install-strip: $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install installdirs: $(mkinstalldirs) $(DESTDIR)$(configdir) 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: mostlyclean-am: mostlyclean-generic mostlyclean: mostlyclean-am clean-am: clean-generic mostlyclean-am clean: clean-am distclean-am: distclean-generic clean-am 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-configDATA install-configDATA 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 mostlyclean-generic distclean-generic clean-generic \ maintainer-clean-generic clean mostlyclean distclean maintainer-clean all-local: bbtoolsrc bbtoolsrc: bbtoolsrc.in @regex_cmd@ -e "s,@configdir@,$(configdir)," bbtoolsrc.in > bbtoolsrc # 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: bbtime-0.1.5/data/Makefile.am0000644000175000001440000000045306754621423011414 configdir = $(datadir)/bbtools CLEANFILES = bbtoolsrc config_DATA = bbtoolsrc.in \ bbtime.conf \ bbtime.style \ bbtime.nobb \ README.bbtime EXTRA_DIST = $(config_DATA) all-local: bbtoolsrc bbtoolsrc: bbtoolsrc.in @regex_cmd@ -e "s,@configdir@,$(configdir)," bbtoolsrc.in > bbtoolsrc bbtime-0.1.5/data/bbtoolsrc.in0000644000175000001440000000020406754621503011672 bbtools.colorsPerChannel: 4 bbtools.imageDither: False bbtime.styleFile: @configdir@/bbtime.nobb bbtime-0.1.5/data/bbtime.conf0000644000175000001440000000237406755762035011503 !********************************************************************** !** bbtime.config Configuration file for bbtime ** !********************************************************************** ! ** auto reconfigure when config-file has changed ** bbtime.autoConfig: false !** position of bbtime window ** bbtime.position: +0-0 !** bbtime on top of other windows ** bbtime.raised: True !** place bbtime in the slit ** !bbtime.withdrawn: True !** don't show frame ** !bbtime.shape: True !** define label style ** !bbtime.transparent: True !bbtime.strftimeFormat: %I:%M %p !** if you have no strftime: ** !** use european style dd/mm/yy ** !bbtime.show.euStyle: True !** use 24 hour clock ** !bbtime.show.clock24Hour: True !** name (put in front of the time in the menu) of own time !bbtime.my.name: \me !** the number of different times !** name (put in front of the time in the menu) and time difference !** to your own time ** !bbtime.numberOf.friends: 0 !bbtime.friend.1.name: name1 !bbtime.friend.1.offset: -6:00 !bbtime.friend.2.name: name2 !bbtime.friend.2.offset: +1:00 bbtime-0.1.5/data/bbtime.style0000644000175000001440000000146406755755471011723 !********************************************************************** !** bbtime.style Style file for bbtime ** !********************************************************************** !** position of bbtime window ** bbtime.position: +0-0 bbtime.bevelWidth: 4 ! font which determines the height (compatible with blackbox) bbtime.heightBy.font: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* !** label font ** bbtime.labelFont: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* !** define frame style ** bbtime.frame: Raised Gradient Vertical Bevel1 bbtime.frame.color: gray45 bbtime.frame.colorTo: gray21 !** define label style ** bbtime.label: Sunken Gradient Vertical Bevel1 bbtime.label.color: gray45 bbtime.label.colorTo: gray21 !** text color date ** bbtime.textColor: lightgrey bbtime-0.1.5/data/bbtime.nobb0000644000175000001440000000327206755762032011471 !********************************************************************** !** bbtime.nobb: Style file for bbtime when not using Blackbox ** !********************************************************************** ! ** auto reconfigure when config-file has changed ** bbtime.autoConfig: false !** position of bbtime window ** bbtime.position: +0-0 bbtime.bevelWidth: 4 !** place bbtime in the slit ** !bbtime.withdrawn: True !** don't show frame ** !bbtime.shape: True !** bbtime on top of other windows ** bbtime.raised: True !bbtime.strftimeFormat: %I:%M %p !** if you have no strftime: ** !** use european style dd/mm/yy ** !bbtime.show.euStyle: True !** use 24 hour clock ** !bbtime.show.clock24Hour: True !** name (put in front of the time in the menu) of own time !bbtime.my.name: \me !** the number of different times !** name (put in front of the time in the menu) and time difference !** to your own time ** !bbtime.numberOf.friends: 0 !bbtime.friend.1.name: name1 !bbtime.friend.1.offset: -6:00 !bbtime.friend.2.name: name2 !bbtime.friend.2.offset: +1:00 ! font which determines the height (compatible with blackbox) bbtime.heightBy.font: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* !** label font ** bbtime.labelFont: -*-helvetica-medium-r-*-*-*-120-*-*-*-*-*-* !** define frame style ** bbtime.frame: Raised Gradient Vertical Bevel1 bbtime.frame.color: gray45 bbtime.frame.colorTo: gray21 !** define label style ** !bbtime.transparent: True bbtime.label: Sunken Gradient Vertical Bevel1 bbtime.label.color: gray45 bbtime.label.colorTo: gray21 !** text color date ** bbtime.textColor: lightgrey bbtime-0.1.5/data/README.bbtime0000644000175000001440000000475106754621373011512 This file gives a short description of the configuration possibilities of bbtime. ** Configuring bbtime ** ------------------------ Blackbox users: By default bbtime reads the Blackbox style-file as defined in .blackboxrc and copies as much of the style as possible. The result is a application which looks a lot like the toolbar. Further configuration options can be found in bbtime.style. Most likely you want to change these options, copy this file to somewhere in your homedir (eg blackbox/bbtime.config) and edit it. Edit the file .blackboxrc and add or edit the line: bbtime.configFile: WARNING: You have to define the entire PATH. All style options set be reading the Blackbox-style file can be overridden by placing them in bbtime.config (and changing them). See bbtime.style for all possible options. Make sure the file .bbtoolsrc does not exist, else the configuration style for other Window Managers will be used. Users other Window managers: By default bbtime reads the bbtoolsrc and bbtime.nobb config files. If you want to define your personal config-file copy bbtoolsrc to your homedir as ./.bbtoolsrc Copy bbtime.nobb somewhere in your homedir. Edit .bbtoolsrc so bbtime.configFile: . WARNING: You have to define the entire PATH. ** Reconfigure bbtime.** ------------------------ Automatic update style: If the resource : bbtimel.autoConfig: true The tool will periodically check if the main config files, .blackboxrc for Blackbox users and .btoolsrc for other WM's to see if they have changed. If so bbtime will reconfigure. For blackbox users this means they have to restart for a style change in blackbox will take effect for bbtime. Update by hand: The second way you can let bbtime reconfigure is pressing the right mouse-button on the envelope. ** Copying the look of the Blackbox toolbar ** ---------------------------------------------- bbtime automaticly copes the style of the blackbox toolbar. It copies: toolbar -> bbtime.frame toolbar.label -> bbtime.label toolbar.color -> bbtime.frame.color toolbar.colorTo -> bbtime.frame.colorTo toolbar.label.color -> bbtime.label.color toolbar.label.colorTo -> bbtime.label.colorTo toolbar.textColor -> bbtime..textColor bevelWidth -> bbtime.bevelWidth WARNING: if .bbtoolsrc is defined it won't copy the blackbox style. For the meaning of the different resources see the comments in the config-files.