diff options
Diffstat (limited to 'apps')
128 files changed, 33796 insertions, 0 deletions
diff --git a/apps/Makefile.in b/apps/Makefile.in new file mode 100644 index 0000000..e23a3c6 --- /dev/null +++ b/apps/Makefile.in @@ -0,0 +1,360 @@ +# Makefile.in generated by automake 1.6.2 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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. + +@SET_MAKE@ +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 +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = .. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CURL_LIBS = @CURL_LIBS@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +GENCCODE = @GENCCODE@ +GENCMN = @GENCMN@ +GENRB = @GENRB@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +PACKAGE = @PACKAGE@ +PKGDATA = @PKGDATA@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +dir_confdef = @dir_confdef@ +enable_debug = @enable_debug@ +enable_profile = @enable_profile@ +install_sh = @install_sh@ +target_cpu = @target_cpu@ +target_mingw32 = @target_mingw32@ +target_os = @target_os@ +target_system = @target_system@ +target_vendor = @target_vendor@ +with_conf = @with_conf@ +with_icu = @with_icu@ +with_zlib = @with_zlib@ +AUTOMAKE_OPTIONS = 1.6 + +SUBDIRS = console +subdir = apps +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu apps/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# 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. +$(RECURSIVE_TARGETS): + @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; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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 + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(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) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = .. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive distclean \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ + info-recursive install install-am install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ + tags tags-recursive uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/X11/InstallMgr/ABOUT-NLS b/apps/X11/InstallMgr/ABOUT-NLS new file mode 100644 index 0000000..28d38c7 --- /dev/null +++ b/apps/X11/InstallMgr/ABOUT-NLS @@ -0,0 +1,226 @@ +Notes on the Free Translation Project +************************************* + + Free software is going international! The Free Translation Project +is a way to get maintainers of free software, translators, and users all +together, so that will gradually become able to speak many languages. +A few packages already provide translations for their messages. + + If you found this `ABOUT-NLS' file inside a distribution, you may +assume that the distributed package does use GNU `gettext' internally, +itself available at your nearest GNU archive site. But you do *not* +need to install GNU `gettext' prior to configuring, installing or using +this package with messages translated. + + Installers will find here some useful hints. These notes also +explain how users should proceed for getting the programs to use the +available translations. They tell how people wanting to contribute and +work at translations should contact the appropriate team. + + When reporting bugs in the `intl/' directory or bugs which may be +related to internationalization, you should tell about the version of +`gettext' which is used. The information can be found in the +`intl/VERSION' file, in internationalized packages. + +One advise in advance +===================== + + If you want to exploit the full power of internationalization, you +should configure it using + + ./configure --with-included-gettext + +to force usage of internationalizing routines provided within this +package, despite the existence of internationalizing capabilities in the +operating system where this package is being installed. So far, only +the `gettext' implementation in the GNU C library version 2 provides as +many features (such as locale alias or message inheritance) as the +implementation here. It is also not possible to offer this additional +functionality on top of a `catgets' implementation. Future versions of +GNU `gettext' will very likely convey even more functionality. So it +might be a good idea to change to GNU `gettext' as soon as possible. + + So you need not provide this option if you are using GNU libc 2 or +you have installed a recent copy of the GNU gettext package with the +included `libintl'. + +INSTALL Matters +=============== + + Some packages are "localizable" when properly installed; the +programs they contain can be made to speak your own native language. +Most such packages use GNU `gettext'. Other packages have their own +ways to internationalization, predating GNU `gettext'. + + By default, this package will be installed to allow translation of +messages. It will automatically detect whether the system provides +usable `catgets' (if using this is selected by the installer) or +`gettext' functions. If neither is available, the GNU `gettext' own +library will be used. This library is wholly contained within this +package, usually in the `intl/' subdirectory, so prior installation of +the GNU `gettext' package is *not* required. Installers may use +special options at configuration time for changing the default +behaviour. The commands: + + ./configure --with-included-gettext + ./configure --with-catgets + ./configure --disable-nls + +will respectively bypass any pre-existing `catgets' or `gettext' to use +the internationalizing routines provided within this package, enable +the use of the `catgets' functions (if found on the locale system), or +else, *totally* disable translation of messages. + + When you already have GNU `gettext' installed on your system and run +configure without an option for your new package, `configure' will +probably detect the previously built and installed `libintl.a' file and +will decide to use this. This might be not what is desirable. You +should use the more recent version of the GNU `gettext' library. I.e. +if the file `intl/VERSION' shows that the library which comes with this +package is more recent, you should use + + ./configure --with-included-gettext + +to prevent auto-detection. + + By default the configuration process will not test for the `catgets' +function and therefore they will not be used. The reasons are already +given above: the emulation on top of `catgets' cannot provide all the +extensions provided by the GNU `gettext' library. If you nevertheless +want to use the `catgets' functions use + + ./configure --with-catgets + +to enable the test for `catgets' (this causes no harm if `catgets' is +not available on your system). If you really select this option we +would like to hear about the reasons because we cannot think of any +good one ourself. + + Internationalized packages have usually many `po/LL.po' files, where +LL gives an ISO 639 two-letter code identifying the language. Unless +translations have been forbidden at `configure' time by using the +`--disable-nls' switch, all available translations are installed +together with the package. However, the environment variable `LINGUAS' +may be set, prior to configuration, to limit the installed set. +`LINGUAS' should then contain a space separated list of two-letter +codes, stating which languages are allowed. + +Using This Package +================== + + As a user, if your language has been installed for this package, you +only have to set the `LANG' environment variable to the appropriate +ISO 639 `LL' two-letter code prior to using the programs in the +package. For example, let's suppose that you speak German. At the +shell prompt, merely execute `setenv LANG de' (in `csh'), +`export LANG; LANG=de' (in `sh') or `export LANG=de' (in `bash'). This +can be done from your `.login' or `.profile' file, once and for all. + + An operating system might already offer message localization for +many of its programs, while other programs have been installed locally +with the full capabilities of GNU `gettext'. Just using `gettext' +extended syntax for `LANG' would break proper localization of already +available operating system programs. In this case, users should set +both `LANGUAGE' and `LANG' variables in their environment, as programs +using GNU `gettext' give preference to `LANGUAGE'. For example, some +Swedish users would rather read translations in German than English for +when Swedish is not available. This is easily accomplished by setting +`LANGUAGE' to `sv:de' while leaving `LANG' to `sv'. + +Translating Teams +================= + + For the Free Translation Project to be a success, we need interested +people who like their own language and write it well, and who are also +able to synergize with other translators speaking the same language. +Each translation team has its own mailing list, courtesy of Linux +International. You may reach your translation team at the address +`LL@li.org', replacing LL by the two-letter ISO 639 code for your +language. Language codes are *not* the same as the country codes given +in ISO 3166. The following translation teams exist, as of December +1997: + + Chinese `zh', Czech `cs', Danish `da', Dutch `nl', English `en', + Esperanto `eo', Finnish `fi', French `fr', German `de', Hungarian + `hu', Irish `ga', Italian `it', Indonesian `id', Japanese `ja', + Korean `ko', Latin `la', Norwegian `no', Persian `fa', Polish + `pl', Portuguese `pt', Russian `ru', Slovenian `sl', Spanish `es', + Swedish `sv', and Turkish `tr'. + +For example, you may reach the Chinese translation team by writing to +`zh@li.org'. + + If you'd like to volunteer to *work* at translating messages, you +should become a member of the translating team for your own language. +The subscribing address is *not* the same as the list itself, it has +`-request' appended. For example, speakers of Swedish can send a +message to `sv-request@li.org', having this message body: + + subscribe + + Keep in mind that team members are expected to participate +*actively* in translations, or at solving translational difficulties, +rather than merely lurking around. If your team does not exist yet and +you want to start one, or if you are unsure about what to do or how to +get started, please write to `translation@iro.umontreal.ca' to reach the +coordinator for all translator teams. + + The English team is special. It works at improving and uniformizing +the terminology in use. Proven linguistic skill are praised more than +programming skill, here. + +Available Packages +================== + + Languages are not equally supported in all packages. The following +matrix shows the current state of internationalization, as of December +1997. The matrix shows, in regard of each package, for which languages +PO files have been submitted to translation coordination. + + Ready PO files cs da de en es fi fr it ja ko nl no pl pt ru sl sv + .----------------------------------------------------. + bash | [] [] [] | 3 + bison | [] [] [] | 3 + clisp | [] [] [] [] | 4 + cpio | [] [] [] [] [] [] | 6 + diffutils | [] [] [] [] [] | 5 + enscript | [] [] [] [] [] [] | 6 + fileutils | [] [] [] [] [] [] [] [] [] [] | 10 + findutils | [] [] [] [] [] [] [] [] [] | 9 + flex | [] [] [] [] | 4 + gcal | [] [] [] [] [] | 5 + gettext | [] [] [] [] [] [] [] [] [] [] [] | 12 + grep | [] [] [] [] [] [] [] [] [] [] | 10 + hello | [] [] [] [] [] [] [] [] [] [] [] | 11 + id-utils | [] [] [] | 3 + indent | [] [] [] [] [] | 5 + libc | [] [] [] [] [] [] [] | 7 + m4 | [] [] [] [] [] [] | 6 + make | [] [] [] [] [] [] | 6 + music | [] [] | 2 + ptx | [] [] [] [] [] [] [] [] | 8 + recode | [] [] [] [] [] [] [] [] [] | 9 + sh-utils | [] [] [] [] [] [] [] [] | 8 + sharutils | [] [] [] [] [] [] | 6 + tar | [] [] [] [] [] [] [] [] [] [] [] | 11 + texinfo | [] [] [] | 3 + textutils | [] [] [] [] [] [] [] [] [] | 9 + wdiff | [] [] [] [] [] [] [] [] | 8 + `----------------------------------------------------' + 17 languages cs da de en es fi fr it ja ko nl no pl pt ru sl sv + 27 packages 6 4 25 1 18 1 26 2 1 12 20 9 19 7 4 7 17 179 + + Some counters in the preceding matrix are higher than the number of +visible blocks let us expect. This is because a few extra PO files are +used for implementing regional variants of languages, or language +dialects. + + For a PO file in the matrix above to be effective, the package to +which it applies should also have been internationalized and +distributed as such by its maintainer. There might be an observable +lag between the mere existence a PO file and its wide availability in a +distribution. + + If December 1997 seems to be old, you may fetch a more recent copy +of this `ABOUT-NLS' file on most GNU archive sites. + diff --git a/apps/X11/InstallMgr/ChangeLog b/apps/X11/InstallMgr/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/apps/X11/InstallMgr/ChangeLog diff --git a/apps/X11/InstallMgr/Makefile.am b/apps/X11/InstallMgr/Makefile.am new file mode 100644 index 0000000..6adb3cc --- /dev/null +++ b/apps/X11/InstallMgr/Makefile.am @@ -0,0 +1,25 @@ +## Process this file with automake to produce Makefile.in + +SUBDIRS = intl po macros vcl src + +install-data-local: + @$(NORMAL_INSTALL) + if test -d $(srcdir)/pixmaps; then \ + $(mkinstalldirs) $(DESTDIR)@PACKAGE_PIXMAPS_DIR@; \ + for pixmap in $(srcdir)/pixmaps/*; do \ + if test -f $$pixmap; then \ + $(INSTALL_DATA) $$pixmap $(DESTDIR)@PACKAGE_PIXMAPS_DIR@; \ + fi \ + done \ + fi + +dist-hook: + if test -d pixmaps; then \ + mkdir $(distdir)/pixmaps; \ + for pixmap in pixmaps/*; do \ + if test -f $$pixmap; then \ + cp -p $$pixmap $(distdir)/pixmaps; \ + fi \ + done \ + fi + diff --git a/apps/X11/InstallMgr/Makefile.in b/apps/X11/InstallMgr/Makefile.in new file mode 100644 index 0000000..8479c97 --- /dev/null +++ b/apps/X11/InstallMgr/Makefile.in @@ -0,0 +1,424 @@ +# 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CXX = @CXX@ +DATADIRNAME = @DATADIRNAME@ +GENCAT = @GENCAT@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOMEGNORBA_LIBS = @GNOMEGNORBA_LIBS@ +GNOMEUI_LIBS = @GNOMEUI_LIBS@ +GNOME_APPLETS_LIBS = @GNOME_APPLETS_LIBS@ +GNOME_CAPPLET_LIBS = @GNOME_CAPPLET_LIBS@ +GNOME_CONFIG = @GNOME_CONFIG@ +GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ +GNOME_LIBDIR = @GNOME_LIBDIR@ +GNOME_LIBS = @GNOME_LIBS@ +GNORBA_CFLAGS = @GNORBA_CFLAGS@ +GNORBA_LIBS = @GNORBA_LIBS@ +GTKXMHTML_LIBS = @GTKXMHTML_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +ORBIT_CFLAGS = @ORBIT_CFLAGS@ +ORBIT_CONFIG = @ORBIT_CONFIG@ +ORBIT_IDL = @ORBIT_IDL@ +ORBIT_LIBS = @ORBIT_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_PIXMAPS_DIR = @PACKAGE_PIXMAPS_DIR@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PTHREAD_LIB = @PTHREAD_LIB@ +RANLIB = @RANLIB@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XPM_LIBS = @XPM_LIBS@ +ZVT_LIBS = @ZVT_LIBS@ +cflags_set = @cflags_set@ +cxxflags_set = @cxxflags_set@ + +SUBDIRS = intl po macros vcl src +ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = config.h +CONFIG_CLEAN_FILES = +DIST_COMMON = README ./stamp-h.in ABOUT-NLS AUTHORS COPYING ChangeLog \ +INSTALL Makefile.am Makefile.in NEWS acconfig.h aclocal.m4 config.guess \ +config.h.in config.sub configure configure.in install-sh missing \ +mkinstalldirs + + +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 Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + 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) + +config.h: stamp-h + @if test ! -f $@; then \ + rm -f stamp-h; \ + $(MAKE) stamp-h; \ + else :; fi +stamp-h: $(srcdir)/config.h.in $(top_builddir)/config.status + cd $(top_builddir) \ + && CONFIG_FILES= CONFIG_HEADERS=config.h \ + $(SHELL) ./config.status + @echo timestamp > stamp-h 2> /dev/null +$(srcdir)/config.h.in: $(srcdir)/stamp-h.in + @if test ! -f $@; then \ + rm -f $(srcdir)/stamp-h.in; \ + $(MAKE) $(srcdir)/stamp-h.in; \ + else :; fi +$(srcdir)/stamp-h.in: $(top_srcdir)/configure.in $(ACLOCAL_M4) acconfig.h + cd $(top_srcdir) && $(AUTOHEADER) + @echo timestamp > $(srcdir)/stamp-h.in 2> /dev/null + +mostlyclean-hdr: + +clean-hdr: + +distclean-hdr: + -rm -f config.h + +maintainer-clean-hdr: + +# This directory's subdirectories are mostly independent; you can cd +# into them and run `make' without going through this Makefile. +# To change the values of `make' variables: instead of editing Makefiles, +# (1) if the variable is set in `config.status', edit `config.status' +# (which will cause the Makefiles to be regenerated when you run `make'); +# (2) otherwise, pass the desired values on the `make' command line. + +@SET_MAKE@ + +all-recursive install-data-recursive install-exec-recursive \ +installdirs-recursive install-recursive uninstall-recursive \ +check-recursive installcheck-recursive info-recursive dvi-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + target=`echo $@ | sed s/-recursive//`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + dot_seen=yes; \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done; \ + if test "$$dot_seen" = "no"; then \ + $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ + fi; test -z "$$fail" + +mostlyclean-recursive clean-recursive distclean-recursive \ +maintainer-clean-recursive: + @set fnord $(MAKEFLAGS); amf=$$2; \ + dot_seen=no; \ + rev=''; list='$(SUBDIRS)'; for subdir in $$list; do \ + rev="$$subdir $$rev"; \ + test "$$subdir" != "." || dot_seen=yes; \ + done; \ + test "$$dot_seen" = "no" && rev=". $$rev"; \ + target=`echo $@ | sed s/-recursive//`; \ + for subdir in $$rev; do \ + echo "Making $$target in $$subdir"; \ + if test "$$subdir" = "."; then \ + local_target="$$target-am"; \ + else \ + local_target="$$target"; \ + fi; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ + || case "$$amf" in *=*) exit 1;; *k*) fail=yes;; *) exit 1;; esac; \ + done && test -z "$$fail" +tags-recursive: + list='$(SUBDIRS)'; for subdir in $$list; do \ + test "$$subdir" = . || (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \ + done + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -f $$subdir/TAGS && tags="$$tags -i $$here/$$subdir/TAGS"; \ + fi; \ + done; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)config.h.in$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags config.h.in $$unique $(LISP)) + +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 --with-included-gettext --srcdir=.. --prefix=$$dc_install_base \ + && $(MAKE) $(AM_MAKEFLAGS) \ + && $(MAKE) $(AM_MAKEFLAGS) dvi \ + && $(MAKE) $(AM_MAKEFLAGS) check \ + && $(MAKE) $(AM_MAKEFLAGS) install \ + && $(MAKE) $(AM_MAKEFLAGS) installcheck \ + && $(MAKE) $(AM_MAKEFLAGS) dist + -rm -rf $(distdir) + @banner="$(distdir).tar.gz is ready for distribution"; \ + dashes=`echo "$$banner" | sed s/./=/g`; \ + echo "$$dashes"; \ + echo "$$banner"; \ + echo "$$dashes" +dist: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +dist-all: distdir + -chmod -R a+r $(distdir) + GZIP=$(GZIP_ENV) $(TAR) chozf $(distdir).tar.gz $(distdir) + -rm -rf $(distdir) +distdir: $(DISTFILES) + -rm -rf $(distdir) + mkdir $(distdir) + -chmod 777 $(distdir) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + for subdir in $(SUBDIRS); do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + chmod 777 $(distdir)/$$subdir; \ + (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir=../$(distdir) distdir=../$(distdir)/$$subdir distdir) \ + || exit 1; \ + fi; \ + done + $(MAKE) $(AM_MAKEFLAGS) top_distdir="$(top_distdir)" distdir="$(distdir)" dist-hook +info-am: +info: info-recursive +dvi-am: +dvi: dvi-recursive +check-am: all-am +check: check-recursive +installcheck-am: +installcheck: installcheck-recursive +all-recursive-am: config.h + $(MAKE) $(AM_MAKEFLAGS) all-recursive + +install-exec-am: +install-exec: install-exec-recursive + +install-data-am: install-data-local +install-data: install-data-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-recursive +uninstall-am: +uninstall: uninstall-recursive +all-am: Makefile config.h +all-redirect: all-recursive-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: installdirs-recursive +installdirs-am: + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-hdr mostlyclean-tags mostlyclean-generic + +mostlyclean: mostlyclean-recursive + +clean-am: clean-hdr clean-tags clean-generic mostlyclean-am + +clean: clean-recursive + +distclean-am: distclean-hdr distclean-tags distclean-generic clean-am + +distclean: distclean-recursive + -rm -f config.status + +maintainer-clean-am: maintainer-clean-hdr maintainer-clean-tags \ + maintainer-clean-generic distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-recursive + -rm -f config.status + +.PHONY: mostlyclean-hdr distclean-hdr clean-hdr maintainer-clean-hdr \ +install-data-recursive uninstall-data-recursive install-exec-recursive \ +uninstall-exec-recursive installdirs-recursive uninstalldirs-recursive \ +all-recursive check-recursive installcheck-recursive info-recursive \ +dvi-recursive mostlyclean-recursive distclean-recursive clean-recursive \ +maintainer-clean-recursive tags tags-recursive mostlyclean-tags \ +distclean-tags clean-tags maintainer-clean-tags distdir info-am info \ +dvi-am dvi check check-am installcheck-am installcheck all-recursive-am \ +install-exec-am install-exec install-data-local 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 + + +install-data-local: + @$(NORMAL_INSTALL) + if test -d $(srcdir)/pixmaps; then \ + $(mkinstalldirs) $(DESTDIR)@PACKAGE_PIXMAPS_DIR@; \ + for pixmap in $(srcdir)/pixmaps/*; do \ + if test -f $$pixmap; then \ + $(INSTALL_DATA) $$pixmap $(DESTDIR)@PACKAGE_PIXMAPS_DIR@; \ + fi \ + done \ + fi + +dist-hook: + if test -d pixmaps; then \ + mkdir $(distdir)/pixmaps; \ + for pixmap in pixmaps/*; do \ + if test -f $$pixmap; then \ + cp -p $$pixmap $(distdir)/pixmaps; \ + fi \ + done \ + fi + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/X11/InstallMgr/aclocal.m4 b/apps/X11/InstallMgr/aclocal.m4 new file mode 100644 index 0000000..3c6c894 --- /dev/null +++ b/apps/X11/InstallMgr/aclocal.m4 @@ -0,0 +1,1424 @@ +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)]) + +# Like AC_CONFIG_HEADER, but automatically create stamp file. + +AC_DEFUN([AM_CONFIG_HEADER], +[AC_PREREQ([2.12]) +AC_CONFIG_HEADER([$1]) +dnl When config.status generates a header, we must update the stamp-h file. +dnl This file resides in the same directory as the config header +dnl that is generated. We must strip everything past the first ":", +dnl and everything past the last "/". +AC_OUTPUT_COMMANDS(changequote(<<,>>)dnl +ifelse(patsubst(<<$1>>, <<[^ ]>>, <<>>), <<>>, +<<test -z "<<$>>CONFIG_HEADERS" || echo timestamp > patsubst(<<$1>>, <<^\([^:]*/\)?.*>>, <<\1>>)stamp-h<<>>dnl>>, +<<am_indx=1 +for am_file in <<$1>>; do + case " <<$>>CONFIG_HEADERS " in + *" <<$>>am_file "*<<)>> + echo timestamp > `echo <<$>>am_file | sed -e 's%:.*%%' -e 's%[^/]*$%%'`stamp-h$am_indx + ;; + esac + am_indx=`expr "<<$>>am_indx" + 1` +done<<>>dnl>>) +changequote([,]))]) + +# aclocal-include.m4 +# +# This macro adds the name macrodir to the set of directories +# that `aclocal' searches for macros. + +# serial 1 + +dnl AM_ACLOCAL_INCLUDE(macrodir) +AC_DEFUN([AM_ACLOCAL_INCLUDE], +[ + AM_CONDITIONAL(INSIDE_GNOME_COMMON, test x = y) + + test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" + + for k in $1 ; do ACLOCAL="$ACLOCAL -I $k" ; done +]) + +# Define a conditional. + +AC_DEFUN([AM_CONDITIONAL], +[AC_SUBST($1_TRUE) +AC_SUBST($1_FALSE) +if $2; then + $1_TRUE= + $1_FALSE='#' +else + $1_TRUE='#' + $1_FALSE= +fi]) + +dnl +dnl GNOME_INIT_HOOK (script-if-gnome-enabled, [failflag], [additional-inits]) +dnl +dnl if failflag is "fail" then GNOME_INIT_HOOK will abort if gnomeConf.sh +dnl is not found. +dnl + +AC_DEFUN([GNOME_INIT_HOOK],[ + AC_SUBST(GNOME_LIBS) + AC_SUBST(GNOMEUI_LIBS) + AC_SUBST(GNOMEGNORBA_LIBS) + AC_SUBST(GTKXMHTML_LIBS) + AC_SUBST(ZVT_LIBS) + AC_SUBST(GNOME_LIBDIR) + AC_SUBST(GNOME_INCLUDEDIR) + + AC_ARG_WITH(gnome-includes, + [ --with-gnome-includes Specify location of GNOME headers],[ + CFLAGS="$CFLAGS -I$withval" + ]) + + AC_ARG_WITH(gnome-libs, + [ --with-gnome-libs Specify location of GNOME libs],[ + LDFLAGS="$LDFLAGS -L$withval" + gnome_prefix=$withval + ]) + + AC_ARG_WITH(gnome, + [ --with-gnome Specify prefix for GNOME files], + if test x$withval = xyes; then + want_gnome=yes + dnl Note that an empty true branch is not + dnl valid sh syntax. + ifelse([$1], [], :, [$1]) + else + if test "x$withval" = xno; then + want_gnome=no + else + want_gnome=yes + LDFLAGS="$LDFLAGS -L$withval/lib" + CFLAGS="$CFLAGS -I$withval/include" + gnome_prefix=$withval/lib + fi + fi, + want_gnome=yes) + + if test "x$want_gnome" = xyes; then + + AC_PATH_PROG(GNOME_CONFIG,gnome-config,no) + if test "$GNOME_CONFIG" = "no"; then + no_gnome_config="yes" + else + AC_MSG_CHECKING(if $GNOME_CONFIG works) + if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then + AC_MSG_RESULT(yes) + GNOME_GNORBA_HOOK([],$2) + GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" + GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" + GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`" + GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`" + ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`" + GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" + GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" + $1 + else + AC_MSG_RESULT(no) + no_gnome_config="yes" + fi + fi + + if test x$exec_prefix = xNONE; then + if test x$prefix = xNONE; then + gnome_prefix=$ac_default_prefix/lib + else + gnome_prefix=$prefix/lib + fi + else + gnome_prefix=`eval echo \`echo $libdir\`` + fi + + if test "$no_gnome_config" = "yes"; then + AC_MSG_CHECKING(for gnomeConf.sh file in $gnome_prefix) + if test -f $gnome_prefix/gnomeConf.sh; then + AC_MSG_RESULT(found) + echo "loading gnome configuration from" \ + "$gnome_prefix/gnomeConf.sh" + . $gnome_prefix/gnomeConf.sh + $1 + else + AC_MSG_RESULT(not found) + if test x$2 = xfail; then + AC_MSG_ERROR(Could not find the gnomeConf.sh file that is generated by gnome-libs install) + fi + fi + fi + fi + + if test -n "$3"; then + n="$3" + for i in $n; do + AC_MSG_CHECKING(extra library \"$i\") + case $i in + applets) + AC_SUBST(GNOME_APPLETS_LIBS) + GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets` + AC_MSG_RESULT($GNOME_APPLETS_LIBS);; + capplet) + AC_SUBST(GNOME_CAPPLET_LIBS) + GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet` + AC_MSG_RESULT($GNOME_CAPPLET_LIBS);; + *) + AC_MSG_RESULT(unknown library) + esac + done + fi +]) + +dnl +dnl GNOME_INIT ([additional-inits]) +dnl + +AC_DEFUN([GNOME_INIT],[ + GNOME_INIT_HOOK([],fail,$1) +]) + +dnl +dnl GNOME_GNORBA_HOOK (script-if-gnorba-found, failflag) +dnl +dnl if failflag is "failure" it aborts if gnorba is not found. +dnl + +AC_DEFUN([GNOME_GNORBA_HOOK],[ + GNOME_ORBIT_HOOK([],$2) + AC_CACHE_CHECK([for gnorba libraries],gnome_cv_gnorba_found,[ + gnome_cv_gnorba_found=no + if test x$gnome_cv_orbit_found = xyes; then + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + if test -n "$GNORBA_LIBS"; then + gnome_cv_gnorba_found=yes + fi + fi + ]) + AM_CONDITIONAL(HAVE_GNORBA, test x$gnome_cv_gnorba_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + AC_SUBST(GNORBA_CFLAGS) + AC_SUBST(GNORBA_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(gnorba library not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_GNORBA_CHECK], [ + GNOME_GNORBA_HOOK([],failure) +]) + +dnl +dnl GNOME_ORBIT_HOOK (script-if-orbit-found, failflag) +dnl +dnl if failflag is "failure" it aborts if orbit is not found. +dnl + +AC_DEFUN([GNOME_ORBIT_HOOK],[ + AC_PATH_PROG(ORBIT_CONFIG,orbit-config,no) + AC_PATH_PROG(ORBIT_IDL,orbit-idl,no) + AC_CACHE_CHECK([for working ORBit environment],gnome_cv_orbit_found,[ + if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then + gnome_cv_orbit_found=no + else + gnome_cv_orbit_found=yes + fi + ]) + AM_CONDITIONAL(HAVE_ORBIT, test x$gnome_cv_orbit_found = xyes) + if test x$gnome_cv_orbit_found = xyes; then + $1 + ORBIT_CFLAGS=`orbit-config --cflags client server` + ORBIT_LIBS=`orbit-config --use-service=name --libs client server` + AC_SUBST(ORBIT_CFLAGS) + AC_SUBST(ORBIT_LIBS) + else + if test x$2 = xfailure; then + AC_MSG_ERROR(ORBit not installed or installation problem) + fi + fi +]) + +AC_DEFUN([GNOME_ORBIT_CHECK], [ + GNOME_ORBIT_HOOK([],failure) +]) + +#serial 1 +# This test replaces the one in autoconf. +# Currently this macro should have the same name as the autoconf macro +# because gettext's gettext.m4 (distributed in the automake package) +# still uses it. Otherwise, the use in gettext.m4 makes autoheader +# give these diagnostics: +# configure.in:556: AC_TRY_COMPILE was called before AC_ISC_POSIX +# configure.in:556: AC_TRY_RUN was called before AC_ISC_POSIX + +undefine([AC_ISC_POSIX]) + +AC_DEFUN([AC_ISC_POSIX], + [ + dnl This test replaces the obsolescent AC_ISC_POSIX kludge. + AC_CHECK_LIB(cposix, strerror, [LIBS="$LIBS -lcposix"]) + ] +) + + +# serial 1 + +# @defmac AC_PROG_CC_STDC +# @maindex PROG_CC_STDC +# @ovindex CC +# If the C compiler in not in ANSI C mode by default, try to add an option +# to output variable @code{CC} to make it so. This macro tries various +# options that select ANSI C on some system or another. It considers the +# compiler to be in ANSI C mode if it handles function prototypes correctly. +# +# If you use this macro, you should check after calling it whether the C +# compiler has been set to accept ANSI C; if not, the shell variable +# @code{am_cv_prog_cc_stdc} is set to @samp{no}. If you wrote your source +# code in ANSI C, you can make an un-ANSIfied copy of it by using the +# program @code{ansi2knr}, which comes with Ghostscript. +# @end defmac + +AC_DEFUN([AM_PROG_CC_STDC], +[AC_REQUIRE([AC_PROG_CC]) +AC_BEFORE([$0], [AC_C_INLINE]) +AC_BEFORE([$0], [AC_C_CONST]) +dnl Force this before AC_PROG_CPP. Some cpp's, eg on HPUX, require +dnl a magic option to avoid problems with ANSI preprocessor commands +dnl like #elif. +dnl FIXME: can't do this because then AC_AIX won't work due to a +dnl circular dependency. +dnl AC_BEFORE([$0], [AC_PROG_CPP]) +AC_MSG_CHECKING(for ${CC-cc} option to accept ANSI C) +AC_CACHE_VAL(am_cv_prog_cc_stdc, +[am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + AC_TRY_COMPILE( +[#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; +], [ +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +], +[am_cv_prog_cc_stdc="$ac_arg"; break]) +done +CC="$ac_save_CC" +]) +if test -z "$am_cv_prog_cc_stdc"; then + AC_MSG_RESULT([none needed]) +else + AC_MSG_RESULT($am_cv_prog_cc_stdc) +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac +]) + +dnl GNOME_COMPILE_WARNINGS +dnl Turn on many useful compiler warnings +dnl For now, only works on GCC +AC_DEFUN([GNOME_COMPILE_WARNINGS],[ + AC_ARG_ENABLE(compile-warnings, + [ --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_compile_warnings=minimum) + + AC_MSG_CHECKING(what warning flags to pass to the C compiler) + warnCFLAGS= + if test "x$GCC" != xyes; then + enable_compile_warnings=no + fi + + if test "x$enable_compile_warnings" != "xno"; then + if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *[\ \ ]-Wall[\ \ ]*) ;; + *) warnCFLAGS="-Wall -Wunused" ;; + esac + + ## -W is not all that useful. And it cannot be controlled + ## with individual -Wno-xxx flags, unlike -Wall + if test "x$enable_compile_warnings" = "xyes"; then + warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations" + fi + fi + fi + AC_MSG_RESULT($warnCFLAGS) + + AC_ARG_ENABLE(iso-c, + [ --enable-iso-c Try to warn if code is not ISO C ],, + enable_iso_c=no) + + AC_MSG_CHECKING(what language compliance flags to pass to the C compiler) + complCFLAGS= + if test "x$enable_iso_c" != "xno"; then + if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *[\ \ ]-ansi[\ \ ]*) ;; + *) complCFLAGS="$complCFLAGS -ansi" ;; + esac + + case " $CFLAGS " in + *[\ \ ]-pedantic[\ \ ]*) ;; + *) complCFLAGS="$complCFLAGS -pedantic" ;; + esac + fi + fi + AC_MSG_RESULT($complCFLAGS) + if test "x$cflags_set" != "xyes"; then + CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS" + cflags_set=yes + AC_SUBST(cflags_set) + fi +]) + +dnl For C++, do basically the same thing. + +AC_DEFUN([GNOME_CXX_WARNINGS],[ + AC_ARG_ENABLE(cxx-warnings, + [ --enable-cxx-warnings=[no/minimum/yes] Turn on compiler warnings.],,enable_cxx_warnings=minimum) + + AC_MSG_CHECKING(what warning flags to pass to the C++ compiler) + warnCXXFLAGS= + if test "x$GCC" != xyes; then + enable_compile_warnings=no + fi + if test "x$enable_cxx_warnings" != "xno"; then + if test "x$GCC" = "xyes"; then + case " $CXXFLAGS " in + *[\ \ ]-Wall[\ \ ]*) ;; + *) warnCXXFLAGS="-Wall -Wno-unused" ;; + esac + + ## -W is not all that useful. And it cannot be controlled + ## with individual -Wno-xxx flags, unlike -Wall + if test "x$enable_cxx_warnings" = "xyes"; then + warnCXXFLAGS="$warnCXXFLAGS -Wmissing-prototypes -Wmissing-declarations -Wshadow -Woverloaded-virtual" + fi + fi + fi + AC_MSG_RESULT($warnCXXFLAGS) + + AC_ARG_ENABLE(iso-cxx, + [ --enable-iso-cxx Try to warn if code is not ISO C++ ],, + enable_iso_cxx=no) + + AC_MSG_CHECKING(what language compliance flags to pass to the C++ compiler) + complCXXFLAGS= + if test "x$enable_iso_cxx" != "xno"; then + if test "x$GCC" = "xyes"; then + case " $CXXFLAGS " in + *[\ \ ]-ansi[\ \ ]*) ;; + *) complCXXFLAGS="$complCXXFLAGS -ansi" ;; + esac + + case " $CXXFLAGS " in + *[\ \ ]-pedantic[\ \ ]*) ;; + *) complCXXFLAGS="$complCXXFLAGS -pedantic" ;; + esac + fi + fi + AC_MSG_RESULT($complCXXFLAGS) + if test "x$cxxflags_set" != "xyes"; then + CXXFLAGS="$CXXFLAGS $warnCXXFLAGS $complCXXFLAGS" + cxxflags_set=yes + AC_SUBST(cxxflags_set) + fi +]) + +dnl GNOME_X_CHECKS +dnl +dnl Basic X11 related checks for X11. At the end, the following will be +dnl defined/changed: +dnl GTK_{CFLAGS,LIBS} From AM_PATH_GTK +dnl CPPFLAGS Will include $X_CFLAGS +dnl GNOME_HAVE_SM `true' or `false' depending on whether session +dnl management is available. It is available if +dnl both -lSM and X11/SM/SMlib.h exist. (Some +dnl Solaris boxes have the library but not the header) +dnl XPM_LIBS -lXpm if Xpm library is present, otherwise "" +dnl +dnl The following configure cache variables are defined (but not used): +dnl gnome_cv_passdown_{x_libs,X_LIBS,X_CFLAGS} +dnl +AC_DEFUN([GNOME_X_CHECKS], +[ + AM_PATH_GTK(1.2.0,,AC_MSG_ERROR(GTK not installed, or gtk-config not in path)) + dnl Hope that GTK_CFLAGS have only -I and -D. Otherwise, we could + dnl test -z "$x_includes" || CPPFLAGS="$CPPFLAGS -I$x_includes" + dnl + dnl Use CPPFLAGS instead of CFLAGS because AC_CHECK_HEADERS uses + dnl CPPFLAGS, not CFLAGS + CPPFLAGS="$CPPFLAGS $GTK_CFLAGS" + + saved_ldflags="$LDFLAGS" + LDFLAGS="$LDFLAGS $GTK_LIBS" + + gnome_cv_passdown_x_libs="$GTK_LIBS" + gnome_cv_passdown_X_LIBS="$GTK_LIBS" + gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS" + gnome_cv_passdown_GTK_LIBS="$GTK_LIBS" + + LDFLAGS="$saved_ldflags $GTK_LIBS" + +dnl We are requiring GTK >= 1.1.1, which means this will be fine anyhow. + USE_DEVGTK=true + +dnl AC_MSG_CHECKING([whether to use features from (unstable) GTK+ 1.1.x]) +dnl AC_EGREP_CPP(answer_affirmatively, +dnl [#include <gtk/gtkfeatures.h> +dnl #ifdef GTK_HAVE_FEATURES_1_1_0 +dnl answer_affirmatively +dnl #endif +dnl ], dev_gtk=yes, dev_gtk=no) +dnl if test "$dev_gtk" = "yes"; then +dnl USE_DEVGTK=true +dnl fi +dnl AC_MSG_RESULT("$dev_gtk") + + GNOME_HAVE_SM=true + case "$GTK_LIBS" in + *-lSM*) + dnl Already found it. + ;; + *) + dnl Assume that if we have -lSM then we also have -lICE. + AC_CHECK_LIB(SM, SmcSaveYourselfDone, + [GTK_LIBS="-lSM -lICE $GTK_LIBS"],GNOME_HAVE_SM=false, + $x_libs -lICE) + ;; + esac + + if test "$GNOME_HAVE_SM" = true; then + AC_CHECK_HEADERS(X11/SM/SMlib.h,,GNOME_HAVE_SM=false) + fi + + if test "$GNOME_HAVE_SM" = true; then + AC_DEFINE(HAVE_LIBSM) + fi + + XPM_LIBS="" + AC_CHECK_LIB(Xpm, XpmFreeXpmImage, [XPM_LIBS="-lXpm"], , $x_libs) + AC_SUBST(XPM_LIBS) + + AC_REQUIRE([GNOME_PTHREAD_CHECK]) + LDFLAGS="$saved_ldflags" + + AC_PROVIDE([GNOME_X_CHECKS]) +]) + +# Configure paths for GTK+ +# Owen Taylor 97-11-3 + +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]]) +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS +dnl +AC_DEFUN(AM_PATH_GTK, +[dnl +dnl Get the cflags and libraries from the gtk-config script +dnl +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)], + gtk_config_prefix="$withval", gtk_config_prefix="") +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)], + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="") +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program], + , enable_gtktest=yes) + + for module in . $4 + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + AC_PATH_PROG(GTK_CONFIG, gtk-config, no) + min_gtk_version=ifelse([$1], ,0.99.7,$1) + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version) + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" +dnl +dnl Now check if the installed GTK is sufficiently new. (Also sanity +dnl checks the results of gtk-config to some extent +dnl + rm -f conf.gtktest + AC_TRY_RUN([ +#include <gtk/gtk.h> +#include <stdio.h> +#include <stdlib.h> + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + AC_TRY_LINK([ +#include <gtk/gtk.h> +#include <stdio.h> +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" ], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(GTK_CFLAGS) + AC_SUBST(GTK_LIBS) + rm -f conf.gtktest +]) + +dnl +dnl And better, use gthreads instead... +dnl + +AC_DEFUN([GNOME_PTHREAD_CHECK],[ + PTHREAD_LIB="" + AC_CHECK_LIB(pthread, pthread_create, PTHREAD_LIB="-lpthread", + [AC_CHECK_LIB(pthreads, pthread_create, PTHREAD_LIB="-lpthreads", + [AC_CHECK_LIB(c_r, pthread_create, PTHREAD_LIB="-lc_r", + [AC_CHECK_FUNC(pthread_create)] + )] + )] + ) + AC_SUBST(PTHREAD_LIB) + AC_PROVIDE([GNOME_PTHREAD_CHECK]) +]) + +# Macro to add for using GNU gettext. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 10 + +dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR]). +dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library +dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, +dnl depending on --{enable,disable}-{shared,static} and on the presence of +dnl AM-DISABLE-SHARED). Otherwise, a static library +dnl $(top_builddir)/intl/libintl.a will be created. +dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext +dnl implementations (in libc or libintl) without the ngettext() function +dnl will be ignored. +dnl LIBDIR is used to find the intl libraries. If empty, +dnl the value `$(top_builddir)/intl/' is used. +dnl +dnl The result of the configuration is one of three cases: +dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled +dnl and used. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 2) GNU gettext has been found in the system's C library. +dnl Catalog format: GNU --> install in $(datadir) +dnl Catalog extension: .mo after installation, .gmo in source tree +dnl 3) No internationalization, always use English msgid. +dnl Catalog format: none +dnl Catalog extension: none +dnl The use of .gmo is historical (it was needed to avoid overwriting the +dnl GNU format catalogs when building on a platform with an X/Open gettext), +dnl but we keep it in order not to force irrelevant filename changes on the +dnl maintainers. +dnl +AC_DEFUN([AM_WITH_NLS], + [AC_MSG_CHECKING([whether NLS is requested]) + dnl Default is enabled NLS + AC_ARG_ENABLE(nls, + [ --disable-nls do not use Native Language Support], + USE_NLS=$enableval, USE_NLS=yes) + AC_MSG_RESULT($USE_NLS) + AC_SUBST(USE_NLS) + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + INTLLIBS= + + dnl If we use NLS figure out what method + if test "$USE_NLS" = "yes"; then + AC_DEFINE(ENABLE_NLS, 1, + [Define to 1 if translation of program messages to the user's native language + is requested.]) + AC_MSG_CHECKING([whether included gettext is requested]) + AC_ARG_WITH(included-gettext, + [ --with-included-gettext use the GNU gettext library included here], + nls_cv_force_use_gnu_gettext=$withval, + nls_cv_force_use_gnu_gettext=no) + AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + dnl User does not insist on using GNU NLS library. Figure out what + dnl to use. If GNU gettext is available we use this. Else we have + dnl to fall back to GNU NLS library. + CATOBJEXT=NONE + + dnl Add a version number to the cache macros. + define(gt_cv_func_gnugettext_libc, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libc]) + define(gt_cv_func_gnugettext_libintl, [gt_cv_func_gnugettext]ifelse([$2], need-ngettext, 2, 1)[_libintl]) + + AC_CHECK_HEADER(libintl.h, + [AC_CACHE_CHECK([for GNU gettext in libc], gt_cv_func_gnugettext_libc, + [AC_TRY_LINK([#include <libintl.h> +extern int _nl_msg_cat_cntr;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], + gt_cv_func_gnugettext_libc=yes, + gt_cv_func_gnugettext_libc=no)]) + + if test "$gt_cv_func_gnugettext_libc" != "yes"; then + AC_CACHE_CHECK([for GNU gettext in libintl], + gt_cv_func_gnugettext_libintl, + [gt_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $LIBICONV" + AC_TRY_LINK([#include <libintl.h> +extern int _nl_msg_cat_cntr;], + [bindtextdomain ("", ""); +return (int) gettext ("")]ifelse([$2], need-ngettext, [ + (int) ngettext ("", "", 0)], [])[ + _nl_msg_cat_cntr], + gt_cv_func_gnugettext_libintl=yes, + gt_cv_func_gnugettext_libintl=no) + LIBS="$gt_save_LIBS"]) + fi + + dnl If an already present or preinstalled GNU gettext() is found, + dnl use it. But if this macro is used in GNU gettext, and GNU + dnl gettext is already preinstalled in libintl, we update this + dnl libintl. (Cf. the install rule in intl/Makefile.in.) + if test "$gt_cv_func_gnugettext_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + AC_DEFINE(HAVE_GETTEXT, 1, + [Define if the GNU gettext() function is already present or preinstalled.]) + + if test "$gt_cv_func_gnugettext_libintl" = "yes"; then + dnl If iconv() is in a separate libiconv library, then anyone + dnl linking with libintl{.a,.so} also needs to link with + dnl libiconv. + INTLLIBS="-lintl $LIBICONV" + fi + + gt_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + AC_CHECK_FUNCS(dcgettext) + LIBS="$gt_save_LIBS" + + dnl Search for GNU msgfmt in the PATH. + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + + dnl Search for GNU xgettext in the PATH. + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + + CATOBJEXT=.gmo + fi + ]) + + if test "$CATOBJEXT" = "NONE"; then + dnl GNU gettext is not found in the C library. + dnl Fall back on GNU gettext library. + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + dnl Mark actions used to generate GNU NLS library. + INTLOBJS="\$(GETTOBJS)" + AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, + [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) + AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) + AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, + [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) + AC_SUBST(MSGFMT) + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU msgfmt. + if test "$GMSGFMT" != ":"; then + dnl If it is no GNU msgfmt we define it as : so that the + dnl Makefiles still can work. + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then + : ; + else + AC_MSG_RESULT( + [found msgfmt program is not GNU msgfmt; ignore it]) + GMSGFMT=":" + fi + fi + + dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. + dnl Test whether we really found GNU xgettext. + if test "$XGETTEXT" != ":"; then + dnl If it is no GNU xgettext we define it as : so that the + dnl Makefiles still can work. + if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then + : ; + else + AC_MSG_RESULT( + [found xgettext program is not GNU xgettext; ignore it]) + XGETTEXT=":" + fi + fi + + dnl We need to process the po/ directory. + POSUB=po + fi + AC_OUTPUT_COMMANDS( + [for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done]) + + + dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL + dnl to 'yes' because some of the testsuite requires it. + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi + + dnl intl/plural.c is generated from intl/plural.y. It requires bison, + dnl because plural.y uses bison specific features. It requires at least + dnl bison-1.26 because earlier versions generate a plural.c that doesn't + dnl compile. + dnl bison is only needed for the maintainer (who touches plural.y). But in + dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put + dnl the rule in general Makefile. Now, some people carelessly touch the + dnl files or have a broken "make" program, hence the plural.c rule will + dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not + dnl present or too old. + AC_CHECK_PROGS([INTLBISON], [bison]) + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + dnl Found it, now check the version. + AC_MSG_CHECKING([version of bison]) +changequote(<<,>>)dnl + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) +changequote([,])dnl + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + AC_MSG_RESULT([$ac_prog_version]) + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + dnl These rules are solely for the distribution goal. While doing this + dnl we only have to keep exactly one list of the available catalogs + dnl in configure.in. + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + dnl Make all variables we use known to autoconf. + AC_SUBST(BUILD_INCLUDED_LIBINTL) + AC_SUBST(USE_INCLUDED_LIBINTL) + AC_SUBST(CATALOGS) + AC_SUBST(CATOBJEXT) + AC_SUBST(GMOFILES) + AC_SUBST(INTLLIBS) + AC_SUBST(INTLOBJS) + AC_SUBST(POFILES) + AC_SUBST(POSUB) + + dnl For backward compatibility. Some configure.ins may be using this. + nls_cv_header_intl= + nls_cv_header_libgt= + + dnl For backward compatibility. Some Makefiles may be using this. + DATADIRNAME=share + AC_SUBST(DATADIRNAME) + + dnl For backward compatibility. Some Makefiles may be using this. + INSTOBJEXT=.mo + AC_SUBST(INSTOBJEXT) + + dnl For backward compatibility. Some Makefiles may be using this. + GENCAT=gencat + AC_SUBST(GENCAT) + ]) + +dnl Usage: Just like AM_WITH_NLS, which see. +AC_DEFUN([AM_GNU_GETTEXT], + [AC_REQUIRE([AC_PROG_MAKE_SET])dnl + AC_REQUIRE([AC_PROG_CC])dnl + AC_REQUIRE([AC_CANONICAL_HOST])dnl + AC_REQUIRE([AC_PROG_RANLIB])dnl + AC_REQUIRE([AC_ISC_POSIX])dnl + AC_REQUIRE([AC_HEADER_STDC])dnl + AC_REQUIRE([AC_C_CONST])dnl + AC_REQUIRE([AC_C_INLINE])dnl + AC_REQUIRE([AC_TYPE_OFF_T])dnl + AC_REQUIRE([AC_TYPE_SIZE_T])dnl + AC_REQUIRE([AC_FUNC_ALLOCA])dnl + AC_REQUIRE([AC_FUNC_MMAP])dnl + AC_REQUIRE([jm_GLIBC21])dnl + + AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h]) + AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \ +getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ +strdup strtoul tsearch __argz_count __argz_stringify __argz_next]) + + AM_ICONV + AM_LANGINFO_CODESET + AM_LC_MESSAGES + AM_WITH_NLS([$1],[$2],[$3]) + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + AC_MSG_CHECKING(for catalogs to be installed) + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + AC_MSG_RESULT($LINGUAS) + fi + + dnl Construct list of names of catalog files to be constructed. + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + dnl If the AC_CONFIG_AUX_DIR macro for autoconf is used we possibly + dnl find the mkinstalldirs script in another subdir but $(top_srcdir). + dnl Try to locate is. + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + AC_SUBST(MKINSTALLDIRS) + + dnl Enable libtool support if the surrounding package wishes it. + INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], []) + AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) + ]) + +# Search path for a program which passes the given test. +# Ulrich Drepper <drepper@cygnus.com>, 1996. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 2 + +dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, +dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) +AC_DEFUN([AM_PATH_PROG_WITH_TEST], +[# Extract the first word of "$2", so it can be a program name with args. +set dummy $2; ac_word=[$]2 +AC_MSG_CHECKING([for $ac_word]) +AC_CACHE_VAL(ac_cv_path_$1, +[case "[$]$1" in + /*) + ac_cv_path_$1="[$]$1" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in ifelse([$5], , $PATH, [$5]); do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if [$3]; then + ac_cv_path_$1="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" +dnl If no 4th arg is given, leave the cache variable unset, +dnl so AC_PATH_PROGS will keep looking. +ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" +])dnl + ;; +esac])dnl +$1="$ac_cv_path_$1" +if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then + AC_MSG_RESULT([$]$1) +else + AC_MSG_RESULT(no) +fi +AC_SUBST($1)dnl +]) + +#serial 2 + +# Test for the GNU C Library, version 2.1 or newer. +# From Bruno Haible. + +AC_DEFUN([jm_GLIBC21], + [ + AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, + ac_cv_gnu_library_2_1, + [AC_EGREP_CPP([Lucky GNU user], + [ +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + ], + ac_cv_gnu_library_2_1=yes, + ac_cv_gnu_library_2_1=no) + ] + ) + AC_SUBST(GLIBC21) + GLIBC21="$ac_cv_gnu_library_2_1" + ] +) + +#serial AM2 + +dnl From Bruno Haible. + +AC_DEFUN([AM_ICONV], +[ + dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and + dnl those with the standalone portable GNU libiconv installed). + + AC_ARG_WITH([libiconv-prefix], +[ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + ]) + + AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + AC_TRY_LINK([#include <stdlib.h> +#include <iconv.h>], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_func_iconv=yes) + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + AC_TRY_LINK([#include <stdlib.h> +#include <iconv.h>], + [iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd);], + am_cv_lib_iconv=yes + am_cv_func_iconv=yes) + LIBS="$am_save_LIBS" + fi + ]) + if test "$am_cv_func_iconv" = yes; then + AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) + AC_MSG_CHECKING([for iconv declaration]) + AC_CACHE_VAL(am_cv_proto_iconv, [ + AC_TRY_COMPILE([ +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif +], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) + am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + AC_MSG_RESULT([$]{ac_t:- + }[$]am_cv_proto_iconv) + AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, + [Define as const if the declaration of iconv() needs const.]) + fi + LIBICONV= + if test "$am_cv_lib_iconv" = yes; then + LIBICONV="-liconv" + fi + AC_SUBST(LIBICONV) +]) + +#serial AM1 + +dnl From Bruno Haible. + +AC_DEFUN([AM_LANGINFO_CODESET], +[ + AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, + [AC_TRY_LINK([#include <langinfo.h>], + [char* cs = nl_langinfo(CODESET);], + am_cv_langinfo_codeset=yes, + am_cv_langinfo_codeset=no) + ]) + if test $am_cv_langinfo_codeset = yes; then + AC_DEFINE(HAVE_LANGINFO_CODESET, 1, + [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) + fi +]) + +# Check whether LC_MESSAGES is available in <locale.h>. +# Ulrich Drepper <drepper@cygnus.com>, 1995. +# +# This file can be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU General Public +# License or the GNU Library General Public License but which still want +# to provide support for the GNU gettext functionality. +# Please note that the actual code of the GNU gettext library is covered +# by the GNU Library General Public License, and the rest of the GNU +# gettext package package is covered by the GNU General Public License. +# They are *not* in the public domain. + +# serial 2 + +AC_DEFUN([AM_LC_MESSAGES], + [if test $ac_cv_header_locale_h = yes; then + AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, + [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], + am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) + if test $am_cv_val_LC_MESSAGES = yes; then + AC_DEFINE(HAVE_LC_MESSAGES, 1, + [Define if your <locale.h> file defines LC_MESSAGES.]) + fi + fi]) + diff --git a/apps/X11/InstallMgr/config.h b/apps/X11/InstallMgr/config.h new file mode 100644 index 0000000..0d16366 --- /dev/null +++ b/apps/X11/InstallMgr/config.h @@ -0,0 +1,134 @@ +/* config.h. Generated automatically by configure. */ +/* config.h.in. Generated automatically from configure.in by autoheader. */ + +/* Define if using alloca.c. */ +/* #undef C_ALLOCA */ + +/* Define to empty if the keyword does not work. */ +/* #undef const */ + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +/* #undef CRAY_STACKSEG_END */ + +/* Define if you have alloca, as a function or macro. */ +#define HAVE_ALLOCA 1 + +/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ +#define HAVE_ALLOCA_H 1 + +/* Define if you have a working `mmap' system call. */ +#define HAVE_MMAP 1 + +/* Define as __inline if that's what the C compiler calls it. */ +/* #undef inline */ + +/* Define to `long' if <sys/types.h> doesn't define. */ +/* #undef off_t */ + +/* Define if you need to in order for stat and other things to work. */ +/* #undef _POSIX_SOURCE */ + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +/* #undef size_t */ + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +/* #undef STACK_DIRECTION */ + +/* Define if you have the ANSI C header files. */ +#define STDC_HEADERS 1 + +#define ENABLE_NLS 1 +/* #undef HAVE_CATGETS */ +#define HAVE_GETTEXT 1 +#define HAVE_LC_MESSAGES 1 +#define HAVE_STPCPY 1 +#define HAVE_LIBSM 1 +#define PACKAGE_LOCALE_DIR "/usr/local/share/locale" +/* #undef PACKAGE_DATA_DIR */ +/* #undef PACKAGE_SOURCE_DIR */ + +/* Define if you have the __argz_count function. */ +#define HAVE___ARGZ_COUNT 1 + +/* Define if you have the __argz_next function. */ +#define HAVE___ARGZ_NEXT 1 + +/* Define if you have the __argz_stringify function. */ +#define HAVE___ARGZ_STRINGIFY 1 + +/* Define if you have the dcgettext function. */ +#define HAVE_DCGETTEXT 1 + +/* Define if you have the getcwd function. */ +#define HAVE_GETCWD 1 + +/* Define if you have the getpagesize function. */ +#define HAVE_GETPAGESIZE 1 + +/* Define if you have the munmap function. */ +#define HAVE_MUNMAP 1 + +/* Define if you have the putenv function. */ +#define HAVE_PUTENV 1 + +/* Define if you have the setenv function. */ +#define HAVE_SETENV 1 + +/* Define if you have the setlocale function. */ +#define HAVE_SETLOCALE 1 + +/* Define if you have the stpcpy function. */ +#define HAVE_STPCPY 1 + +/* Define if you have the strcasecmp function. */ +#define HAVE_STRCASECMP 1 + +/* Define if you have the strchr function. */ +#define HAVE_STRCHR 1 + +/* Define if you have the strdup function. */ +#define HAVE_STRDUP 1 + +/* Define if you have the <X11/SM/SMlib.h> header file. */ +#define HAVE_X11_SM_SMLIB_H 1 + +/* Define if you have the <argz.h> header file. */ +#define HAVE_ARGZ_H 1 + +/* Define if you have the <limits.h> header file. */ +#define HAVE_LIMITS_H 1 + +/* Define if you have the <locale.h> header file. */ +#define HAVE_LOCALE_H 1 + +/* Define if you have the <malloc.h> header file. */ +#define HAVE_MALLOC_H 1 + +/* Define if you have the <nl_types.h> header file. */ +#define HAVE_NL_TYPES_H 1 + +/* Define if you have the <string.h> header file. */ +#define HAVE_STRING_H 1 + +/* Define if you have the <sys/param.h> header file. */ +#define HAVE_SYS_PARAM_H 1 + +/* Define if you have the <unistd.h> header file. */ +#define HAVE_UNISTD_H 1 + +/* Define if you have the i library (-li). */ +/* #undef HAVE_LIBI */ + +/* Name of package */ +#define PACKAGE "installmgr" + +/* Version number of package */ +#define VERSION "0.1" + diff --git a/apps/X11/InstallMgr/config.h.in b/apps/X11/InstallMgr/config.h.in new file mode 100644 index 0000000..9d9b1d1 --- /dev/null +++ b/apps/X11/InstallMgr/config.h.in @@ -0,0 +1,179 @@ +/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ + +/* Define if using alloca.c. */ +#undef C_ALLOCA + +/* Define to empty if the keyword does not work. */ +#undef const + +/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems. + This function is required for alloca.c support on those systems. */ +#undef CRAY_STACKSEG_END + +/* Define if you have alloca, as a function or macro. */ +#undef HAVE_ALLOCA + +/* Define if you have <alloca.h> and it should be used (not on Ultrix). */ +#undef HAVE_ALLOCA_H + +/* Define if you have a working `mmap' system call. */ +#undef HAVE_MMAP + +/* Define as __inline if that's what the C compiler calls it. */ +#undef inline + +/* Define to `long' if <sys/types.h> doesn't define. */ +#undef off_t + +/* Define to `unsigned' if <sys/types.h> doesn't define. */ +#undef size_t + +/* If using the C implementation of alloca, define if you know the + direction of stack growth for your system; otherwise it will be + automatically deduced at run-time. + STACK_DIRECTION > 0 => grows toward higher addresses + STACK_DIRECTION < 0 => grows toward lower addresses + STACK_DIRECTION = 0 => direction of growth unknown + */ +#undef STACK_DIRECTION + +/* Define if you have the ANSI C header files. */ +#undef STDC_HEADERS + +#undef ENABLE_NLS +#undef HAVE_CATGETS +#undef HAVE_GETTEXT +#undef HAVE_LC_MESSAGES +#undef HAVE_STPCPY +#undef HAVE_LIBSM +#undef PACKAGE_LOCALE_DIR +#undef PACKAGE_DATA_DIR +#undef PACKAGE_SOURCE_DIR + +/* Define if you have the __argz_count function. */ +#undef HAVE___ARGZ_COUNT + +/* Define if you have the __argz_next function. */ +#undef HAVE___ARGZ_NEXT + +/* Define if you have the __argz_stringify function. */ +#undef HAVE___ARGZ_STRINGIFY + +/* Define if you have the dcgettext function. */ +#undef HAVE_DCGETTEXT + +/* Define if you have the feof_unlocked function. */ +#undef HAVE_FEOF_UNLOCKED + +/* Define if you have the fgets_unlocked function. */ +#undef HAVE_FGETS_UNLOCKED + +/* Define if you have the getcwd function. */ +#undef HAVE_GETCWD + +/* Define if you have the getegid function. */ +#undef HAVE_GETEGID + +/* Define if you have the geteuid function. */ +#undef HAVE_GETEUID + +/* Define if you have the getgid function. */ +#undef HAVE_GETGID + +/* Define if you have the getpagesize function. */ +#undef HAVE_GETPAGESIZE + +/* Define if you have the getuid function. */ +#undef HAVE_GETUID + +/* Define if you have the mempcpy function. */ +#undef HAVE_MEMPCPY + +/* Define if you have the munmap function. */ +#undef HAVE_MUNMAP + +/* Define if you have the putenv function. */ +#undef HAVE_PUTENV + +/* Define if you have the setenv function. */ +#undef HAVE_SETENV + +/* Define if you have the setlocale function. */ +#undef HAVE_SETLOCALE + +/* Define if you have the stpcpy function. */ +#undef HAVE_STPCPY + +/* Define if you have the strcasecmp function. */ +#undef HAVE_STRCASECMP + +/* Define if you have the strchr function. */ +#undef HAVE_STRCHR + +/* Define if you have the strdup function. */ +#undef HAVE_STRDUP + +/* Define if you have the strtoul function. */ +#undef HAVE_STRTOUL + +/* Define if you have the tsearch function. */ +#undef HAVE_TSEARCH + +/* Define if you have the <X11/SM/SMlib.h> header file. */ +#undef HAVE_X11_SM_SMLIB_H + +/* Define if you have the <argz.h> header file. */ +#undef HAVE_ARGZ_H + +/* Define if you have the <limits.h> header file. */ +#undef HAVE_LIMITS_H + +/* Define if you have the <locale.h> header file. */ +#undef HAVE_LOCALE_H + +/* Define if you have the <malloc.h> header file. */ +#undef HAVE_MALLOC_H + +/* Define if you have the <nl_types.h> header file. */ +#undef HAVE_NL_TYPES_H + +/* Define if you have the <stddef.h> header file. */ +#undef HAVE_STDDEF_H + +/* Define if you have the <stdlib.h> header file. */ +#undef HAVE_STDLIB_H + +/* Define if you have the <string.h> header file. */ +#undef HAVE_STRING_H + +/* Define if you have the <sys/param.h> header file. */ +#undef HAVE_SYS_PARAM_H + +/* Define if you have the <unistd.h> header file. */ +#undef HAVE_UNISTD_H + +/* Name of package */ +#undef PACKAGE + +/* Version number of package */ +#undef VERSION + +/* Define if you have the iconv() function. */ +#undef HAVE_ICONV + +/* Define as const if the declaration of iconv() needs const. */ +#undef ICONV_CONST + +/* Define if you have <langinfo.h> and nl_langinfo(CODESET). */ +#undef HAVE_LANGINFO_CODESET + +/* Define if your <locale.h> file defines LC_MESSAGES. */ +#undef HAVE_LC_MESSAGES + +/* Define to 1 if translation of program messages to the user's native language + is requested. */ +#undef ENABLE_NLS + +/* Define if the GNU gettext() function is already present or preinstalled. */ +#undef HAVE_GETTEXT + diff --git a/apps/X11/InstallMgr/configure b/apps/X11/InstallMgr/configure new file mode 100755 index 0000000..e0c9c48 --- /dev/null +++ b/apps/X11/InstallMgr/configure @@ -0,0 +1,4619 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-gnome-includes Specify location of GNOME headers" +ac_help="$ac_help + --with-gnome-libs Specify location of GNOME libs" +ac_help="$ac_help + --with-gnome Specify prefix for GNOME files" +ac_help="$ac_help + --enable-compile-warnings=[no/minimum/yes] Turn on compiler warnings." +ac_help="$ac_help + --enable-iso-c Try to warn if code is not ISO C " +ac_help="$ac_help + --with-gtk-prefix=PFX Prefix where GTK is installed (optional)" +ac_help="$ac_help + --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)" +ac_help="$ac_help + --disable-gtktest Do not try to compile and run a test GTK program" +ac_help="$ac_help + --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib" +ac_help="$ac_help + --disable-nls do not use Native Language Support" +ac_help="$ac_help + --with-included-gettext use the GNU gettext library included here" + +# 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=configure.in + +# 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:578: 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:631: 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:688: 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=installmgr + +VERSION=0.1 + +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 <<EOF +#define PACKAGE "$PACKAGE" +EOF + +cat >> confdefs.h <<EOF +#define VERSION "$VERSION" +EOF + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:734: 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:747: 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:760: 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:773: 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:786: 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 + + + + + + +abs_srcdir="`cd $srcdir && pwd`" + + + + +if test x = y; then + INSIDE_GNOME_COMMON_TRUE= + INSIDE_GNOME_COMMON_FALSE='#' +else + INSIDE_GNOME_COMMON_TRUE='#' + INSIDE_GNOME_COMMON_FALSE= +fi + + test -n "$ACLOCAL_FLAGS" && ACLOCAL="$ACLOCAL $ACLOCAL_FLAGS" + + for k in macros ; do ACLOCAL="$ACLOCAL -I $k" ; done + + + + + + + + + + + + + # Check whether --with-gnome-includes or --without-gnome-includes was given. +if test "${with_gnome_includes+set}" = set; then + withval="$with_gnome_includes" + + CFLAGS="$CFLAGS -I$withval" + +fi + + + # Check whether --with-gnome-libs or --without-gnome-libs was given. +if test "${with_gnome_libs+set}" = set; then + withval="$with_gnome_libs" + + LDFLAGS="$LDFLAGS -L$withval" + gnome_prefix=$withval + +fi + + + # Check whether --with-gnome or --without-gnome was given. +if test "${with_gnome+set}" = set; then + withval="$with_gnome" + if test x$withval = xyes; then + want_gnome=yes + : + else + if test "x$withval" = xno; then + want_gnome=no + else + want_gnome=yes + LDFLAGS="$LDFLAGS -L$withval/lib" + CFLAGS="$CFLAGS -I$withval/include" + gnome_prefix=$withval/lib + fi + fi +else + want_gnome=yes +fi + + + if test "x$want_gnome" = xyes; then + + # Extract the first word of "gnome-config", so it can be a program name with args. +set dummy gnome-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:876: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GNOME_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GNOME_CONFIG" in + /*) + ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GNOME_CONFIG="$GNOME_CONFIG" # Let the user override the test with a dos path. + ;; + *) + 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_path_GNOME_CONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GNOME_CONFIG" && ac_cv_path_GNOME_CONFIG="no" + ;; +esac +fi +GNOME_CONFIG="$ac_cv_path_GNOME_CONFIG" +if test -n "$GNOME_CONFIG"; then + echo "$ac_t""$GNOME_CONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + if test "$GNOME_CONFIG" = "no"; then + no_gnome_config="yes" + else + echo $ac_n "checking if $GNOME_CONFIG works""... $ac_c" 1>&6 +echo "configure:913: checking if $GNOME_CONFIG works" >&5 + if $GNOME_CONFIG --libs-only-l gnome >/dev/null 2>&1; then + echo "$ac_t""yes" 1>&6 + + + # Extract the first word of "orbit-config", so it can be a program name with args. +set dummy orbit-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:921: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_ORBIT_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$ORBIT_CONFIG" in + /*) + ac_cv_path_ORBIT_CONFIG="$ORBIT_CONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_ORBIT_CONFIG="$ORBIT_CONFIG" # Let the user override the test with a dos path. + ;; + *) + 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_path_ORBIT_CONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_ORBIT_CONFIG" && ac_cv_path_ORBIT_CONFIG="no" + ;; +esac +fi +ORBIT_CONFIG="$ac_cv_path_ORBIT_CONFIG" +if test -n "$ORBIT_CONFIG"; then + echo "$ac_t""$ORBIT_CONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "orbit-idl", so it can be a program name with args. +set dummy orbit-idl; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:957: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_ORBIT_IDL'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$ORBIT_IDL" in + /*) + ac_cv_path_ORBIT_IDL="$ORBIT_IDL" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_ORBIT_IDL="$ORBIT_IDL" # Let the user override the test with a dos path. + ;; + *) + 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_path_ORBIT_IDL="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_ORBIT_IDL" && ac_cv_path_ORBIT_IDL="no" + ;; +esac +fi +ORBIT_IDL="$ac_cv_path_ORBIT_IDL" +if test -n "$ORBIT_IDL"; then + echo "$ac_t""$ORBIT_IDL" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for working ORBit environment""... $ac_c" 1>&6 +echo "configure:991: checking for working ORBit environment" >&5 +if eval "test \"`echo '$''{'gnome_cv_orbit_found'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + if test x$ORBIT_CONFIG = xno -o x$ORBIT_IDL = xno; then + gnome_cv_orbit_found=no + else + gnome_cv_orbit_found=yes + fi + +fi + +echo "$ac_t""$gnome_cv_orbit_found" 1>&6 + + +if test x$gnome_cv_orbit_found = xyes; then + HAVE_ORBIT_TRUE= + HAVE_ORBIT_FALSE='#' +else + HAVE_ORBIT_TRUE='#' + HAVE_ORBIT_FALSE= +fi + if test x$gnome_cv_orbit_found = xyes; then + + ORBIT_CFLAGS=`orbit-config --cflags client server` + ORBIT_LIBS=`orbit-config --use-service=name --libs client server` + + + else + if test xfail = xfailure; then + { echo "configure: error: ORBit not installed or installation problem" 1>&2; exit 1; } + fi + fi + + echo $ac_n "checking for gnorba libraries""... $ac_c" 1>&6 +echo "configure:1027: checking for gnorba libraries" >&5 +if eval "test \"`echo '$''{'gnome_cv_gnorba_found'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + gnome_cv_gnorba_found=no + if test x$gnome_cv_orbit_found = xyes; then + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + if test -n "$GNORBA_LIBS"; then + gnome_cv_gnorba_found=yes + fi + fi + +fi + +echo "$ac_t""$gnome_cv_gnorba_found" 1>&6 + + +if test x$gnome_cv_gnorba_found = xyes; then + HAVE_GNORBA_TRUE= + HAVE_GNORBA_FALSE='#' +else + HAVE_GNORBA_TRUE='#' + HAVE_GNORBA_FALSE= +fi + if test x$gnome_cv_orbit_found = xyes; then + + GNORBA_CFLAGS="`gnome-config --cflags gnorba gnomeui`" + GNORBA_LIBS="`gnome-config --libs gnorba gnomeui`" + + + else + if test xfail = xfailure; then + { echo "configure: error: gnorba library not installed or installation problem" 1>&2; exit 1; } + fi + fi + + GNOME_LIBS="`$GNOME_CONFIG --libs-only-l gnome`" + GNOMEUI_LIBS="`$GNOME_CONFIG --libs-only-l gnomeui`" + GNOMEGNORBA_LIBS="`$GNOME_CONFIG --libs-only-l gnorba gnomeui`" + GTKXMHTML_LIBS="`$GNOME_CONFIG --libs-only-l gtkxmhtml`" + ZVT_LIBS="`$GNOME_CONFIG --libs-only-l zvt`" + GNOME_LIBDIR="`$GNOME_CONFIG --libs-only-L gnorba gnomeui`" + GNOME_INCLUDEDIR="`$GNOME_CONFIG --cflags gnorba gnomeui`" + + else + echo "$ac_t""no" 1>&6 + no_gnome_config="yes" + fi + fi + + if test x$exec_prefix = xNONE; then + if test x$prefix = xNONE; then + gnome_prefix=$ac_default_prefix/lib + else + gnome_prefix=$prefix/lib + fi + else + gnome_prefix=`eval echo \`echo $libdir\`` + fi + + if test "$no_gnome_config" = "yes"; then + echo $ac_n "checking for gnomeConf.sh file in $gnome_prefix""... $ac_c" 1>&6 +echo "configure:1091: checking for gnomeConf.sh file in $gnome_prefix" >&5 + if test -f $gnome_prefix/gnomeConf.sh; then + echo "$ac_t""found" 1>&6 + echo "loading gnome configuration from" \ + "$gnome_prefix/gnomeConf.sh" + . $gnome_prefix/gnomeConf.sh + + else + echo "$ac_t""not found" 1>&6 + if test xfail = xfail; then + { echo "configure: error: Could not find the gnomeConf.sh file that is generated by gnome-libs install" 1>&2; exit 1; } + fi + fi + fi + fi + + if test -n ""; then + n="" + for i in $n; do + echo $ac_n "checking extra library \"$i\"""... $ac_c" 1>&6 +echo "configure:1111: checking extra library \"$i\"" >&5 + case $i in + applets) + + GNOME_APPLETS_LIBS=`$GNOME_CONFIG --libs-only-l applets` + echo "$ac_t""$GNOME_APPLETS_LIBS" 1>&6;; + capplet) + + GNOME_CAPPLET_LIBS=`$GNOME_CONFIG --libs-only-l capplet` + echo "$ac_t""$GNOME_CAPPLET_LIBS" 1>&6;; + *) + echo "$ac_t""unknown library" 1>&6 + esac + done + fi + + + + echo $ac_n "checking for strerror in -lcposix""... $ac_c" 1>&6 +echo "configure:1130: checking for strerror in -lcposix" >&5 +ac_lib_var=`echo cposix'_'strerror | 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="-lcposix $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1138 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char strerror(); + +int main() { +strerror() +; return 0; } +EOF +if { (eval echo configure:1149: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS -lcposix" +else + echo "$ac_t""no" 1>&6 +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:1174: 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:1204: 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:1255: 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:1287: 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 1298 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:1303: \"$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:1329: 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:1334: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:1343: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:1362: 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:1398: 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:1430: 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 1441 "configure" +#include "confdefs.h" + +int main(){return(0);} +EOF +if { (eval echo configure:1446: \"$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:1472: 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:1477: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1486: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi + +ac_test_CXXFLAGS="${CXXFLAGS+set}" +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= +echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +echo "configure:1505: 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 + + + + +echo $ac_n "checking for ${CC-cc} option to accept ANSI C""... $ac_c" 1>&6 +echo "configure:1540: checking for ${CC-cc} option to accept ANSI C" >&5 +if eval "test \"`echo '$''{'am_cv_prog_cc_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + am_cv_prog_cc_stdc=no +ac_save_CC="$CC" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +do + CC="$ac_save_CC $ac_arg" + cat > conftest.$ac_ext <<EOF +#line 1556 "configure" +#include "confdefs.h" +#include <stdarg.h> +#include <stdio.h> +#include <sys/types.h> +#include <sys/stat.h> +/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +struct buf { int x; }; +FILE * (*rcsopen) (struct buf *, struct stat *, int); +static char *e (p, i) + char **p; + int i; +{ + return p[i]; +} +static char *f (char * (*g) (char **, int), char **p, ...) +{ + char *s; + va_list v; + va_start (v,p); + s = g (p, va_arg (v,int)); + va_end (v); + return s; +} +int test (int i, double x); +struct s1 {int (*f) (int a);}; +struct s2 {int (*f) (double a);}; +int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +int argc; +char **argv; + +int main() { + +return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; + +; return 0; } +EOF +if { (eval echo configure:1593: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_prog_cc_stdc="$ac_arg"; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done +CC="$ac_save_CC" + +fi + +if test -z "$am_cv_prog_cc_stdc"; then + echo "$ac_t""none needed" 1>&6 +else + echo "$ac_t""$am_cv_prog_cc_stdc" 1>&6 +fi +case "x$am_cv_prog_cc_stdc" in + x|xno) ;; + *) CC="$CC $am_cv_prog_cc_stdc" ;; +esac + +echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +echo "configure:1617: checking how to run the C preprocessor" >&5 +# On Suns, sometimes $CPP names a directory. +if test -n "$CPP" && test -d "$CPP"; then + CPP= +fi +if test -z "$CPP"; then +if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + # This must be in double quotes, not single quotes, because CPP may get + # substituted into the Makefile and "${CC-cc}" will confuse make. + CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext <<EOF +#line 1632 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1638: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext <<EOF +#line 1649 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1655: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext <<EOF +#line 1666 "configure" +#include "confdefs.h" +#include <assert.h> +Syntax Error +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1672: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + : +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + CPP=/lib/cpp +fi +rm -f conftest* +fi +rm -f conftest* +fi +rm -f conftest* + ac_cv_prog_CPP="$CPP" +fi + CPP="$ac_cv_prog_CPP" +else + ac_cv_prog_CPP="$CPP" +fi +echo "$ac_t""$CPP" 1>&6 + +echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +echo "configure:1697: checking for ANSI C header files" >&5 +if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1702 "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <stdarg.h> +#include <string.h> +#include <float.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:1710: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + ac_cv_header_stdc=yes +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 1727 "configure" +#include "confdefs.h" +#include <string.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "memchr" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +cat > conftest.$ac_ext <<EOF +#line 1745 "configure" +#include "confdefs.h" +#include <stdlib.h> +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "free" >/dev/null 2>&1; then + : +else + rm -rf conftest* + ac_cv_header_stdc=no +fi +rm -f conftest* + +fi + +if test $ac_cv_header_stdc = yes; then + # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +if test "$cross_compiling" = yes; then + : +else + cat > conftest.$ac_ext <<EOF +#line 1766 "configure" +#include "confdefs.h" +#include <ctype.h> +#define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +int main () { int i; for (i = 0; i < 256; i++) +if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); +exit (0); } + +EOF +if { (eval echo configure:1777: \"$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 + + + + # Check whether --enable-compile-warnings or --disable-compile-warnings was given. +if test "${enable_compile_warnings+set}" = set; then + enableval="$enable_compile_warnings" + : +else + enable_compile_warnings=minimum +fi + + + echo $ac_n "checking what warning flags to pass to the C compiler""... $ac_c" 1>&6 +echo "configure:1812: checking what warning flags to pass to the C compiler" >&5 + warnCFLAGS= + if test "x$GCC" != xyes; then + enable_compile_warnings=no + fi + + if test "x$enable_compile_warnings" != "xno"; then + if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *\ \ -Wall\ \ *) ;; + *) warnCFLAGS="-Wall -Wunused" ;; + esac + + ## -W is not all that useful. And it cannot be controlled + ## with individual -Wno-xxx flags, unlike -Wall + if test "x$enable_compile_warnings" = "xyes"; then + warnCFLAGS="$warnCFLAGS -Wmissing-prototypes -Wmissing-declarations" + fi + fi + fi + echo "$ac_t""$warnCFLAGS" 1>&6 + + # Check whether --enable-iso-c or --disable-iso-c was given. +if test "${enable_iso_c+set}" = set; then + enableval="$enable_iso_c" + : +else + enable_iso_c=no +fi + + + echo $ac_n "checking what language compliance flags to pass to the C compiler""... $ac_c" 1>&6 +echo "configure:1844: checking what language compliance flags to pass to the C compiler" >&5 + complCFLAGS= + if test "x$enable_iso_c" != "xno"; then + if test "x$GCC" = "xyes"; then + case " $CFLAGS " in + *\ \ -ansi\ \ *) ;; + *) complCFLAGS="$complCFLAGS -ansi" ;; + esac + + case " $CFLAGS " in + *\ \ -pedantic\ \ *) ;; + *) complCFLAGS="$complCFLAGS -pedantic" ;; + esac + fi + fi + echo "$ac_t""$complCFLAGS" 1>&6 + if test "x$cflags_set" != "xyes"; then + CFLAGS="$CFLAGS $warnCFLAGS $complCFLAGS" + cflags_set=yes + + fi + + + PTHREAD_LIB="" + echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 +echo "configure:1869: checking for pthread_create in -lpthread" >&5 +ac_lib_var=`echo pthread'_'pthread_create | 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="-lpthread $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1877 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_create(); + +int main() { +pthread_create() +; return 0; } +EOF +if { (eval echo configure:1888: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIB="-lpthread" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for pthread_create in -lpthreads""... $ac_c" 1>&6 +echo "configure:1907: checking for pthread_create in -lpthreads" >&5 +ac_lib_var=`echo pthreads'_'pthread_create | 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="-lpthreads $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1915 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_create(); + +int main() { +pthread_create() +; return 0; } +EOF +if { (eval echo configure:1926: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIB="-lpthreads" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 +echo "configure:1945: checking for pthread_create in -lc_r" >&5 +ac_lib_var=`echo c_r'_'pthread_create | 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="-lc_r $LIBS" +cat > conftest.$ac_ext <<EOF +#line 1953 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_create(); + +int main() { +pthread_create() +; return 0; } +EOF +if { (eval echo configure:1964: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + PTHREAD_LIB="-lc_r" +else + echo "$ac_t""no" 1>&6 +echo $ac_n "checking for pthread_create""... $ac_c" 1>&6 +echo "configure:1983: checking for pthread_create" >&5 +if eval "test \"`echo '$''{'ac_cv_func_pthread_create'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 1988 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pthread_create(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char pthread_create(); + +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_pthread_create) || defined (__stub___pthread_create) +choke me +#else +pthread_create(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_pthread_create=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_pthread_create=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'pthread_create`\" = yes"; then + echo "$ac_t""yes" 1>&6 + : +else + echo "$ac_t""no" 1>&6 +fi + + +fi + + +fi + + +fi + + + + + + # Check whether --with-gtk-prefix or --without-gtk-prefix was given. +if test "${with_gtk_prefix+set}" = set; then + withval="$with_gtk_prefix" + gtk_config_prefix="$withval" +else + gtk_config_prefix="" +fi + +# Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given. +if test "${with_gtk_exec_prefix+set}" = set; then + withval="$with_gtk_exec_prefix" + gtk_config_exec_prefix="$withval" +else + gtk_config_exec_prefix="" +fi + +# Check whether --enable-gtktest or --disable-gtktest was given. +if test "${enable_gtktest+set}" = set; then + enableval="$enable_gtktest" + : +else + enable_gtktest=yes +fi + + + for module in . + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + # Extract the first word of "gtk-config", so it can be a program name with args. +set dummy gtk-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2093: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GTK_CONFIG" in + /*) + ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a dos path. + ;; + *) + 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_path_GTK_CONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" + ;; +esac +fi +GTK_CONFIG="$ac_cv_path_GTK_CONFIG" +if test -n "$GTK_CONFIG"; then + echo "$ac_t""$GTK_CONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + min_gtk_version=1.2.0 + echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 +echo "configure:2128: checking for GTK - version >= $min_gtk_version" >&5 + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" + rm -f conf.gtktest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat > conftest.$ac_ext <<EOF +#line 2151 "configure" +#include "confdefs.h" + +#include <gtk/gtk.h> +#include <stdio.h> +#include <stdlib.h> + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} + +EOF +if { (eval echo configure:2229: \"$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* + no_gtk=yes +fi +rm -fr conftest* +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + echo "$ac_t""yes" 1>&6 + : + else + echo "$ac_t""no" 1>&6 + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + cat > conftest.$ac_ext <<EOF +#line 2263 "configure" +#include "confdefs.h" + +#include <gtk/gtk.h> +#include <stdio.h> + +int main() { + return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); +; return 0; } +EOF +if { (eval echo configure:2273: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" +fi +rm -f conftest* + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + { echo "configure: error: GTK not installed" 1>&2; exit 1; } + fi + + + rm -f conf.gtktest + + CPPFLAGS="$CPPFLAGS $GTK_CFLAGS" + + saved_ldflags="$LDFLAGS" + LDFLAGS="$LDFLAGS $GTK_LIBS" + + gnome_cv_passdown_x_libs="$GTK_LIBS" + gnome_cv_passdown_X_LIBS="$GTK_LIBS" + gnome_cv_passdown_X_CFLAGS="$GTK_CFLAGS" + gnome_cv_passdown_GTK_LIBS="$GTK_LIBS" + + LDFLAGS="$saved_ldflags $GTK_LIBS" + + USE_DEVGTK=true + + + GNOME_HAVE_SM=true + case "$GTK_LIBS" in + *-lSM*) + ;; + *) + echo $ac_n "checking for SmcSaveYourselfDone in -lSM""... $ac_c" 1>&6 +echo "configure:2332: checking for SmcSaveYourselfDone in -lSM" >&5 +ac_lib_var=`echo SM'_'SmcSaveYourselfDone | 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="-lSM $x_libs -lICE $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2340 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char SmcSaveYourselfDone(); + +int main() { +SmcSaveYourselfDone() +; return 0; } +EOF +if { (eval echo configure:2351: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + GTK_LIBS="-lSM -lICE $GTK_LIBS" +else + echo "$ac_t""no" 1>&6 +GNOME_HAVE_SM=false +fi + + ;; + esac + + if test "$GNOME_HAVE_SM" = true; then + for ac_hdr in X11/SM/SMlib.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2380: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2385 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2390: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +GNOME_HAVE_SM=false +fi +done + + fi + + if test "$GNOME_HAVE_SM" = true; then + cat >> confdefs.h <<\EOF +#define HAVE_LIBSM 1 +EOF + + fi + + XPM_LIBS="" + echo $ac_n "checking for XpmFreeXpmImage in -lXpm""... $ac_c" 1>&6 +echo "configure:2428: checking for XpmFreeXpmImage in -lXpm" >&5 +ac_lib_var=`echo Xpm'_'XpmFreeXpmImage | 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="-lXpm $x_libs $LIBS" +cat > conftest.$ac_ext <<EOF +#line 2436 "configure" +#include "confdefs.h" +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XpmFreeXpmImage(); + +int main() { +XpmFreeXpmImage() +; return 0; } +EOF +if { (eval echo configure:2447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + XPM_LIBS="-lXpm" +else + echo "$ac_t""no" 1>&6 +fi + + + + + LDFLAGS="$saved_ldflags" + + + + +ALL_LINGUAS="" + +# Make sure we can run config.sub. +if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : +else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +fi + +echo $ac_n "checking host system type""... $ac_c" 1>&6 +echo "configure:2483: checking host system type" >&5 + +host_alias=$host +case "$host_alias" in +NONE) + case $nonopt in + NONE) + if host_alias=`${CONFIG_SHELL-/bin/sh} $ac_config_guess`; then : + else { echo "configure: error: can not guess host type; you must specify one" 1>&2; exit 1; } + fi ;; + *) host_alias=$nonopt ;; + esac ;; +esac + +host=`${CONFIG_SHELL-/bin/sh} $ac_config_sub $host_alias` +host_cpu=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +echo "$ac_t""$host" 1>&6 + +# Extract the first word of "ranlib", so it can be a program name with args. +set dummy ranlib; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2506: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$RANLIB"; then + ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. +else + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_prog_RANLIB="ranlib" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_prog_RANLIB" && ac_cv_prog_RANLIB=":" +fi +fi +RANLIB="$ac_cv_prog_RANLIB" +if test -n "$RANLIB"; then + echo "$ac_t""$RANLIB" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +echo $ac_n "checking for working const""... $ac_c" 1>&6 +echo "configure:2534: 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 <<EOF +#line 2539 "configure" +#include "confdefs.h" + +int main() { + +/* Ultrix mips cc rejects this. */ +typedef int charset[2]; const charset x; +/* SunOS 4.1.1 cc rejects this. */ +char const *const *ccp; +char **p; +/* NEC SVR4.0.2 mips cc rejects this. */ +struct point {int x, y;}; +static struct point const zero = {0,0}; +/* AIX XL C 1.02.0.0 rejects this. + It does not let you subtract one const X* pointer from another in an arm + of an if-expression whose if-part is not a constant expression */ +const char *g = "string"; +ccp = &g + (g ? g-g : 0); +/* HPUX 7.0 cc rejects these. */ +++ccp; +p = (char**) ccp; +ccp = (char const *const *) p; +{ /* SCO 3.2v4 cc rejects this. */ + char *t; + char const *s = 0 ? (char *) 0 : (char const *) 0; + + *t++ = 0; +} +{ /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ + int x[] = {25, 17}; + const int *foo = &x[0]; + ++foo; +} +{ /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ + typedef const int *iptr; + iptr p = 0; + ++p; +} +{ /* AIX XL C 1.02.0.0 rejects this saying + "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ + struct s { int j; const int *ap[3]; }; + struct s *b; b->j = 5; +} +{ /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ + const int foo = 10; +} + +; return 0; } +EOF +if { (eval echo configure:2588: \"$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 for inline""... $ac_c" 1>&6 +echo "configure:2609: checking for inline" >&5 +if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_cv_c_inline=no +for ac_kw in inline __inline__ __inline; do + cat > conftest.$ac_ext <<EOF +#line 2616 "configure" +#include "confdefs.h" + +int main() { +} $ac_kw foo() { +; return 0; } +EOF +if { (eval echo configure:2623: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_inline=$ac_kw; break +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* +done + +fi + +echo "$ac_t""$ac_cv_c_inline" 1>&6 +case "$ac_cv_c_inline" in + inline | yes) ;; + no) cat >> confdefs.h <<\EOF +#define inline +EOF + ;; + *) cat >> confdefs.h <<EOF +#define inline $ac_cv_c_inline +EOF + ;; +esac + +echo $ac_n "checking for off_t""... $ac_c" 1>&6 +echo "configure:2649: checking for off_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2654 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])off_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_off_t=yes +else + rm -rf conftest* + ac_cv_type_off_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_off_t" 1>&6 +if test $ac_cv_type_off_t = no; then + cat >> confdefs.h <<\EOF +#define off_t long +EOF + +fi + +echo $ac_n "checking for size_t""... $ac_c" 1>&6 +echo "configure:2682: checking for size_t" >&5 +if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2687 "configure" +#include "confdefs.h" +#include <sys/types.h> +#if STDC_HEADERS +#include <stdlib.h> +#include <stddef.h> +#endif +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "(^|[^a-zA-Z_0-9])size_t[^a-zA-Z_0-9]" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_type_size_t=yes +else + rm -rf conftest* + ac_cv_type_size_t=no +fi +rm -f conftest* + +fi +echo "$ac_t""$ac_cv_type_size_t" 1>&6 +if test $ac_cv_type_size_t = no; then + cat >> confdefs.h <<\EOF +#define size_t unsigned +EOF + +fi + +# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works +# for constant arguments. Useless! +echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +echo "configure:2717: checking for working alloca.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2722 "configure" +#include "confdefs.h" +#include <alloca.h> +int main() { +char *p = alloca(2 * sizeof(int)); +; return 0; } +EOF +if { (eval echo configure:2729: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_header_alloca_h=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_header_alloca_h=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_header_alloca_h" 1>&6 +if test $ac_cv_header_alloca_h = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ALLOCA_H 1 +EOF + +fi + +echo $ac_n "checking for alloca""... $ac_c" 1>&6 +echo "configure:2750: checking for alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2755 "configure" +#include "confdefs.h" + +#ifdef __GNUC__ +# define alloca __builtin_alloca +#else +# ifdef _MSC_VER +# include <malloc.h> +# define alloca _alloca +# else +# if HAVE_ALLOCA_H +# include <alloca.h> +# else +# ifdef _AIX + #pragma alloca +# else +# ifndef alloca /* predefined by HP cc +Olibcalls */ +char *alloca (); +# endif +# endif +# endif +# endif +#endif + +int main() { +char *p = (char *) alloca(1); +; return 0; } +EOF +if { (eval echo configure:2783: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_alloca_works=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + ac_cv_func_alloca_works=no +fi +rm -f conftest* +fi + +echo "$ac_t""$ac_cv_func_alloca_works" 1>&6 +if test $ac_cv_func_alloca_works = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ALLOCA 1 +EOF + +fi + +if test $ac_cv_func_alloca_works = no; then + # The SVR3 libPW and SVR4 libucb both contain incompatible functions + # that cause trouble. Some versions do not even contain alloca or + # contain a buggy version. If you still want to use their alloca, + # use ar to extract alloca.o from them instead of compiling alloca.c. + ALLOCA=alloca.${ac_objext} + cat >> confdefs.h <<\EOF +#define C_ALLOCA 1 +EOF + + +echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +echo "configure:2815: checking whether alloca needs Cray hooks" >&5 +if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2820 "configure" +#include "confdefs.h" +#if defined(CRAY) && ! defined(CRAY2) +webecray +#else +wenotbecray +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "webecray" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_os_cray=yes +else + rm -rf conftest* + ac_cv_os_cray=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$ac_cv_os_cray" 1>&6 +if test $ac_cv_os_cray = yes; then +for ac_func in _getb67 GETB67 getb67; do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2845: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2850 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2873: \"$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 + cat >> confdefs.h <<EOF +#define CRAY_STACKSEG_END $ac_func +EOF + + break +else + echo "$ac_t""no" 1>&6 +fi + +done +fi + +echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +echo "configure:2900: checking stack direction for C alloca" >&5 +if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_c_stack_direction=0 +else + cat > conftest.$ac_ext <<EOF +#line 2908 "configure" +#include "confdefs.h" +find_stack_direction () +{ + static char *addr = 0; + auto char dummy; + if (addr == 0) + { + addr = &dummy; + return find_stack_direction (); + } + else + return (&dummy > addr) ? 1 : -1; +} +main () +{ + exit (find_stack_direction() < 0); +} +EOF +if { (eval echo configure:2927: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_c_stack_direction=1 +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_c_stack_direction=-1 +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_c_stack_direction" 1>&6 +cat >> confdefs.h <<EOF +#define STACK_DIRECTION $ac_cv_c_stack_direction +EOF + +fi + +for ac_hdr in unistd.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:2952: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2957 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:2962: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +for ac_func in getpagesize +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:2991: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 2996 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3019: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + +echo $ac_n "checking for working mmap""... $ac_c" 1>&6 +echo "configure:3044: checking for working mmap" >&5 +if eval "test \"`echo '$''{'ac_cv_func_mmap_fixed_mapped'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_mmap_fixed_mapped=no +else + cat > conftest.$ac_ext <<EOF +#line 3052 "configure" +#include "confdefs.h" + +/* Thanks to Mike Haertel and Jim Avera for this test. + Here is a matrix of mmap possibilities: + mmap private not fixed + mmap private fixed at somewhere currently unmapped + mmap private fixed at somewhere already mapped + mmap shared not fixed + mmap shared fixed at somewhere currently unmapped + mmap shared fixed at somewhere already mapped + For private mappings, we should verify that changes cannot be read() + back from the file, nor mmap's back from the file at a different + address. (There have been systems where private was not correctly + implemented like the infamous i386 svr4.0, and systems where the + VM page cache was not coherent with the filesystem buffer cache + like early versions of FreeBSD and possibly contemporary NetBSD.) + For shared mappings, we should conversely verify that changes get + propogated back to all the places they're supposed to be. + + Grep wants private fixed already mapped. + The main things grep needs to know about mmap are: + * does it exist and is it safe to write into the mmap'd area + * how to use it (BSD variants) */ +#include <sys/types.h> +#include <fcntl.h> +#include <sys/mman.h> + +/* This mess was copied from the GNU getpagesize.h. */ +#ifndef HAVE_GETPAGESIZE +# ifdef HAVE_UNISTD_H +# include <unistd.h> +# endif + +/* Assume that all systems that can run configure have sys/param.h. */ +# ifndef HAVE_SYS_PARAM_H +# define HAVE_SYS_PARAM_H 1 +# endif + +# ifdef _SC_PAGESIZE +# define getpagesize() sysconf(_SC_PAGESIZE) +# else /* no _SC_PAGESIZE */ +# ifdef HAVE_SYS_PARAM_H +# include <sys/param.h> +# ifdef EXEC_PAGESIZE +# define getpagesize() EXEC_PAGESIZE +# else /* no EXEC_PAGESIZE */ +# ifdef NBPG +# define getpagesize() NBPG * CLSIZE +# ifndef CLSIZE +# define CLSIZE 1 +# endif /* no CLSIZE */ +# else /* no NBPG */ +# ifdef NBPC +# define getpagesize() NBPC +# else /* no NBPC */ +# ifdef PAGESIZE +# define getpagesize() PAGESIZE +# endif /* PAGESIZE */ +# endif /* no NBPC */ +# endif /* no NBPG */ +# endif /* no EXEC_PAGESIZE */ +# else /* no HAVE_SYS_PARAM_H */ +# define getpagesize() 8192 /* punt totally */ +# endif /* no HAVE_SYS_PARAM_H */ +# endif /* no _SC_PAGESIZE */ + +#endif /* no HAVE_GETPAGESIZE */ + +#ifdef __cplusplus +extern "C" { void *malloc(unsigned); } +#else +char *malloc(); +#endif + +int +main() +{ + char *data, *data2, *data3; + int i, pagesize; + int fd; + + pagesize = getpagesize(); + + /* + * First, make a file with some known garbage in it. + */ + data = malloc(pagesize); + if (!data) + exit(1); + for (i = 0; i < pagesize; ++i) + *(data + i) = rand(); + umask(0); + fd = creat("conftestmmap", 0600); + if (fd < 0) + exit(1); + if (write(fd, data, pagesize) != pagesize) + exit(1); + close(fd); + + /* + * Next, try to mmap the file at a fixed address which + * already has something else allocated at it. If we can, + * also make sure that we see the same garbage. + */ + fd = open("conftestmmap", O_RDWR); + if (fd < 0) + exit(1); + data2 = malloc(2 * pagesize); + if (!data2) + exit(1); + data2 += (pagesize - ((int) data2 & (pagesize - 1))) & (pagesize - 1); + if (data2 != mmap(data2, pagesize, PROT_READ | PROT_WRITE, + MAP_PRIVATE | MAP_FIXED, fd, 0L)) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data2 + i)) + exit(1); + + /* + * Finally, make sure that changes to the mapped area + * do not percolate back to the file as seen by read(). + * (This is a bug on some variants of i386 svr4.0.) + */ + for (i = 0; i < pagesize; ++i) + *(data2 + i) = *(data2 + i) + 1; + data3 = malloc(pagesize); + if (!data3) + exit(1); + if (read(fd, data3, pagesize) != pagesize) + exit(1); + for (i = 0; i < pagesize; ++i) + if (*(data + i) != *(data3 + i)) + exit(1); + close(fd); + unlink("conftestmmap"); + exit(0); +} + +EOF +if { (eval echo configure:3192: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + ac_cv_func_mmap_fixed_mapped=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + ac_cv_func_mmap_fixed_mapped=no +fi +rm -fr conftest* +fi + +fi + +echo "$ac_t""$ac_cv_func_mmap_fixed_mapped" 1>&6 +if test $ac_cv_func_mmap_fixed_mapped = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_MMAP 1 +EOF + +fi + + + echo $ac_n "checking whether we are using the GNU C Library 2.1 or newer""... $ac_c" 1>&6 +echo "configure:3216: checking whether we are using the GNU C Library 2.1 or newer" >&5 +if eval "test \"`echo '$''{'ac_cv_gnu_library_2_1'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3221 "configure" +#include "confdefs.h" + +#include <features.h> +#ifdef __GNU_LIBRARY__ + #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) + Lucky GNU user + #endif +#endif + +EOF +if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | + egrep "Lucky GNU user" >/dev/null 2>&1; then + rm -rf conftest* + ac_cv_gnu_library_2_1=yes +else + rm -rf conftest* + ac_cv_gnu_library_2_1=no +fi +rm -f conftest* + + + +fi + +echo "$ac_t""$ac_cv_gnu_library_2_1" 1>&6 + + GLIBC21="$ac_cv_gnu_library_2_1" + + + + for ac_hdr in argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ +stdlib.h string.h unistd.h sys/param.h +do +ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 +echo "configure:3257: checking for $ac_hdr" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3262 "configure" +#include "confdefs.h" +#include <$ac_hdr> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3267: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` +if test -z "$ac_err"; then + rm -rf conftest* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` + cat >> confdefs.h <<EOF +#define $ac_tr_hdr 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + for ac_func in feof_unlocked fgets_unlocked getcwd getegid geteuid \ +getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ +strdup strtoul tsearch __argz_count __argz_stringify __argz_next +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3298: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3303 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3326: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + + + + # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. +if test "${with_libiconv_prefix+set}" = set; then + withval="$with_libiconv_prefix" + + for dir in `echo "$withval" | tr : ' '`; do + if test -d $dir/include; then CPPFLAGS="$CPPFLAGS -I$dir/include"; fi + if test -d $dir/lib; then LDFLAGS="$LDFLAGS -L$dir/lib"; fi + done + +fi + + + echo $ac_n "checking for iconv""... $ac_c" 1>&6 +echo "configure:3366: checking for iconv" >&5 +if eval "test \"`echo '$''{'am_cv_func_iconv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + am_cv_func_iconv="no, consider installing GNU libiconv" + am_cv_lib_iconv=no + cat > conftest.$ac_ext <<EOF +#line 3374 "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <iconv.h> +int main() { +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); +; return 0; } +EOF +if { (eval echo configure:3384: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_func_iconv=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + if test "$am_cv_func_iconv" != yes; then + am_save_LIBS="$LIBS" + LIBS="$LIBS -liconv" + cat > conftest.$ac_ext <<EOF +#line 3396 "configure" +#include "confdefs.h" +#include <stdlib.h> +#include <iconv.h> +int main() { +iconv_t cd = iconv_open("",""); + iconv(cd,NULL,NULL,NULL,NULL); + iconv_close(cd); +; return 0; } +EOF +if { (eval echo configure:3406: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_lib_iconv=yes + am_cv_func_iconv=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +fi +rm -f conftest* + LIBS="$am_save_LIBS" + fi + +fi + +echo "$ac_t""$am_cv_func_iconv" 1>&6 + if test "$am_cv_func_iconv" = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_ICONV 1 +EOF + + echo $ac_n "checking for iconv declaration""... $ac_c" 1>&6 +echo "configure:3427: checking for iconv declaration" >&5 + if eval "test \"`echo '$''{'am_cv_proto_iconv'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + + cat > conftest.$ac_ext <<EOF +#line 3433 "configure" +#include "confdefs.h" + +#include <stdlib.h> +#include <iconv.h> +extern +#ifdef __cplusplus +"C" +#endif +#if defined(__STDC__) || defined(__cplusplus) +size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); +#else +size_t iconv(); +#endif + +int main() { + +; return 0; } +EOF +if { (eval echo configure:3452: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + am_cv_proto_iconv_arg1="" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_proto_iconv_arg1="const" +fi +rm -f conftest* + am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);" +fi + + am_cv_proto_iconv=`echo "$am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` + echo "$ac_t""${ac_t:- + }$am_cv_proto_iconv" 1>&6 + cat >> confdefs.h <<EOF +#define ICONV_CONST $am_cv_proto_iconv_arg1 +EOF + + fi + LIBICONV= + if test "$am_cv_lib_iconv" = yes; then + LIBICONV="-liconv" + fi + + + + echo $ac_n "checking for nl_langinfo and CODESET""... $ac_c" 1>&6 +echo "configure:3481: checking for nl_langinfo and CODESET" >&5 +if eval "test \"`echo '$''{'am_cv_langinfo_codeset'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3486 "configure" +#include "confdefs.h" +#include <langinfo.h> +int main() { +char* cs = nl_langinfo(CODESET); +; return 0; } +EOF +if { (eval echo configure:3493: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_langinfo_codeset=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_langinfo_codeset=no +fi +rm -f conftest* + +fi + +echo "$ac_t""$am_cv_langinfo_codeset" 1>&6 + if test $am_cv_langinfo_codeset = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LANGINFO_CODESET 1 +EOF + + fi + + if test $ac_cv_header_locale_h = yes; then + echo $ac_n "checking for LC_MESSAGES""... $ac_c" 1>&6 +echo "configure:3516: checking for LC_MESSAGES" >&5 +if eval "test \"`echo '$''{'am_cv_val_LC_MESSAGES'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3521 "configure" +#include "confdefs.h" +#include <locale.h> +int main() { +return LC_MESSAGES +; return 0; } +EOF +if { (eval echo configure:3528: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + am_cv_val_LC_MESSAGES=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + am_cv_val_LC_MESSAGES=no +fi +rm -f conftest* +fi + +echo "$ac_t""$am_cv_val_LC_MESSAGES" 1>&6 + if test $am_cv_val_LC_MESSAGES = yes; then + cat >> confdefs.h <<\EOF +#define HAVE_LC_MESSAGES 1 +EOF + + fi + fi + echo $ac_n "checking whether NLS is requested""... $ac_c" 1>&6 +echo "configure:3549: checking whether NLS is requested" >&5 + # Check whether --enable-nls or --disable-nls was given. +if test "${enable_nls+set}" = set; then + enableval="$enable_nls" + USE_NLS=$enableval +else + USE_NLS=yes +fi + + echo "$ac_t""$USE_NLS" 1>&6 + + + BUILD_INCLUDED_LIBINTL=no + USE_INCLUDED_LIBINTL=no + INTLLIBS= + + if test "$USE_NLS" = "yes"; then + cat >> confdefs.h <<\EOF +#define ENABLE_NLS 1 +EOF + + echo $ac_n "checking whether included gettext is requested""... $ac_c" 1>&6 +echo "configure:3571: checking whether included gettext is requested" >&5 + # Check whether --with-included-gettext or --without-included-gettext was given. +if test "${with_included_gettext+set}" = set; then + withval="$with_included_gettext" + nls_cv_force_use_gnu_gettext=$withval +else + nls_cv_force_use_gnu_gettext=no +fi + + echo "$ac_t""$nls_cv_force_use_gnu_gettext" 1>&6 + + nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" + if test "$nls_cv_force_use_gnu_gettext" != "yes"; then + CATOBJEXT=NONE + + + + + ac_safe=`echo "libintl.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for libintl.h""... $ac_c" 1>&6 +echo "configure:3591: checking for libintl.h" >&5 +if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3596 "configure" +#include "confdefs.h" +#include <libintl.h> +EOF +ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +{ (eval echo configure:3601: \"$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 + echo $ac_n "checking for GNU gettext in libc""... $ac_c" 1>&6 +echo "configure:3618: checking for GNU gettext in libc" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3623 "configure" +#include "confdefs.h" +#include <libintl.h> +extern int _nl_msg_cat_cntr; +int main() { +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr +; return 0; } +EOF +if { (eval echo configure:3632: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + gt_cv_func_gnugettext1_libc=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gt_cv_func_gnugettext1_libc=no +fi +rm -f conftest* +fi + +echo "$ac_t""$gt_cv_func_gnugettext1_libc" 1>&6 + + if test "$gt_cv_func_gnugettext1_libc" != "yes"; then + echo $ac_n "checking for GNU gettext in libintl""... $ac_c" 1>&6 +echo "configure:3648: checking for GNU gettext in libintl" >&5 +if eval "test \"`echo '$''{'gt_cv_func_gnugettext1_libintl'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + gt_save_LIBS="$LIBS" + LIBS="$LIBS -lintl $LIBICONV" + cat > conftest.$ac_ext <<EOF +#line 3655 "configure" +#include "confdefs.h" +#include <libintl.h> +extern int _nl_msg_cat_cntr; +int main() { +bindtextdomain ("", ""); +return (int) gettext ("") + _nl_msg_cat_cntr +; return 0; } +EOF +if { (eval echo configure:3664: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + gt_cv_func_gnugettext1_libintl=yes +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + gt_cv_func_gnugettext1_libintl=no +fi +rm -f conftest* + LIBS="$gt_save_LIBS" +fi + +echo "$ac_t""$gt_cv_func_gnugettext1_libintl" 1>&6 + fi + + if test "$gt_cv_func_gnugettext1_libc" = "yes" \ + || { test "$gt_cv_func_gnugettext1_libintl" = "yes" \ + && test "$PACKAGE" != gettext; }; then + cat >> confdefs.h <<\EOF +#define HAVE_GETTEXT 1 +EOF + + + if test "$gt_cv_func_gnugettext1_libintl" = "yes"; then + INTLLIBS="-lintl $LIBICONV" + fi + + gt_save_LIBS="$LIBS" + LIBS="$LIBS $INTLLIBS" + for ac_func in dcgettext +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3697: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext <<EOF +#line 3702 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func(); below. */ +#include <assert.h> +/* Override any gcc2 internal prototype to avoid an error. */ +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char $ac_func(); + +int main() { + +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +choke me +#else +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3725: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <<EOF +#define $ac_tr_func 1 +EOF + +else + echo "$ac_t""no" 1>&6 +fi +done + + LIBS="$gt_save_LIBS" + + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3754: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + echo "$ac_t""$MSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3788: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + 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_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3825: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + CATOBJEXT=.gmo + fi + +else + echo "$ac_t""no" 1>&6 +fi + + + if test "$CATOBJEXT" = "NONE"; then + nls_cv_use_gnu_gettext=yes + fi + fi + + if test "$nls_cv_use_gnu_gettext" = "yes"; then + INTLOBJS="\$(GETTOBJS)" + # Extract the first word of "msgfmt", so it can be a program name with args. +set dummy msgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3875: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_MSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$MSGFMT" in + /*) + ac_cv_path_MSGFMT="$MSGFMT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1; then + ac_cv_path_MSGFMT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_MSGFMT" && ac_cv_path_MSGFMT=":" + ;; +esac +fi +MSGFMT="$ac_cv_path_MSGFMT" +if test "$MSGFMT" != ":"; then + echo "$ac_t""$MSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "gmsgfmt", so it can be a program name with args. +set dummy gmsgfmt; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3909: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GMSGFMT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GMSGFMT" in + /*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GMSGFMT="$GMSGFMT" # Let the user override the test with a dos path. + ;; + *) + 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_path_GMSGFMT="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GMSGFMT" && ac_cv_path_GMSGFMT="$MSGFMT" + ;; +esac +fi +GMSGFMT="$ac_cv_path_GMSGFMT" +if test -n "$GMSGFMT"; then + echo "$ac_t""$GMSGFMT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + # Extract the first word of "xgettext", so it can be a program name with args. +set dummy xgettext; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:3945: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_XGETTEXT'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$XGETTEXT" in + /*) + ac_cv_path_XGETTEXT="$XGETTEXT" # Let the user override the test with a path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" + for ac_dir in $PATH; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + if $ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1; then + ac_cv_path_XGETTEXT="$ac_dir/$ac_word" + break + fi + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_XGETTEXT" && ac_cv_path_XGETTEXT=":" + ;; +esac +fi +XGETTEXT="$ac_cv_path_XGETTEXT" +if test "$XGETTEXT" != ":"; then + echo "$ac_t""$XGETTEXT" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + + BUILD_INCLUDED_LIBINTL=yes + USE_INCLUDED_LIBINTL=yes + CATOBJEXT=.gmo + INTLLIBS="\$(top_builddir)/intl/libintl.a $LIBICONV" + LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` + fi + + if test "$GMSGFMT" != ":"; then + if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then + : ; + else + echo "$ac_t""found msgfmt program is not GNU msgfmt; ignore it" 1>&6 + GMSGFMT=":" + fi + fi + + if test "$XGETTEXT" != ":"; then + if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then + : ; + else + echo "$ac_t""found xgettext program is not GNU xgettext; ignore it" 1>&6 + XGETTEXT=":" + fi + fi + + POSUB=po + fi + + + + if test "$PACKAGE" = gettext; then + BUILD_INCLUDED_LIBINTL=yes + fi + + for ac_prog in bison +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:4016: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_INTLBISON'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + if test -n "$INTLBISON"; then + ac_cv_prog_INTLBISON="$INTLBISON" # 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_INTLBISON="$ac_prog" + break + fi + done + IFS="$ac_save_ifs" +fi +fi +INTLBISON="$ac_cv_prog_INTLBISON" +if test -n "$INTLBISON"; then + echo "$ac_t""$INTLBISON" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + +test -n "$INTLBISON" && break +done + + if test -z "$INTLBISON"; then + ac_verc_fail=yes + else + echo $ac_n "checking version of bison""... $ac_c" 1>&6 +echo "configure:4049: checking version of bison" >&5 + ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) + ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; + *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; + esac + echo "$ac_t""$ac_prog_version" 1>&6 + fi + if test $ac_verc_fail = yes; then + INTLBISON=: + fi + + for lang in $ALL_LINGUAS; do + GMOFILES="$GMOFILES $lang.gmo" + POFILES="$POFILES $lang.po" + done + + + + + + + + + + + + nls_cv_header_intl= + nls_cv_header_libgt= + + DATADIRNAME=share + + + INSTOBJEXT=.mo + + + GENCAT=gencat + + + + if test "x$CATOBJEXT" != "x"; then + if test "x$ALL_LINGUAS" = "x"; then + LINGUAS= + else + echo $ac_n "checking for catalogs to be installed""... $ac_c" 1>&6 +echo "configure:4096: checking for catalogs to be installed" >&5 + NEW_LINGUAS= + for presentlang in $ALL_LINGUAS; do + useit=no + for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do + # Use the presentlang catalog if desiredlang is + # a. equal to presentlang, or + # b. a variant of presentlang (because in this case, + # presentlang can be used as a fallback for messages + # which are not translated in the desiredlang catalog). + case "$desiredlang" in + "$presentlang"*) useit=yes;; + esac + done + if test $useit = yes; then + NEW_LINGUAS="$NEW_LINGUAS $presentlang" + fi + done + LINGUAS=$NEW_LINGUAS + echo "$ac_t""$LINGUAS" 1>&6 + fi + + if test -n "$LINGUAS"; then + for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done + fi + fi + + MKINSTALLDIRS= + if test -n "$ac_aux_dir"; then + MKINSTALLDIRS="$ac_aux_dir/mkinstalldirs" + fi + if test -z "$MKINSTALLDIRS"; then + MKINSTALLDIRS="\$(top_srcdir)/mkinstalldirs" + fi + + + INTL_LIBTOOL_SUFFIX_PREFIX= + + + +if test "x${prefix}" = "xNONE"; then + cat >> confdefs.h <<EOF +#define PACKAGE_LOCALE_DIR "${ac_default_prefix}/${DATADIRNAME}/locale" +EOF + +else + cat >> confdefs.h <<EOF +#define PACKAGE_LOCALE_DIR "${prefix}/${DATADIRNAME}/locale" +EOF + +fi + +PACKAGE_PIXMAPS_DIR="`gnome-config --datadir`/pixmaps/${PACKAGE}" + + +VCL_dir="vcl" +(mkdir -p $VCL_dir; cd $VCL_dir; $abs_srcdir/../VCL/configure) + +trap '' 1 2 15 +cat > confcache <<\EOF +# This file is a shell script that caches the results of configure +# tests run on this system so they can be shared between configure +# scripts and configure runs. It is not useful on other systems. +# If it contains results you don't want to keep, you may remove or edit it. +# +# By default, configure uses ./config.cache as the cache file, +# creating it if it does not exist already. You can give configure +# the --cache-file=FILE option to use a different cache file; that is +# what configure does when it calls configure scripts in +# subdirectories, so they share the cache. +# Giving --cache-file=/dev/null disables caching, for debugging configure. +# config.status only pays attention to the cache file if you give it the +# --recheck option to rerun configure. +# +EOF +# The following way of writing the cache mishandles newlines in values, +# but we know of no workaround that is simple, portable, and efficient. +# So, don't put newlines in cache variables' values. +# Ultrix sh set writes to stderr and can't be redirected directly, +# and sets the high bit in the cache file unless we assign to the vars. +(set) 2>&1 | + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) + # `set' does not quote correctly, so add quotes (double-quote substitution + # turns \\\\ into \\, and sed turns \\ into \). + sed -n \ + -e "s/'/'\\\\''/g" \ + -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" + ;; + *) + # `set' quotes correctly as required by POSIX, so do not add quotes. + sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' + ;; + esac >> confcache +if cmp -s $cache_file confcache; then + : +else + if test -w $cache_file; then + echo "updating cache $cache_file" + cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi +fi +rm -f confcache + +trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 + +test "x$prefix" = xNONE && prefix=$ac_default_prefix +# Let make expand exec_prefix. +test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +# Any assignment to VPATH causes Sun make to only execute +# the first set of double-colon rules, so remove it if not needed. +# If there is a colon in the path, we need to keep it. +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' +fi + +trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + +DEFS=-DHAVE_CONFIG_H + +# Without the "./", some shells look in PATH for config.status. +: ${CONFIG_STATUS=./config.status} + +echo creating $CONFIG_STATUS +rm -f $CONFIG_STATUS +cat > $CONFIG_STATUS <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo " +Makefile +macros/Makefile +src/Makefile +intl/Makefile +po/Makefile.in + config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@INSIDE_GNOME_COMMON_TRUE@%$INSIDE_GNOME_COMMON_TRUE%g +s%@INSIDE_GNOME_COMMON_FALSE@%$INSIDE_GNOME_COMMON_FALSE%g +s%@GNOME_LIBS@%$GNOME_LIBS%g +s%@GNOMEUI_LIBS@%$GNOMEUI_LIBS%g +s%@GNOMEGNORBA_LIBS@%$GNOMEGNORBA_LIBS%g +s%@GTKXMHTML_LIBS@%$GTKXMHTML_LIBS%g +s%@ZVT_LIBS@%$ZVT_LIBS%g +s%@GNOME_LIBDIR@%$GNOME_LIBDIR%g +s%@GNOME_INCLUDEDIR@%$GNOME_INCLUDEDIR%g +s%@GNOME_CONFIG@%$GNOME_CONFIG%g +s%@ORBIT_CONFIG@%$ORBIT_CONFIG%g +s%@ORBIT_IDL@%$ORBIT_IDL%g +s%@HAVE_ORBIT_TRUE@%$HAVE_ORBIT_TRUE%g +s%@HAVE_ORBIT_FALSE@%$HAVE_ORBIT_FALSE%g +s%@ORBIT_CFLAGS@%$ORBIT_CFLAGS%g +s%@ORBIT_LIBS@%$ORBIT_LIBS%g +s%@HAVE_GNORBA_TRUE@%$HAVE_GNORBA_TRUE%g +s%@HAVE_GNORBA_FALSE@%$HAVE_GNORBA_FALSE%g +s%@GNORBA_CFLAGS@%$GNORBA_CFLAGS%g +s%@GNORBA_LIBS@%$GNORBA_LIBS%g +s%@GNOME_APPLETS_LIBS@%$GNOME_APPLETS_LIBS%g +s%@GNOME_CAPPLET_LIBS@%$GNOME_CAPPLET_LIBS%g +s%@CC@%$CC%g +s%@CXX@%$CXX%g +s%@CPP@%$CPP%g +s%@cflags_set@%$cflags_set%g +s%@GTK_CONFIG@%$GTK_CONFIG%g +s%@GTK_CFLAGS@%$GTK_CFLAGS%g +s%@GTK_LIBS@%$GTK_LIBS%g +s%@XPM_LIBS@%$XPM_LIBS%g +s%@PTHREAD_LIB@%$PTHREAD_LIB%g +s%@host@%$host%g +s%@host_alias@%$host_alias%g +s%@host_cpu@%$host_cpu%g +s%@host_vendor@%$host_vendor%g +s%@host_os@%$host_os%g +s%@RANLIB@%$RANLIB%g +s%@ALLOCA@%$ALLOCA%g +s%@GLIBC21@%$GLIBC21%g +s%@LIBICONV@%$LIBICONV%g +s%@USE_NLS@%$USE_NLS%g +s%@MSGFMT@%$MSGFMT%g +s%@GMSGFMT@%$GMSGFMT%g +s%@XGETTEXT@%$XGETTEXT%g +s%@INTLBISON@%$INTLBISON%g +s%@BUILD_INCLUDED_LIBINTL@%$BUILD_INCLUDED_LIBINTL%g +s%@USE_INCLUDED_LIBINTL@%$USE_INCLUDED_LIBINTL%g +s%@CATALOGS@%$CATALOGS%g +s%@CATOBJEXT@%$CATOBJEXT%g +s%@GMOFILES@%$GMOFILES%g +s%@INTLLIBS@%$INTLLIBS%g +s%@INTLOBJS@%$INTLOBJS%g +s%@POFILES@%$POFILES%g +s%@POSUB@%$POSUB%g +s%@DATADIRNAME@%$DATADIRNAME%g +s%@INSTOBJEXT@%$INSTOBJEXT%g +s%@GENCAT@%$GENCAT%g +s%@MKINSTALLDIRS@%$MKINSTALLDIRS%g +s%@INTL_LIBTOOL_SUFFIX_PREFIX@%$INTL_LIBTOOL_SUFFIX_PREFIX%g +s%@PACKAGE_PIXMAPS_DIR@%$PACKAGE_PIXMAPS_DIR%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile +macros/Makefile +src/Makefile +intl/Makefile +po/Makefile.in +"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' +ac_dC='\3' +ac_dD='%g' +# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". +ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='\([ ]\)%\1#\2define\3' +ac_uC=' ' +ac_uD='\4%g' +# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_eB='$%\1#\2define\3' +ac_eC=' ' +ac_eD='%g' + +if test "${CONFIG_HEADERS+set}" != set; then +EOF +cat >> $CONFIG_STATUS <<EOF + CONFIG_HEADERS="config.h" +EOF +cat >> $CONFIG_STATUS <<\EOF +fi +for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + echo creating $ac_file + + rm -f conftest.frag conftest.in conftest.out + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + cat $ac_file_inputs > conftest.in + +EOF + +# Transform confdefs.h into a sed script conftest.vals that substitutes +# the proper values into config.h.in to produce config.h. And first: +# Protect against being on the right side of a sed subst in config.status. +# Protect against being in an unquoted here document in config.status. +rm -f conftest.vals +cat > conftest.hdr <<\EOF +s/[\\&%]/\\&/g +s%[\\$`]%\\&%g +s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp +s%ac_d%ac_u%gp +s%ac_u%ac_e%gp +EOF +sed -n -f conftest.hdr confdefs.h > conftest.vals +rm -f conftest.hdr + +# This sed command replaces #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +cat >> conftest.vals <<\EOF +s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% +EOF + +# Break up conftest.vals because some shells have a limit on +# the size of here documents, and old seds have small limits too. + +rm -f conftest.tail +while : +do + ac_lines=`grep -c . conftest.vals` + # grep -c gives empty output for an empty file on some AIX systems. + if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi + # Write a limited-size here document to conftest.frag. + echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF + sed -f conftest.frag conftest.in > conftest.out + rm -f conftest.in + mv conftest.out conftest.in +' >> $CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail + rm -f conftest.vals + mv conftest.tail conftest.vals +done +rm -f conftest.vals + +cat >> $CONFIG_STATUS <<\EOF + rm -f conftest.frag conftest.h + echo "/* $ac_file. Generated automatically by configure. */" > conftest.h + cat conftest.in >> conftest.h + rm -f conftest.in + if cmp -s $ac_file conftest.h 2>/dev/null; then + echo "$ac_file is unchanged" + rm -f conftest.h + else + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + fi + rm -f $ac_file + mv conftest.h $ac_file + fi +fi; done + +EOF +cat >> $CONFIG_STATUS <<EOF + + + +EOF +cat >> $CONFIG_STATUS <<\EOF +test -z "$CONFIG_HEADERS" || echo timestamp > stamp-h +for ac_file in $CONFIG_FILES; do + # Support "outfile[:infile[:infile...]]" + case "$ac_file" in + *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + esac + # PO directories have a Makefile.in generated from Makefile.in.in. + case "$ac_file" in */Makefile.in) + # Adjust a relative srcdir. + ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` + ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" + ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` + # In autoconf-2.13 it is called $ac_given_srcdir. + # In autoconf-2.50 it is called $srcdir. + test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" + case "$ac_given_srcdir" in + .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; + /*) top_srcdir="$ac_given_srcdir" ;; + *) top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then + rm -f "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" + sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" + test -n "$as_me" && echo "$as_me: creating $ac_dir/Makefile" || echo "creating $ac_dir/Makefile" + sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/Makefile.in" > "$ac_dir/Makefile" + fi + ;; + esac + done + +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 + + diff --git a/apps/X11/InstallMgr/configure.in b/apps/X11/InstallMgr/configure.in new file mode 100644 index 0000000..9cae988 --- /dev/null +++ b/apps/X11/InstallMgr/configure.in @@ -0,0 +1,47 @@ +dnl Process this file with autoconf to produce a configure script. + +AC_INIT(configure.in) +AM_INIT_AUTOMAKE(installmgr, 0.1) +AM_CONFIG_HEADER(config.h) + +abs_srcdir="`cd $srcdir && pwd`" + +dnl Pick up the Gnome macros. +AM_ACLOCAL_INCLUDE(macros) + +GNOME_INIT +AC_ISC_POSIX +AC_PROG_CC +AC_PROG_CXX +AM_PROG_CC_STDC +AC_HEADER_STDC + +GNOME_COMPILE_WARNINGS +GNOME_X_CHECKS + +dnl Add the languages which your application supports here. +ALL_LINGUAS="" +AM_GNU_GETTEXT + +dnl Set PACKAGE_LOCALE_DIR in config.h. +if test "x${prefix}" = "xNONE"; then + AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${ac_default_prefix}/${DATADIRNAME}/locale") +else + AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${prefix}/${DATADIRNAME}/locale") +fi + +dnl Subst PACKAGE_PIXMAPS_DIR. +PACKAGE_PIXMAPS_DIR="`gnome-config --datadir`/pixmaps/${PACKAGE}" +AC_SUBST(PACKAGE_PIXMAPS_DIR) + +VCL_dir="vcl" +(mkdir -p $VCL_dir; cd $VCL_dir; $abs_srcdir/../VCL/configure) + +AC_OUTPUT([ +Makefile +macros/Makefile +src/Makefile +intl/Makefile +po/Makefile.in +]) + diff --git a/apps/X11/InstallMgr/macros/Makefile.in b/apps/X11/InstallMgr/macros/Makefile.in new file mode 100644 index 0000000..c6ca611 --- /dev/null +++ b/apps/X11/InstallMgr/macros/Makefile.in @@ -0,0 +1,257 @@ +# 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CXX = @CXX@ +DATADIRNAME = @DATADIRNAME@ +GENCAT = @GENCAT@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOMEGNORBA_LIBS = @GNOMEGNORBA_LIBS@ +GNOMEUI_LIBS = @GNOMEUI_LIBS@ +GNOME_APPLETS_LIBS = @GNOME_APPLETS_LIBS@ +GNOME_CAPPLET_LIBS = @GNOME_CAPPLET_LIBS@ +GNOME_CONFIG = @GNOME_CONFIG@ +GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ +GNOME_LIBDIR = @GNOME_LIBDIR@ +GNOME_LIBS = @GNOME_LIBS@ +GNORBA_CFLAGS = @GNORBA_CFLAGS@ +GNORBA_LIBS = @GNORBA_LIBS@ +GTKXMHTML_LIBS = @GTKXMHTML_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +ORBIT_CFLAGS = @ORBIT_CFLAGS@ +ORBIT_CONFIG = @ORBIT_CONFIG@ +ORBIT_IDL = @ORBIT_IDL@ +ORBIT_LIBS = @ORBIT_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_PIXMAPS_DIR = @PACKAGE_PIXMAPS_DIR@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PTHREAD_LIB = @PTHREAD_LIB@ +RANLIB = @RANLIB@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XPM_LIBS = @XPM_LIBS@ +ZVT_LIBS = @ZVT_LIBS@ +cflags_set = @cflags_set@ +cxxflags_set = @cxxflags_set@ + +MACROS = aclocal-include.m4 compiler-flags.m4 curses.m4 gnome-bonobo-check.m4 gnome-fileutils.m4 gnome-gettext.m4 gnome-ghttp-check.m4 gnome-gnorba-check.m4 gnome-guile-checks.m4 gnome-libgtop-check.m4 gnome-objc-checks.m4 gnome-orbit-check.m4 gnome-print-check.m4 gnome-pthread-check.m4 gnome-support.m4 gnome-undelfs.m4 gnome-vfs.m4 gnome-x-checks.m4 gnome-xml-check.m4 gnome.m4 linger.m4 need-declaration.m4 + + +EXTRA_DIST = $(MACROS) gnome-common.m4 autogen.sh +MAINTAINERCLEANFILES = macros.dep + +@INSIDE_GNOME_COMMON_TRUE@gnome_aclocaldir = $(datadir)/aclocal/gnome + +@INSIDE_GNOME_COMMON_TRUE@gnome_aclocal_DATA = $(MACROS) gnome-macros.dep gnome-common.m4 autogen.sh +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +DATA = $(gnome_aclocal_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 macros/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +install-gnome_aclocalDATA: $(gnome_aclocal_DATA) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(gnome_aclocaldir) + @list='$(gnome_aclocal_DATA)'; for p in $$list; do \ + if test -f $(srcdir)/$$p; then \ + echo " $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gnome_aclocaldir)/$$p"; \ + $(INSTALL_DATA) $(srcdir)/$$p $(DESTDIR)$(gnome_aclocaldir)/$$p; \ + else if test -f $$p; then \ + echo " $(INSTALL_DATA) $$p $(DESTDIR)$(gnome_aclocaldir)/$$p"; \ + $(INSTALL_DATA) $$p $(DESTDIR)$(gnome_aclocaldir)/$$p; \ + fi; fi; \ + done + +uninstall-gnome_aclocalDATA: + @$(NORMAL_UNINSTALL) + list='$(gnome_aclocal_DATA)'; for p in $$list; do \ + rm -f $(DESTDIR)$(gnome_aclocaldir)/$$p; \ + done +tags: TAGS +TAGS: + + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = macros + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu macros/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: +install-exec: install-exec-am + +install-data-am: install-gnome_aclocalDATA +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-gnome_aclocalDATA +uninstall: uninstall-am +all-am: Makefile $(DATA) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(gnome_aclocaldir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: + -test -z "$(MAINTAINERCLEANFILES)" || rm -f $(MAINTAINERCLEANFILES) +mostlyclean-am: mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-generic clean-am + +distclean: 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-gnome_aclocalDATA install-gnome_aclocalDATA tags \ +distdir info-am info dvi-am dvi check check-am installcheck-am \ +installcheck install-exec-am install-exec install-data-am install-data \ +install-am install uninstall-am uninstall all-redirect all-am all \ +installdirs mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +macros.dep: Makefile.am + @echo '$$(top_srcdir)/aclocal.m4: $(MACROS:%=macros/%)' > $@ + +@INSIDE_GNOME_COMMON_TRUE@gnome-macros.dep: Makefile.am +@INSIDE_GNOME_COMMON_TRUE@ @echo '$$(top_srcdir)/aclocal.m4: $(MACROS:%=$(gnome_aclocaldir)/%)' > $@ + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/X11/InstallMgr/mkinstalldirs b/apps/X11/InstallMgr/mkinstalldirs new file mode 100755 index 0000000..51d276b --- /dev/null +++ b/apps/X11/InstallMgr/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman <friedman@prep.ai.mit.edu> +# Created: 1993-05-16 +# Public domain + +# $Id: mkinstalldirs,v 1.1 1999/12/21 08:19:13 scribe 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" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/apps/X11/InstallMgr/po/ChangeLog b/apps/X11/InstallMgr/po/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/apps/X11/InstallMgr/po/ChangeLog diff --git a/apps/X11/InstallMgr/po/Makefile.in b/apps/X11/InstallMgr/po/Makefile.in new file mode 100644 index 0000000..fad13da --- /dev/null +++ b/apps/X11/InstallMgr/po/Makefile.in @@ -0,0 +1,248 @@ +# Generated automatically from Makefile.in.in by configure. +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu> +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +PACKAGE = installmgr +VERSION = 0.1 + +SHELL = /bin/sh + + +srcdir = . +top_srcdir = .. + +prefix = /usr/local +exec_prefix = ${prefix} +datadir = $(prefix)/share +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext/po +subdir = po + +INSTALL = /usr/bin/install -c +INSTALL_DATA = ${INSTALL} -m 644 +MKINSTALLDIRS = $(top_srcdir)/./mkinstalldirs + +CC = gcc +GENCAT = +GMSGFMT = PATH=../src:$$PATH /usr/bin/msgfmt +MSGFMT = /usr/bin/msgfmt +XGETTEXT = PATH=../src:$$PATH /usr/bin/xgettext +MSGMERGE = PATH=../src:$$PATH msgmerge + +DEFS = -DHAVE_CONFIG_H +CFLAGS = -g -O2 -Wall -Wunused +CPPFLAGS = -I/usr/lib/glib/include -I/usr/X11R6/include + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = +GMOFILES = +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = +CATOBJEXT = .gmo +INSTOBJEXT = .mo + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: all-yes + +all-yes: cat-id-tbl.c $(CATALOGS) +all-no: + +$(srcdir)/$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in \ + && test ! -f $(PACKAGE).po \ + || ( rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) + +$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: +$(srcdir)/stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp + if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: install-data-yes +install-data-no: all +install-data-yes: all + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(datadir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \ + fi + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + case "$$cat" in \ + *.gmo) destdir=$(gnulocaledir);; \ + *) destdir=$(localedir);; \ + esac; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $$dir; \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ + fi; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi; \ + if test -r $$cat.m; then \ + $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + if test -r $(srcdir)/$$cat.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$cat.m \ + $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + true; \ + fi; \ + fi; \ + done + if test "$(PACKAGE)" = "gettext"; then \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(gettextsrcdir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + fi; \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +dvi info tags TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: update-po $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + PATH=`pwd`/../src:$$PATH; \ + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + echo "$$lang:"; \ + if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "msgmerge for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + rm -f $@-t $@ \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/X11/InstallMgr/po/Makefile.in.in b/apps/X11/InstallMgr/po/Makefile.in.in new file mode 100644 index 0000000..111b40f --- /dev/null +++ b/apps/X11/InstallMgr/po/Makefile.in.in @@ -0,0 +1,248 @@ +# Makefile for program source directory in GNU NLS utilities package. +# Copyright (C) 1995, 1996, 1997 by Ulrich Drepper <drepper@gnu.ai.mit.edu> +# +# This file file be copied and used freely without restrictions. It can +# be used in projects which are not available under the GNU Public License +# but which still want to provide support for the GNU gettext functionality. +# Please note that the actual code is *not* freely available. + +PACKAGE = @PACKAGE@ +VERSION = @VERSION@ + +SHELL = /bin/sh +@SET_MAKE@ + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +prefix = @prefix@ +exec_prefix = @exec_prefix@ +datadir = $(prefix)/@DATADIRNAME@ +localedir = $(datadir)/locale +gnulocaledir = $(prefix)/share/locale +gettextsrcdir = $(prefix)/share/gettext/po +subdir = po + +INSTALL = @INSTALL@ +INSTALL_DATA = @INSTALL_DATA@ +MKINSTALLDIRS = $(top_srcdir)/@MKINSTALLDIRS@ + +CC = @CC@ +GENCAT = @GENCAT@ +GMSGFMT = PATH=../src:$$PATH @GMSGFMT@ +MSGFMT = @MSGFMT@ +XGETTEXT = PATH=../src:$$PATH @XGETTEXT@ +MSGMERGE = PATH=../src:$$PATH msgmerge + +DEFS = @DEFS@ +CFLAGS = @CFLAGS@ +CPPFLAGS = @CPPFLAGS@ + +INCLUDES = -I.. -I$(top_srcdir)/intl + +COMPILE = $(CC) -c $(DEFS) $(INCLUDES) $(CPPFLAGS) $(CFLAGS) $(XCFLAGS) + +SOURCES = cat-id-tbl.c +POFILES = @POFILES@ +GMOFILES = @GMOFILES@ +DISTFILES = ChangeLog Makefile.in.in POTFILES.in $(PACKAGE).pot \ +stamp-cat-id $(POFILES) $(GMOFILES) $(SOURCES) + +POTFILES = \ + +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +INSTOBJEXT = @INSTOBJEXT@ + +.SUFFIXES: +.SUFFIXES: .c .o .po .pox .gmo .mo .msg .cat + +.c.o: + $(COMPILE) $< + +.po.pox: + $(MAKE) $(PACKAGE).pot + $(MSGMERGE) $< $(srcdir)/$(PACKAGE).pot -o $*.pox + +.po.mo: + $(MSGFMT) -o $@ $< + +.po.gmo: + file=$(srcdir)/`echo $* | sed 's,.*/,,'`.gmo \ + && rm -f $$file && $(GMSGFMT) -o $$file $< + +.po.cat: + sed -f ../intl/po2msg.sed < $< > $*.msg \ + && rm -f $@ && $(GENCAT) $@ $*.msg + + +all: all-@USE_NLS@ + +all-yes: cat-id-tbl.c $(CATALOGS) +all-no: + +$(srcdir)/$(PACKAGE).pot: $(POTFILES) + $(XGETTEXT) --default-domain=$(PACKAGE) --directory=$(top_srcdir) \ + --add-comments --keyword=_ --keyword=N_ \ + --files-from=$(srcdir)/POTFILES.in \ + && test ! -f $(PACKAGE).po \ + || ( rm -f $(srcdir)/$(PACKAGE).pot \ + && mv $(PACKAGE).po $(srcdir)/$(PACKAGE).pot ) + +$(srcdir)/cat-id-tbl.c: stamp-cat-id; @: +$(srcdir)/stamp-cat-id: $(PACKAGE).pot + rm -f cat-id-tbl.tmp + sed -f ../intl/po2tbl.sed $(srcdir)/$(PACKAGE).pot \ + | sed -e "s/@PACKAGE NAME@/$(PACKAGE)/" > cat-id-tbl.tmp + if cmp -s cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; then \ + rm cat-id-tbl.tmp; \ + else \ + echo cat-id-tbl.c changed; \ + rm -f $(srcdir)/cat-id-tbl.c; \ + mv cat-id-tbl.tmp $(srcdir)/cat-id-tbl.c; \ + fi + cd $(srcdir) && rm -f stamp-cat-id && echo timestamp > stamp-cat-id + + +install: install-exec install-data +install-exec: +install-data: install-data-@USE_NLS@ +install-data-no: all +install-data-yes: all + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(datadir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(datadir); \ + fi + @catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + case "$$cat" in \ + *.gmo) destdir=$(gnulocaledir);; \ + *) destdir=$(localedir);; \ + esac; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + dir=$$destdir/$$lang/LC_MESSAGES; \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $$dir; \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $$dir; \ + fi; \ + if test -r $$cat; then \ + $(INSTALL_DATA) $$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $$cat as $$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + else \ + $(INSTALL_DATA) $(srcdir)/$$cat $$dir/$(PACKAGE)$(INSTOBJEXT); \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT)"; \ + fi; \ + if test -r $$cat.m; then \ + $(INSTALL_DATA) $$cat.m $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $$cat.m as $$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + if test -r $(srcdir)/$$cat.m ; then \ + $(INSTALL_DATA) $(srcdir)/$$cat.m \ + $$dir/$(PACKAGE)$(INSTOBJEXT).m; \ + echo "installing $(srcdir)/$$cat as" \ + "$$dir/$(PACKAGE)$(INSTOBJEXT).m"; \ + else \ + true; \ + fi; \ + fi; \ + done + if test "$(PACKAGE)" = "gettext"; then \ + if test -r "$(MKINSTALLDIRS)"; then \ + $(MKINSTALLDIRS) $(gettextsrcdir); \ + else \ + $(SHELL) $(top_srcdir)/mkinstalldirs $(gettextsrcdir); \ + fi; \ + $(INSTALL_DATA) $(srcdir)/Makefile.in.in \ + $(gettextsrcdir)/Makefile.in.in; \ + else \ + : ; \ + fi + +# Define this as empty until I found a useful application. +installcheck: + +uninstall: + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(localedir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT); \ + rm -f $(gnulocaledir)/$$lang/LC_MESSAGES/$(PACKAGE)$(INSTOBJEXT).m; \ + done + rm -f $(gettextsrcdir)/po-Makefile.in.in + +check: all + +cat-id-tbl.o: ../intl/libgettext.h + +dvi info tags TAGS ID: + +mostlyclean: + rm -f core core.* *.pox $(PACKAGE).po *.old.po cat-id-tbl.tmp + rm -fr *.o + +clean: mostlyclean + +distclean: clean + rm -f Makefile Makefile.in POTFILES *.mo *.msg *.cat *.cat.m + +maintainer-clean: distclean + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + rm -f $(GMOFILES) + +distdir = ../$(PACKAGE)-$(VERSION)/$(subdir) +dist distdir: update-po $(DISTFILES) + dists="$(DISTFILES)"; \ + for file in $$dists; do \ + ln $(srcdir)/$$file $(distdir) 2> /dev/null \ + || cp -p $(srcdir)/$$file $(distdir); \ + done + +update-po: Makefile + $(MAKE) $(PACKAGE).pot + PATH=`pwd`/../src:$$PATH; \ + cd $(srcdir); \ + catalogs='$(CATALOGS)'; \ + for cat in $$catalogs; do \ + cat=`basename $$cat`; \ + lang=`echo $$cat | sed 's/\$(CATOBJEXT)$$//'`; \ + mv $$lang.po $$lang.old.po; \ + echo "$$lang:"; \ + if $(MSGMERGE) $$lang.old.po $(PACKAGE).pot -o $$lang.po; then \ + rm -f $$lang.old.po; \ + else \ + echo "msgmerge for $$cat failed!"; \ + rm -f $$lang.po; \ + mv $$lang.old.po $$lang.po; \ + fi; \ + done + +POTFILES: POTFILES.in + ( if test 'x$(srcdir)' != 'x.'; then \ + posrcprefix='$(top_srcdir)/'; \ + else \ + posrcprefix="../"; \ + fi; \ + rm -f $@-t $@ \ + && (sed -e '/^#/d' -e '/^[ ]*$$/d' \ + -e "s@.*@ $$posrcprefix& \\\\@" < $(srcdir)/$@.in \ + | sed -e '$$s/\\$$//') > $@-t \ + && chmod a-w $@-t \ + && mv $@-t $@ ) + +Makefile: Makefile.in.in ../config.status POTFILES + cd .. \ + && CONFIG_FILES=$(subdir)/$@.in CONFIG_HEADERS= \ + $(SHELL) ./config.status + +# Tell versions [3.59,3.63) of GNU make not to export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/X11/InstallMgr/po/POTFILES b/apps/X11/InstallMgr/po/POTFILES new file mode 100644 index 0000000..3f9cfd2 --- /dev/null +++ b/apps/X11/InstallMgr/po/POTFILES @@ -0,0 +1,4 @@ + ../src/MainFrm.cpp \ + ../src/interface.c \ + ../src/callbacks.cpp \ + ../src/support.c diff --git a/apps/X11/InstallMgr/src/MainFrm.h b/apps/X11/InstallMgr/src/MainFrm.h new file mode 100644 index 0000000..c7eefae --- /dev/null +++ b/apps/X11/InstallMgr/src/MainFrm.h @@ -0,0 +1,169 @@ +//--------------------------------------------------------------------------- +#ifndef MainFrmH +#define MainFrmH +//--------------------------------------------------------------------------- +#include <swmgr.h> +//#include <gnome.h> +#include <TCustomImageList.h> +#include <TTreeView.h> +#include <TTreeNode.h> +#include <TTreeNodes.h> + + +#ifdef ENABLE_NLS +# include <libintl.h> +# undef _ +# define _(String) dgettext (PACKAGE, String) +# ifdef gettext_noop +# define N_(String) gettext_noop (String) +# else +# define N_(String) (String) +# endif +#else +# define textdomain(String) (String) +# define gettext(String) (String) +# define dgettext(Domain,Message) (Message) +# define dcgettext(Domain,Message,Type) (Message) +# define bindtextdomain(Domain,Directory) (Domain) +# define _(String) (String) +# define N_(String) (String) +#endif + + + + +class VersionInfo { + public: + int major, minor, minor2, minor3; + + VersionInfo(const char *version); + int compare(const VersionInfo &vi) const; + bool operator>(const VersionInfo &vi) const {return (compare(vi) > 0);} + bool operator<(const VersionInfo &vi) const {return (compare(vi) < 0);} + bool operator==(const VersionInfo &vi) const {return (compare(vi) == 0);} +}; + + +class InstallSourceTab { +public: + InstallSourceTab(GtkWidget *Owner, const char *confEnt, const char *type); + ~InstallSourceTab(); + string Type; + string Source; + string Directory; + string Caption; + GtkWidget *tree; + SWMgr *mgr; +}; + + +//--------------------------------------------------------------------------- +class TMainForm { + class TWebThread; + friend class TWebThread; + + GtkAccelGroup *accel_group; + GtkWidget *menubar1; + GtkWidget *banner_panel; + guint tmp_key; + GtkWidget *file2; + GtkWidget *file2_menu; + GtkAccelGroup *file2_menu_accels; + GtkWidget *exit1; + GtkWidget *options1; + GtkWidget *options1_menu; + GtkAccelGroup *options1_menu_accels; + GtkWidget *local_path1; + GtkWidget *manage_remote_sources1; + GtkWidget *main_window; + GtkWidget *dock1; + GtkWidget *vbox1; + GtkWidget *pixmap1; + GtkWidget *hpaned1; + GtkWidget *vbox2; + GtkWidget *toolbar2; + GtkWidget *label3; + GtkWidget *tmp_toolbar_icon; + GtkWidget *GlobeBtn; + GtkWidget *label5; + GtkWidget *pixmap2; + GtkWidget *label4; + GtkWidget *notebook1; + GtkWidget *scrolledwindow3; + GtkWidget *viewport1; + GtkWidget *label1; + GtkWidget *toolbar3; + GtkWidget *InfoBtn; + GtkWidget *SelectBtn; + GtkWidget *SelectAllBtn; + GtkWidget *InstallBtn; + GtkWidget *vbox3; + GtkWidget *label2; + GtkWidget *scrolledwindow4; + GtkWidget *viewport2; + GtkWidget *toolbar4; + GtkWidget *RemoveBtn; + GtkWidget *appbar1; +// GtkWidget *InstalledTree; + TTreeView *installTree; + TTreeView *localTree; + TCustomImageList *ImageList1; + TCustomImageList *ImageList2; + +public: + GtkWidget *localPathDlg; + void FormCreate(GtkWidget *Sender); + void LocalPath1Click(GtkWidget *Sender); + void LocalPath1Click_ok(GtkWidget *Sender); + void Button5Click(GtkWidget *Sender); + void Button6Click(GtkWidget *Sender); + void Button4Click(GtkWidget *Sender); + void Button2Click(GtkWidget *Sender); +/* + void localTreeDblClick(GtkWidget *Sender); + void Image1Click(GtkWidget *Sender); + void SpeedButton1Click(GtkWidget *Sender); + void SpeedButton5Click(GtkWidget *Sender); + void Exit1Click(GtkWidget *Sender); +*/ + void FormShow(GtkWidget *Sender); + + void refreshPageControl(); + +private: // User declarations + + SWMgr *manager; + SWConfig *installConf; + const char *getLocalDir(); + void setLocalDir(const char *idir); + void fillAllSourceTrees(); + void deleteAllModules(); +/* + void addSource(InstallSourceTab *ist); +*/ + +public: // User declarations + TMainForm(GtkWidget* Owner); + ~TMainForm(); + int selectAll(TTreeView *tree, bool sel); + int removeModule(const char *modName); + int installModule(const char *modName, InstallSourceTab *ist = 0); + static int createParent(const char *pName); + int createPathAndFile(const char *fName); + int copyFile(const char *sourceFile, const char *targetFile); + int copyFileToCWD(const char *sourceDir, const char *fName); +/* + void RefreshRemoteSource(GtkWidget *Sender); + int FTPCopy(InstallSourceTab *ist, const char *src, const char *dest, bool dirTransfer = false); +*/ + SWMgr *localMgr; + +protected: + virtual void fillInstallTree(); + virtual void fillSourceTree(const char *sourceConf, TTreeView *tree); +}; + +//--------------------------------------------------------------------------- +extern TMainForm *MainForm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/X11/InstallMgr/src/Makefile.in b/apps/X11/InstallMgr/src/Makefile.in new file mode 100644 index 0000000..17efa4e --- /dev/null +++ b/apps/X11/InstallMgr/src/Makefile.in @@ -0,0 +1,389 @@ +# 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 = : +host_alias = @host_alias@ +host_triplet = @host@ +BUILD_INCLUDED_LIBINTL = @BUILD_INCLUDED_LIBINTL@ +CATALOGS = @CATALOGS@ +CATOBJEXT = @CATOBJEXT@ +CC = @CC@ +CXX = @CXX@ +DATADIRNAME = @DATADIRNAME@ +GENCAT = @GENCAT@ +GLIBC21 = @GLIBC21@ +GMOFILES = @GMOFILES@ +GMSGFMT = @GMSGFMT@ +GNOMEGNORBA_LIBS = @GNOMEGNORBA_LIBS@ +GNOMEUI_LIBS = @GNOMEUI_LIBS@ +GNOME_APPLETS_LIBS = @GNOME_APPLETS_LIBS@ +GNOME_CAPPLET_LIBS = @GNOME_CAPPLET_LIBS@ +GNOME_CONFIG = @GNOME_CONFIG@ +GNOME_INCLUDEDIR = @GNOME_INCLUDEDIR@ +GNOME_LIBDIR = @GNOME_LIBDIR@ +GNOME_LIBS = @GNOME_LIBS@ +GNORBA_CFLAGS = @GNORBA_CFLAGS@ +GNORBA_LIBS = @GNORBA_LIBS@ +GTKXMHTML_LIBS = @GTKXMHTML_LIBS@ +GTK_CFLAGS = @GTK_CFLAGS@ +GTK_CONFIG = @GTK_CONFIG@ +GTK_LIBS = @GTK_LIBS@ +INSTOBJEXT = @INSTOBJEXT@ +INTLBISON = @INTLBISON@ +INTLLIBS = @INTLLIBS@ +INTLOBJS = @INTLOBJS@ +INTL_LIBTOOL_SUFFIX_PREFIX = @INTL_LIBTOOL_SUFFIX_PREFIX@ +LIBICONV = @LIBICONV@ +MAKEINFO = @MAKEINFO@ +MKINSTALLDIRS = @MKINSTALLDIRS@ +MSGFMT = @MSGFMT@ +ORBIT_CFLAGS = @ORBIT_CFLAGS@ +ORBIT_CONFIG = @ORBIT_CONFIG@ +ORBIT_IDL = @ORBIT_IDL@ +ORBIT_LIBS = @ORBIT_LIBS@ +PACKAGE = @PACKAGE@ +PACKAGE_PIXMAPS_DIR = @PACKAGE_PIXMAPS_DIR@ +POFILES = @POFILES@ +POSUB = @POSUB@ +PTHREAD_LIB = @PTHREAD_LIB@ +RANLIB = @RANLIB@ +USE_INCLUDED_LIBINTL = @USE_INCLUDED_LIBINTL@ +USE_NLS = @USE_NLS@ +VERSION = @VERSION@ +XPM_LIBS = @XPM_LIBS@ +ZVT_LIBS = @ZVT_LIBS@ +cflags_set = @cflags_set@ +cxxflags_set = @cxxflags_set@ + +INCLUDES = -I$(top_srcdir)/intl @GTK_CFLAGS@ -I $(top_srcdir)/../../../include -I $(top_srcdir)/../VCL -static + + +bin_PROGRAMS = installmgr + +installmgr_SOURCES = main.cpp callbacks.cpp callbacks.h MainFrm.cpp MainFrm.h + +# interface.c interface.h \ +# support.c support.h \ + +installmgr_LDADD = -L$(top_srcdir)/../../../lib -L../vcl -lVCL @GTK_LIBS@ $(INTLLIBS) -lsword -lz +installmgr_LDFLAGS = +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = ../config.h +CONFIG_CLEAN_FILES = +PROGRAMS = $(bin_PROGRAMS) + + +DEFS = @DEFS@ -I. -I$(srcdir) -I.. +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +installmgr_OBJECTS = main.o callbacks.o MainFrm.o +installmgr_DEPENDENCIES = +CXXFLAGS = @CXXFLAGS@ +CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(LDFLAGS) -o $@ +CFLAGS = @CFLAGS@ +COMPILE = $(CC) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) +CCLD = $(CC) +LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(LDFLAGS) -o $@ +DIST_COMMON = Makefile.am Makefile.in + + +DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +TAR = tar +GZIP_ENV = --best +DEP_FILES = .deps/MainFrm.P .deps/callbacks.P .deps/main.P +SOURCES = $(installmgr_SOURCES) +OBJECTS = $(installmgr_OBJECTS) + +all: all-redirect +.SUFFIXES: +.SUFFIXES: .S .c .cpp .o .s +$(srcdir)/Makefile.in: Makefile.am $(top_srcdir)/configure.in $(ACLOCAL_M4) + cd $(top_srcdir) && $(AUTOMAKE) --gnu src/Makefile + +Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status $(BUILT_SOURCES) + cd $(top_builddir) \ + && CONFIG_FILES=$(subdir)/$@ CONFIG_HEADERS= $(SHELL) ./config.status + + +mostlyclean-binPROGRAMS: + +clean-binPROGRAMS: + -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) + +distclean-binPROGRAMS: + +maintainer-clean-binPROGRAMS: + +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ + echo " $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ + $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + list='$(bin_PROGRAMS)'; for p in $$list; do \ + rm -f $(DESTDIR)$(bindir)/`echo $$p|sed 's/$(EXEEXT)$$//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + done + +.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: + +installmgr: $(installmgr_OBJECTS) $(installmgr_DEPENDENCIES) + @rm -f installmgr + $(CXXLINK) $(installmgr_LDFLAGS) $(installmgr_OBJECTS) $(installmgr_LDADD) $(LIBS) +.cpp.o: + $(CXXCOMPILE) -c $< + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + here=`pwd` && cd $(srcdir) \ + && mkid -f$$here/ID $$unique $(LISP) + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS)'; \ + unique=`for i in $$list; do echo $$i; done | \ + awk ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$unique$(LISP)$$tags" \ + || (cd $(srcdir) && etags -o $$here/TAGS $(ETAGS_ARGS) $$tags $$unique $(LISP)) + +mostlyclean-tags: + +clean-tags: + +distclean-tags: + -rm -f TAGS ID + +maintainer-clean-tags: + +distdir = $(top_builddir)/$(PACKAGE)-$(VERSION)/$(subdir) + +subdir = src + +distdir: $(DISTFILES) + here=`cd $(top_builddir) && pwd`; \ + top_distdir=`cd $(top_distdir) && pwd`; \ + distdir=`cd $(distdir) && pwd`; \ + cd $(top_srcdir) \ + && $(AUTOMAKE) --include-deps --build-dir=$$here --srcdir-name=$(top_srcdir) --output-dir=$$top_distdir --gnu src/Makefile + @for file in $(DISTFILES); do \ + d=$(srcdir); \ + if test -d $$d/$$file; then \ + cp -pr $$d/$$file $(distdir)/$$file; \ + else \ + test -f $(distdir)/$$file \ + || ln $$d/$$file $(distdir)/$$file 2> /dev/null \ + || cp -p $$d/$$file $(distdir)/$$file || :; \ + fi; \ + done + +DEPS_MAGIC := $(shell mkdir .deps > /dev/null 2>&1 || :) + +-include $(DEP_FILES) + +mostlyclean-depend: + +clean-depend: + +distclean-depend: + -rm -rf .deps + +maintainer-clean-depend: + +%.o: %.c + @echo '$(COMPILE) -c $<'; \ + $(COMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.c + @echo '$(LTCOMPILE) -c $<'; \ + $(LTCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp + +%.o: %.cpp + @echo '$(CXXCOMPILE) -c $<'; \ + $(CXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-cp .deps/$(*F).pp .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm .deps/$(*F).pp + +%.lo: %.cpp + @echo '$(LTCXXCOMPILE) -c $<'; \ + $(LTCXXCOMPILE) -Wp,-MD,.deps/$(*F).pp -c $< + @-sed -e 's/^\([^:]*\)\.o[ ]*:/\1.lo \1.o :/' \ + < .deps/$(*F).pp > .deps/$(*F).P; \ + tr ' ' '\012' < .deps/$(*F).pp \ + | sed -e 's/^\\$$//' -e '/^$$/ d' -e '/:$$/ d' -e 's/$$/ :/' \ + >> .deps/$(*F).P; \ + rm -f .deps/$(*F).pp +info-am: +info: info-am +dvi-am: +dvi: dvi-am +check-am: all-am +check: check-am +installcheck-am: +installcheck: installcheck-am +install-exec-am: install-binPROGRAMS +install-exec: install-exec-am + +install-data-am: +install-data: install-data-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am +install: install-am +uninstall-am: uninstall-binPROGRAMS +uninstall: uninstall-am +all-am: Makefile $(PROGRAMS) +all-redirect: all-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) AM_INSTALL_PROGRAM_FLAGS=-s install +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + + +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + -rm -f config.cache config.log stamp-h stamp-h[0-9]* + +maintainer-clean-generic: +mostlyclean-am: mostlyclean-binPROGRAMS mostlyclean-compile \ + mostlyclean-tags mostlyclean-depend mostlyclean-generic + +mostlyclean: mostlyclean-am + +clean-am: clean-binPROGRAMS clean-compile clean-tags clean-depend \ + clean-generic mostlyclean-am + +clean: clean-am + +distclean-am: distclean-binPROGRAMS distclean-compile distclean-tags \ + distclean-depend distclean-generic clean-am + +distclean: distclean-am + +maintainer-clean-am: maintainer-clean-binPROGRAMS \ + maintainer-clean-compile maintainer-clean-tags \ + maintainer-clean-depend maintainer-clean-generic \ + distclean-am + @echo "This command is intended for maintainers to use;" + @echo "it deletes files that may require special tools to rebuild." + +maintainer-clean: maintainer-clean-am + +.PHONY: mostlyclean-binPROGRAMS distclean-binPROGRAMS clean-binPROGRAMS \ +maintainer-clean-binPROGRAMS uninstall-binPROGRAMS install-binPROGRAMS \ +mostlyclean-compile distclean-compile clean-compile \ +maintainer-clean-compile tags mostlyclean-tags distclean-tags \ +clean-tags maintainer-clean-tags distdir mostlyclean-depend \ +distclean-depend clean-depend maintainer-clean-depend info-am info \ +dvi-am dvi check check-am installcheck-am installcheck install-exec-am \ +install-exec install-data-am install-data install-am install \ +uninstall-am uninstall all-redirect all-am all installdirs \ +mostlyclean-generic distclean-generic clean-generic \ +maintainer-clean-generic clean mostlyclean distclean maintainer-clean + + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/X11/InstallMgr/src/cipherfrm.cpp b/apps/X11/InstallMgr/src/cipherfrm.cpp new file mode 100644 index 0000000..5b77797 --- /dev/null +++ b/apps/X11/InstallMgr/src/cipherfrm.cpp @@ -0,0 +1,67 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "cipherfrm.h" +#include <swmgr.h> +#include <swconfig.h> +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TCipherForm *CipherForm; +//--------------------------------------------------------------------------- +__fastcall TCipherForm::TCipherForm(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void __fastcall TCipherForm::Button2Click(TObject *Sender) +{ + SectionMap::iterator section; + ConfigEntMap::iterator entry; + SWConfig *modconf = new SWConfig(confFile.c_str()); + string tmpBuf; + + section = modconf->Sections.find(modName); + if (section != modconf->Sections.end()) { + entry = section->second.find("CipherKey"); + if (entry != section->second.end()) { + entry->second = CipherForm->cipherEdit->Text.c_str(); + modconf->Save(); + delete modconf; // close file + modconf = 0; + SWMgr *mgr = new SWMgr(); + SWModule *mod = mgr->Modules[modName]; + mod->SetKey("Ipet 2:12"); + tmpBuf = mod->StripText(); + mod->SetKey("gen 1:10"); + tmpBuf += "\r\n\r\n"; + tmpBuf += mod->StripText(); + Memo1->Text = tmpBuf.c_str(); + delete mgr; + } + } + if (modconf) + delete modconf; + +} +//--------------------------------------------------------------------------- + +void __fastcall TCipherForm::FormShow(TObject *Sender) +{ + string tmpCaption; + tmpCaption = "Cipher Key: ["; + tmpCaption += modName; + tmpCaption += "]"; + Caption = tmpCaption.c_str(); +} +//--------------------------------------------------------------------------- + + +void __fastcall TCipherForm::FormClose(TObject *Sender, + TCloseAction &Action) +{ + Memo1->Text = ""; +} +//--------------------------------------------------------------------------- + diff --git a/apps/X11/VCL/Makefile.am b/apps/X11/VCL/Makefile.am new file mode 100644 index 0000000..1a93246 --- /dev/null +++ b/apps/X11/VCL/Makefile.am @@ -0,0 +1,9 @@ +noinst_LIBRARIES = libVCL.a + +libVCL_a_SOURCES = TObject.cpp TPersistent.cpp TComponent.cpp \ + TControl.cpp TWinControl.cpp TTreeNode.cpp TTreeNodes.cpp \ + TCustomTreeView.cpp TCustomTabControl.cpp TPageControl.cpp \ + TTreeView.cpp TCustomImageList.cpp TDragImageList.cpp \ + TImageList.cpp + +CPPFLAGS += `gtk-config --cflags` -static diff --git a/apps/X11/VCL/TCustomTreeView.h b/apps/X11/VCL/TCustomTreeView.h new file mode 100644 index 0000000..0b3c91d --- /dev/null +++ b/apps/X11/VCL/TCustomTreeView.h @@ -0,0 +1,238 @@ +#ifndef TCUSTOMTREEVIEW_H +#define TCUSTOMTREEVIEW_H + +#include <TWinControl.h> +#include <TTreeNode.h> +#include <TCustomImageList.h> +#include <gtk/gtktree.h> +#include <gtk/gtktreeitem.h> + + enum THitTest {htAbove, htBelow, htNowhere, htOnItem, htOnButton, htOnIcon, + htOnIndent, htOnLabel, htOnRight, htOnStateIcon, htToLeft, htToRight}; +// THitTests = set of THitTest; + enum TSortType {stNone, stData, stText, stBoth}; + +/* + ETreeViewError = class(Exception); + TTVChangingEvent = procedure(Sender: TObject; Node: TTreeNode; + var AllowChange: Boolean) of object; + TTVChangedEvent = procedure(Sender: TObject; Node: TTreeNode) of object; + TTVEditingEvent = procedure(Sender: TObject; Node: TTreeNode; + var AllowEdit: Boolean) of object; + TTVEditedEvent = procedure(Sender: TObject; Node: TTreeNode; var S: string) of object; + TTVExpandingEvent = procedure(Sender: TObject; Node: TTreeNode; + var AllowExpansion: Boolean) of object; + TTVCollapsingEvent = procedure(Sender: TObject; Node: TTreeNode; + var AllowCollapse: Boolean) of object; + TTVExpandedEvent = procedure(Sender: TObject; Node: TTreeNode) of object; + TTVCompareEvent = procedure(Sender: TObject; Node1, Node2: TTreeNode; + Data: Integer; var Compare: Integer) of object; + TTVCustomDrawEvent = procedure(Sender: TCustomTreeView; const ARect: TRect; + var DefaultDraw: Boolean) of object; + TTVCustomDrawItemEvent = procedure(Sender: TCustomTreeView; Node: TTreeNode; + State: TCustomDrawState; var DefaultDraw: Boolean) of object; +*/ + +class TTreeNodes; + +class TCustomTreeView : public TWinControl { +friend TTreeNodes; +friend TTreeNode; +protected: + void init(TComponent *AOwner); + +// procedure SetTreeNodes(Value: TTreeNodes); + void SetTreeNodes(TTreeNodes* Value); +// FImages: TCustomImageList; + TCustomImageList *FImages; +// FStateImages: TCustomImageList; + TCustomImageList *FStateImages; +// procedure SetImages(Value: TCustomImageList); + void SetImages(TCustomImageList *val); + TCustomImageList * getImages() { return FImages; } +// procedure SetStateImages(Value: TCustomImageList); + void SetStateImages(TCustomImageList *val); + TCustomImageList * getStateImages() { return FStateImages; } +/* + FAutoExpand: Boolean; + FBorderStyle: TBorderStyle; + FCanvas: TCanvas; + FCanvasChanged: Boolean; + FDefEditProc: Pointer; + FDragged: Boolean; + FDragImage: TDragImageList; + FDragNode: TTreeNode; + FEditHandle: HWND; + FEditInstance: Pointer; + FHideSelection: Boolean; + FHotTrack: Boolean; + FImageChangeLink: TChangeLink; + FLastDropTarget: TTreeNode; + FManualNotify: Boolean; + FMemStream: TMemoryStream; + FRClickNode: TTreeNode; + FRightClickSelect: Boolean; + FReadOnly: Boolean; + FRowSelect: Boolean; + FSaveIndex: Integer; + FSaveIndent: Integer; + FSaveItems: TStringList; + FSaveTopIndex: Integer; + FShowButtons: Boolean; + FShowLines: Boolean; + FShowRoot: Boolean; + FSortType: TSortType; + FStateChanging: Boolean; + FStateChangeLink: TChangeLink; + FToolTips: Boolean; + FWideText: WideString; + FOnEditing: TTVEditingEvent; + FOnEdited: TTVEditedEvent; + FOnExpanded: TTVExpandedEvent; + FOnExpanding: TTVExpandingEvent; + FOnCollapsed: TTVExpandedEvent; + FOnCollapsing: TTVCollapsingEvent; + FOnChanging: TTVChangingEvent; + FOnChange: TTVChangedEvent; + FOnCompare: TTVCompareEvent; + FOnDeletion: TTVExpandedEvent; + FOnCustomDraw: TTVCustomDrawEvent; + FOnCustomDrawItem: TTVCustomDrawItemEvent; + FOnGetImageIndex: TTVExpandedEvent; + FOnGetSelectedIndex: TTVExpandedEvent; + procedure CanvasChanged(Sender: TObject); + procedure CMColorChanged(var Message: TMessage); message CM_COLORCHANGED; + procedure CMCtl3DChanged(var Message: TMessage); message CM_CTL3DCHANGED; + procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED; + procedure CMDrag(var Message: TCMDrag); message CM_DRAG; + procedure CNNotify(var Message: TWMNotify); message CN_NOTIFY; + procedure EditWndProc(var Message: TMessage); + procedure DoDragOver(Source: TDragObject; X, Y: Integer; CanDrop: Boolean); + function GetChangeDelay: Integer; + function GetDropTarget: TTreeNode; + function GetIndent: Integer; + function GetNodeFromItem(const Item: TTVItem): TTreeNode; + function GetTopItem: TTreeNode; + procedure ImageListChange(Sender: TObject); + procedure SetAutoExpand(Value: Boolean); + procedure SetBorderStyle(Value: TBorderStyle); + procedure SetButtonStyle(Value: Boolean); + procedure SetChangeDelay(Value: Integer); + procedure SetDropTarget(Value: TTreeNode); + procedure SetHideSelection(Value: Boolean); + procedure SetHotTrack(Value: Boolean); + procedure SetImageList(Value: HImageList; Flags: Integer); + procedure SetIndent(Value: Integer); + procedure SetLineStyle(Value: Boolean); + procedure SetReadOnly(Value: Boolean); + procedure SetRootStyle(Value: Boolean); + procedure SetRowSelect(Value: Boolean); + procedure SetSortType(Value: TSortType); + procedure SetToolTips(Value: Boolean); + procedure SetTopItem(Value: TTreeNode); + procedure OnChangeTimer(Sender: TObject); + procedure WMLButtonDown(var Message: TWMLButtonDown); message WM_LBUTTONDOWN; + procedure WMRButtonDown(var Message: TWMRButtonDown); message WM_RBUTTONDOWN; + procedure WMRButtonUp(var Message: TWMRButtonUp); message WM_RBUTTONUP; + procedure WMNotify(var Message: TWMNotify); message WM_NOTIFY; + procedure CMSysColorChange(var Message: TMessage); message CM_SYSCOLORCHANGE; +*/ + protected: +// property Items: TTreeNodes read FTreeNodes write SetTreeNodes; + TTreeNodes *FTreeNodes; + property <TCustomTreeView, TTreeNodes*> Items; + TTreeNodes *getItems() { return FTreeNodes; } + +// property Images: TCustomImageList read FImages write SetImages; + property <TCustomTreeView, TCustomImageList *> Images; +// property StateImages: TCustomImageList read FStateImages write SetStateImages; + property <TCustomTreeView, TCustomImageList *> StateImages; + +// property Selected: TTreeNode read GetSelection write SetSelection; +// function GetSelection: TTreeNode; +// procedure SetSelection(Value: TTreeNode); + TTreeNode *GetSelection(); + void SetSelection(TTreeNode *); + +/* + FChangeTimer: TTimer; + function CanEdit(Node: TTreeNode): Boolean; dynamic; + function CanChange(Node: TTreeNode): Boolean; dynamic; + function CanCollapse(Node: TTreeNode): Boolean; dynamic; + function CanExpand(Node: TTreeNode): Boolean; dynamic; + procedure Change(Node: TTreeNode); dynamic; + procedure Collapse(Node: TTreeNode); dynamic; + function CreateNode: TTreeNode; virtual; + procedure CreateParams(var Params: TCreateParams); override; + procedure CreateWnd; override; + function CustomDraw(const ARect: TRect; Stage: TCustomDrawStage): Boolean; virtual; + function CustomDrawItem(Node: TTreeNode; State: TCustomDrawState; + Stage: TCustomDrawStage): Boolean; virtual; + procedure Delete(Node: TTreeNode); dynamic; + procedure DestroyWnd; override; + procedure DoEndDrag(Target: TObject; X, Y: Integer); override; + procedure DoStartDrag(var DragObject: TDragObject); override; + procedure Edit(const Item: TTVItem); dynamic; + procedure Expand(Node: TTreeNode); dynamic; + function GetDragImages: TDragImageList; override; + procedure GetImageIndex(Node: TTreeNode); virtual; + procedure GetSelectedIndex(Node: TTreeNode); virtual; + function IsCustomDrawn(Target: TCustomDrawTarget; Stage: TCustomDrawStage): Boolean; + procedure Loaded; override; + procedure Notification(AComponent: TComponent; + Operation: TOperation); override; + procedure SetDragMode(Value: TDragMode); override; + procedure WndProc(var Message: TMessage); override; + property AutoExpand: Boolean read FAutoExpand write SetAutoExpand default False; + property BorderStyle: TBorderStyle read FBorderStyle write SetBorderStyle default bsSingle; + property ChangeDelay: Integer read GetChangeDelay write SetChangeDelay default 0; + property HideSelection: Boolean read FHideSelection write SetHideSelection default True; + property HotTrack: Boolean read FHotTrack write SetHotTrack default False; + property Indent: Integer read GetIndent write SetIndent; + property ReadOnly: Boolean read FReadOnly write SetReadOnly default False; + property RightClickSelect: Boolean read FRightClickSelect write FRightClickSelect default False; + property RowSelect: Boolean read FRowSelect write SetRowSelect default False; + property ShowButtons: Boolean read FShowButtons write SetButtonStyle default True; + property ShowLines: Boolean read FShowLines write SetLineStyle default True; + property ShowRoot: Boolean read FShowRoot write SetRootStyle default True; + property SortType: TSortType read FSortType write SetSortType default stNone; + property ToolTips: Boolean read FToolTips write SetToolTips default True; + property OnCustomDraw: TTVCustomDrawEvent read FOnCustomDraw write FOnCustomDraw; + property OnCustomDrawItem: TTVCustomDrawItemEvent read FOnCustomDrawItem write FOnCustomDrawItem; + property OnEditing: TTVEditingEvent read FOnEditing write FOnEditing; + property OnEdited: TTVEditedEvent read FOnEdited write FOnEdited; + property OnExpanding: TTVExpandingEvent read FOnExpanding write FOnExpanding; + property OnExpanded: TTVExpandedEvent read FOnExpanded write FOnExpanded; + property OnCollapsing: TTVCollapsingEvent read FOnCollapsing write FOnCollapsing; + property OnCollapsed: TTVExpandedEvent read FOnCollapsed write FOnCollapsed; + property OnChanging: TTVChangingEvent read FOnChanging write FOnChanging; + property OnChange: TTVChangedEvent read FOnChange write FOnChange; + property OnCompare: TTVCompareEvent read FOnCompare write FOnCompare; + property OnDeletion: TTVExpandedEvent read FOnDeletion write FOnDeletion; + property OnGetImageIndex: TTVExpandedEvent read FOnGetImageIndex write FOnGetImageIndex; + property OnGetSelectedIndex: TTVExpandedEvent read FOnGetSelectedIndex write FOnGetSelectedIndex; +*/ +public: + TCustomTreeView(TComponent *AOwner); + TCustomTreeView(GtkWidget *parent); + property <TCustomTreeView, TTreeNode *> Selected; + virtual ~TCustomTreeView(); +/* + function AlphaSort: Boolean; + function CustomSort(SortProc: TTVCompare; Data: Longint): Boolean; + procedure FullCollapse; + procedure FullExpand; + function GetHitTestInfoAt(X, Y: Integer): THitTests; + function GetNodeAt(X, Y: Integer): TTreeNode; + function IsEditing: Boolean; + procedure LoadFromFile(const FileName: string); + procedure LoadFromStream(Stream: TStream); + procedure SaveToFile(const FileName: string); + procedure SaveToStream(Stream: TStream); + property Canvas: TCanvas read FCanvas; + property DropTarget: TTreeNode read GetDropTarget write SetDropTarget; + property TopItem: TTreeNode read GetTopItem write SetTopItem; +*/ +}; + +#endif diff --git a/apps/X11/VCL/property b/apps/X11/VCL/property new file mode 100644 index 0000000..aee9eda --- /dev/null +++ b/apps/X11/VCL/property @@ -0,0 +1,77 @@ +#ifndef PROPERTY_H +#define PROPERTY_H + +#include <iostream> + +template<class Context, class T> struct Property_index; + +template<class Context, class T> +class property { + Context* view; // an Item needs to access values in its context + T (Context::*Getter)(); + void (Context::*Setter)(T); + +protected: + T get() const { return (Getter) ? (view->*Getter)() : 0; } + void set(T val) { if (Setter) (view->*Setter)(val); } + +public: + property(Context* v, + T (Context::*G)() = &Context::get, + void (Context::*S)(T) = &Context::set) + :view(v), Getter(G), Setter(S) { } + + operator T() const { return get(); } + property& operator=(T val) { set(val); return *this; } + property& operator+=(T val) { set(get() + val); return *this; } + property& operator=(const property &other) { set(T(other)); return *this; } + + // specialized operations: + + T operator->() { return get(); } + + // string specific + property<Property_index<Context,T>,char> operator[](int i); + int size() { return (view->*Getter)().size(); } + +}; + +template<class Context, class T> +struct Property_index { // inefficient + property<Context,T>* p; + int i; + Property_index(property<Context,T>* pp, int ii) : p(pp), i(ii) { } + char get() const { return p->get()[i]; } + void set(char ch) { T v = p->get(); v[i] = ch; p->set(v); } +}; + +template<class Context, class T> +property<Property_index<Context,T>,char> property<Context,T>::operator[](int i) +{ + return property<Property_index<Context,T>,char>(new Property_index<Context,T>(this,i)); +// leaks +} + +template<class Context, class T> +inline ostream& operator<<(ostream& s, property<Context,T> p) +{ + s << T(p); +} + +template<class Context, class T> +inline istream& operator>>(istream& s, property<Context,T>& p) +{ + T t; + s >> t; + p = t; +} + + + +/* examples +property<TTreeView,TTreeNodes*> Items; +Items(this, &get, &set); +*/ + + +#endif diff --git a/apps/X11/cheatah/cheatah.cpp b/apps/X11/cheatah/cheatah.cpp new file mode 100644 index 0000000..0cb5778 --- /dev/null +++ b/apps/X11/cheatah/cheatah.cpp @@ -0,0 +1,654 @@ +/* cheatah + * Copyright (C) 1999, CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include <gtk/gtk.h> +#include <gdk/gdkkeysyms.h> +#include "cheatsig.h" +#include "cheatah.h" +#include <swmgr.h> +#include <versekey.h> +#include <regex.h> +#include <gbfplain.h> +#include <thmlplain.h> +#include <string.h> + + +MainWindow *cheatahWindow = NULL; + +/* I'm going to try commenting out get_widget() - it no longer seems to be used */ +/* Note: this doesn't seem to have caused any problems so far. */ +/* +GtkWidget* +get_widget (GtkWidget *widget, + gchar *widget_name) +{ + GtkWidget *found_widget; + + if (widget->parent) + widget = gtk_widget_get_toplevel (widget); + found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget), + widget_name); + if (!found_widget) + g_warning ("Widget not found: %s", widget_name); + return found_widget; +} +*/ + +/* This is an internally used function to set notebook tab widgets. */ +void +set_notebook_tab (GtkWidget *notebook, + gint page_num, + GtkWidget *widget) +{ + GtkNotebookPage *page; + GtkWidget *notebook_page; + + page = (GtkNotebookPage*) g_list_nth (GTK_NOTEBOOK (notebook)->children, page_num)->data; + notebook_page = page->child; + gtk_widget_ref (notebook_page); + gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), page_num); + gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), notebook_page, + widget, page_num); + gtk_widget_unref (notebook_page); +} + + + +MainWindow::MainWindow() { + searchType_group = NULL; + mainMgr = new SWMgr(); + curMod = NULL; + chapDisplay = 0; // set in create + entryDisplay = 0; // set in create +} + + +MainWindow::~MainWindow() { + delete mainMgr; + if (chapDisplay) + delete chapDisplay; + if (entryDisplay) + delete entryDisplay; +} + + +GtkWidget* create_mainWindow () { + GtkWidget *retWidget; + cheatahWindow = new MainWindow(); + retWidget = cheatahWindow->create(); + cheatahWindow->initSWORD(); + return retWidget; +} + +/* */ +/* Note: this seems to be a poor choice of a name for this function . */ +/* When I accidentally left off the parenthesis when trying to call it, */ +/* the compiler didn't complain, but it didn't execute, either. */ +/* Could there be a macro or something by the same name? */ +/* At any rate, be careful with it. */ +/* */ +void destroy_mainWindow () { + delete cheatahWindow; +} + +GtkWidget *MainWindow::create() { + mainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_object_set_data (GTK_OBJECT (mainWindow), "mainWindow", mainWindow); + gtk_window_set_title (GTK_WINDOW (mainWindow), "Cheatah - SWORD Quick Lookup / Search"); + gtk_window_set_policy (GTK_WINDOW (mainWindow), TRUE, TRUE, FALSE); + gtk_widget_set_usize(GTK_WIDGET(mainWindow), 580, 360); + gtk_signal_connect(GTK_OBJECT(mainWindow), + "destroy", + GTK_SIGNAL_FUNC(gtk_main_quit), + NULL); + + + mainPanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "mainPanel", mainPanel); + gtk_widget_show (mainPanel); + gtk_container_add (GTK_CONTAINER (mainWindow), mainPanel); + + headerPanel = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "headerPanel", headerPanel); + gtk_widget_show (headerPanel); + gtk_box_pack_start (GTK_BOX (mainPanel), headerPanel, FALSE, TRUE, 0); + + handlebox3 = gtk_handle_box_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "handlebox3", handlebox3); + gtk_widget_show (handlebox3); + gtk_box_pack_start (GTK_BOX (headerPanel), handlebox3, TRUE, TRUE, 0); + + menubar4 = gtk_menu_bar_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menubar4", menubar4); + gtk_widget_show (menubar4); + gtk_container_add (GTK_CONTAINER (handlebox3), menubar4); + + File = gtk_menu_item_new_with_label ("File"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "File", File); + gtk_widget_show (File); + gtk_container_add (GTK_CONTAINER (menubar4), File); + + menuFile = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuFile", menuFile); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (File), menuFile); + + Exit3 = gtk_menu_item_new_with_label ("Exit"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "Exit3", Exit3); + gtk_widget_show (Exit3); + gtk_container_add (GTK_CONTAINER (menuFile), Exit3); + gtk_signal_connect (GTK_OBJECT (Exit3), "activate", + GTK_SIGNAL_FUNC (gtk_main_quit), + NULL); + + + View3 = gtk_menu_item_new_with_label ("View"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "View3", View3); + gtk_widget_show (View3); + gtk_container_add (GTK_CONTAINER (menubar4), View3); + gtk_signal_connect (GTK_OBJECT (View3), "activate", + GTK_SIGNAL_FUNC (on_View3_activate), + NULL); + + menuView = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuView", menuView); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (View3), menuView); + + commentaries = gtk_menu_item_new_with_label ("Commentaries"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "commentaries", commentaries); + gtk_widget_show (commentaries); + + menuCommentaries = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuCommentaries", menuCommentaries); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (commentaries), menuCommentaries); + + dictionaries = gtk_menu_item_new_with_label ("Dictionaries"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "Dictionaries", dictionaries); + gtk_widget_show (dictionaries); + + menuDictionaries = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuDictionaries", menuDictionaries); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (dictionaries), menuDictionaries); + + + + Help = gtk_menu_item_new_with_label ("Help"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "Help", Help); + gtk_widget_show (Help); + gtk_container_add (GTK_CONTAINER (menubar4), Help); + gtk_signal_connect (GTK_OBJECT (Help), "activate", + GTK_SIGNAL_FUNC (on_Help_activate), + NULL); + gtk_menu_item_right_justify (GTK_MENU_ITEM (Help)); + + menuHelp = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuHelp", menuHelp); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (Help), menuHelp); + + About = gtk_menu_item_new_with_label ("About"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "About", About); + gtk_widget_show (About); + gtk_container_add (GTK_CONTAINER (menuHelp), About); + gtk_signal_connect (GTK_OBJECT (About), "activate", + GTK_SIGNAL_FUNC (on_About_activate), + NULL); + + handlebox4 = gtk_handle_box_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "handlebox4", handlebox4); + gtk_widget_show (handlebox4); + gtk_box_pack_start (GTK_BOX (headerPanel), handlebox4, TRUE, TRUE, 0); + + hbox6 = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "hbox6", hbox6); + gtk_widget_show (hbox6); + gtk_container_add (GTK_CONTAINER (handlebox4), hbox6); + + label2 = gtk_label_new ("FreeForm Lookup:"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "label2", label2); + gtk_widget_show (label2); + gtk_box_pack_start (GTK_BOX (hbox6), label2, FALSE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_RIGHT); + gtk_misc_set_padding (GTK_MISC (label2), 2, 0); + + lookupText = gtk_entry_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "lookupText", lookupText); + gtk_widget_show (lookupText); + gtk_box_pack_start (GTK_BOX (hbox6), lookupText, FALSE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (lookupText), "changed", + GTK_SIGNAL_FUNC (on_lookupText_changed), + NULL); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "hbox2", hbox2); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (mainPanel), hbox2, TRUE, TRUE, 0); + + +/* + textScrolledWindow = gtk_scrolled_window_new (NULL, NULL); + gtk_object_set_data (GTK_OBJECT (mainWindow), "textScrolledWindow", textScrolledWindow); + gtk_widget_show (textScrolledWindow); + gtk_box_pack_start (GTK_BOX (hbox2), textScrolledWindow, FALSE, FALSE, 0); +*/ + + moduleText = gtk_text_new (NULL, NULL); + gtk_object_set_data (GTK_OBJECT (mainWindow), "moduleText", moduleText); + gtk_widget_show (moduleText); +// gtk_container_add (GTK_CONTAINER (textScrolledWindow), moduleText); + gtk_box_pack_start (GTK_BOX (hbox2), moduleText, TRUE, TRUE, 0); + gtk_text_set_editable (GTK_TEXT (moduleText), FALSE); + gtk_text_set_word_wrap (GTK_TEXT (moduleText), TRUE); + gtk_widget_realize (moduleText); + + /* Add a vertical scrollbar to the GtkText widget */ + textScrollbar = gtk_vscrollbar_new (GTK_TEXT (moduleText)->vadj); + gtk_box_pack_start (GTK_BOX (hbox2), textScrollbar, FALSE, FALSE, 0); + gtk_widget_show (textScrollbar); + + +/* + handlebox5 = gtk_handle_box_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "handlebox5", handlebox5); + gtk_widget_show (handlebox5); + gtk_box_pack_start (GTK_BOX (hbox2), handlebox5, FALSE, FALSE, 0); + gtk_container_border_width (GTK_CONTAINER (handlebox5), 5); +*/ + + searchPanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchPanel", searchPanel); + gtk_widget_show (searchPanel); + gtk_box_pack_start (GTK_BOX (hbox2), searchPanel, FALSE, FALSE, 0); +// gtk_container_add (GTK_CONTAINER (handlebox5), searchPanel); + + hbox4 = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "hbox4", hbox4); + gtk_widget_show (hbox4); + gtk_box_pack_start (GTK_BOX (searchPanel), hbox4, FALSE, FALSE, 0); + + searchText = gtk_entry_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchText", searchText); + gtk_widget_show (searchText); + gtk_box_pack_start (GTK_BOX (hbox4), searchText, TRUE, TRUE, 0); + + searchButton = gtk_button_new_with_label ("Search"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchButton", searchButton); + gtk_widget_show (searchButton); + gtk_box_pack_start (GTK_BOX (hbox4), searchButton, FALSE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (searchButton), "clicked", + GTK_SIGNAL_FUNC (on_searchButton_clicked), + NULL); + + searchSettingsPanel = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchSettingsPanel", searchSettingsPanel); + gtk_widget_show (searchSettingsPanel); + gtk_box_pack_start (GTK_BOX (searchPanel), searchSettingsPanel, FALSE, FALSE, 0); + + searchTypePanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchTypePanel", searchTypePanel); + gtk_widget_show (searchTypePanel); + gtk_box_pack_start (GTK_BOX (searchSettingsPanel), searchTypePanel, FALSE, FALSE, 0); + + multiWordSearch = gtk_radio_button_new_with_label (searchType_group, "Multi Word"); + searchType_group = gtk_radio_button_group (GTK_RADIO_BUTTON (multiWordSearch)); + gtk_object_set_data (GTK_OBJECT (mainWindow), "multiWordSearch", multiWordSearch); + gtk_widget_show (multiWordSearch); + gtk_box_pack_start (GTK_BOX (searchTypePanel), multiWordSearch, FALSE, FALSE, 0); + + phraseSearch = gtk_radio_button_new_with_label (searchType_group, "Exact Phrase"); + searchType_group = gtk_radio_button_group (GTK_RADIO_BUTTON (phraseSearch)); + gtk_object_set_data (GTK_OBJECT (mainWindow), "phraseSearch", phraseSearch); + gtk_widget_show (phraseSearch); + gtk_box_pack_start (GTK_BOX (searchTypePanel), phraseSearch, FALSE, FALSE, 0); + + regexSearch = gtk_radio_button_new_with_label (searchType_group, "Regular Expression"); + searchType_group = gtk_radio_button_group (GTK_RADIO_BUTTON (regexSearch)); + gtk_object_set_data (GTK_OBJECT (mainWindow), "regexSearch", regexSearch); + gtk_widget_show (regexSearch); + gtk_box_pack_start (GTK_BOX (searchTypePanel), regexSearch, FALSE, FALSE, 0); + + + searchOptionsPanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchOptionsPanel", searchOptionsPanel); + gtk_widget_show (searchOptionsPanel); + gtk_box_pack_start (GTK_BOX (searchSettingsPanel), searchOptionsPanel, FALSE, FALSE, 0); + + caseSensitive = gtk_check_button_new_with_label ("Case Sensitive"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "caseSensitive", caseSensitive); + gtk_widget_show (caseSensitive); + gtk_box_pack_start (GTK_BOX (searchOptionsPanel), caseSensitive, FALSE, FALSE, 0); + + GtkWidget *resultPanel = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "resultPanel", resultPanel); + gtk_widget_show (resultPanel); + gtk_box_pack_start (GTK_BOX (searchPanel), resultPanel, TRUE, TRUE, 0); + resultList = gtk_clist_new(1); + gtk_object_set_data(GTK_OBJECT (mainWindow), "resultList", resultList); +// gtk_clist_set_policy(GTK_CLIST(resultList), GTK_POLICY_AUTOMATIC, 0); +// gtk_clist_set_border(GTK_CLIST(resultList), GTK_SHADOW_ETCHED_IN); + gtk_widget_show (resultList); + gtk_box_pack_start (GTK_BOX (resultPanel), resultList, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (resultList), "select_row", + GTK_SIGNAL_FUNC (on_resultList_selection_changed), + NULL); + /* Add a vertical scrollbar to the GtkCList widget */ + textScrollbar = gtk_vscrollbar_new (NULL); + gtk_clist_set_vadjustment (GTK_CLIST(resultList), gtk_range_get_adjustment(GTK_RANGE(textScrollbar))); + gtk_box_pack_start (GTK_BOX (resultPanel), textScrollbar, FALSE, FALSE, 0); + gtk_widget_show (textScrollbar); + + +/* + statusbar1 = gtk_statusbar_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "statusbar1", statusbar1); + gtk_widget_show (statusbar1); + gtk_box_pack_start (GTK_BOX (mainPanel), statusbar1, FALSE, TRUE, 0); +*/ + + arrow1 = gtk_button_new_with_label ("[<]"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "arrow1", arrow1); + gtk_widget_show (arrow1); + gtk_box_pack_start (GTK_BOX (headerPanel), arrow1, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (arrow1), "clicked", + GTK_SIGNAL_FUNC (on_arrow1_button_press_event), + NULL); + + arrow2 = gtk_button_new_with_label ("[>]"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "arrow2", arrow2); + gtk_widget_show (arrow2); + gtk_box_pack_start (GTK_BOX (headerPanel), arrow2, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (arrow2), "clicked", + GTK_SIGNAL_FUNC (on_arrow2_button_press_event), + NULL); + + + statusbar1 = gtk_label_new (""); + gtk_object_set_data (GTK_OBJECT (mainWindow), "statusbar1", statusbar1); + gtk_widget_show (statusbar1); + gtk_box_pack_start (GTK_BOX (mainPanel), statusbar1, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (statusbar1), GTK_JUSTIFY_LEFT); + gtk_misc_set_padding (GTK_MISC (statusbar1), 2, 0); + + + GTKEntryDisp::__initialize(); + chapDisplay = new GTKChapDisp(moduleText); + entryDisplay = new GTKEntryDisp(moduleText); + + return mainWindow; +} + +void MainWindow::initSWORD() { + + GtkWidget *menuChoice; + int viewNumber = 1; + char menuName[64]; + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + char *font; + SWModule *curMod; + +/* First, check and see whether SWMgr found any installed books. If not, tell the user what the problem is. */ +/* Print a short notice to stderr, for use when the program is invoked from the command line, */ +/* and also put a bit longer message into the spot where bible text would otherwise show up. */ +/* Then, return out of this function, because there's nothing left to do. */ + + if (mainMgr->Modules.empty()==TRUE) { + fprintf(stderr,"SWMgr: Can't find 'mods.conf' or 'mods.d'. Try setting:\n\tSWORD_PATH=<directory containing mods.conf>\n\tOr see the README file for a full description of setup options.\n\t"); + + gtk_text_set_point(GTK_TEXT(moduleText), 0); + gtk_text_forward_delete (GTK_TEXT (moduleText), gtk_text_get_length((GTK_TEXT(moduleText)))); + int curPos = 0; + gtk_text_freeze (GTK_TEXT(moduleText)); + gtk_text_insert(GTK_TEXT(moduleText), NULL, &moduleText->style->black, NULL, "\nCheatah was unable to find any books installed!\n\n", -1); + gtk_text_insert(GTK_TEXT(moduleText), NULL, &moduleText->style->black, NULL, "They should be listed in a configuration file named either: ", -1); + gtk_text_insert(GTK_TEXT(moduleText), NULL, &moduleText->style->black, NULL, "'mods.conf' or 'mods.d'. \n\n", -1); + gtk_text_insert(GTK_TEXT(moduleText), NULL, &moduleText->style->black, NULL, "Try setting:\n\tSWORD_PATH=<directory containing mods.conf>\n\t",-1); + gtk_text_insert(GTK_TEXT(moduleText), NULL, &moduleText->style->black, NULL, "Or see the README file for a full description of setup options.\n", -1); + gtk_text_set_point(GTK_TEXT(moduleText), curPos); + gtk_text_thaw(GTK_TEXT(moduleText)); + + return; + } + +/* +* Create filters to use, depending on the needs of the installed modules. +* Right now, basically just handling GBF files and converting them to plain +* text for display. So far, I haven't found any modules that specify +* anything other than GBF, but I've dropped in code to +* install the thtml to plain filter just in case, since it's available. +* Question: I'm installing this as a display filter - would it make more +* sense to install it is a raw filter, so that I could use "plain" as the +* base for any strip filters we may need? Or is that used for something else, +* like compression or decyphering locked books? +*/ + + gbftoplain = new GBFPlain(); + thmlplain = new ThMLPlain(); + +/* +* Next, if SWMgr did find some book modules installed , hook them up to any filters needed +* and set up the menues to reflect them. +* Pick a default module to show on startup. +*/ + + for (it = mainMgr->Modules.begin(); it != mainMgr->Modules.end(); it++) { + curMod = (*it).second; + menuChoice = gtk_menu_item_new_with_label (curMod->Name()); + sprintf(menuName, "viewMod%d", viewNumber++); + gtk_object_set_data (GTK_OBJECT (mainWindow), menuName, menuChoice); + gtk_widget_show (menuChoice); + gtk_signal_connect(GTK_OBJECT (menuChoice), "activate", + GTK_SIGNAL_FUNC (on_viewMod_activate), + g_strdup(curMod->Name())); + + if ((sit = mainMgr->config->Sections.find(curMod->Name())) != mainMgr->config->Sections.end()) { + if ((eit = (*sit).second.find("SourceType")) != (*sit).second.end()) { + if (!strcasecmp((*eit).second.c_str(), "GBF")) { + curMod->AddRenderFilter(gbftoplain); + } + else if (!strcasecmp((*eit).second.c_str(), "ThML")) { + curMod->AddRenderFilter(thmlplain); + } + } + } + + if (!strcmp((*it).second->Type(), "Biblical Texts")) { + gtk_container_add (GTK_CONTAINER (menuView), menuChoice); + font = 0; + if ((sit = mainMgr->config->Sections.find(curMod->Name())) != mainMgr->config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + font = (char *)(*eit).second.c_str(); + } + } +// CreateTextPane((*it).second, font); + curMod->Disp(chapDisplay); // set our GTKChapDisp object up for the diplayer of each Biblical Text module + if (!this->curMod) // set currently selected module for app to first module from SWMgr (Bible Texts get first preference + this->curMod = curMod; + } + else { + curMod->Disp(entryDisplay); // set our GTKEntryDisp object up for the diplayer of each module other than Biblical Texts + if (!strcmp(curMod->Type(), "Commentaries")) { + gtk_container_add (GTK_CONTAINER (menuCommentaries), menuChoice); + // CreateCommentPane((*it).second); + } + if (!strcmp(curMod->Type(), "Lexicons / Dictionaries")) { + gtk_container_add (GTK_CONTAINER (menuDictionaries), menuChoice); + // CreateLDPane((*it).second); + } + } + + + } + gtk_container_add (GTK_CONTAINER (menuView), commentaries); + gtk_container_add (GTK_CONTAINER (menuView), dictionaries); + + if (!this->curMod) // We didn't find a bible text, so set currently selected module for app to first module from SWMgr + this->curMod = curMod; // Should be o.k. to do this, because we've already tested to see if SWMgr thinks it found something + assert(this->curMod!=NULL); + if(this->curMod!=NULL) // Go ahead and display default module + lookupTextChanged(); +} + + +void MainWindow::lookupTextChanged() { + string keyText; + gchar *entryText; + char tmpBuf[255]; + + entryText = gtk_entry_get_text(GTK_ENTRY(lookupText)); + keyText = entryText; + + if (curMod) { + curMod->SetKey(keyText.c_str()); + curMod->Display(); + sprintf(tmpBuf, "%s (%s)", curMod->KeyText(), curMod->Name()); + gtk_label_set(GTK_LABEL(statusbar1), tmpBuf); + } +} + +void MainWindow::viewModActivate(GtkMenuItem *sender, gchar *modName) { + ModMap::iterator it; + + it = mainMgr->Modules.find(modName); + if (it != mainMgr->Modules.end()) { + curMod = (*it).second; + lookupTextChanged(); + } + else curMod = 0; +} + + +void MainWindow::navigateButtonClicked(int direction) { + if (curMod) { + if (direction) + (*curMod)++; + else (*curMod)--; + (const char *)*curMod; // snap to closest locations + const gchar *text = curMod->KeyText(); + gtk_entry_set_text(GTK_ENTRY(lookupText), text); +// curMod->Display(); + } +} + + +void MainWindow::searchButtonClicked() { + string srchText; + gchar *entryText; + const gchar *resultText; + gchar **clistText = (gchar **)&resultText; + + + gtk_clist_clear(GTK_CLIST(resultList)); + + entryText = gtk_entry_get_text(GTK_ENTRY(searchText)); + srchText = entryText; + + if (curMod) { + int searchType = GTK_TOGGLE_BUTTON(regexSearch)->active ? 0 : GTK_TOGGLE_BUTTON(phraseSearch)->active ? -1 : -2; + int searchParams = GTK_TOGGLE_BUTTON(caseSensitive)->active ? 0 : REG_ICASE; + gtk_clist_freeze(GTK_CLIST(resultList)); + for (ListKey searchResults = curMod->Search(srchText.c_str(), searchType, searchParams); !searchResults.Error(); searchResults++) { + resultText = (const char *)searchResults; + gtk_clist_append(GTK_CLIST(resultList), clistText); + } + gtk_clist_thaw(GTK_CLIST(resultList)); + } +} + + +void MainWindow::resultListSelectionChanged(GtkWidget *clist, gint row, gint column, GdkEventButton *event, gpointer data) { + gchar *text; + + gtk_clist_get_text(GTK_CLIST(resultList), row, column, &text); + + if (text) { + gtk_entry_set_text(GTK_ENTRY(lookupText), text); + } +} + +GdkColor GTKEntryDisp::colourBlue; +GdkColor GTKEntryDisp::colourGreen; + +/* */ +/* Note: we have a warning that should be fixed here. GTKEntryDisp::Display() is defined */ +/* as returning char, but doesn't have a return statement */ +/* What was intended - a return code? That doesn't seem right, because those are */ +/* usually int's. But it isn't defined as returning a char*, so it doesn't seem */ +/* likely that it's intended to return the text involved. */ +/* */ +char GTKEntryDisp::Display(SWModule &imodule) { + char tmpBuf[255]; + + gtk_text_set_point(GTK_TEXT(gtkText), 0); + gtk_text_forward_delete (GTK_TEXT (gtkText), gtk_text_get_length((GTK_TEXT(gtkText)))); + int curPos = 0; + (const char *)imodule; // snap to entry + gtk_text_freeze (GTK_TEXT(gtkText)); + sprintf(tmpBuf, "[%s] ", imodule.KeyText()); + gtk_text_insert(GTK_TEXT(gtkText), NULL, &colourBlue, NULL, tmpBuf, -1); + gtk_text_insert(GTK_TEXT(gtkText), NULL, >kText->style->black, NULL, (const char *)imodule, -1); + gtk_text_set_point(GTK_TEXT(gtkText), curPos); + gtk_text_thaw(GTK_TEXT(gtkText)); +} + +/* */ +/* Note: we have a warning that should be fixed here. GTKChapDisp::Display() is defined */ +/* as returning char, but doesn't have a return statement. */ +/* What was intended - a return code? That doesn't seem right, because those are */ +/* usually int's. But it isn't defined as returning a char*, so it doesn't seem */ +/* likely that it's intended to return the text involved. */ +/* */ + +char GTKChapDisp::Display(SWModule &imodule) { + char tmpBuf[255]; + + gtk_text_set_point(GTK_TEXT(gtkText), 0); + gtk_text_forward_delete (GTK_TEXT (gtkText), gtk_text_get_length((GTK_TEXT(gtkText)))); + VerseKey *key = (VerseKey *)(SWKey *)imodule; + int curVerse = key->Verse(); + int curChapter = key->Chapter(); + int curBook = key->Book(); + int curPos = 0; + gfloat adjVal; + gtk_text_freeze (GTK_TEXT(gtkText)); + for (key->Verse(1); (key->Book() == curBook && key->Chapter() == curChapter && !imodule.Error()); imodule++) { + sprintf(tmpBuf, "%d. ", key->Verse()); + gtk_text_insert(GTK_TEXT(gtkText), NULL, &colourBlue, NULL, tmpBuf, -1); + if (key->Verse() == curVerse) { + gtk_text_thaw(GTK_TEXT(gtkText)); + adjVal = GTK_TEXT(gtkText)->vadj->upper; + curPos = gtk_text_get_length(GTK_TEXT(gtkText)); + gtk_text_insert(GTK_TEXT(gtkText), NULL, &colourGreen, NULL, (const char *)imodule, -1); + gtk_text_freeze (GTK_TEXT(gtkText)); + } + else { + gtk_text_insert(GTK_TEXT(gtkText), NULL, >kText->style->black, NULL, (const char *)imodule, -1); + } + gtk_text_insert(GTK_TEXT(gtkText), NULL, >kText->style->black, NULL, " ", -1); + } + gtk_text_set_point(GTK_TEXT(gtkText), curPos); + gtk_text_thaw(GTK_TEXT(gtkText)); + adjVal -= (GTK_TEXT(gtkText)->vadj->page_size / 2); + gtk_adjustment_set_value(GTK_TEXT(gtkText)->vadj, (adjVal>0)?adjVal:0); + key->Verse(1); + key->Chapter(1); + key->Book(curBook); + key->Chapter(curChapter); + key->Verse(curVerse); +} diff --git a/apps/X11/cheatah/cheatah.h b/apps/X11/cheatah/cheatah.h new file mode 100644 index 0000000..42fae6d --- /dev/null +++ b/apps/X11/cheatah/cheatah.h @@ -0,0 +1,162 @@ +/* Note: You are free to use whatever license you want. + Eventually you will be able to edit it within Glade. */ + +/* cheatah + * Copyright (C) <YEAR> <AUTHORS> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include <gtk/gtk.h> +#include <swmgr.h> +#include <swdisp.h> + +/* + * This function returns a widget in a component created by Glade. + * Call it with the toplevel widget in the component (i.e. a window/dialog), + * or alternatively any widget in the component, and the name of the widget + * you want returned. + */ +/* I'm going to try commenting it out - it no longer seems to be used. */ +/* Note: This doesn't seem to have caused any problems so far. */ +/* +GtkWidget* +get_widget (GtkWidget *widget, + gchar *widget_name); +*/ + + /* + * This is an internally used function for setting notebook tabs. It is only + * included in this header file so you don't get compilation warnings + */ +void +set_notebook_tab (GtkWidget *notebook, + gint page_num, + GtkWidget *widget); + +GtkWidget* create_mainWindow (void); +void destroy_mainWindow (void); + +class GTKEntryDisp : public SWDisplay { +protected: + GtkWidget *gtkText; +public: + static GdkColor colourGreen; + static GdkColor colourBlue; + static void __initialize() { + GdkColormap *cmap; + + cmap = gdk_colormap_get_system(); + colourGreen.red = 0; + colourGreen.green = 0x00ff; + colourGreen.blue = 0xffff; + colourBlue.red = 0; + colourBlue.green = 0; + colourBlue.blue = 0xffff; + if (!gdk_color_alloc(cmap, &colourGreen)) { + g_error("couldn't allocate colour"); + } + if (!gdk_color_alloc(cmap, &colourBlue)) { + g_error("couldn't allocate colour"); + } + } + GTKEntryDisp(GtkWidget *gtkText) { this->gtkText = gtkText; } + virtual char Display(SWModule &imodule); +}; + +class GTKChapDisp : public GTKEntryDisp { +public: + GTKChapDisp(GtkWidget *gtkText) : GTKEntryDisp(gtkText) {} + virtual char Display(SWModule &imodule); +}; + +class MainWindow { + GtkWidget *mainWindow; + GtkWidget *mainPanel; + GtkWidget *headerPanel; + GtkWidget *handlebox3; + GtkWidget *menubar4; + GtkWidget *File; + GtkWidget *menuFile; + GtkWidget *Exit3; + GtkWidget *View3; + GtkWidget *Help; + GtkWidget *menuHelp; + GtkWidget *menuView; + GtkWidget *menuCommentaries; + GtkWidget *menuDictionaries; + GtkWidget *commentaries; + GtkWidget *dictionaries; + GtkWidget *About; + GtkWidget *handlebox4; + GtkWidget *hbox6; + GtkWidget *label2; + GtkWidget *lookupText; + GtkWidget *hbox2; + GtkWidget *moduleText; + GtkWidget *handlebox5; + GtkWidget *searchPanel; + GtkWidget *hbox4; + GtkWidget *searchText; + GtkWidget *searchButton; + GtkWidget *searchSettingsPanel; + GtkWidget *searchTypePanel; + GSList *searchType_group; + GtkWidget *regexSearch; + GtkWidget *phraseSearch; + GtkWidget *multiWordSearch; + GtkWidget *searchOptionsPanel; + GtkWidget *caseSensitive; + GtkWidget *resultList; + GtkWidget *statusbar1; + GtkWidget *textScrolledWindow; + GtkWidget *textScrollbar; + GtkWidget *arrow1; + GtkWidget *arrow2; + + + SWMgr *mainMgr; + SWModule *curMod; + SWDisplay *chapDisplay; + SWDisplay *entryDisplay; + SWFilter *gbftoplain; // GBF seems to be the most common format + SWFilter *thmlplain; // ThML to Plain filter is also available - put it in just in case + // Should there be any more added? (Do we need a RWPtoPlain filter?) + +public: + MainWindow(); + ~MainWindow(); + GtkWidget *create(); + void initSWORD(); + void lookupTextChanged(); + void viewModActivate(GtkMenuItem *sender, gchar *modName); + void searchButtonClicked(); + void navigateButtonClicked(int direction); + void resultListSelectionChanged(GtkWidget *clist, gint row, gint column, GdkEventButton *event, gpointer data); + SWMgr *getSwordManager(void) {return(mainMgr);}; +}; + + +extern MainWindow *cheatahWindow; + + + + + + + + + + diff --git a/apps/X11/cheatah/cheatsig.cpp b/apps/X11/cheatah/cheatsig.cpp new file mode 100644 index 0000000..d3646ba --- /dev/null +++ b/apps/X11/cheatah/cheatsig.cpp @@ -0,0 +1,326 @@ +/* Note: You are free to use whatever license you want. + Eventually you will be able to edit it within Glade. */ + +/* cheatah + * Copyright (C) <YEAR> <AUTHORS> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include <gtk/gtk.h> +#include "cheatah.h" +#include "cheatsig.h" + +int +main (int argc, char *argv[]) +{ + GtkWidget *mainWindow; + + gtk_set_locale (); + gtk_init (&argc, &argv); + + /* + * The following code was added by Glade to create one of each component + * (except popup menus), just so that you see something after building + * the project. Delete any components that you don't want shown initially. + */ + mainWindow = create_mainWindow (); + gtk_widget_show (mainWindow); + + gtk_main (); + + destroy_mainWindow(); + return 0; +} + + +void +on_Exit3_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + +} + + +void +on_View3_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + +} + + +void +on_Help_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + +} + + +void +on_viewMod_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + cheatahWindow->viewModActivate(menuitem, (gchar *)user_data); +} + + +/* +* This function is used to do a quick and dirty translation of the formating +* commands in the module descriptions into reasonable equivalents in +* plain ascii. (The descriptions look like .rtf-lite, perhaps?) +* It takes a character pointer to the module description and +* returns a pointer to a new string that's been fixed up. Ultimately, +* a better solution should be developed, but this improves the +* appearance of the descriptions significantly for now. +* +* Perhaps this could serve as the basis for a function that would take +* an input string and a text widget, then insert the string into the +* widget in a formatted manner (good next step?); +*/ + +char * +str_fixup_format (const char *string) +{ + char *strNew; + int i,j; + + assert(string!=NULL); + strNew = (char *) malloc(strlen(string)); // First, allocate space for the new string + assert(strNew!=NULL); + if(strNew==NULL) return ((char *)NULL); // Make sure we actually got it + + for (i=0,j=0;i<strlen(string);i++) { // Work through input string char at a time + if (string[i]=='\\') { // Found backslash, probably a command + if (string[i+1]=='q') { // Looks like an alignment command + if(string[i+2]=='c') { // Want to center text + strNew[j]='\n'; // - make do with a new line + j++; + strNew[j]='\t'; // - and a tab for now + j++; + } + i=i+2; // Assume command and skip past q and ? + continue; + } + else { // if string[i+1] != 'q' + if(string[i+1]=='p' && string[i+2]=='a' && string[i+3]=='r') { // "\par" or "\pard"command? + if(string[i+4]=='d') { // "\pard" command - ignore for now + i=i+4; // Skip past the "pard" + continue; + } + else { // "\par" command + strNew[j]='\n'; // - use a new line for now + j++; + i=i+3; // Skip past the "par" + continue; + } + } + } // End of "else" + } // End of "if(string[i]=='\\') + strNew[j]=string[i]; // Don't know what it is, so copy it + j++; + } // End of "for" + strNew[j]='\0'; // Terminate new string + +// fprintf(stderr, "strlen(string) = %i, strlen(strNew) = %i \n", strlen(string), strlen(strNew)); // Used for debugging +// fprintf(stderr, "string = \"%s\"\n",string); // Used for debugging +// fprintf(stderr, "strNew = \"%s\"\n",strNew); // Used for debugging + + assert(strlen(strNew)<=strlen(string)); // Nothing we have done should have lengthend it + return(strNew); // Return fixed-up string +} + +void +on_About_activate (GtkMenuItem *menuitem, + gpointer user_data) +{ + SWMgr *mainMgr; + + mainMgr=cheatahWindow->getSwordManager(); + int i; + char *tempString; + static char *modtypes[] = {"Biblical Texts", "Commentaries", "Lexicons / Dictionaries"}; + string newtext, tmptext; + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + + GtkWidget *dialogAbout; + GtkWidget *hBoxModDesc; + GtkWidget *textAboutMods; + GtkWidget *textScrollbarMods; + GtkWidget *hBoxAbout; + GtkWidget *textAbout; + GtkWidget *textScrollbar; + GtkWidget *buttonOK; + + dialogAbout=gtk_dialog_new(); + gtk_object_set_data (GTK_OBJECT (dialogAbout), "dialogAbout", dialogAbout); + gtk_window_set_title (GTK_WINDOW (dialogAbout), "About Cheatah"); + gtk_window_set_policy (GTK_WINDOW (dialogAbout), FALSE, TRUE, FALSE); + gtk_widget_set_usize(GTK_WIDGET(dialogAbout), 360, 360); + gtk_window_position(GTK_WINDOW(dialogAbout),GTK_WIN_POS_CENTER); + + buttonOK = gtk_button_new_with_label("O.k."); + +/* */ +/* Set it up so that the dialog box and all it's children are automatically */ +/* destroyed when the user is done looking at it. */ +/* Note: Use gtk_signal_connect_object() rather than */ +/* gtk_signal_connect(), because we want the "destroy" */ +/* connected to the dialog box, not just the button. */ +/* */ + gtk_signal_connect_object(GTK_OBJECT(buttonOK), + "clicked", + GTK_SIGNAL_FUNC(gtk_widget_destroy), + GTK_OBJECT(dialogAbout)); + + gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialogAbout)->action_area), buttonOK); + + hBoxModDesc = gtk_hbox_new (FALSE,0); + gtk_object_set_data (GTK_OBJECT (dialogAbout), "hBoxModDesc", hBoxModDesc); + gtk_box_pack_end (GTK_BOX (GTK_DIALOG(dialogAbout)->vbox), hBoxModDesc, TRUE, TRUE, 0); + textAboutMods = gtk_text_new (NULL, NULL); + gtk_object_set_data (GTK_OBJECT (dialogAbout), "textAboutMods", textAboutMods); + gtk_box_pack_start (GTK_BOX (hBoxModDesc), textAboutMods, TRUE, TRUE, 0); + gtk_text_set_editable (GTK_TEXT (textAboutMods), FALSE); + gtk_text_set_word_wrap (GTK_TEXT (textAboutMods), TRUE); + + gtk_text_freeze (GTK_TEXT(textAboutMods)); + gtk_text_set_point(GTK_TEXT(textAboutMods), 0); + gtk_text_forward_delete (GTK_TEXT (textAboutMods), gtk_text_get_length((GTK_TEXT(textAboutMods)))); + + if (mainMgr->Modules.empty()==TRUE) { + gtk_text_freeze (GTK_TEXT(textAboutMods)); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "\nCheatah was unable to find any books installed!\n\n", -1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "They should be listed in a configuration file named either: ", -1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "'mods.conf' or 'mods.d'. \n\n", -1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "Try setting:\n\tSWORD_PATH=<directory containing mods.conf>\n\t",-1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "Or see the README file for a full description of setup options.\n", -1); + } + else { + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "\tInstalled Book Modules", -1); + for (i = 0; i < 3; i++) { + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "\n\n\t", -1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, modtypes[i], -1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "\n\n", -1); + for (it = mainMgr->Modules.begin(); it != mainMgr->Modules.end(); it++) { + if (!strcmp((*it).second->Type(), modtypes[i])) { + sit = mainMgr->config->Sections.find((*it).second->Name()); + if (sit != mainMgr->config->Sections.end()) { + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, (*it).second->Name() ,-1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, ": " ,-1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, (*it).second->Description() ,-1); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "\n\n", -1); + eit = (*sit).second.find("About"); + if (eit != (*sit).second.end()) { +// gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, (*eit).second.c_str() ,-1); + tempString=str_fixup_format((*eit).second.c_str() ); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, tempString, -1); + free(tempString); + gtk_text_insert(GTK_TEXT(textAboutMods), NULL, &textAboutMods->style->black, NULL, "\n\n" ,-1); + } +// eit = (*sit).second.find("SourceType"); +// if (eit != (*sit).second.end()) { +// fprintf(stderr,"SourceType: %s\n", (*eit).second.c_str() ); +// } + } + } + } + } + } + + gtk_text_set_point(GTK_TEXT(textAboutMods), 0); + gtk_text_thaw(GTK_TEXT(textAboutMods)); + + /* Add a vertical scrollbar to the textAboutMods GtkText widget */ + textScrollbarMods = gtk_vscrollbar_new (GTK_TEXT (textAboutMods)->vadj); + gtk_box_pack_end (GTK_BOX (hBoxModDesc), textScrollbarMods, FALSE, FALSE, 0); + + hBoxAbout = gtk_hbox_new (FALSE,0); + gtk_object_set_data (GTK_OBJECT (dialogAbout), "hBoxAbout", hBoxAbout); + gtk_box_pack_start (GTK_BOX (GTK_DIALOG(dialogAbout)->vbox), hBoxAbout, FALSE, TRUE, 0); + textAbout = gtk_text_new (NULL, NULL); + gtk_object_set_data (GTK_OBJECT (dialogAbout), "textAbout", textAbout); + gtk_box_pack_start (GTK_BOX (hBoxAbout), textAbout, TRUE, TRUE, 0); + gtk_text_set_editable (GTK_TEXT (textAbout), FALSE); + gtk_text_set_word_wrap (GTK_TEXT (textAbout), TRUE); + + gtk_text_freeze (GTK_TEXT(textAbout)); + gtk_text_set_point(GTK_TEXT(textAbout), 0); + gtk_text_forward_delete (GTK_TEXT (textAbout), gtk_text_get_length((GTK_TEXT(textAbout)))); + gtk_text_insert(GTK_TEXT(textAbout), NULL, &textAbout->style->black, NULL, "Cheatah is a quick and dirty GTK/Linux front end to the Sword software.", -1); + gtk_text_insert(GTK_TEXT(textAbout), NULL, &textAbout->style->black, NULL, "\n\nSword is developed by the CrossWire Software & Bible Society:",-1); + gtk_text_insert(GTK_TEXT(textAbout), NULL, &textAbout->style->black, NULL, "\n\tP. O. Box 2528",-1); + gtk_text_insert(GTK_TEXT(textAbout), NULL, &textAbout->style->black, NULL, "\n\tTempe, AZ 85280-2528 ", -1); + gtk_text_insert(GTK_TEXT(textAbout), NULL, &textAbout->style->black, NULL, "\n\thttp://www.crosswire.org ", -1); + gtk_text_insert(GTK_TEXT(textAbout), NULL, &textAbout->style->black, NULL, "\n\nThis software is provided free for the study of God and His Word.",-1); + + gtk_text_set_point(GTK_TEXT(textAbout), 0); + gtk_text_thaw(GTK_TEXT(textAbout)); + + /* Add a vertical scrollbar to the textAbout GtkText widget */ + textScrollbar = gtk_vscrollbar_new (GTK_TEXT (textAbout)->vadj); + gtk_box_pack_end (GTK_BOX (hBoxAbout), textScrollbar, FALSE, FALSE, 0); + + gtk_widget_show_all(dialogAbout); // "show_all" makes all the children visable too + +/* */ +/* No need to clean up the various widgets - we've arranged */ +/* for that to happen automatically when the user presses the */ +/* "o.k." button. */ +/* */ + + return; +} + + +void +on_lookupText_changed (GtkEditable *editable, + gpointer user_data) +{ + cheatahWindow->lookupTextChanged(); +} + + +void +on_searchButton_clicked (GtkButton *button, + gpointer user_data) +{ + cheatahWindow->searchButtonClicked(); +} + + +void +on_resultList_selection_changed (GtkWidget *clist, gint row, gint column, GdkEventButton *event, gpointer data) +{ + cheatahWindow->resultListSelectionChanged(clist, row, column, event, data); +} + + +void on_arrow1_button_press_event(GtkButton *button, gpointer user_data) { + cheatahWindow->navigateButtonClicked(0); +} + + +void on_arrow2_button_press_event(GtkButton *button, gpointer user_data) { + cheatahWindow->navigateButtonClicked(1); +} + + + + + diff --git a/apps/X11/cheatah/configure b/apps/X11/cheatah/configure new file mode 100644 index 0000000..6bd577d --- /dev/null +++ b/apps/X11/cheatah/configure @@ -0,0 +1,1707 @@ +#! /bin/sh + +# Guess values for system-dependent variables and create Makefiles. +# Generated automatically using autoconf version 2.13 +# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. +# +# This configure script is free software; the Free Software Foundation +# gives unlimited permission to copy, distribute and modify it. + +# Defaults: +ac_help= +ac_default_prefix=/usr/local +# Any additions from configure.in: +ac_help="$ac_help + --with-gtk-prefix=PFX Prefix where GTK is installed (optional)" +ac_help="$ac_help + --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)" +ac_help="$ac_help + --disable-gtktest Do not try to compile and run a test GTK program" + +# 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=cheatah.cpp + +# 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:564: 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:617: 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:674: 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=cheatah + +VERSION=0.1 + +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 <<EOF +#define PACKAGE "$PACKAGE" +EOF + +cat >> confdefs.h <<EOF +#define VERSION "$VERSION" +EOF + + + +missing_dir=`cd $ac_aux_dir && pwd` +echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +echo "configure:720: 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:733: 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:746: 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:759: 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:772: 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 + + + +# 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:789: 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:819: 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:870: 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:902: 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 913 "configure" +#include "confdefs.h" + +main(){return(0);} +EOF +if { (eval echo configure:918: \"$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:944: 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:949: checking whether we are using GNU C" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.c <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:958: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes +else + ac_cv_prog_gcc=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +if test $ac_cv_prog_gcc = yes; then + GCC=yes +else + GCC= +fi + +ac_test_CFLAGS="${CFLAGS+set}" +ac_save_CFLAGS="$CFLAGS" +CFLAGS= +echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +echo "configure:977: 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 + + +# Check whether --with-gtk-prefix or --without-gtk-prefix was given. +if test "${with_gtk_prefix+set}" = set; then + withval="$with_gtk_prefix" + gtk_config_prefix="$withval" +else + gtk_config_prefix="" +fi + +# Check whether --with-gtk-exec-prefix or --without-gtk-exec-prefix was given. +if test "${with_gtk_exec_prefix+set}" = set; then + withval="$with_gtk_exec_prefix" + gtk_config_exec_prefix="$withval" +else + gtk_config_exec_prefix="" +fi + +# Check whether --enable-gtktest or --disable-gtktest was given. +if test "${enable_gtktest+set}" = set; then + enableval="$enable_gtktest" + : +else + enable_gtktest=yes +fi + + + for module in . + do + case "$module" in + gthread) + gtk_config_args="$gtk_config_args gthread" + ;; + esac + done + + if test x$gtk_config_exec_prefix != x ; then + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config + fi + fi + if test x$gtk_config_prefix != x ; then + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix" + if test x${GTK_CONFIG+set} != xset ; then + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config + fi + fi + + # Extract the first word of "gtk-config", so it can be a program name with args. +set dummy gtk-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:1059: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$GTK_CONFIG" in + /*) + ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_GTK_CONFIG="$GTK_CONFIG" # Let the user override the test with a dos path. + ;; + *) + 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_path_GTK_CONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_GTK_CONFIG" && ac_cv_path_GTK_CONFIG="no" + ;; +esac +fi +GTK_CONFIG="$ac_cv_path_GTK_CONFIG" +if test -n "$GTK_CONFIG"; then + echo "$ac_t""$GTK_CONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + min_gtk_version=1.2.0 + echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 +echo "configure:1094: checking for GTK - version >= $min_gtk_version" >&5 + no_gtk="" + if test "$GTK_CONFIG" = "no" ; then + no_gtk=yes + else + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags` + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs` + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_gtktest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$GTK_LIBS $LIBS" + rm -f conf.gtktest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" +else + cat > conftest.$ac_ext <<EOF +#line 1117 "configure" +#include "confdefs.h" + +#include <gtk/gtk.h> +#include <stdio.h> +#include <stdlib.h> + +int +main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.gtktest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = g_strdup("$min_gtk_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_gtk_version"); + exit(1); + } + + if ((gtk_major_version != $gtk_config_major_version) || + (gtk_minor_version != $gtk_config_minor_version) || + (gtk_micro_version != $gtk_config_micro_version)) + { + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n", + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version, + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf ("*** was found! If gtk-config was correct, then it is best\n"); + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n"); + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n"); + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n"); + printf("*** required on your system.\n"); + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n"); + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n"); + printf("*** before re-running configure\n"); + } +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION) + else if ((gtk_major_version != GTK_MAJOR_VERSION) || + (gtk_minor_version != GTK_MINOR_VERSION) || + (gtk_micro_version != GTK_MICRO_VERSION)) + { + printf("*** GTK+ header files (version %d.%d.%d) do not match\n", + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION); + printf("*** library (version %d.%d.%d)\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + } +#endif /* defined (GTK_MAJOR_VERSION) ... */ + else + { + if ((gtk_major_version > major) || + ((gtk_major_version == major) && (gtk_minor_version > minor)) || + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n", + gtk_major_version, gtk_minor_version, gtk_micro_version); + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n", + major, minor, micro); + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n"); + printf("***\n"); + printf("*** If you have already installed a sufficiently new version, this error\n"); + printf("*** probably means that the wrong copy of the gtk-config shell script is\n"); + printf("*** being found. The easiest way to fix this is to remove the old version\n"); + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n"); + printf("*** correct copy of gtk-config. (In this case, you will have to\n"); + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n"); + printf("*** so that the correct libraries are found at run-time))\n"); + } + } + return 1; +} + +EOF +if { (eval echo configure:1195: \"$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* + no_gtk=yes +fi +rm -fr conftest* +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_gtk" = x ; then + echo "$ac_t""yes" 1>&6 + LIBS="$LIBS $GTK_LIBS" CFLAGS="$CFLAGS $GTK_CFLAGS" + else + echo "$ac_t""no" 1>&6 + if test "$GTK_CONFIG" = "no" ; then + echo "*** The gtk-config script installed by GTK could not be found" + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the GTK_CONFIG environment variable to the" + echo "*** full path to gtk-config." + else + if test -f conf.gtktest ; then + : + else + echo "*** Could not run GTK test program, checking why..." + CFLAGS="$CFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + cat > conftest.$ac_ext <<EOF +#line 1229 "configure" +#include "confdefs.h" + +#include <gtk/gtk.h> +#include <stdio.h> + +int main() { + return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); +; return 0; } +EOF +if { (eval echo configure:1239: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding GTK or finding the wrong" + echo "*** version of GTK. If it is not finding GTK, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" + echo "***" + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that" + echo "*** came with the system with the command" + echo "***" + echo "*** rpm --erase --nodeps gtk gtk-devel" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means GTK was incorrectly installed" + echo "*** or that you have moved GTK since it was installed. In the latter case, you" + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" +fi +rm -f conftest* + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + GTK_CFLAGS="" + GTK_LIBS="" + { echo "configure: error: Cannot find GTK: Is gtk-config in path?" 1>&2; exit 1; } + fi + + + rm -f conf.gtktest + + +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:1283: 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:1315: 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 1326 "configure" +#include "confdefs.h" + +int main(){return(0);} +EOF +if { (eval echo configure:1331: \"$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:1357: 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:1362: checking whether we are using GNU C++" >&5 +if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.C <<EOF +#ifdef __GNUC__ + yes; +#endif +EOF +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:1371: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gxx=yes +else + ac_cv_prog_gxx=no +fi +fi + +echo "$ac_t""$ac_cv_prog_gxx" 1>&6 + +if test $ac_cv_prog_gxx = yes; then + GXX=yes +else + GXX= +fi + +ac_test_CXXFLAGS="${CXXFLAGS+set}" +ac_save_CXXFLAGS="$CXXFLAGS" +CXXFLAGS= +echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 +echo "configure:1390: 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 + + +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 + +LIBS="$LIBS -L../../../lib -lsword -lz" +if test "x$GCC" = "xyes"; then + if test -z "`echo "$CFLAGS" | grep "\-Wall" 2> /dev/null`" ; then + CFLAGS="$CFLAGS -Wall" + fi +fi + +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 <<EOF +#! /bin/sh +# Generated automatically by configure. +# Run this file to recreate the current configuration. +# This directory was configured as follows, +# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: +# +# $0 $ac_configure_args +# +# Compiler output produced by configure, useful for debugging +# configure, is in ./config.log if it exists. + +ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" +for ac_option +do + case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) + echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" + exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; + -version | --version | --versio | --versi | --vers | --ver | --ve | --v) + echo "$CONFIG_STATUS generated by autoconf version 2.13" + exit 0 ;; + -help | --help | --hel | --he | --h) + echo "\$ac_cs_usage"; exit 0 ;; + *) echo "\$ac_cs_usage"; exit 1 ;; + esac +done + +ac_given_srcdir=$srcdir +ac_given_INSTALL="$INSTALL" + +trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +EOF +cat >> $CONFIG_STATUS <<EOF + +# Protect against being on the right side of a sed subst in config.status. +sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; + s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF +$ac_vpsub +$extrasub +s%@SHELL@%$SHELL%g +s%@CFLAGS@%$CFLAGS%g +s%@CPPFLAGS@%$CPPFLAGS%g +s%@CXXFLAGS@%$CXXFLAGS%g +s%@FFLAGS@%$FFLAGS%g +s%@DEFS@%$DEFS%g +s%@LDFLAGS@%$LDFLAGS%g +s%@LIBS@%$LIBS%g +s%@exec_prefix@%$exec_prefix%g +s%@prefix@%$prefix%g +s%@program_transform_name@%$program_transform_name%g +s%@bindir@%$bindir%g +s%@sbindir@%$sbindir%g +s%@libexecdir@%$libexecdir%g +s%@datadir@%$datadir%g +s%@sysconfdir@%$sysconfdir%g +s%@sharedstatedir@%$sharedstatedir%g +s%@localstatedir@%$localstatedir%g +s%@libdir@%$libdir%g +s%@includedir@%$includedir%g +s%@oldincludedir@%$oldincludedir%g +s%@infodir@%$infodir%g +s%@mandir@%$mandir%g +s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g +s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g +s%@INSTALL_DATA@%$INSTALL_DATA%g +s%@PACKAGE@%$PACKAGE%g +s%@VERSION@%$VERSION%g +s%@ACLOCAL@%$ACLOCAL%g +s%@AUTOCONF@%$AUTOCONF%g +s%@AUTOMAKE@%$AUTOMAKE%g +s%@AUTOHEADER@%$AUTOHEADER%g +s%@MAKEINFO@%$MAKEINFO%g +s%@SET_MAKE@%$SET_MAKE%g +s%@CC@%$CC%g +s%@GTK_CONFIG@%$GTK_CONFIG%g +s%@GTK_CFLAGS@%$GTK_CFLAGS%g +s%@GTK_LIBS@%$GTK_LIBS%g +s%@CXX@%$CXX%g + +CEOF +EOF + +cat >> $CONFIG_STATUS <<\EOF + +# Split the substitutions into bite-sized pieces for seds with +# small command number limits, like on Digital OSF/1 and HP-UX. +ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. +ac_file=1 # Number of current file. +ac_beg=1 # First line for current file. +ac_end=$ac_max_sed_cmds # Line after last line for current file. +ac_more_lines=: +ac_sed_cmds="" +while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file + else + sed "${ac_end}q" conftest.subs > conftest.s$ac_file + fi + if test ! -s conftest.s$ac_file; then + ac_more_lines=false + rm -f conftest.s$ac_file + else + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f conftest.s$ac_file" + else + ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi + ac_file=`expr $ac_file + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +done +if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat +fi +EOF + +cat >> $CONFIG_STATUS <<EOF + +CONFIG_FILES=\${CONFIG_FILES-"Makefile"} +EOF +cat >> $CONFIG_STATUS <<\EOF +for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case "$ac_file" in + *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` + ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; + *) ac_file_in="${ac_file}.in" ;; + esac + + # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. + + # Remove last slash and all that follows it. Not all systems have dirname. + ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` + if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then + # The file is in a subdirectory. + test ! -d "$ac_dir" && mkdir "$ac_dir" + ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" + # A "../" for each directory in $ac_dir_suffix. + ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` + else + ac_dir_suffix= ac_dots= + fi + + case "$ac_given_srcdir" in + .) srcdir=. + if test -z "$ac_dots"; then top_srcdir=. + else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; + /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; + *) # Relative path. + srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" + top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + + case "$ac_given_INSTALL" in + [/$]*) INSTALL="$ac_given_INSTALL" ;; + *) INSTALL="$ac_dots$ac_given_INSTALL" ;; + esac + + echo creating "$ac_file" + rm -f "$ac_file" + configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." + case "$ac_file" in + *Makefile*) ac_comsub="1i\\ +# $configure_input" ;; + *) ac_comsub= ;; + esac + + ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` + sed -e "$ac_comsub +s%@configure_input@%$configure_input%g +s%@srcdir@%$srcdir%g +s%@top_srcdir@%$top_srcdir%g +s%@INSTALL@%$INSTALL%g +" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file +fi; done +rm -f conftest.s* + +EOF +cat >> $CONFIG_STATUS <<EOF + +EOF +cat >> $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 + diff --git a/apps/X11/micros/micros.cpp b/apps/X11/micros/micros.cpp new file mode 100644 index 0000000..0321b92 --- /dev/null +++ b/apps/X11/micros/micros.cpp @@ -0,0 +1,699 @@ +/* micros + * Copyright (C) 2000, CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +*/ + +#include <gtk/gtk.h> +#include <gdk/gdkkeysyms.h> +#include "microssig.h" +#include "micros.h" +#include <swmgr.h> +#include <versekey.h> +#include <regex.h> + +MainWindow *mainWindow = NULL; +GtkWidget* +get_widget (GtkWidget *widget, + gchar *widget_name) +{ + GtkWidget *found_widget; + + if (widget->parent) + widget = gtk_widget_get_toplevel (widget); + found_widget = (GtkWidget*) gtk_object_get_data (GTK_OBJECT (widget), + widget_name); + if (!found_widget) + g_warning ("Widget not found: %s", widget_name); + return found_widget; +} + +/* This is an internally used function to set notebook tab widgets. */ +void +set_notebook_tab (GtkWidget *notebook, + gint page_num, + GtkWidget *widget) +{ + GtkNotebookPage *page; + GtkWidget *notebook_page; + + page = (GtkNotebookPage*) g_list_nth (GTK_NOTEBOOK (notebook)->children, page_num)->data; + notebook_page = page->child; + gtk_widget_ref (notebook_page); + gtk_notebook_remove_page (GTK_NOTEBOOK (notebook), page_num); + gtk_notebook_insert_page (GTK_NOTEBOOK (notebook), notebook_page, + widget, page_num); + gtk_widget_unref (notebook_page); +} + + + +MainWindow::MainWindow() { + searchType_group = NULL; + mainMgr = new SWMgr(); + curMod = NULL; + chapDisplay = 0; // set in create + entryDisplay = 0; // set in create + skipLookup = false; +} + + +MainWindow::~MainWindow() { + delete mainMgr; + if (chapDisplay) + delete chapDisplay; + if (entryDisplay) + delete entryDisplay; +} + + +GtkWidget* create_mainWindow () { + GtkWidget *retWidget; + mainWindow = new MainWindow(); + retWidget = mainWindow->create(); + mainWindow->initSWORD(); + return retWidget; +} + +GtkWidget *MainWindow::create() { + mainWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); + gtk_object_set_data (GTK_OBJECT (mainWindow), "mainWindow", mainWindow); + gtk_window_set_title (GTK_WINDOW (mainWindow), "Micros - SWORD PDA UI"); + gtk_window_set_policy (GTK_WINDOW (mainWindow), TRUE, TRUE, FALSE); + gtk_widget_set_usize(GTK_WIDGET(mainWindow), 315, 225); + gtk_signal_connect(GTK_OBJECT(mainWindow), + "destroy", + GTK_SIGNAL_FUNC(gtk_main_quit), + NULL); + + + mainPanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "mainPanel", mainPanel); + gtk_widget_show (mainPanel); + gtk_container_add (GTK_CONTAINER (mainWindow), mainPanel); + + headerPanel = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "headerPanel", headerPanel); + gtk_widget_show (headerPanel); + gtk_box_pack_start (GTK_BOX (mainPanel), headerPanel, FALSE, TRUE, 0); + + handlebox3 = gtk_handle_box_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "handlebox3", handlebox3); + gtk_widget_show (handlebox3); + gtk_box_pack_start (GTK_BOX (headerPanel), handlebox3, TRUE, TRUE, 0); + + menubar4 = gtk_menu_bar_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menubar4", menubar4); + gtk_widget_show (menubar4); + gtk_container_add (GTK_CONTAINER (handlebox3), menubar4); + +/* + File3 = gtk_menu_item_new_with_label ("File"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "File3", File3); + gtk_widget_show (File3); + gtk_container_add (GTK_CONTAINER (menubar4), File3); + + menu13 = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menu13", menu13); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (File3), menu13); + + Exit3 = gtk_menu_item_new_with_label ("Exit"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "Exit3", Exit3); + gtk_widget_show (Exit3); + gtk_container_add (GTK_CONTAINER (menu13), Exit3); + gtk_signal_connect (GTK_OBJECT (Exit3), "activate", + GTK_SIGNAL_FUNC (gtk_main_quit), + NULL); +*/ + + + View3 = gtk_menu_item_new_with_label ("View"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "View3", View3); + gtk_widget_show (View3); + gtk_container_add (GTK_CONTAINER (menubar4), View3); + gtk_signal_connect (GTK_OBJECT (View3), "activate", + GTK_SIGNAL_FUNC (on_View3_activate), + NULL); + + menuView = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuView", menuView); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (View3), menuView); + + commentaries = gtk_menu_item_new_with_label ("Commentaries"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "commentaries", commentaries); + gtk_widget_show (commentaries); + + menuCommentaries = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuCommentaries", menuCommentaries); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (commentaries), menuCommentaries); + + dictionaries = gtk_menu_item_new_with_label ("Dictionaries"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "Dictionaries", dictionaries); + gtk_widget_show (dictionaries); + + menuDictionaries = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menuDictionaries", menuDictionaries); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (dictionaries), menuDictionaries); + + + +/* + Help = gtk_menu_item_new_with_label ("Help"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "Help", Help); + gtk_widget_show (Help); + gtk_container_add (GTK_CONTAINER (menubar4), Help); + gtk_signal_connect (GTK_OBJECT (Help), "activate", + GTK_SIGNAL_FUNC (on_Help_activate), + NULL); + gtk_menu_item_right_justify (GTK_MENU_ITEM (Help)); + + menu14 = gtk_menu_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "menu14", menu14); + gtk_menu_item_set_submenu (GTK_MENU_ITEM (Help), menu14); + + About = gtk_menu_item_new_with_label ("About"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "About", About); + gtk_widget_show (About); + gtk_container_add (GTK_CONTAINER (menu14), About); + gtk_signal_connect (GTK_OBJECT (About), "activate", + GTK_SIGNAL_FUNC (on_About_activate), + NULL); +*/ + + handlebox4 = gtk_handle_box_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "handlebox4", handlebox4); + gtk_widget_show (handlebox4); + gtk_box_pack_start (GTK_BOX (headerPanel), handlebox4, TRUE, TRUE, 0); + + hbox6 = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "hbox6", hbox6); + gtk_widget_show (hbox6); + gtk_container_add (GTK_CONTAINER (handlebox4), hbox6); + + showSearchButton = gtk_button_new_with_label ("-O"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "showSearchButton", showSearchButton); + gtk_widget_show (showSearchButton); + gtk_box_pack_start (GTK_BOX (hbox6), showSearchButton, FALSE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (showSearchButton), "clicked", + GTK_SIGNAL_FUNC (on_showSearchButton_clicked), + NULL); + + label2 = gtk_label_new ("Verse"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "label2", label2); + gtk_widget_show (label2); + gtk_box_pack_start (GTK_BOX (hbox6), label2, FALSE, TRUE, 0); + gtk_label_set_justify (GTK_LABEL (label2), GTK_JUSTIFY_RIGHT); + gtk_misc_set_padding (GTK_MISC (label2), 2, 0); + + + + + + GtkWidget *combo1 = gtk_combo_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "combo1", combo1); + gtk_widget_show (combo1); + gtk_box_pack_start (GTK_BOX (hbox6), combo1, FALSE, TRUE, 0); + gtk_widget_set_usize (combo1, 90, -2); +// GtkRequisition req = {90, 175}; +// gtk_widget_size_request(GTK_WIDGET(GTK_COMBO(combo1)->list), &req); +// gtk_widget_size_request(GTK_WIDGET(combo1), &req); +// gtk_widget_size_allocate(GTK_WIDGET(GTK_COMBO(combo1)->list), &allc); +// gtk_widget_set_usize(GTK_WIDGET(GTK_COMBO(combo1)->list), -2, 175); +// gtk_list_scroll_vertical(GTK_LIST(GTK_COMBO(combo1)->list), +// GTK_SCROLL_STEP_FORWARD, +// 0); + GList *combo1_items = NULL; + + VerseKey *myVk = new VerseKey(); + myVk->Error(); //clear error + (*myVk) = TOP; + char *buf; + while (!myVk->Error()) { + const char *bname = myVk->books[myVk->Testament()-1][myVk->Book()-1].name; + int len = strlen(bname); + buf = new char [ len + 1 ]; + strcpy(buf, bname); + combo1_items = g_list_append (combo1_items, buf); + myVk->Book(myVk->Book() + 1); + } + delete myVk; + + gtk_combo_set_popdown_strings (GTK_COMBO (combo1), combo1_items); + + + lookupText = GTK_COMBO (combo1)->entry; + gtk_object_set_data(GTK_OBJECT(mainWindow), "lookupText", lookupText); + gtk_widget_show (lookupText); + gtk_entry_set_text (GTK_ENTRY (lookupText),(char *)g_list_nth_data (combo1_items, 0)); + gtk_signal_connect (GTK_OBJECT (lookupText), "changed", + GTK_SIGNAL_FUNC (on_lookupText_changed), + NULL); + + for (GList *i = g_list_first(combo1_items); i; i = g_list_next(i)) + delete [] i->data; + g_list_free (combo1_items); + + gtk_widget_set_usize (GTK_COMBO(combo1)->popup, 90, 175); +// GtkAllocation allc = {-2, -2, 90, 175}; +// gtk_widget_size_allocate(GTK_WIDGET(combo1), &allc); +// gtk_widget_set_usize(GTK_WIDGET(GTK_COMBO(combo1)->list), 90, 175); +//GTK_WIDGET(GTK_COMBO(combo1))->allocation.height = 175; +//GTK_WIDGET(GTK_COMBO(combo1))->allocation.width = 90; +//GTK_WIDGET(GTK_COMBO(combo1)->list)->allocation.height = 175; +//GTK_WIDGET(GTK_COMBO(combo1)->list)->allocation.width = 90; +//GTK_WIDGET(GTK_COMBO(combo1))->requisition.height = 175; +//GTK_WIDGET(GTK_COMBO(combo1))->requisition.width = 90; +//GTK_WIDGET(GTK_COMBO(combo1)->list)->requisition.height = 175; +//GTK_WIDGET(GTK_COMBO(combo1)->list)->requisition.width = 90; +//GTK_WIDGET(GTK_COMBO(combo1)->popwin)->allocation.height = 175; +//GTK_WIDGET(GTK_COMBO(combo1)->popwin)->allocation.width = 90; +//GTK_WIDGET(GTK_COMBO(combo1)->popwin)->requisition.height = 175; +//GTK_WIDGET(GTK_COMBO(combo1)->popwin)->requisition.width = 90; + + + GtkObject *spinbutton_adj = gtk_adjustment_new (1, 1, 200, 1, 10, 10); + chapBox = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_adj), 1, 0); + gtk_widget_ref (chapBox); + gtk_object_set_data(GTK_OBJECT (mainWindow), "chapBox", chapBox); + gtk_widget_show (chapBox); + gtk_box_pack_start (GTK_BOX (hbox6), chapBox, FALSE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (chapBox), "changed", + GTK_SIGNAL_FUNC (on_lookupText_changed), + NULL); + gtk_widget_set_usize (chapBox, 40, -2); + + spinbutton_adj = gtk_adjustment_new (1, 1, 200, 1, 10, 10); + verseBox = gtk_spin_button_new (GTK_ADJUSTMENT (spinbutton_adj), 1, 0); + gtk_widget_ref (verseBox); + gtk_object_set_data(GTK_OBJECT (mainWindow), "verseBox", verseBox); + gtk_widget_show (verseBox); + gtk_box_pack_start (GTK_BOX (hbox6), verseBox, FALSE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (verseBox), "changed", + GTK_SIGNAL_FUNC (on_lookupText_changed), + NULL); + gtk_widget_set_usize (verseBox, 40, -2); + + hbox2 = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "hbox2", hbox2); + gtk_widget_show (hbox2); + gtk_box_pack_start (GTK_BOX (mainPanel), hbox2, TRUE, TRUE, 0); + + +/* + textScrolledWindow = gtk_scrolled_window_new (NULL, NULL); + gtk_object_set_data (GTK_OBJECT (mainWindow), "textScrolledWindow", textScrolledWindow); + gtk_widget_show (textScrolledWindow); + gtk_box_pack_start (GTK_BOX (hbox2), textScrolledWindow, FALSE, FALSE, 0); +*/ + + moduleText = gtk_text_new (NULL, NULL); + gtk_object_set_data (GTK_OBJECT (mainWindow), "moduleText", moduleText); + gtk_widget_show (moduleText); +// gtk_container_add (GTK_CONTAINER (textScrolledWindow), moduleText); + gtk_box_pack_start (GTK_BOX (hbox2), moduleText, TRUE, TRUE, 0); + gtk_text_set_editable (GTK_TEXT (moduleText), FALSE); + gtk_text_set_word_wrap (GTK_TEXT (moduleText), TRUE); + gtk_widget_realize (moduleText); + + /* Add a vertical scrollbar to the GtkText widget */ + textScrollbar = gtk_vscrollbar_new (GTK_TEXT (moduleText)->vadj); + gtk_box_pack_start (GTK_BOX (hbox2), textScrollbar, FALSE, FALSE, 0); + gtk_widget_show (textScrollbar); + + +/* + handlebox5 = gtk_handle_box_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "handlebox5", handlebox5); + gtk_widget_show (handlebox5); + gtk_box_pack_start (GTK_BOX (hbox2), handlebox5, FALSE, FALSE, 0); + gtk_container_border_width (GTK_CONTAINER (handlebox5), 5); +*/ + + searchPanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchPanel", searchPanel); + gtk_widget_hide (searchPanel); + gtk_box_pack_start (GTK_BOX (hbox2), searchPanel, FALSE, FALSE, 0); +// gtk_container_add (GTK_CONTAINER (handlebox5), searchPanel); + + hbox4 = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "hbox4", hbox4); + gtk_widget_show (hbox4); + gtk_box_pack_start (GTK_BOX (searchPanel), hbox4, FALSE, FALSE, 0); + + searchText = gtk_entry_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchText", searchText); + gtk_widget_show (searchText); + gtk_box_pack_start (GTK_BOX (hbox4), searchText, TRUE, TRUE, 0); + gtk_widget_set_usize (searchText, 90, -2); + + searchButton = gtk_button_new_with_label ("Go"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchButton", searchButton); + gtk_widget_show (searchButton); + gtk_box_pack_start (GTK_BOX (hbox4), searchButton, FALSE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (searchButton), "clicked", + GTK_SIGNAL_FUNC (on_searchButton_clicked), + NULL); + + searchSettingsPanel = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchSettingsPanel", searchSettingsPanel); + gtk_widget_show (searchSettingsPanel); + gtk_box_pack_start (GTK_BOX (searchPanel), searchSettingsPanel, FALSE, FALSE, 0); + + searchTypePanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchTypePanel", searchTypePanel); + gtk_widget_show (searchTypePanel); + gtk_box_pack_start (GTK_BOX (searchSettingsPanel), searchTypePanel, FALSE, FALSE, 0); + + multiWordSearch = gtk_radio_button_new_with_label (searchType_group, "Multi Word"); + searchType_group = gtk_radio_button_group (GTK_RADIO_BUTTON (multiWordSearch)); + gtk_object_set_data (GTK_OBJECT (mainWindow), "multiWordSearch", multiWordSearch); + gtk_widget_show (multiWordSearch); + gtk_box_pack_start (GTK_BOX (searchTypePanel), multiWordSearch, FALSE, FALSE, 0); + + phraseSearch = gtk_radio_button_new_with_label (searchType_group, "Exact Phrase"); + searchType_group = gtk_radio_button_group (GTK_RADIO_BUTTON (phraseSearch)); + gtk_object_set_data (GTK_OBJECT (mainWindow), "phraseSearch", phraseSearch); + gtk_widget_show (phraseSearch); + gtk_box_pack_start (GTK_BOX (searchTypePanel), phraseSearch, FALSE, FALSE, 0); + + regexSearch = gtk_radio_button_new_with_label (searchType_group, "Regular Expression"); + searchType_group = gtk_radio_button_group (GTK_RADIO_BUTTON (regexSearch)); + gtk_object_set_data (GTK_OBJECT (mainWindow), "regexSearch", regexSearch); + gtk_widget_show (regexSearch); + gtk_box_pack_start (GTK_BOX (searchTypePanel), regexSearch, FALSE, FALSE, 0); + + +/* + searchOptionsPanel = gtk_vbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "searchOptionsPanel", searchOptionsPanel); + gtk_widget_show (searchOptionsPanel); + gtk_box_pack_start (GTK_BOX (searchSettingsPanel), searchOptionsPanel, FALSE, FALSE, 0); +*/ + + caseSensitive = gtk_check_button_new_with_label ("Case Sensitive"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "caseSensitive", caseSensitive); + gtk_widget_show (caseSensitive); +// gtk_box_pack_start (GTK_BOX (searchOptionsPanel), caseSensitive, FALSE, FALSE, 0); + gtk_box_pack_start (GTK_BOX (searchTypePanel), caseSensitive, FALSE, FALSE, 0); + + GtkWidget *resultPanel = gtk_hbox_new (FALSE, 0); + gtk_object_set_data (GTK_OBJECT (mainWindow), "resultPanel", resultPanel); + gtk_widget_show (resultPanel); + gtk_box_pack_start (GTK_BOX (searchPanel), resultPanel, TRUE, TRUE, 0); + resultList = gtk_clist_new(1); + gtk_object_set_data(GTK_OBJECT (mainWindow), "resultList", resultList); +// gtk_clist_set_policy(GTK_CLIST(resultList), GTK_POLICY_AUTOMATIC, 0); +// gtk_clist_set_border(GTK_CLIST(resultList), GTK_SHADOW_ETCHED_IN); + gtk_widget_show (resultList); + gtk_box_pack_start (GTK_BOX (resultPanel), resultList, TRUE, TRUE, 0); + gtk_signal_connect (GTK_OBJECT (resultList), "select_row", + GTK_SIGNAL_FUNC (on_resultList_selection_changed), + NULL); + /* Add a vertical scrollbar to the GtkCList widget */ + textScrollbar = gtk_vscrollbar_new (NULL); + gtk_clist_set_vadjustment (GTK_CLIST(resultList), gtk_range_get_adjustment(GTK_RANGE(textScrollbar))); + gtk_box_pack_start (GTK_BOX (resultPanel), textScrollbar, FALSE, FALSE, 0); + gtk_widget_show (textScrollbar); + + +/* + statusbar1 = gtk_statusbar_new (); + gtk_object_set_data (GTK_OBJECT (mainWindow), "statusbar1", statusbar1); + gtk_widget_show (statusbar1); + gtk_box_pack_start (GTK_BOX (mainPanel), statusbar1, FALSE, TRUE, 0); +*/ + +/* + arrow1 = gtk_button_new_with_label ("[<]"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "arrow1", arrow1); + gtk_widget_show (arrow1); + gtk_box_pack_start (GTK_BOX (headerPanel), arrow1, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (arrow1), "clicked", + GTK_SIGNAL_FUNC (on_arrow1_button_press_event), + NULL); + + arrow2 = gtk_button_new_with_label ("[>]"); + gtk_object_set_data (GTK_OBJECT (mainWindow), "arrow2", arrow2); + gtk_widget_show (arrow2); + gtk_box_pack_start (GTK_BOX (headerPanel), arrow2, FALSE, FALSE, 0); + gtk_signal_connect (GTK_OBJECT (arrow2), "clicked", + GTK_SIGNAL_FUNC (on_arrow2_button_press_event), + NULL); + +*/ + + statusbar1 = gtk_label_new (""); + gtk_object_set_data (GTK_OBJECT (mainWindow), "statusbar1", statusbar1); + gtk_widget_show (statusbar1); + gtk_box_pack_start (GTK_BOX (mainPanel), statusbar1, FALSE, FALSE, 0); + gtk_label_set_justify (GTK_LABEL (statusbar1), GTK_JUSTIFY_LEFT); + gtk_misc_set_padding (GTK_MISC (statusbar1), 2, 0); + + + GTKEntryDisp::__initialize(); + chapDisplay = new GTKChapDisp(moduleText); + entryDisplay = new GTKEntryDisp(moduleText); + + return mainWindow; +} + +void MainWindow::initSWORD() { + + GtkWidget *menuChoice; + int viewNumber = 1; + char menuName[64]; + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + char *font; + SWModule *curMod; + + for (it = mainMgr->Modules.begin(); it != mainMgr->Modules.end(); it++) { + curMod = (*it).second; + menuChoice = gtk_menu_item_new_with_label (curMod->Name()); + sprintf(menuName, "viewMod%d", viewNumber++); + gtk_object_set_data (GTK_OBJECT (mainWindow), menuName, menuChoice); + gtk_widget_show (menuChoice); + gtk_signal_connect(GTK_OBJECT (menuChoice), "activate", + GTK_SIGNAL_FUNC (on_viewMod_activate), + g_strdup(curMod->Name())); + + if (!strcmp((*it).second->Type(), "Biblical Texts")) { + gtk_container_add (GTK_CONTAINER (menuView), menuChoice); + font = 0; + if ((sit = mainMgr->config->Sections.find((*it).second->Name())) != mainMgr->config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + font = (char *)(*eit).second.c_str(); + } + } +// CreateTextPane((*it).second, font); + curMod->Disp(chapDisplay); // set our GTKChapDisp object up for the diplayer of each Biblical Text module + if (!this->curMod) // set currently selected module for app to first module from SWMgr (Bible Texts get first preference + this->curMod = curMod; + } + else { + curMod->Disp(entryDisplay); // set our GTKEntryDisp object up for the diplayer of each module other than Biblical Texts + if (!strcmp((*it).second->Type(), "Commentaries")) { + gtk_container_add (GTK_CONTAINER (menuCommentaries), menuChoice); + // CreateCommentPane((*it).second); + } + if (!strcmp((*it).second->Type(), "Lexicons / Dictionaries")) { + gtk_container_add (GTK_CONTAINER (menuDictionaries), menuChoice); + // CreateLDPane((*it).second); + } + } + + + } + gtk_container_add (GTK_CONTAINER (menuView), commentaries); + gtk_container_add (GTK_CONTAINER (menuView), dictionaries); + if (!this->curMod) // set currently selected module for app to first module from SWMgr + this->curMod = curMod; +} + + +void MainWindow::lookupTextChanged() { + string keyText; + gchar *entryText; + char tmpBuf[255]; + + if (!skipLookup) { + entryText = gtk_entry_get_text(GTK_ENTRY(lookupText)); + keyText = entryText; + entryText = gtk_entry_get_text(GTK_ENTRY(chapBox)); + keyText += " "; + keyText += entryText; + entryText = gtk_entry_get_text(GTK_ENTRY(verseBox)); + keyText += ":"; + keyText += entryText; + + if (curMod) { + curMod->SetKey(keyText.c_str()); + curMod->Display(); + sprintf(tmpBuf, "%s (%s)", curMod->KeyText(), curMod->Name()); + gtk_label_set(GTK_LABEL(statusbar1), tmpBuf); + } + } +} + +void MainWindow::viewModActivate(GtkMenuItem *sender, gchar *modName) { + ModMap::iterator it; + + it = mainMgr->Modules.find(modName); + if (it != mainMgr->Modules.end()) { + curMod = (*it).second; + lookupTextChanged(); + } + else curMod = 0; +} + + +void MainWindow::navigateButtonClicked(int direction) { + if (curMod) { + if (direction) + (*curMod)++; + else (*curMod)--; + (const char *)*curMod; // snap to closest locations + const gchar *text = curMod->KeyText(); + gtk_entry_set_text(GTK_ENTRY(lookupText), text); +// curMod->Display(); + } +} + + +void MainWindow::showSearchButtonClicked() { + static bool showing = false; + if (showing) + gtk_widget_hide(searchPanel); + else gtk_widget_show(searchPanel); + showing = !showing; + +} + +void statusUpdate(char percent, void *userData) { + char buf[5]; + GtkWidget *button = (GtkWidget *)userData; + sprintf(buf, "%d%%", percent); + gtk_label_set_text(GTK_LABEL(GTK_BIN(button)->child), buf); +// gtk_widget_draw_focus(button); +} + + +void MainWindow::searchButtonClicked() { + string srchText; + gchar *entryText; + const gchar *resultText; + gchar **clistText = (gchar **)&resultText; + + + gtk_clist_clear(GTK_CLIST(resultList)); + + entryText = gtk_entry_get_text(GTK_ENTRY(searchText)); + srchText = entryText; + + if (curMod) { + int searchType = GTK_TOGGLE_BUTTON(regexSearch)->active ? 0 : GTK_TOGGLE_BUTTON(phraseSearch)->active ? -1 : -2; + int searchParams = GTK_TOGGLE_BUTTON(caseSensitive)->active ? 0 : REG_ICASE; + gtk_clist_freeze(GTK_CLIST(resultList)); + for (ListKey searchResults = curMod->Search(srchText.c_str(), searchType, searchParams, 0, 0, statusUpdate, searchButton); !searchResults.Error(); searchResults++) { + resultText = (const char *)searchResults; + gtk_clist_append(GTK_CLIST(resultList), clistText); + } + gtk_clist_thaw(GTK_CLIST(resultList)); + gtk_label_set_text(GTK_LABEL(GTK_BIN(searchButton)->child), "Go"); + } +} + + +void MainWindow::resultListSelectionChanged(GtkWidget *clist, gint row, gint column, GdkEventButton *event, gpointer data) { + gchar *text; + char buf[256]; + + gtk_clist_get_text(GTK_CLIST(resultList), row, column, &text); + VerseKey vkey(text); + + if (text) { + skipLookup = true; + memset(buf, 0, 256); + int len = strlen((const char *)vkey); + if (len > 255) len = 255; + strncpy(buf, (const char *)vkey, len-4); + gtk_entry_set_text(GTK_ENTRY(lookupText), vkey.books[vkey.Testament()-1][vkey.Book()-1].name); + sprintf(buf, "%d", vkey.Chapter()); + gtk_entry_set_text(GTK_ENTRY(chapBox), buf); + skipLookup = false; + sprintf(buf, "%d", vkey.Verse()); + gtk_entry_set_text(GTK_ENTRY(verseBox), buf); + } +} + +GdkColor GTKEntryDisp::colourBlue; +GdkColor GTKEntryDisp::colourGreen; + +char GTKEntryDisp::Display(SWModule &imodule) { + char tmpBuf[255]; + + gtk_text_set_point(GTK_TEXT(gtkText), 0); + gtk_text_forward_delete (GTK_TEXT (gtkText), gtk_text_get_length((GTK_TEXT(gtkText)))); + int curPos = 0; + (const char *)imodule; // snap to entry + gtk_text_freeze (GTK_TEXT(gtkText)); + sprintf(tmpBuf, "[%s] ", imodule.KeyText()); + gtk_text_insert(GTK_TEXT(gtkText), NULL, &colourBlue, NULL, tmpBuf, -1); + gtk_text_insert(GTK_TEXT(gtkText), NULL, >kText->style->black, NULL, imodule.StripText(), -1); + gtk_text_set_point(GTK_TEXT(gtkText), curPos); + gtk_text_thaw(GTK_TEXT(gtkText)); +} + + +char GTKChapDisp::Display(SWModule &imodule) { + char tmpBuf[255]; + + gtk_text_set_point(GTK_TEXT(gtkText), 0); + gtk_text_forward_delete (GTK_TEXT (gtkText), gtk_text_get_length((GTK_TEXT(gtkText)))); + VerseKey *key = (VerseKey *)(SWKey *)imodule; + int curVerse = key->Verse(); + int curChapter = key->Chapter(); + int curBook = key->Book(); + int curPos = 0; + gfloat adjVal; + gtk_text_freeze (GTK_TEXT(gtkText)); + for (key->Verse(1); (key->Book() == curBook && key->Chapter() == curChapter && !imodule.Error()); imodule++) { + sprintf(tmpBuf, "%d. ", key->Verse()); + gtk_text_insert(GTK_TEXT(gtkText), NULL, &colourBlue, NULL, tmpBuf, -1); + if (key->Verse() == curVerse) { + gtk_text_thaw(GTK_TEXT(gtkText)); + adjVal = GTK_TEXT(gtkText)->vadj->upper; + curPos = gtk_text_get_length(GTK_TEXT(gtkText)); + gtk_text_insert(GTK_TEXT(gtkText), NULL, &colourGreen, NULL, imodule.StripText(), -1); + gtk_text_freeze (GTK_TEXT(gtkText)); + } + else { + gtk_text_insert(GTK_TEXT(gtkText), NULL, >kText->style->black, NULL, imodule.StripText(), -1); + } + gtk_text_insert(GTK_TEXT(gtkText), NULL, >kText->style->black, NULL, " ", -1); + } + gtk_text_set_point(GTK_TEXT(gtkText), curPos); + gtk_text_thaw(GTK_TEXT(gtkText)); + adjVal -= (GTK_TEXT(gtkText)->vadj->page_size / 2); + gtk_adjustment_set_value(GTK_TEXT(gtkText)->vadj, (adjVal>0)?adjVal:0); + key->Verse(1); + key->Chapter(1); + key->Book(curBook); + key->Chapter(curChapter); + key->Verse(curVerse); +} diff --git a/apps/X11/wxSword/gui_sword.cpp b/apps/X11/wxSword/gui_sword.cpp new file mode 100644 index 0000000..33d50ca --- /dev/null +++ b/apps/X11/wxSword/gui_sword.cpp @@ -0,0 +1,1075 @@ +// -------------------------------------------------------------- +// For compilers that support precompilation, includes "wx/wx.h" + +#include "wx/wxprec.h" + +#ifndef WX_PRECOMP +#include "wx/wx.h" +#endif + +// Things for Sword +#include <stdio.h> +#include <iostream.h> +#include <versekey.h> +#include <rawtext.h> +#include <zcom.h> +#include <rawcom.h> +#include <rawgbf.h> +#include <stdlib.h> +#include <rawcom.h> +#include <rawld.h> +#include <regex.h> + +#include <swmgr.h> + +// I added +#include <stl.h> +#include <strstream.h> + +#include "wx/notebook.h" +#include "wx/imaglist.h" +#include "wx/toolbar.h" +#include "gui_sword.h" + + +#ifdef __WXGTK__ +#include "mondrian.xpm" +#include "bitmaps/new.xpm" +#include "bitmaps/open.xpm" +#include "bitmaps/save.xpm" +#include "bitmaps/copy.xpm" +#include "bitmaps/cut.xpm" + +// #include "bitmaps/paste.xpm" + +#include "bitmaps/print.xpm" +#include "bitmaps/preview.xpm" +#include "bitmaps/help.xpm" +#endif + +#include "jptr.h" + + +int ID_CHOICE = 300; + +// =============================================================================== +// Global Declarations +// =============================================================================== +class ttextVec : public vector<clJPTR<wxTextCtrl> > +{ +}; + +class tpanelVec : public vector<clJPTR<wxPanel> > +{ +}; + +class globals +{ +private: + static int id_counter; + +public: + int get_id() + { + return (id_counter ++ ); + } +}; + +int globals::id_counter = 10; +globals gPool; + + +IMPLEMENT_APP(MyApp) + +// ============================================= +// CLASS: cNewNote +// +// Contain all information for a particular +// notebook control. +// +// ============================================= + template< class tType > +class cNewNote +{ +public: + class tVec : public vector< clJPTR<tType> > + { + }; + +private: + ttextVec m_vpTextCtrl; + tpanelVec m_vpPanel; + +private: + clJPTR<wxNotebook> m_notebook; + tVec m_vBookList; + +public: + + cNewNote() + { + } + + void Init( wxPanel* pMainPanel ) + { + assert( m_vBookList.size() > 0 && "use AddPage First!" ); + + // Create a new NOTEBOOK item + m_notebook = new wxNotebook( pMainPanel, gPool.get_id() ); + + // Add all the pages + make_panels (); + + // Layout NoteBook in Main Panel + wxLayoutConstraints *pLayout = new wxLayoutConstraints; + pLayout->left.SameAs ( pMainPanel, wxLeft ); + pLayout->top.SameAs ( pMainPanel, wxTop ); + pLayout->right.SameAs ( pMainPanel, wxRight); + pLayout->bottom.SameAs ( pMainPanel, wxBottom); + m_notebook -> SetConstraints( pLayout ); + + // Create Initial Verse and Populate notebook texts. + // Update all commentaries and bibles + // NewVerse( wxString( "Genesis 1:1" )); + } + + // ----------------------------------------------- + // Create a note book tab, including + // panel, name of tab, and text area. + // + // ----------------------------------------------- + void make_panels() + { + tVec& oList = m_vBookList; + tVec::const_iterator iWalk; + + // For all books in our list do ... + for( iWalk = oList.begin(); iWalk != oList.end(); iWalk ++ ) + { + // Create a new Panel + m_vpPanel.push_back( new wxPanel( m_notebook.ptr() ) ); + m_vpPanel.back() -> SetAutoLayout( TRUE ); + + // Create a Text control for our panel + m_vpTextCtrl.push_back( new wxTextCtrl( (m_vpPanel.back()).ptr(), + gPool.get_id(), "", + wxPoint(-1,-1), wxSize(-1,-1), wxTE_MULTILINE )); + + // Remove right to edit + m_vpTextCtrl.back() -> SetEditable( FALSE ); + + // Set layout for this panel + wxLayoutConstraints *pLayout = new wxLayoutConstraints; + pLayout->left.SameAs ( (m_vpPanel.back()).ptr(), wxLeft ); + pLayout->top.SameAs ( (m_vpPanel.back()).ptr(), wxTop ); + pLayout->right.SameAs ( (m_vpPanel.back()).ptr(), wxRight); + pLayout->bottom.SameAs ( (m_vpPanel.back()).ptr(), wxBottom); + m_vpTextCtrl.back() -> SetConstraints(pLayout); + + // SET: Tab Name + m_notebook->AddPage( (m_vpPanel.back()).ptr(), (*iWalk)->Name(NULL), FALSE); + } + } + + // Adds a book I want to reference in my NoteBook. + void AddBook( tType* pABook ) + { + m_vBookList.push_back( pABook ); + } + + + // --------------------------------------------------------- + // NewVerse + // + // + void CommentaryVerse( wxString sVerse ) + { + VerseKey oKey = (char * ) sVerse.c_str(); + + oKey.Persist(1); + + tVec::iterator iWalk; + + // For every book in my list of books + // set this verse + for( iWalk = m_vBookList.begin(); + iWalk != m_vBookList.end(); + iWalk ++ ) + { + (*iWalk) -> SetKey( oKey ); + } + + ttextVec::iterator iText; + tVec::iterator iBooks = m_vBookList.begin(); + + // For every book, update verse info in text control. + for( iText = m_vpTextCtrl.begin(); + iText != m_vpTextCtrl.end(); + iText ++, iBooks ++ ) + { + // (*iText) -> SetValue( wxString( (*iBooks)->KeyText() )); + (*iText) -> SetValue( wxString( * ((*iBooks).ptr()) )); + } + } + // ---------------------------------------------------- + // Set the chapter in all the relevant note books + // + void BibleVerse( wxString sBook, const int nChapter, const int nVerse ) + { + wxString sTop; + sTop.Printf( "%s %d:%d", sBook.c_str(), nChapter, nVerse ); + + VerseKey oKey = (char * ) sTop.c_str(); + oKey.Persist(1); + + tVec::iterator iWalk; + + // For every book in my list of books + // set this verse + for( iWalk = m_vBookList.begin(); iWalk != m_vBookList.end(); iWalk ++ ) + { + (*iWalk) -> SetKey( oKey ); + } + + ttextVec::iterator iText; + tVec::iterator iBooks = m_vBookList.begin(); + + // For every book, update verse info in text control. + for( iText = m_vpTextCtrl.begin(); + iText != m_vpTextCtrl.end(); + iText ++, iBooks ++ ) + { + int i = 1; + ostrstream oOut; + int nStartPos = 0; + + // Clear Previous Text + (*iText) -> SetValue(""); + + // Add new Text + for( oKey = (char * ) sTop.c_str() ; oKey.Chapter() == nChapter; oKey ++, i++ ) + { + if ( i == nVerse ) + { + // Here is the verse we are interested in, mark it in some special + // way. + oOut << " <" << i << "> "; + } + else + oOut << " [" << i <<"] " ; + + oOut << * ((*iBooks).ptr()); + + if ( i == nVerse ) + { + nStartPos = oOut.pcount(); + } + } + oOut.put(0); + // Write out entire chapter + (*iText) -> WriteText( oOut.str()); + + // @todo: At this point you might want to + // 1. Grab a dynamic scroll bar + // 2. If you have the scroll bar, adjust it to the + // correct position, and with any insight + // the window should scroll to the appropriate + // verse. + // Exercise is left to the reader + + } + } + + + + void DictionaryKey( wxString sWord ) { + ttextVec::iterator iText; + tVec::iterator iBooks = m_vBookList.begin(); + + // For every book, update verse info in text control. + for( iText = m_vpTextCtrl.begin(); iText != m_vpTextCtrl.end(); iText ++, iBooks ++ ) { + ostrstream oOut; + + (*iBooks)->SetKey( sWord.c_str() ); + + // Clear Previous Text + (*iText) -> SetValue(""); + + // Add new Text + // This 'if' checks to make sure we have an entry + // It also forces the module to retrieve its text which forces KeyText to closest + // match. Without it, the call to KeyText would get exactly what we set with + // SetKey, above. + if (strlen(* ((*iBooks).ptr())) > 0) { + oOut << "[ " << ((*iBooks).ptr()) -> KeyText() << " ]" << endl; + oOut << * ((*iBooks).ptr()) << endl; + oOut.put(0); + (*iText) -> WriteText( oOut.str()); + } + } + } + + // NEW UPDATE + + void UpdateSearch( wxString sWord ) + { + ttextVec::iterator iText; + tVec::iterator iBooks = m_vBookList.begin(); + + // For every book, update verse info in text control. + for( iText = m_vpTextCtrl.begin(); + iText != m_vpTextCtrl.end(); + iText ++, iBooks ++ ) + { + ostrstream oOut; + + // Get the search results and start a key here. + SWListKey& oSearchResults = (*iBooks)->Search( sWord ); + oSearchResults.Persist( true ); + (*iBooks)->SetKey( oSearchResults ); + + // Clear Previous Text + (*iText) -> SetValue(""); + + // Add new Text + for( oSearchResults = TOP; + !oSearchResults.Error(); + oSearchResults ++ ) + { + oOut << (const char *) oSearchResults << ":" << endl; + oOut << * ((*iBooks).ptr()) << endl; + } + // Write out all matches + oOut.put(0); + (*iText) -> WriteText( oOut.str()); + } + } + + + + // --------------------------------------------------------- + // UpdateSearch + // Given a word, update all windows to reflect + // that word. + // NOTE: This may only be need by the Definition + // Windows. + // + void OLD_UpdateSearch( const wxString sWord ) + { + SWListKey oList; + tVec::iterator iWalk; + ttextVec::iterator iText = m_vpTextCtrl.begin(); + char szBuff[5000] = { 0 }; + + for( iWalk = m_vBookList.begin(); + iWalk != m_vBookList.end(); + iWalk ++ ) + { + // For all the matches do: + for( SWListKey oListKey = (*iWalk) -> Search( sWord.c_str(), REG_ICASE ); + !oListKey.Error(); + oListKey++ ) + { + strcat( szBuff, (const char *) oListKey ); + strcat( szBuff, "\n\n" ); + } + + // Update Text of Notebook + (*iText) -> SetValue( wxString( szBuff ) ); + } + return; + } + + +}; + + + + +// -------------------------------------------------------- +// CLASS: CHEADLINE +// +// + +class cHeadLine +{ +public: + clJPTR<wxComboBox> m_pBible; + clJPTR<wxComboBox> m_pChapter; + clJPTR<wxComboBox> m_pVerse; +private: + clJPTR<wxButton> m_pButton; + + +private: // member functions + // ---------------------------------------------------------- + // Find Book info in one of our 2 book lists. + // --------------------------------------------------------- + struct sbook* FindBook( const wxString& sBook ) + { + static const VerseKey oStep; + + + for(int i = 0; i < 2; i ++ ) + { + for( int j = 0; j < oStep.BMAX[i]; j ++ ) + { + if ( wxStringEq(sBook, wxString(oStep.books[i][j].name)) ) + { + return &oStep.books[i][j]; + } + } + } + return ( NULL ); + } + +public: + cHeadLine( wxPanel* pPanel) + { + static wxString choices[ 200 ]; + static VerseKey oStep; + int k = 0; + + // Initialize STRINGS of books of bible + for( int i = 0; i < 2; i ++ ) + { + for( int j = 0; j < oStep.BMAX[i]; j ++ ) + { + choices[k++] = wxString( oStep.books[i][j].name ); + } + } + + // Create Bible Book Selector + m_pBible = new wxComboBox( pPanel , + ID_CHOICE+1, choices[0], wxPoint(10,10), + wxSize(200,-1), k, choices ); + + m_pBible -> SetEditable( FALSE ); + + // Create Chapter Selector + m_pChapter = new wxComboBox( pPanel , + ID_CHOICE+2, "", wxPoint(220,10), + wxSize(50,-1) ); + + m_pChapter -> SetEditable( FALSE ); + + // Create Verse Selector + + m_pVerse = new wxComboBox( pPanel , + ID_CHOICE+3, "", wxPoint(280,10), + wxSize(50,-1) ); + + m_pVerse -> SetEditable( FALSE ); + + // Create Button for Search for Verse NOW. + m_pButton = new wxButton( pPanel, + ID_CHOICE+4, "GO!", wxPoint( 340, 10), + wxSize( 60 , -1 )); + + UpdateChapter( choices[0] ); + UpdateVerse( choices[0], 0 ); + } + + // ----------------------------------------------------- + // UpdateChapter + // Set all chapter numbers for the 1st chapter + // of this particular book. + // + // + void UpdateChapter( const wxString& sBook ) + { + struct sbook* pFound = NULL; + wxString sTemp; + + // Find Struct of Book Info + pFound = FindBook( sBook ); + assert( pFound && "This should always find something!"); + + // Remove all elements from chapter control. + m_pChapter->Clear(); + + // Fill List of Chapters + for( int i = 0; i < pFound->chapmax; i ++ ) + { + sTemp.Printf("%2d", i + 1 ); + m_pChapter->Append( sTemp ); + } + } + + + // ----------------------------------------------------- + // UpdateVerse + // Set all verses for the 1st verse of this + // particular chapter, in this particular + // book. + // + UpdateVerse( wxString sBook, const int iChapter ) + { + struct sbook* pFound = NULL; + + // Find Struct of Book Info + pFound = FindBook( sBook ); + assert( pFound && "This should always find something!"); + + wxString sTemp; + + m_pVerse -> Clear(); + for( int i = 0; i < pFound->versemax[iChapter]; i ++ ) + { + sTemp.Printf( "%d", i + 1 ); + m_pVerse->Append( sTemp ); + } + } +}; + + + +// =================================================================== +// CLASS: CDEFHEADLINE +// Contain Headliner information about Definition notebook. +// +// @todo: Looks like a kludge - fix. +int WID_STATICTEXT = 100; +int WID_TEXT = WID_STATICTEXT + 1; + + +class cDefHeadLine +{ +public: + clJPTR<wxTextCtrl> m_pSearchCtrl; + +public: + cDefHeadLine(wxPanel* pPanel) + { + + // Create Bible Book Selector + new wxStaticText( pPanel, + WID_STATICTEXT, "Dictionary Key:", + wxPoint( 10, 15), wxSize( 100, -1 ), + wxRAISED_BORDER); + + m_pSearchCtrl = new wxTextCtrl( pPanel, + WID_TEXT, "", wxPoint(105,10), + wxSize(200,-1), wxTE_PROCESS_ENTER); + } +}; + + +// =================================================================== +// CLASS: MyFrame +// +// Define a new frame +class MyFrame: public wxFrame +{ +public: + wxPanel* m_pBiblePanel; + wxPanel* m_pCommentPanel; + wxPanel* m_pDefPanel; + wxPanel* m_pHeadLine; + wxPanel* m_pDefHeadLine; + + cHeadLine* m_pcHeadLine; + cDefHeadLine* m_pcDefHeadLine; + + cNewNote<SWModule>* m_pcNoteBible; + cNewNote<SWModule>* m_pcNoteCommentary; + cNewNote<SWModule>* m_pcNoteDef; + +public: + MyFrame(wxFrame *parent, wxWindowID id = -1, const wxString& title = "wxToolBar Sample", + const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE); + + virtual ~MyFrame(); + +public: + // Event Handlers + void OnCloseWindow(wxCloseEvent& event); + void OnQuit(wxCommandEvent& event); + void OnAbout(wxCommandEvent& event); + void OnToolLeftClick(wxCommandEvent& event); + void OnToolEnter(wxCommandEvent& event); + void OnBookUpdate( wxCommandEvent& event ); + void OnChapterUpdate( wxCommandEvent& event ); + void OnGoButton( wxCommandEvent& event ); + void OnDefinitionSearch( wxCommandEvent& event ); + + DECLARE_EVENT_TABLE() + + + public: + SWMgr *mainMgr; + char CreateTextPane(SWModule *mod, char *font = 0); + char CreateCommentPane(SWModule *mod); + char CreateLDPane(SWModule *mod); +}; + + +// ----------------------------------------------------------------------- +// The `main program' equivalent, creating the windows and returning the +// main frame +// ----------------------------------------------------------------------- +bool MyApp::OnInit(void) +{ + // CREATE Main Frame + MyFrame* pFrame = + new MyFrame((wxFrame *) NULL, -1, + (const wxString) "Sword Project 1.0", + wxPoint(100, 100), wxSize(650, 500)); + + // CREATE Status Line + pFrame -> CreateStatusBar(); + + // SET: Auto Layout + pFrame -> SetAutoLayout( TRUE ); + + // SET: Icon + pFrame->SetIcon( wxIcon(mondrian_xpm) ); + + // CREATE File Menu + wxMenu *fileMenu = new wxMenu; + + fileMenu->Append(wxID_EXIT, "E&xit"); + + // CREATE Help Menu + wxMenu *helpMenu = new wxMenu; + helpMenu->Append(wxID_HELP, "&About"); + + // CREATE Menu Bar + wxMenuBar* menuBar = new wxMenuBar; + + menuBar->Append(fileMenu, "&File"); + menuBar->Append(helpMenu, "&Help"); + + // ASSOCIATE: Menubar and Frame + pFrame->SetMenuBar(menuBar); + + // CREATE: toolbar + pFrame->CreateToolBar(wxNO_BORDER|wxHORIZONTAL|wxTB_FLAT, ID_TOOLBAR); + + // INITIALIZE: toolbar + InitToolbar(pFrame->GetToolBar()); + + // Text Message + pFrame->SetStatusText("Alpha $Revision: 1.1.1.1 $:Linux Version:Sword Development Team."); + + // Add Panel Info ============================================== + + // CREATE: Bible All Major Panels + pFrame->m_pBiblePanel = new wxPanel(pFrame, 0, 0, 10, 10, wxTAB_TRAVERSAL); + pFrame->m_pCommentPanel = new wxPanel(pFrame, 0, 0, 10, 10, wxTAB_TRAVERSAL); + pFrame->m_pDefPanel = new wxPanel(pFrame, 0, 0, 10, 10, wxTAB_TRAVERSAL); + pFrame->m_pHeadLine = new wxPanel(pFrame, 0, 0, 10, 10, wxRAISED_BORDER); + pFrame->m_pDefHeadLine = new wxPanel(pFrame, 0, 0, 10, 10, wxRAISED_BORDER); + + // pFrame->m_pDefPanel->SetBackgroundColour(wxColour(192, 192, 192)); + + // Set constraints for panel subwindow + wxLayoutConstraints *pLayout = new wxLayoutConstraints; + + // Set constraints for Head Line Window + + pLayout->left.SameAs ( pFrame, wxLeft ); + pLayout->right.SameAs ( pFrame, wxRight); + pLayout->top.SameAs ( pFrame, wxTop ); + pLayout->height.PercentOf ( pFrame, wxHeight, 10 ); + + pFrame-> m_pHeadLine ->SetConstraints( pLayout ); + + // Bible Constraints + pLayout = new wxLayoutConstraints; + pLayout->left.SameAs (pFrame, wxLeft); + pLayout->right.PercentOf (pFrame, wxWidth, 60); + pLayout->top.SameAs ( pFrame -> m_pHeadLine, wxBottom ); + pLayout->height.PercentOf (pFrame, wxHeight, 50); + + pFrame-> m_pBiblePanel -> SetConstraints( pLayout ); + + // Commentary Constraints + pLayout = new wxLayoutConstraints; + + pLayout->left.SameAs ( pFrame->m_pBiblePanel, wxRight ); + pLayout->right.SameAs ( pFrame, wxRight ); + pLayout->top.SameAs ( pFrame -> m_pHeadLine, wxBottom ); + pLayout->height.PercentOf ( pFrame, wxHeight, 50 ); + + pFrame-> m_pCommentPanel -> SetConstraints( pLayout ); + + // Set constraints for Definition Search + pLayout = new wxLayoutConstraints; + + pLayout->left.SameAs ( pFrame, wxLeft ); + pLayout->right.SameAs ( pFrame, wxRight); + pLayout->top.SameAs ( pFrame->m_pBiblePanel, wxBottom ); + pLayout->height.PercentOf ( pFrame, wxHeight, 10 ); + + pFrame -> m_pDefHeadLine -> SetConstraints( pLayout ); + + // Definition Window + pLayout = new wxLayoutConstraints; + pLayout->left.SameAs ( pFrame, wxLeft ); + pLayout->right.SameAs ( pFrame, wxRight); + pLayout->top.SameAs ( pFrame->m_pDefHeadLine, wxBottom ); + pLayout->bottom.SameAs ( pFrame, wxBottom); + + pFrame-> m_pDefPanel ->SetConstraints( pLayout ); + + + // ===================================================== + // Start loading modules. + // + pFrame -> m_pcHeadLine = new cHeadLine( pFrame -> m_pHeadLine ); + pFrame -> m_pcDefHeadLine = new cDefHeadLine( pFrame -> m_pDefHeadLine ); + + pFrame -> m_pcNoteBible = new cNewNote<SWModule>; + pFrame -> m_pcNoteCommentary = new cNewNote<SWModule>; + pFrame -> m_pcNoteDef = new cNewNote<SWModule>; + + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + char *font; + + pFrame->mainMgr = new SWMgr(); + + // -------------------------------------------- + // @todo: Need to find a better way to exit. + // + assert( (pFrame -> mainMgr -> Modules.size() > 0) && "No modules found!" ); + + for (it = pFrame->mainMgr->Modules.begin(); + it != pFrame->mainMgr->Modules.end(); it++) + { + if (!strcmp((*it).second->Type(), "Biblical Texts")) + { + font = 0; + if ((sit = pFrame->mainMgr->config->Sections.find((*it).second->Name())) != pFrame->mainMgr->config->Sections.end()) + { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) + { + font = (char *)(*eit).second.c_str(); + } + } + + // question: why is font null? + // answer: most of the time, a unique font is not + // specified in mods.conf with 'font=' + cout << font << endl; + pFrame->CreateTextPane((*it).second, font); + } + + if (!strcmp((*it).second->Type(), "Commentaries")) + pFrame->CreateCommentPane((*it).second); + + if (!strcmp((*it).second->Type(), "Lexicons / Dictionaries")) + pFrame->CreateLDPane((*it).second); + } + + // Initialize all views with data + if ( pFrame && pFrame -> m_pcNoteBible ) + pFrame -> m_pcNoteBible -> Init( pFrame -> m_pBiblePanel ); + + if ( pFrame && pFrame -> m_pcNoteCommentary ) + pFrame -> m_pcNoteCommentary -> Init( pFrame -> m_pCommentPanel ); + + if (pFrame && pFrame -> m_pcNoteDef ) + pFrame -> m_pcNoteDef -> Init( pFrame -> m_pDefPanel ); + + // ----------------------------------------------- + // Okay, Initial verse would be a nice touch. + // + wxString sBook = "Genesis"; + wxString sStart = sBook + " 1:1"; + + if (pFrame && pFrame -> m_pcNoteBible ) + pFrame -> m_pcNoteBible -> BibleVerse( sBook, 1, 1 ); + + if (pFrame && pFrame -> m_pcNoteCommentary ) + pFrame -> m_pcNoteCommentary -> CommentaryVerse( sStart ); + + // Force a resize. This should probably be replaced by a call to a wxFrame + // function that lays out default decorations and the remaining content window. + + // pFrame->OnSize(wxSizeEvent(wxSize(-1, -1), pFrame->GetId()) ); + pFrame->Show(TRUE); + + // ================================================= + + SetTopWindow( pFrame ); + return TRUE; +} + + +/****************************************************************************** + * CreateTextPane - creates a new pane in the tabsheet for a Bible Text + * + * mod - Bible text module to associate with this panel + * font - font to use for displaying this module (default = 0) + * + * RETURN: error status + */ + +char MyFrame::CreateTextPane(SWModule *mod, char *font) +{ + // @todo: need to make use of font for displaying Greek MSS + + m_pcNoteBible->AddBook(mod); + return 0; +} + + +/****************************************************************************** + * CreateCommentPane - creates a new pane in the tabsheet for a Bible + * Commentary + * + * mod - Bible commentary module to associate with this panel + * + * RETURN: error status + */ + +char MyFrame::CreateCommentPane(SWModule *mod) +{ + m_pcNoteCommentary->AddBook(mod); + return 0; +} + + +/****************************************************************************** + * CreateLDPane - creates a new pane in the tabsheet for a Bible + * Lexicon or Dictionary + * + * mod - Bible text module to associate with this panel + * + * RETURN: error status + */ + +char MyFrame::CreateLDPane(SWModule *mod) +{ + m_pcNoteDef->AddBook(mod); + return 0; +} + + + + +bool MyApp::InitToolbar(wxToolBar* toolBar) +{ + toolBar->SetMargins(5, 5); + + // Set up toolbar + wxBitmap* toolBarBitmaps[8]; + + toolBarBitmaps[0] = new wxBitmap( new_xpm ); + toolBarBitmaps[1] = new wxBitmap( open_xpm ); + toolBarBitmaps[2] = new wxBitmap( save_xpm ); + toolBarBitmaps[3] = new wxBitmap( copy_xpm ); + toolBarBitmaps[4] = new wxBitmap( cut_xpm ); + // toolBarBitmaps[5] = new wxBitmap( paste_xpm ); + toolBarBitmaps[5] = new wxBitmap( preview_xpm ); + toolBarBitmaps[6] = new wxBitmap( print_xpm ); + toolBarBitmaps[7] = new wxBitmap( help_xpm ); + + int width = 16; + int currentX = 5; + + toolBar->AddTool(wxID_NEW, *(toolBarBitmaps[0]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "New file"); + currentX += width + 5; + toolBar->AddTool(wxID_OPEN, *(toolBarBitmaps[1]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Open file"); + currentX += width + 5; + toolBar->AddTool(wxID_SAVE, *(toolBarBitmaps[2]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Save file"); + currentX += width + 5; + toolBar->AddSeparator(); + toolBar->AddTool(wxID_COPY, *(toolBarBitmaps[3]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Copy"); + currentX += width + 5; + toolBar->AddTool(wxID_CUT, *(toolBarBitmaps[4]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Cut"); + currentX += width + 5; + toolBar->AddTool(wxID_PASTE, *(toolBarBitmaps[5]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Paste"); + currentX += width + 5; + toolBar->AddSeparator(); + toolBar->AddTool(wxID_PRINT, *(toolBarBitmaps[6]), wxNullBitmap, FALSE, (float)currentX, -1, (wxObject *) NULL, "Print"); + currentX += width + 5; + toolBar->AddSeparator(); + toolBar->AddTool(wxID_HELP, *(toolBarBitmaps[7]), wxNullBitmap, FALSE, currentX, -1, (wxObject *) NULL, "Help"); + + toolBar->Realize(); + + // Can delete the bitmaps since they're reference counted + int i; + for (i = 0; i < 8; i++) + delete toolBarBitmaps[i]; + + return TRUE; +} + +// wxID_HELP will be processed for the 'About' menu and the toolbar help button. + +BEGIN_EVENT_TABLE(MyFrame, wxFrame) + EVT_MENU(wxID_EXIT, MyFrame::OnQuit) + EVT_MENU(wxID_HELP, MyFrame::OnAbout) + EVT_CLOSE(MyFrame::OnCloseWindow) + EVT_TOOL_RANGE(wxID_OPEN, wxID_PASTE, MyFrame::OnToolLeftClick) + EVT_TOOL_ENTER(ID_TOOLBAR, MyFrame::OnToolEnter) + EVT_CHOICE(ID_CHOICE+1, MyFrame::OnBookUpdate) + EVT_CHOICE(ID_CHOICE+2, MyFrame::OnChapterUpdate) + EVT_BUTTON(ID_CHOICE+4, MyFrame::OnGoButton) + + // REQUIREMENT: On enter on text to search + EVT_TEXT(WID_TEXT, MyFrame::OnDefinitionSearch ) + + // End + END_EVENT_TABLE() + + // Define my frame constructor + MyFrame::MyFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos, + const wxSize& size, long style): + wxFrame(parent, id, title, pos, size, style) +{ + // m_textWindow = new wxTextCtrl(this, -1, "", wxPoint(0, 0), wxSize(-1, -1), wxTE_MULTILINE); + mainMgr = 0; +} + + +MyFrame::~MyFrame() +{ + if (mainMgr) + delete mainMgr; +} + + +void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event)) +{ + Close(TRUE); +} + +void MyFrame::OnAbout(wxCommandEvent& WXUNUSED(event)) +{ + static char * szMess = + { + "Sword Project 1.0\n" + "Linux Version\n" + "Sword Development Team\n" + "LC\n" + }; + + + (void)wxMessageBox( szMess , "About Sword"); +} + +// Define the behaviour for the frame closing +// - must delete all frames except for the main one. +void MyFrame::OnCloseWindow(wxCloseEvent& WXUNUSED(event)) +{ + Destroy(); +} + +void MyFrame::OnToolLeftClick(wxCommandEvent& event) +{ + wxString str; + str.Printf("Clicked on tool %d", event.GetId()); + SetStatusText(str); +} + +void MyFrame::OnToolEnter(wxCommandEvent& event) +{ + if (event.GetSelection() > -1) + { + wxString str; + str.Printf("This is tool number %d", event.GetSelection()); + SetStatusText(str); + } + else + SetStatusText(""); +} + + +// ============================================================================ +// OnBookUpdate +// When the book changes we do 3 things. +// 1. Reset verse and chapter to 1 ( all books have 1 chapter 1 verse ). +// 2. Update the valid list of Chapters 1..ChapterMax for this book +// 3. Update the verse list for the first chapter (1..verse max for this chapter). +// +void MyFrame::OnBookUpdate( wxCommandEvent& event ) +{ + if (event.GetSelection() > -1) + { + + if (m_pcHeadLine) + { + // Get book name. + wxString sBook = m_pcHeadLine ->m_pBible->GetString( event.GetSelection() ); + + // Update chapter (automagically calls OnChapterUpdate ) + m_pcHeadLine -> UpdateChapter( sBook ); + } + } +} + +// =============================================================== +// On chapter change we need to do +// 1. Update Verse information for this chapter. +// +void MyFrame::OnChapterUpdate( wxCommandEvent& event ) +{ + if (event.GetSelection() > -1 ) + { + + if (m_pcHeadLine) + { + // Get Book and current chapter + wxString sBook = m_pcHeadLine -> m_pBible -> GetValue(); + int iChapter = event.GetSelection(); + + m_pcHeadLine -> UpdateVerse( sBook, iChapter ); + } + } +} + +void MyFrame::OnGoButton( wxCommandEvent& event ) +{ + wxString sNewVerse; + + // Check for Programmer Error + assert( m_pcHeadLine ); + assert( m_pcNoteBible ); + assert( m_pcNoteCommentary ); + + + // Insanity Check + if ( m_pcHeadLine ) + { + // Get Selection Data + wxString sBook = m_pcHeadLine ->m_pBible-> GetValue(); + int iChapter = atoi(m_pcHeadLine -> m_pChapter -> GetValue()); + int iVerse = atoi(m_pcHeadLine -> m_pVerse -> GetValue()); + + sNewVerse.Printf( "%s %d : %d", sBook.c_str(), iChapter, iVerse ); + + // Update current verse + SetStatusText( "VERSE: " + sNewVerse ); + + // Update all commentaries and bibles + m_pcNoteBible -> BibleVerse( sBook, iChapter, iVerse); + m_pcNoteCommentary -> CommentaryVerse( sNewVerse ); + } +} + + +// ---------------------------------------------------- +// OnDefinitionSearch +// Search for definition of the word in the +// text area. Use the definition NOTEBOOK object. +// +// + +void MyFrame::OnDefinitionSearch( wxCommandEvent& event ) +{ + if (m_pcDefHeadLine) + { + wxString sDefinition = wxString( "Searching for: ") + + m_pcDefHeadLine -> m_pSearchCtrl -> GetValue(); + SetStatusText( sDefinition ); + + m_pcNoteDef -> DictionaryKey( m_pcDefHeadLine -> m_pSearchCtrl -> GetValue() ); + } +} diff --git a/apps/console/Makefile.in b/apps/console/Makefile.in new file mode 100644 index 0000000..c364a89 --- /dev/null +++ b/apps/console/Makefile.in @@ -0,0 +1,360 @@ +# Makefile.in generated by automake 1.6.2 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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. + +@SET_MAKE@ +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 +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CURL_LIBS = @CURL_LIBS@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +GENCCODE = @GENCCODE@ +GENCMN = @GENCMN@ +GENRB = @GENRB@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +PACKAGE = @PACKAGE@ +PKGDATA = @PKGDATA@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +dir_confdef = @dir_confdef@ +enable_debug = @enable_debug@ +enable_profile = @enable_profile@ +install_sh = @install_sh@ +target_cpu = @target_cpu@ +target_mingw32 = @target_mingw32@ +target_os = @target_os@ +target_system = @target_system@ +target_vendor = @target_vendor@ +with_conf = @with_conf@ +with_icu = @with_icu@ +with_zlib = @with_zlib@ +AUTOMAKE_OPTIONS = 1.6 + +SUBDIRS = diatheke +subdir = apps/console +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +DIST_SOURCES = + +RECURSIVE_TARGETS = info-recursive dvi-recursive install-info-recursive \ + uninstall-info-recursive all-recursive install-data-recursive \ + install-exec-recursive installdirs-recursive install-recursive \ + uninstall-recursive check-recursive installcheck-recursive +DIST_COMMON = Makefile.am Makefile.in +DIST_SUBDIRS = $(SUBDIRS) +all: all-recursive + +.SUFFIXES: +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu apps/console/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +# 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. +$(RECURSIVE_TARGETS): + @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; \ + case "$@" in \ + distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ + *) list='$(SUBDIRS)' ;; \ + esac; \ + rev=''; for subdir in $$list; do \ + if test "$$subdir" = "."; then :; else \ + rev="$$subdir $$rev"; \ + fi; \ + done; \ + 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 + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: tags-recursive $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(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) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done + list='$(SUBDIRS)'; for subdir in $$list; do \ + if test "$$subdir" = .; then :; else \ + test -d $(distdir)/$$subdir \ + || mkdir $(distdir)/$$subdir \ + || exit 1; \ + (cd $$subdir && \ + $(MAKE) $(AM_MAKEFLAGS) \ + top_distdir="$(top_distdir)" \ + distdir=../$(distdir)/$$subdir \ + distdir) \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-recursive +all-am: Makefile +installdirs: installdirs-recursive +installdirs-am: + +install: install-recursive +install-exec: install-exec-recursive +install-data: install-data-recursive +uninstall: uninstall-recursive + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-recursive +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-recursive + +clean-am: clean-generic clean-libtool mostlyclean-am + +distclean: distclean-recursive + +distclean-am: clean-am distclean-generic distclean-libtool \ + distclean-tags + +dvi: dvi-recursive + +dvi-am: + +info: info-recursive + +info-am: + +install-data-am: + +install-exec-am: + +install-info: install-info-recursive + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-recursive + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-recursive + +mostlyclean-am: mostlyclean-generic mostlyclean-libtool + +uninstall-am: uninstall-info-am + +uninstall-info: uninstall-info-recursive + +.PHONY: $(RECURSIVE_TARGETS) GTAGS all all-am check check-am clean \ + clean-generic clean-libtool clean-recursive distclean \ + distclean-generic distclean-libtool distclean-recursive \ + distclean-tags distdir dvi dvi-am dvi-recursive info info-am \ + info-recursive install install-am install-data install-data-am \ + install-data-recursive install-exec install-exec-am \ + install-exec-recursive install-info install-info-am \ + install-info-recursive install-man install-recursive \ + install-strip installcheck installcheck-am installdirs \ + installdirs-am installdirs-recursive maintainer-clean \ + maintainer-clean-generic maintainer-clean-recursive mostlyclean \ + mostlyclean-generic mostlyclean-libtool mostlyclean-recursive \ + tags tags-recursive uninstall uninstall-am uninstall-info-am \ + uninstall-info-recursive uninstall-recursive + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/console/diatheke/Makefile.in b/apps/console/diatheke/Makefile.in new file mode 100644 index 0000000..b2ea29a --- /dev/null +++ b/apps/console/diatheke/Makefile.in @@ -0,0 +1,386 @@ +# Makefile.in generated by automake 1.6.2 from Makefile.am. +# @configure_input@ + +# Copyright 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002 +# 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. + +@SET_MAKE@ +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 +pkgdatadir = $(datadir)/@PACKAGE@ +pkglibdir = $(libdir)/@PACKAGE@ +pkgincludedir = $(includedir)/@PACKAGE@ +top_builddir = ../../.. + +ACLOCAL = @ACLOCAL@ +AUTOCONF = @AUTOCONF@ +AUTOMAKE = @AUTOMAKE@ +AUTOHEADER = @AUTOHEADER@ + +am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_DATA = @INSTALL_DATA@ +install_sh_DATA = $(install_sh) -c -m 644 +install_sh_PROGRAM = $(install_sh) -c +install_sh_SCRIPT = $(install_sh) -c +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_HEADER = $(INSTALL_DATA) +transform = @program_transform_name@ +NORMAL_INSTALL = : +PRE_INSTALL = : +POST_INSTALL = : +NORMAL_UNINSTALL = : +PRE_UNINSTALL = : +POST_UNINSTALL = : +host_alias = @host_alias@ +host_triplet = @host@ + +EXEEXT = @EXEEXT@ +OBJEXT = @OBJEXT@ +PATH_SEPARATOR = @PATH_SEPARATOR@ +AMTAR = @AMTAR@ +AS = @AS@ +AWK = @AWK@ +CC = @CC@ +CURL_CFLAGS = @CURL_CFLAGS@ +CURL_CONFIG = @CURL_CONFIG@ +CURL_LIBS = @CURL_LIBS@ +CXX = @CXX@ +DEPDIR = @DEPDIR@ +DLLTOOL = @DLLTOOL@ +ECHO = @ECHO@ +GENCCODE = @GENCCODE@ +GENCMN = @GENCMN@ +GENRB = @GENRB@ +INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +LIBTOOL = @LIBTOOL@ +LN_S = @LN_S@ +MAINT = @MAINT@ +OBJDUMP = @OBJDUMP@ +PACKAGE = @PACKAGE@ +PKGDATA = @PKGDATA@ +RANLIB = @RANLIB@ +STRIP = @STRIP@ +VERSION = @VERSION@ +am__include = @am__include@ +am__quote = @am__quote@ +dir_confdef = @dir_confdef@ +enable_debug = @enable_debug@ +enable_profile = @enable_profile@ +install_sh = @install_sh@ +target_cpu = @target_cpu@ +target_mingw32 = @target_mingw32@ +target_os = @target_os@ +target_system = @target_system@ +target_vendor = @target_vendor@ +with_conf = @with_conf@ +with_icu = @with_icu@ +with_zlib = @with_zlib@ +AUTOMAKE_OPTIONS = 1.6 + +INCLUDES = -I$(top_srcdir)/include + +bin_PROGRAMS = diatheke +diatheke_SOURCES = diatheke.cpp corediatheke.cpp diathekemgr.cpp \ + diafiltmgr.cpp thmlcgi.cpp gbfcgi.cpp + +diatheke_LDADD = -L$(top_builddir)/lib -lsword +subdir = apps/console/diatheke +mkinstalldirs = $(SHELL) $(top_srcdir)/mkinstalldirs +CONFIG_HEADER = $(top_builddir)/config.h +CONFIG_CLEAN_FILES = +bin_PROGRAMS = diatheke$(EXEEXT) +PROGRAMS = $(bin_PROGRAMS) + +am_diatheke_OBJECTS = diatheke.$(OBJEXT) corediatheke.$(OBJEXT) \ + diathekemgr.$(OBJEXT) diafiltmgr.$(OBJEXT) thmlcgi.$(OBJEXT) \ + gbfcgi.$(OBJEXT) +diatheke_OBJECTS = $(am_diatheke_OBJECTS) +diatheke_DEPENDENCIES = +diatheke_LDFLAGS = + +DEFS = @DEFS@ +DEFAULT_INCLUDES = -I. -I$(srcdir) -I$(top_builddir) +CPPFLAGS = @CPPFLAGS@ +LDFLAGS = @LDFLAGS@ +LIBS = @LIBS@ +depcomp = $(SHELL) $(top_srcdir)/depcomp +am__depfiles_maybe = depfiles +@AMDEP_TRUE@DEP_FILES = ./$(DEPDIR)/corediatheke.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/diafiltmgr.Po ./$(DEPDIR)/diatheke.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/diathekemgr.Po ./$(DEPDIR)/gbfcgi.Po \ +@AMDEP_TRUE@ ./$(DEPDIR)/thmlcgi.Po +CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \ + $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) +LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) \ + $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \ + $(AM_CXXFLAGS) $(CXXFLAGS) +CXXLD = $(CXX) +CXXLINK = $(LIBTOOL) --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) \ + $(AM_LDFLAGS) $(LDFLAGS) -o $@ +CXXFLAGS = @CXXFLAGS@ +DIST_SOURCES = $(diatheke_SOURCES) +DIST_COMMON = README Makefile.am Makefile.in +SOURCES = $(diatheke_SOURCES) + +all: all-am + +.SUFFIXES: +.SUFFIXES: .cpp .lo .o .obj +$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ Makefile.am $(top_srcdir)/configure.ac $(ACLOCAL_M4) + cd $(top_srcdir) && \ + $(AUTOMAKE) --gnu apps/console/diatheke/Makefile +Makefile: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.in $(top_builddir)/config.status + cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe) +binPROGRAMS_INSTALL = $(INSTALL_PROGRAM) +install-binPROGRAMS: $(bin_PROGRAMS) + @$(NORMAL_INSTALL) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + p1=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + if test -f $$p \ + || test -f $$p1 \ + ; then \ + p1=`echo "$$p1" | sed -e 's,^.*/,,'`; \ + f=`echo $$p1|sed '$(transform);s/$$/$(EXEEXT)/'`; \ + echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f"; \ + $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(binPROGRAMS_INSTALL) $$p $(DESTDIR)$(bindir)/$$f; \ + else :; fi; \ + done + +uninstall-binPROGRAMS: + @$(NORMAL_UNINSTALL) + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/'`; \ + f=`echo "$$f" | sed -e 's,^.*/,,'`; \ + echo " rm -f $(DESTDIR)$(bindir)/$$f"; \ + rm -f $(DESTDIR)$(bindir)/$$f; \ + done + +clean-binPROGRAMS: + @list='$(bin_PROGRAMS)'; for p in $$list; do \ + f=`echo $$p|sed 's/$(EXEEXT)$$//'`; \ + echo " rm -f $$p $$f"; \ + rm -f $$p $$f ; \ + done +diatheke$(EXEEXT): $(diatheke_OBJECTS) $(diatheke_DEPENDENCIES) + @rm -f diatheke$(EXEEXT) + $(CXXLINK) $(diatheke_LDFLAGS) $(diatheke_OBJECTS) $(diatheke_LDADD) $(LIBS) + +mostlyclean-compile: + -rm -f *.$(OBJEXT) core *.core + +distclean-compile: + -rm -f *.tab.c + +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/corediatheke.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diafiltmgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diatheke.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/diathekemgr.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gbfcgi.Po@am__quote@ +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/thmlcgi.Po@am__quote@ + +distclean-depend: + -rm -rf ./$(DEPDIR) + +.cpp.o: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< + +.cpp.obj: +@AMDEP_TRUE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Po' tmpdepfile='$(DEPDIR)/$*.TPo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(CXXCOMPILE) -c -o $@ `cygpath -w $<` + +.cpp.lo: +@AMDEP_TRUE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@ +@AMDEP_TRUE@ depfile='$(DEPDIR)/$*.Plo' tmpdepfile='$(DEPDIR)/$*.TPlo' @AMDEPBACKSLASH@ +@AMDEP_TRUE@ $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ + $(LTCXXCOMPILE) -c -o $@ `test -f '$<' || echo '$(srcdir)/'`$< +CXXDEPMODE = @CXXDEPMODE@ + +mostlyclean-libtool: + -rm -f *.lo + +clean-libtool: + -rm -rf .libs _libs + +distclean-libtool: + -rm -f libtool +uninstall-info-am: + +ETAGS = etags +ETAGSFLAGS = + +tags: TAGS + +ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES) + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + mkid -fID $$unique + +TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \ + $(TAGS_FILES) $(LISP) + tags=; \ + here=`pwd`; \ + list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \ + unique=`for i in $$list; do \ + if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ + done | \ + $(AWK) ' { files[$$0] = 1; } \ + END { for (i in files) print i; }'`; \ + test -z "$(ETAGS_ARGS)$$tags$$unique" \ + || $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ + $$tags $$unique + +GTAGS: + here=`$(am__cd) $(top_builddir) && pwd` \ + && cd $(top_srcdir) \ + && gtags -i $(GTAGS_ARGS) $$here + +distclean-tags: + -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH +DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) + +top_distdir = ../../.. +distdir = $(top_distdir)/$(PACKAGE)-$(VERSION) + +distdir: $(DISTFILES) + @list='$(DISTFILES)'; for file in $$list; do \ + if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ + dir=`echo "$$file" | sed -e 's,/[^/]*$$,,'`; \ + if test "$$dir" != "$$file" && test "$$dir" != "."; then \ + dir="/$$dir"; \ + $(mkinstalldirs) "$(distdir)$$dir"; \ + else \ + dir=''; \ + fi; \ + if test -d $$d/$$file; then \ + if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ + cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \ + fi; \ + cp -pR $$d/$$file $(distdir)$$dir || exit 1; \ + else \ + test -f $(distdir)/$$file \ + || cp -p $$d/$$file $(distdir)/$$file \ + || exit 1; \ + fi; \ + done +check-am: all-am +check: check-am +all-am: Makefile $(PROGRAMS) + +installdirs: + $(mkinstalldirs) $(DESTDIR)$(bindir) + +install: install-am +install-exec: install-exec-am +install-data: install-data-am +uninstall: uninstall-am + +install-am: all-am + @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am + +installcheck: installcheck-am +install-strip: + $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ + INSTALL_STRIP_FLAG=-s \ + `test -z '$(STRIP)' || \ + echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install +mostlyclean-generic: + +clean-generic: + +distclean-generic: + -rm -f Makefile $(CONFIG_CLEAN_FILES) + +maintainer-clean-generic: + @echo "This command is intended for maintainers to use" + @echo "it deletes files that may require special tools to rebuild." +clean: clean-am + +clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am + +distclean: distclean-am + +distclean-am: clean-am distclean-compile distclean-depend \ + distclean-generic distclean-libtool distclean-tags + +dvi: dvi-am + +dvi-am: + +info: info-am + +info-am: + +install-data-am: + +install-exec-am: install-binPROGRAMS + +install-info: install-info-am + +install-man: + +installcheck-am: + +maintainer-clean: maintainer-clean-am + +maintainer-clean-am: distclean-am maintainer-clean-generic + +mostlyclean: mostlyclean-am + +mostlyclean-am: mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool + +uninstall-am: uninstall-binPROGRAMS uninstall-info-am + +.PHONY: GTAGS all all-am check check-am clean clean-binPROGRAMS \ + clean-generic clean-libtool distclean distclean-compile \ + distclean-depend distclean-generic distclean-libtool \ + distclean-tags distdir dvi dvi-am info info-am install \ + install-am install-binPROGRAMS install-data install-data-am \ + install-exec install-exec-am install-info install-info-am \ + install-man install-strip installcheck installcheck-am \ + installdirs maintainer-clean maintainer-clean-generic \ + mostlyclean mostlyclean-compile mostlyclean-generic \ + mostlyclean-libtool tags uninstall uninstall-am \ + uninstall-binPROGRAMS uninstall-info-am + +# Tell versions [3.59,3.63) of GNU make to not export all variables. +# Otherwise a system limit (for SysV at least) may be exceeded. +.NOEXPORT: diff --git a/apps/console/diatheke/cgi/diatheke.pl b/apps/console/diatheke/cgi/diatheke.pl new file mode 100755 index 0000000..1d3de91 --- /dev/null +++ b/apps/console/diatheke/cgi/diatheke.pl @@ -0,0 +1,467 @@ +#!/usr/bin/perl + +# Typical Linux/Unix settings +$err = "2> /dev/null"; +$sword_path = "/home/sword"; # SWORD_PATH environment variable you want to use +$diatheke = "nice /usr/bin/diatheke"; # location of diatheke command line program + +# Typical Windows settings +#$err = ""; +#$sword_path = "C:\\Program Files\\CrossWire\\The SWORD Project"; # SWORD_PATH environment variable you want to use +#$diatheke = "$sword_path\\diatheke.exe"; # location of diatheke command line program + +$cgiurl = "http:\/\/bible.gotjesus.org\/cgi-bin"; + +$scriptname = "diatheke.pl"; +$defaultfontface = "Times New Roman, Times, Roman, serif"; # default font name +$maxverses = 50; # maximum number of verses diatheke will return per query (prevents people from asking for Gen1:1-Rev22:21) +$defaultbook = "KJV"; # book to query when none is selected, but a verse/search is entered +$deflocale = "abbr"; # this is just the default for cases where user has not selected a locale and his browser does not reveal one -- you can also set locale using locale=<locale> in the GET URL + +############################################################################### +## You should not need to edit anything below this line. +## Unless you want to modify functionality of course. :) +############################################################################### + +$version = "4.2"; + +sub plussifyaddress { + ($p_ver = @_[0]) =~ tr/ /+/; + $p_newline = "<a href=\"$scriptname?verse=$p_ver&@_[1]=on\">"; + return $p_newline; +} + +sub urlvers { + $u_verse = @_[0]; + $u_version = @_[1]; + $u_oldverse = $u_verse; + $u_verse =~ tr/ /+/; + $u_newline = "<a href=\"$scriptname?verse=$u_verse&$u_version=on\">$u_oldverse</a>"; + return $u_newline; +} + +$ENV{'SWORD_PATH'} = $sword_path; + +print "Content-type: text/html\n\n"; + + +if ($ENV{'HTTP_COOKIE'}) { + + $cookie = $ENV{'HTTP_COOKIE'}; + $cookie =~ s/\; /=/g; + %cookiedata = split(/=/, $cookie); + + $defversion = $cookiedata{DEFTRANS}; + $locale = $cookiedata{LOCALE}; +} + +if ($defversion eq "") { + $defversion = 'KJV'; +} +if ($locale eq "") { + $locale = $ENV{'HTTP_ACCEPT_LANGUAGE'}; + $locale =~ s/(..).*/$1/; + if ($locale eq "") { + $locale = $deflocale; + } + elsif ($locale eq "en") { + $locale = "abbr"; + } +} + +$hostname = $ENV{'REMOTE_ADDR'}; +@values = split(/\&/,$ENV{'QUERY_STRING'}); +$n = 0; +$palm = 0; + +$latinxlit = ""; + +$optionfilters = ""; +$debug=0; +foreach $i (@values) { + ($varname, $mydata) = split(/=/,$i); + if ($varname ne "Submit" && $varname ne "lookup") { + if ($varname eq "verse") { + $verse = $mydata; + $verse =~ tr/+/ /; + $verse =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg; + } + elsif ($varname eq "search" && $mydata ne "" && $mydata ne "off") { + $search = "-s $mydata"; + } + + elsif ($varname eq "strongs") { + $optionfilters .= "n"; + } + elsif ($varname eq "footnotes") { + $optionfilters .= "f"; + } + elsif ($varname eq "headings") { + $optionfilters .= "h"; + } + elsif ($varname eq "morph") { + $optionfilters .= "m"; + } + elsif ($varname eq "hebcant") { + $optionfilters .= "c"; + } + elsif ($varname eq "hebvowels") { + $optionfilters .= "v"; + } + elsif ($varname eq "grkacc") { + $optionfilters .= "a"; + } + elsif ($varname eq "lemmas") { + $optionfilters .= "l"; + } + elsif ($varname eq "scriprefs") { + $optionfilters .= "s"; + } + elsif ($varname eq "arshape") { + $optionfilters .= "r"; + } + elsif ($varname eq "bidi") { + $optionfilters .= "b"; + } + + elsif ($varname eq "latinxlit") { + $latinxlit = "-t Latin"; + } + + elsif ($varname eq "palm") { + $palm = 1; + } + elsif ($varname eq "debug") { + $debug = 1; + } + elsif ($varname eq "locale") { + $locale = $mydata; + } + elsif ($varname eq "maxverses") { + $maxverses = $mydata; + } + elsif ($mydata eq "on" || $mydata eq "ON") { + $versions[$n] = $varname; + $n++; + } + } +} +if ($optionfilters ne "") { + $optionfilters = "-o " . $optionfilters; +} + + + +if ($n == 0) { + $versions[0] = $defaultbook; + $n++; +} + +if ($verse eq "") { + + @versionlist = `$diatheke -b system -k modulelist $err`; + @versionlist2 = @versionlist; + @localelist = `$diatheke -b system -k localelist $err`; + + print <<DEF1; +<html> +<head> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<title>Diatheke Online Bible</title> +</head> + +<body> + +<form method="get" action="$scriptname"> + <p /><input type="radio" name="search" checked value="" /><font face="Arial, Helvetica, sans-serif">Verse/Commentary Lookup + Verse or Search key:</font><input type="text" name="verse" size="20"><input type="submit" name="Submit" value="Submit"><input type="reset" name="Reset" value="Reset"><br /> + <input type="radio" name="search" value="phrase" /><font face="Arial, Helvetica, sans-serif">Phrase Search</font><br /> + <input type="radio" name="search" value="multiword" /><font face="Arial, Helvetica, sans-serif">Multiple Word Search</font><br /> + <input type="radio" name="search" value="regex" /><font face="Arial, Helvetica, sans-serif">Regular Expression Search</font><br /> + <table width="100%" border="0"> + <tr> + <td width="50%"> + <input type="checkbox" name="strongs" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Strong's Numbers</font></td> + <td width="50%"> + <input type="checkbox" name="headings" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Section Headings</font></td> + </tr> + <tr> + <td width="50%"> + <input type="checkbox" name="footnotes" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Footnotes</font></td> + <td width="50%"> + <input type="checkbox" name="scriprefs" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Scripture Cross-References</font></td> + </tr> + <tr> + <td width="50%"> + <input type="checkbox" name="morph" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Morphology</font></td> + <td width="50%"> + <input type="checkbox" name="hebvowels" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Hebrew Vowels</font></td> + </tr> + <tr> + <td width="50%"> + <input type="checkbox" name="lemmas" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Lemmas</font></td> + <td width="50%"> + <input type="checkbox" name="hebcant" value="on"> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Hebrew Cantillation + Marks </font></td> + </tr> + <tr> + <td width="50%"> + <input type="checkbox" name="latinxlit" value="on"> + <font face="Arial, Helvetica, sans-serif" size="-1">Latin Transliterate</font> + </td> + <td width="50%"> + <input type="checkbox" name="grkacc" value="on" checked> + <font size="-1" face="Arial, Helvetica, sans-serif">Show Greek Accents</font> + </td> + </tr> + </table> + <br /> + <table BORDER="0" WIDTH="100%"> +DEF1 + + foreach $line (@versionlist) { + chomp($line); + + if ($line eq "Biblical Texts:") { + print "<tr><td><font face=$defaultfontface><b>Biblical Texts:</b></font><br /></td></tr>"; + } + elsif ($line eq "Commentaries:") { + print "<tr><td><font face=$defaultfontface><b>Commentaries:</b></font></td></tr>"; + } + elsif ($line eq "Dictionaries:") { + print "<tr><td><font face=$defaultfontface><b>Dictionaries & Lexica:</b></font></td></tr>"; + } + else { + $line =~ s/([^:]+) : (.+)/<tr><td><input type=\"checkbox\" name=\"$1\" value=\"on\"><font size=\"-1\" face=$defaultfontface>$2 ($1)<\/font><\/td><\/tr>/; + print "$line\n"; + } + + } + + print <<DEF2; + </table> +</form> + +<form method="get" action="dia-def.pl"> + Select default Bible version for cross-references: <select name="defversion" size="1"> + +DEF2 + + $biblesflag = 1; + foreach $line (@versionlist2) { + if ($biblesflag == 1) { + chomp ($line); + if ($line eq "Biblical Texts:") { + } + elsif ($line eq "Commentaries:") { + $biblesflag = 0; + } + else { + $line =~ s/([^:]+) : (.+)/<option value=\"$1\">$2 ($1)<\/option>/; + print "$line\n"; + } + } + } + + print <<DEF3; +</select><input type="submit" name="Submit" value="Submit"></form><br/><form method="get" action="dia-def.pl">Select locale: +<select name="locale" size="1"><option value="">browser default</option> +<option value="en">en</option> +DEF3 + foreach $line (@localelist) { + chomp($line); + print "<option value=\"$line\">$line<\/option>"; + } +print <<DEF4 +</select> +<input type="submit" name="Submit" value="Submit"> +</form> +</body> +</html> +DEF4 + +} +else { + + + +if ($palm == 0) { +print <<END; + +<html><head> +<title>Diatheke Interlinear Bible</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<meta name="palmcomputingplatform" content="true"> +<meta name="historylisttext" content="Diatheke"> +<style type="text/css"> +#divBottom{position:absolute; visibility:hidden; font-family:arial,helvetica; height:30; width:100; font-size:10pt; font-weight:bold} +A:link, A:visited, A:active{text-decoration: none} +</style> +<script type="text/javascript" language="JavaScript"> +/******************************************************************************** +Copyright (C) 1999 Thomas Brattli +This script is made by and copyrighted to Thomas Brattli at www.bratta.com +Visit for more great scripts. This may be used freely as long as this msg is intact! +I will also appriciate any links you could give me. +********************************************************************************/ +//Default browsercheck, added to all scripts! +function checkBrowser(){ + this.ver=navigator.appVersion; + this.dom=document.getElementById?1:0; + this.ie5=( (this.ver.indexOf("MSIE 6")>-1 || this.ver.indexOf("MSIE 5")>-1) && this.dom)?1:0; + this.ie4=(document.all && !this.dom)?1:0; + this.ns5=(this.dom && parseInt(this.ver) >= 5) ?1:0; + this.ns4=(document.layers && !this.dom)?1:0; + this.bw=(this.ie5 || this.ie4 || this.ns4 || this.ns5); + return this; +} +bw=new checkBrowser() +/******************************************************************************** +Remeber to set the look of the divBottom layer in the stylesheet (if you wan't +another font or something) +********************************************************************************/ +/*Set these values, gright for how much from the right you wan't the layer to go +and gbottom for how much from the bottom you want it*/ +var gright=160 +var gbottom=80 + + + +/******************************************************************************** +Constructing the ChangeText object +********************************************************************************/ +function makeObj(obj,nest){ + nest=(!nest) ? '':'document.'+nest+'.'; + this.css=bw.dom? document.getElementById(obj).style:bw.ie4?document.all[obj].style:bw.ns4?eval(nest+"document.layers." +obj):0; + this.moveIt=b_moveIt; +} +function b_moveIt(x,y){this.x=x; this.y=y; this.css.left=this.x; this.css.top=this.y} + +/******************************************************************************** +Initilizing the page, getting height and width to moveto and calls the +object constructor +********************************************************************************/ + function geoInit(){ + oGeo=new makeObj('divBottom'); + pageWidth=(bw.ie4 || bw.ie5)?document.body.offsetWidth-4:innerWidth; + pageHeight=(bw.ie4 || bw.ie5)?document.body.offsetHeight-2:innerHeight; + checkIt(); + // sets the resize handler. + onresize=resized; + if(bw.ie4 || bw.ie5) window.onscroll=checkIt; + // shows the div + oGeo.css.visibility='visible'; + } +/******************************************************************************** +This function executes onscroll in ie and every 30 millisecond in ns +and checks if the user have scrolled, and if it has it moves the layer. +********************************************************************************/ +function checkIt(){ + if(bw.ie4 || bw.ie5) oGeo.moveIt(document.body.scrollLeft +pageWidth-gright,document.body.scrollTop+pageHeight-gbottom); + else if(bw.ns4){ + oGeo.moveIt(window.pageXOffset+pageWidth-gright, window.pageYOffset+pageHeight-gbottom); + setTimeout('checkIt()',30); + } +} + +//Adds a onresize event handler to handle the resizing of the window. +function resized(){ + pageWidth=(bw.ie4 || bw.ie5)?document.body.offsetWidth-4:innerWidth; + pageHeight=(bw.ie4 || bw.ie5)?document.body.offsetHeight-2:innerHeight; + if(bw.ie4 || bw.ie5) checkIt() +} + + +//Calls the geoInit onload +if(bw.bw && !bw.ns5) onload=geoInit; + +//Here we will write the div out so that lower browser won't see it.' +if(bw.bw && !bw.ns5) document.write('<div id="divBottom"><table><tr><td align="center">Powered by<br /><img src="http://www.crosswire.org/sword/pbsword.gif"><br /><a href="http://www.crosswire.org/">www.crosswire.org</td></tr></table></div>') +</script> + +</head> + +<body bgcolor="#FFFFFF"><font face="$defaultfontface"> + +END +} +else { +print <<END + +<html><head> +<title>HANDiatheke</title> +<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> +<meta name="palmcomputingplatform" content="true"> +<meta name="historylisttext" content="HANDiatheke"> +</head> +<body bgcolor="#FFFFFF"><font face="$defaultfontface"> +END +} +for ($i = 0; $i < $n; $i++) { + + $line = "$diatheke $search $optionfilters $latinxlit -l $locale -m $maxverses -f cgi -b $versions[$i] -k \"$verse\" $err"; + + if ($debug) { + print "command line: $line\n<br />"; + } + $line = `$line`; + + chomp($line); + + $line =~ s/!DIATHEKE_URL!/$scriptname\?/g; + +# Parse and link to Strong's references if present + + $info = `$diatheke -b info -k $versions[$i] $err`; + $info =~ /([^\;]+)\;([^\;]+)/; + $format = $1; + $type = $2; + + if ($versions[$i] eq "StrongsHebrew") { + $line =~ s/(see HEBREW for )([0-9]+)/<a href=\"$scriptname?verse=$2&StrongsHebrew=on\">$1$2\<\/a\>/g; + } + elsif($versions[$i] eq "StrongsGreek") { + $line =~ s/(see GREEK for )([0-9]+)/<a href=\"$scriptname?verse=$2&StrongsGreek=on\">$1$2\<\/a\>/g; + } + #case for searches + elsif($search ne "") { + $line =~ s/<entry>([^<]+)<\/entry>/urlvers($1, $versions[$i])/eg; + } + #case for non-ThML, non-Bible texts + elsif($type ne "Biblical Texts") { + $book = $verse; + $book =~ s/^([A-Za-z0-9]+) [0-9]+:[0-9]+.*/$1/; + $chapter = $verse; + $chapter =~ s/[A-Za-z0-9]+ ([0-9]+):[0-9]+.*/$1/; + $line =~ s/\#*([1-9]*[A-Z][a-z]+\.*) ([0-9]+):([0-9]+-*,*[0-9]*)\|*/<a href=\"$scriptname?verse=$1+$2%3A$3&$defversion=on\">$1 $2:$3\<\/a\>/g; + $line =~ s/\#([0-9]+):([0-9]+-*,*[0-9]*)\|*/<a href=\"$scriptname?verse=$book+$1%3A$2&$defversion=on\">$book $1:$2\<\/a\>/g; + $line =~ s/\#([0-9]+-*,*[0-9]*)\|*/<a href=\"$scriptname?verse=$book+$chapter%3A$1&$defversion=on\">$book $chapter:$1\<\/a\>/g; + } + + if ($locale ne "abbr") { + $line =~ s/href=\"$scriptname([^\"]+)\"/href=\"$scriptname$1&locale=$locale\"/g; + } + if ($palm == 1) { + $line =~ s/href=\"$scriptname([^\"]+)\"/href=\"$cgiurl\/$scriptname$1&palm=on\"/g; + } + + print "$line <br /><br />\n"; +} + +if ($palm == 1) { + print "<hr>Powered by Diatheke (http:\/\/www.gotjesus.org\/sword\/diatheke) and the SWORD Project (http:\/\/www.crosswire.org\/sword)."; +} + +print "<br /><br /><br /><br /></font></body></html>"; + +} + + diff --git a/apps/console/diatheke/corediatheke.cpp b/apps/console/diatheke/corediatheke.cpp new file mode 100644 index 0000000..6d091b8 --- /dev/null +++ b/apps/console/diatheke/corediatheke.cpp @@ -0,0 +1,427 @@ +// Diatheke 4.2 by Chris Little <chrislit@crosswire.org> +// Copyright 1999-2002 by CrossWire Bible Society +// http://www.crosswire.org/sword/diatheke +// Licensed under GNU General Public License (GPL) +// see accompanying LICENSE file for license details + +#include "corediatheke.h" +#include <iostream> +#include <string> +#include <list> + +void systemquery(const char * key, ostream* output){ + DiathekeMgr manager; + ModMap::iterator it; + + SWModule *target; + + bool types = false, descriptions = false, names = false; + + if (!stricmp(key, "localelist")) { + static LocaleMgr lm = LocaleMgr::systemLocaleMgr; + list<string> loclist = lm.getAvailableLocales(); + list<string>::iterator li = loclist.begin(); + for (;li != loclist.end(); li++) { + *output << li->c_str() << endl; + } + } + else if (!stricmp(key, "modulelist")) { + types = true; + descriptions = true; + names = true; + } + else if (!stricmp(key, "modulelistnames")) { + names = true; + } + else if (!stricmp(key, "modulelistdescriptions")) { + descriptions = true; + } + + + if (types || descriptions || names) { + if (types) *output << "Biblical Texts:\n"; + for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { + target = it->second; + if (!strcmp(target->Type(), "Biblical Texts")) { + if (names) *output << target->Name(); + if (names && descriptions) *output << " : "; + if (descriptions) *output << target->Description(); + *output << endl; + } + } + if (types) *output << "Commentaries:\n"; + for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { + target = it->second; + if (!strcmp(target->Type(), "Commentaries")) { + if (names) *output << target->Name(); + if (names && descriptions) *output << " : "; + if (descriptions) *output << target->Description(); + *output << endl; + } + } + if (types) *output << "Dictionaries:\n"; + for (it = manager.Modules.begin(); it != manager.Modules.end(); it++) { + target = it->second; + if (!strcmp(target->Type(), "Lexicons / Dictionaries")) { + if (names) *output << target->Name(); + if (names && descriptions) *output << " : "; + if (descriptions) *output << target->Description(); + *output << endl; + } + } + } +} + +void doquery(unsigned long maxverses = -1, unsigned char outputformat = FMT_PLAIN, unsigned char outputencoding = ENC_UTF8, unsigned long optionfilters = 0, unsigned char searchtype = ST_NONE, const char *text = 0, const char *locale = 0, const char *ref = 0, ostream* output = &cout, const char *script = 0, signed short variants = 0) { + static DiathekeMgr manager; + + ModMap::iterator it; + ListKey listkey; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + + SWModule * target; + char *font = 0; + char inputformat = 0; + string encoding; + char querytype = 0; + + if (locale) { + LocaleMgr::systemLocaleMgr.setDefaultLocaleName(locale); + } + VerseKey vk; + + //deal with queries to "system" + if (!stricmp(text, "system")) { + querytype = QT_SYSTEM; + systemquery(ref, output); + } + if (!strnicmp(text, "info", 4)) { + querytype = QT_INFO; + text = ref; + } + //otherwise, we have a real book + it = manager.Modules.find(text); + if (it == manager.Modules.end()) { //book not found + return; + } + target = (*it).second; + + manager.Markup(outputformat); + manager.Encoding(outputencoding); + manager.bidi = ((OP_BIDI & optionfilters) == OP_BIDI); + manager.shape = ((OP_ARSHAPE & optionfilters) == OP_ARSHAPE); + + if ((sit = manager.config->Sections.find((*it).second->Name())) != manager.config->Sections.end()) { + if ((eit = (*sit).second.find("SourceType")) != (*sit).second.end()) { + if (!stricmp((char *)(*eit).second.c_str(), "GBF")) + inputformat = FMT_GBF; + else if (!stricmp((char *)(*eit).second.c_str(), "ThML")) + inputformat = FMT_THML; + } + encoding = ((eit = (*sit).second.find("Encoding")) != (*sit).second.end()) ? (*eit).second : (string)""; + } + + + if (querytype == QT_INFO) { + switch (inputformat) { + case FMT_THML : + *output << "ThML"; + break; + case FMT_GBF : + *output << "GBF"; + break; + default: + *output << "Other"; + } + *output << ";"; + *output << target->Type(); + *output << ";"; + return; + } + + if (searchtype) + querytype = QT_SEARCH; + else if (!strcmp(target->Type(), "Biblical Texts")) + querytype = QT_BIBLE; + else if (!strcmp(target->Type(), "Commentaries")) + querytype = QT_COMM; + else if (!strcmp(target->Type(), "Lexicons / Dictionaries")) + querytype = QT_LD; + + if (optionfilters & OP_FOOTNOTES) + manager.setGlobalOption("Footnotes","On"); + else + manager.setGlobalOption("Footnotes","Off"); + if (optionfilters & OP_HEADINGS) + manager.setGlobalOption("Headings","On"); + else + manager.setGlobalOption("Headings","Off"); + if (optionfilters & OP_STRONGS) + manager.setGlobalOption("Strong's Numbers","On"); + else + manager.setGlobalOption("Strong's Numbers","Off"); + if (optionfilters & OP_MORPH) + manager.setGlobalOption("Morphological Tags","On"); + else + manager.setGlobalOption("Morphological Tags","Off"); + if (optionfilters & OP_CANTILLATION) + manager.setGlobalOption("Hebrew Cantillation","On"); + else + manager.setGlobalOption("Hebrew Cantillation","Off"); + if (optionfilters & OP_HEBREWPOINTS) + manager.setGlobalOption("Hebrew Vowel Points","On"); + else + manager.setGlobalOption("Hebrew Vowel Points","Off"); + if (optionfilters & OP_GREEKACCENTS) + manager.setGlobalOption("Greek Accents","On"); + else + manager.setGlobalOption("Greek Accents","Off"); + if (optionfilters & OP_LEMMAS) + manager.setGlobalOption("Lemmas","On"); + else + manager.setGlobalOption("Lemmas","Off"); + if (optionfilters & OP_SCRIPREF) + manager.setGlobalOption("Scripture Cross-References","On"); + else + manager.setGlobalOption("Scripture Cross-References","Off"); + + if (optionfilters & OP_VARIANTS && variants) { + if (variants == -1) + manager.setGlobalOption("Variants", "All Readings"); + else if (variants == 1) + manager.setGlobalOption("Variants", "Secondary Readings"); + } + else + manager.setGlobalOption("Transliteration", "Primary Readings"); + +#ifdef _ICU_ + if (optionfilters & OP_TRANSLITERATOR && script) + manager.setGlobalOption("Transliteration", script); + else + manager.setGlobalOption("Transliteration", "Off"); +#endif + + if (querytype == QT_SEARCH) { + + //this test is just to determine if we've got SWKeys or VerseKeys + if (!strcmp(target->Type(), "Biblical Texts")) + querytype = QT_BIBLE; + else if (!strcmp(target->Type(), "Commentaries")) + querytype = QT_BIBLE; + else if (!strcmp(target->Type(), "Lexicons / Dictionaries")) + querytype = QT_LD; + + //do search stuff + searchtype = 1 - searchtype; + if (querytype == QT_BIBLE) { + *output << "Verses containing \""; + } + else *output << "Entries containing \""; + *output << ref; + *output << "\"-- "; + + listkey = target->Search(ref, searchtype); + + if (strlen((const char*)listkey)) { + if (!listkey.Error()) { + if (outputformat == FMT_CGI) *output << "<entry>"; + if (querytype == QT_BIBLE) { + vk = listkey; + *output << (const char *)vk; + } + else *output << (const char *)listkey; + if (outputformat == FMT_CGI) *output << "</entry>"; + } + listkey++; + while (!listkey.Error()) { + *output << " ; "; + if (outputformat == FMT_CGI) *output << "<entry>"; + if (querytype == QT_BIBLE) { + vk = listkey; + *output << (const char *)vk; + } + else *output << (const char *)listkey; + if (outputformat == FMT_CGI) *output << "</entry>"; + listkey++; + } + *output << " -- "; + + char *temp = new char[10]; + sprintf(temp, "%u", listkey.Count()); + *output << temp; + delete [] temp; + + *output << " matches total ("; + *output << target->Name(); + *output << ")\n"; + } + else { + *output << "none ("; + *output << target->Name(); + *output << ")\n"; + } + } + + else if (querytype == QT_LD) { + //do dictionary stuff + + target->SetKey(ref); + + const char * text = (const char *) *target; + + if (outputformat == FMT_RTF) { + *output << "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\fdecor\\fprq2 "; + if (font) + *output << font; + else + *output << "Times New Roman"; + *output << ";}}"; + } + else if (outputformat == FMT_HTML) { + *output << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"; + } + + if (strlen(text)) { + *output << (char*)target->KeyText(); + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ": <font face=\""; + *output << font; + *output << "\">"; + } + else if (outputformat == FMT_RTF) { + *output << ": {\\f1 "; + } + else { + *output << ": "; + } + *output << text; + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << "</font>"; + } + else if (outputformat == FMT_RTF) { + *output << "}"; + } + + *output << "("; + *output << target->Name(); + *output << ")\n"; + } + + if (outputformat == FMT_RTF) { + *output << "}"; + } + + } + + else if (querytype == QT_BIBLE || querytype == QT_COMM) { + //do commentary/Bible stuff + + if ((sit = manager.config->Sections.find((*it).second->Name())) != manager.config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + font = (char *)(*eit).second.c_str(); + if (strlen(font) == 0) font = 0; + } + } + + listkey = vk.ParseVerseList(ref, "Gen1:1", true); + int i; + + if (outputformat == FMT_RTF) { + *output << "{\\rtf1\\ansi{\\fonttbl{\\f0\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f1\\fdecor\\fprq2 "; + if (font) + *output << font; + else + *output << "Times New Roman"; + *output << ";}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}}"; + } + else if (outputformat == FMT_HTML) { + *output << "<meta http-equiv=\"content-type\" content=\"text/html; charset=UTF-8\">"; + } + + for (i = 0; i < listkey.Count() && maxverses; i++) { + VerseKey *element = SWDYNAMIC_CAST(VerseKey, listkey.GetElement(i)); + if (element) { + target->Key(element->LowerBound()); + vk = element->UpperBound(); + while (maxverses && target->Key() <= vk) { + *output << (char*)target->KeyText(); + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ": <font face=\""; + *output << font; + *output << "\">"; + } + else if (outputformat == FMT_RTF) { + *output << ": {\\f1 "; + } + else { + *output << ": "; + } + *output << (const char*)*target; + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << "</font>"; + } + else if (outputformat == FMT_RTF) { + *output << "}"; + } + + if (inputformat != FMT_THML && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) + *output << "<br />"; + else if (outputformat == FMT_RTF) + *output << "\\par "; + else if (outputformat == FMT_GBF) + *output << "<CM>"; + + *output << "\n"; + + if (target->Key() == vk) + break; + maxverses--; + (*target)++; + } + } + else { + target->Key(*listkey.GetElement(i)); + *output << (char*)target->KeyText(); + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << ": <font face=\""; + *output << font; + *output << "\">"; + } + else if (outputformat == FMT_RTF) { + *output << ": {\\f1 "; + } + else { + *output << ": "; + } + *output << (const char*)*target; + if (font && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) { + *output << "</font>"; + } + else if (outputformat == FMT_RTF) { + *output << "}"; + } + + if (inputformat != FMT_THML && (outputformat == FMT_HTML || outputformat == FMT_THML || outputformat == FMT_CGI)) + *output << "<br />"; + else if (outputformat == FMT_RTF) + *output << "\\par "; + else if (outputformat == FMT_GBF) + *output << "<CM>"; + + *output << "\n"; + maxverses--; + } + } + + *output << "("; + *output << target->Name(); + *output << ")\n"; + + if (outputformat == FMT_RTF) { + *output << "}"; + } + + } +} + diff --git a/apps/console/diatheke/corediatheke.h b/apps/console/diatheke/corediatheke.h new file mode 100644 index 0000000..b265053 --- /dev/null +++ b/apps/console/diatheke/corediatheke.h @@ -0,0 +1,39 @@ +// Diatheke 4.2 by Chris Little <chrislit@crosswire.org> +// Copyright 1999-2002 by CrossWire Bible Society http://www.crosswire.org +// Licensed under GNU General Public License (GPL) +// see accompanying LICENSE file for license details + +#include <stdio.h> + +#include "diathekemgr.h" +#include <localemgr.h> + +#define QT_BIBLE 1 +#define QT_COMM 2 +#define QT_LD 3 +#define QT_SEARCH 4 +#define QT_SYSTEM 5 +#define QT_INFO 6 + +#define OP_NONE 0 +#define OP_STRONGS 1 +#define OP_FOOTNOTES 2 +#define OP_HEADINGS 4 +#define OP_MORPH 8 +#define OP_CANTILLATION 16 +#define OP_HEBREWPOINTS 32 +#define OP_GREEKACCENTS 64 +#define OP_TRANSLITERATOR 128 +#define OP_LEMMAS 256 +#define OP_SCRIPREF 512 +#define OP_ARSHAPE 1024 +#define OP_BIDI 2048 +#define OP_VARIANTS 4096 + +#define ST_NONE 0 +#define ST_REGEX 1 //0 +#define ST_PHRASE 2 // -1 +#define ST_MULTIWORD 3 // -2 + +int hasalpha (char * string); +void doquery(unsigned long maxverses, unsigned char outputformat, unsigned char outputencoding, unsigned long optionfilters, unsigned char searchtype, const char *text, const char *locale, const char *ref, ostream* output, const char* script, signed short variants); diff --git a/apps/console/diatheke/diafiltmgr.h b/apps/console/diatheke/diafiltmgr.h new file mode 100644 index 0000000..cb04fff --- /dev/null +++ b/apps/console/diatheke/diafiltmgr.h @@ -0,0 +1,44 @@ +/****************************************************************************** + * diafiltmgr.h + * + * Copyright 1998 CrossWire Bible Society (http://www.crosswire.org) + * CrossWire Bible Society + * P. O. Box 2528 + * Tempe, AZ 85280-2528 + * + * 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 version 2. + * + * 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. + * + */ + +#ifndef DIAFILTMGR_H +#define DIAFILTMGR_H + +#define FMT_CGI 127 + +#include <encfiltmgr.h> + +class SWDLLEXPORT DiathekeFilterMgr : public EncodingFilterMgr { +protected: + SWFilter* fromthml; + SWFilter* fromgbf; + SWFilter* fromplain; + SWFilter* fromosis; + + char markup; + + void CreateFilters(char markup); +public: + DiathekeFilterMgr(char markup = FMT_THML, char encoding = ENC_UTF8); + ~DiathekeFilterMgr(); + char Markup(char m = FMT_UNKNOWN); + virtual void AddRenderFilters(SWModule *module, ConfigEntMap §ion); +}; + +#endif diff --git a/apps/console/diatheke/diatheke.cpp b/apps/console/diatheke/diatheke.cpp new file mode 100644 index 0000000..f423e6b --- /dev/null +++ b/apps/console/diatheke/diatheke.cpp @@ -0,0 +1,213 @@ +// Diatheke 4.2 by Chris Little <chrislit@crosswire.org> +// Copyright 1999-2002 by CrossWire Bible Society +// http://www.crosswire.org/sword/diatheke +// Licensed under GNU General Public License (GPL) +// see accompanying LICENSE file for license details + +#include "corediatheke.h" +#include "diathekemgr.h" +#include "diafiltmgr.h" +#include <iostream> + +#define RQ_REF 1 +#define RQ_BOOK 2 + +void printsyntax() { + //if we got this far without exiting, something went wrong, so print syntax + fprintf (stderr, "Diatheke command-line SWORD frontend Version 4.2\n"); + fprintf (stderr, "Copyright 1999-2002 by the CrossWire Bible Society\n"); + fprintf (stderr, "http://www.crosswire.org/sword/diatheke/\n"); + fprintf (stderr, "usage: \n "); + fprintf (stderr, "diatheke <-b book> [-s search_type] [-o option_filters]\n"); + fprintf (stderr, "[-m maximum_verses] [-f output_format] [-l locale]\n"); + fprintf (stderr, "[-e output_encoding] [-t script] [-v variant#(-1=all|0|1)]\n"); + fprintf (stderr, "<-k query_key>\n"); + fprintf (stderr, "\n"); + fprintf (stderr, "If <book> is \"system\" you may use these system keys: \"modulelist\",\n"); + fprintf (stderr, "\"modulelistnames\", and \"localelist\"."); + fprintf (stderr, "\n"); + fprintf (stderr, "Valid search_type values are: regex, multiword, and phrase(def).\n"); + fprintf (stderr, "Valid option_filters values are: n (Strong's numbers),\n"); + fprintf (stderr, " f (Footnotes), m (Morphology), h (Section Headings),\n"); + fprintf (stderr, " c (Cantillation), v (Hebrew Vowels), a (Greek Accents),\n"); + fprintf (stderr, " l (Lemmas), s (Scripture Crossrefs), r (Arabic Shaping,\n"); + fprintf (stderr, " b (Bi-Directional Reordering)\n"); + + fprintf (stderr, "Maximum verses may be any integer value\n"); + fprintf (stderr, "Valid output_format values are: GBF, ThML, RTF, HTML, OSIS, CGI, and plain (def)\n"); + fprintf (stderr, "Valid output_encoding values are: Latin1, UTF8 (def), UTF16, HTML, and RTF\n"); + fprintf (stderr, "Valid locale values depend on installed locales. en is default.\n"); + fprintf (stderr, "The query_key must be the last argument because all following\n"); + fprintf (stderr, " arguments are added to the key.\n"); +} + +int main(int argc, char **argv) +{ + int maxverses = -1; + unsigned char outputformat = FMT_PLAIN, searchtype = ST_NONE, outputencoding = ENC_UTF8; + unsigned long optionfilters = OP_NONE; + char *text = 0, *locale = 0, *ref = 0, *script = 0; + signed short variants = 0; + + char runquery = 0; // used to check that we have enough arguments to perform a legal query + // (a querytype & text = 1 and a ref = 2) + + for (int i = 1; i < argc; i++) { + if (!stricmp("-b", argv[i])) { + if (i+1 <= argc) { + text = argv[i+1]; + i++; + runquery |= RQ_BOOK; + } + } + else if (!stricmp("-s", argv[i])) { + if (i+1 <= argc) { + if (!stricmp("phrase", argv[i+1])) { + searchtype = ST_PHRASE; + i++; + } + else if (!stricmp("regex", argv[i+1])) { + searchtype = ST_REGEX; + i++; + } + else if (!stricmp("multiword", argv[i+1])) { + searchtype = ST_MULTIWORD; + i++; + } + else i++; + } + } + else if (!stricmp("-l", argv[i])) { + if (i+1 <= argc) { + locale = argv[i+1]; + i++; + } + } + else if (!stricmp("-m", argv[i])) { + if (i+1 <= argc) { + maxverses = atoi(argv[i+1]); + i++; + } + } + else if (!stricmp("-o", argv[i])) { + if (i+1 <= argc) { + if (strchr(argv[i+1], 'f')) + optionfilters |= OP_FOOTNOTES; + if (strchr(argv[i+1], 'n')) + optionfilters |= OP_STRONGS; + if (strchr(argv[i+1], 'h')) + optionfilters |= OP_HEADINGS; + if (strchr(argv[i+1], 'm')) + optionfilters |= OP_MORPH; + if (strchr(argv[i+1], 'c')) + optionfilters |= OP_CANTILLATION; + if (strchr(argv[i+1], 'v')) + optionfilters |= OP_HEBREWPOINTS; + if (strchr(argv[i+1], 'a')) + optionfilters |= OP_GREEKACCENTS; + if (strchr(argv[i+1], 'l')) + optionfilters |= OP_LEMMAS; + if (strchr(argv[i+1], 's')) + optionfilters |= OP_SCRIPREF; + if (strchr(argv[i+1], 'r')) + optionfilters |= OP_ARSHAPE; + if (strchr(argv[i+1], 'b')) + optionfilters |= OP_BIDI; + i++; + } + } + else if (!stricmp("-f", argv[i])) { + if (i+1 <= argc) { + if (!stricmp("thml", argv[i+1])) { + outputformat = FMT_THML; + i++; + } + else if (!stricmp("cgi", argv[i+1])) { + outputformat = FMT_CGI; + i++; + } + else if (!stricmp("gbf", argv[i+1])) { + outputformat = FMT_GBF; + i++; + } + else if (!stricmp("html", argv[i+1])) { + outputformat = FMT_HTML; + i++; + } + else if (!stricmp("rtf", argv[i+1])) { + outputformat = FMT_RTF; + i++; + } + else if (!stricmp("osis", argv[i+1])) { + outputformat = FMT_OSIS; + i++; + } + else i++; + } + } + else if (!stricmp("-e", argv[i])) { + if (i+1 <= argc) { + if (!stricmp("utf8", argv[i+1])) { + outputencoding = ENC_UTF8; + i++; + } + else if (!stricmp("rtf", argv[i+1])) { + outputencoding = ENC_RTF; + i++; + } + else if (!stricmp("html", argv[i+1])) { + outputencoding = ENC_HTML; + i++; + } + else if (!stricmp("latin1", argv[i+1])) { + outputencoding = ENC_LATIN1; + i++; + } + else if (!stricmp("utf16", argv[i+1])) { + outputencoding = ENC_UTF16; + i++; + } + else i++; + } + } + else if (!stricmp("-k", argv[i])) { + i++; + if (i < argc) { + string key = argv[i]; + i++; + for (; i < argc; i++) + key = key + " " + argv[i]; + ref = new char[key.length() + 1]; + strcpy (ref, key.c_str()); + if (strlen(ref)) + runquery |= RQ_REF; + } + } + else if (!stricmp("-v", argv[i])) { + if (i+1 <= argc) { + variants = atoi(argv[i+1]); + optionfilters |= OP_VARIANTS; + i++; + } + } +#ifdef _ICU_ + else if (!stricmp("-t", argv[i])) { + if (i+1 <= argc) { + script = argv[i+1]; + optionfilters |= OP_TRANSLITERATOR; + i++; + } + } +#endif + } + + + if (runquery == (RQ_BOOK | RQ_REF)) + { + doquery(maxverses, outputformat, outputencoding, optionfilters, searchtype, text, locale, ref, &cout, script, variants); + } + else + printsyntax(); + + return 0; +} diff --git a/apps/console/diatheke/diathekemgr.cpp b/apps/console/diatheke/diathekemgr.cpp new file mode 100644 index 0000000..87f9102 --- /dev/null +++ b/apps/console/diatheke/diathekemgr.cpp @@ -0,0 +1,107 @@ +//--------------------------------------------------------------------------- +#include <thmlplain.h> +#include <gbfplain.h> +#include <thmlgbf.h> +#include <gbfthml.h> +#include <thmlhtml.h> +#include <gbfhtml.h> +#include <plainhtml.h> +#include <thmlhtmlhref.h> +#include <gbfhtmlhref.h> +#include <thmlrtf.h> +#include <gbfrtf.h> + +#include <swconfig.h> +#include "diafiltmgr.h" + +#ifdef _ICU_ +#include <utf8arshaping.h> +#include <utf8bidireorder.h> +#include <utf8transliterator.h> +#endif + +#ifdef WIN32 +#include <windows.h> +#endif + +#include "diathekemgr.h" +#include "gbfcgi.h" +#include "thmlcgi.h" + +//--------------------------------------------------------------------------- +DiathekeMgr::DiathekeMgr (SWConfig * iconfig, SWConfig * isysconfig, bool autoload, char enc, char mark, bool ibidi, bool ishape) + : SWMgr(iconfig, isysconfig, autoload, new DiathekeFilterMgr(mark, enc)) +{ + bidi = ibidi; + shape = ishape; + +#ifdef _ICU_ + arshaping = new UTF8arShaping(); + bidireorder = new UTF8BiDiReorder(); + transliterator = new UTF8Transliterator(); +#endif + Load(); + +#ifdef WIN32 + OSVERSIONINFO osvi; + memset (&osvi, 0, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + platformID = osvi.dwPlatformId; +#endif + +} + + +DiathekeMgr::~DiathekeMgr() +{ +#ifdef _ICU_ + if (arshaping) + delete arshaping; + if (bidireorder) + delete bidireorder; + if (transliterator) + delete transliterator; +#endif +} + + +void DiathekeMgr::AddRenderFilters(SWModule *module, ConfigEntMap §ion) +{ + string lang; + bool rtl; + ConfigEntMap::iterator entry; + + lang = ((entry = section.find("Lang")) != section.end()) ? (*entry).second : (string)"en"; + rtl = ((entry = section.find("Direction")) != section.end()) ? ((*entry).second == "RtoL") : false; + +#ifdef _ICU_ + if (shape && !strnicmp(lang.c_str(), "ar", 2)) { + module->AddRenderFilter(arshaping); + } + if (bidi && rtl) { + module->AddRenderFilter(bidireorder); + } +#endif + SWMgr::AddRenderFilters(module, section); +} + +signed char DiathekeMgr::Load () { + signed char retval = SWMgr::Load(); +#ifdef _ICU_ + optionFilters.insert(FilterMap::value_type("UTF8Transliterator", transliterator)); + options.push_back(transliterator->getOptionName()); +#endif + return retval; +}; + +void DiathekeMgr::AddGlobalOptions (SWModule * module, ConfigEntMap & section, + ConfigEntMap::iterator start, + ConfigEntMap::iterator end) { + + SWMgr::AddGlobalOptions(module, section, start, end); +#ifdef _ICU_ + module->AddOptionFilter(transliterator); +#endif +}; + diff --git a/apps/console/diatheke/gbfcgi.cpp b/apps/console/diatheke/gbfcgi.cpp new file mode 100644 index 0000000..1bcd176 --- /dev/null +++ b/apps/console/diatheke/gbfcgi.cpp @@ -0,0 +1,138 @@ +/*************************************************************************** + gbfcgi.cpp - GBF to Diatheke/CGI format + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#include <stdlib.h> +#include <string.h> +#include "gbfcgi.h" + +GBFCGI::GBFCGI() { + setTokenStart("<"); + setTokenEnd(">"); + + setTokenCaseSensitive(true); + + addTokenSubstitute("Rf", ")</small></font>"); + addTokenSubstitute("FI", "<i>"); // italics begin + addTokenSubstitute("Fi", "</i>"); + addTokenSubstitute("FB", "<n>"); // bold begin + addTokenSubstitute("Fb", "</n>"); + addTokenSubstitute("FR", "<font color=\"#FF0000\">"); // words of Jesus begin + addTokenSubstitute("Fr", "</font>"); + addTokenSubstitute("FU", "<u>"); // underline begin + addTokenSubstitute("Fu", "</u>"); + addTokenSubstitute("FO", "<cite>"); // Old Testament quote begin + addTokenSubstitute("Fo", "</cite>"); + addTokenSubstitute("FS", "<sup>"); // Superscript begin// Subscript begin + addTokenSubstitute("Fs", "</sup>"); + addTokenSubstitute("FV", "<sub>"); // Subscript begin + addTokenSubstitute("Fv", "</sub>"); + addTokenSubstitute("TT", "<big>"); // Book title begin + addTokenSubstitute("Tt", "</big>"); + addTokenSubstitute("PP", "<cite>"); // poetry begin + addTokenSubstitute("Pp", "</cite>"); + addTokenSubstitute("Fn", "</font>"); // font end + addTokenSubstitute("CL", "<br />"); // new line + addTokenSubstitute("CM", "<br />"); // paragraph + addTokenSubstitute("CG", ">"); // ??? + addTokenSubstitute("CT", "<"); // ??? + addTokenSubstitute("JR", "<div align=\"right\">"); // right align begin + addTokenSubstitute("JC", "<div align=\"center\">"); // center align begin + addTokenSubstitute("JL", "</div>"); // align end + +} + + +bool GBFCGI::handleToken(char **buf, const char *token, DualStringMap &userData) { + unsigned long i; + if (!substituteToken(buf, token)) { + if (!strncmp(token, "WG", 2) || !strncmp(token, "WH", 2)) { // strong's numbers + pushString(buf, " <small><em><<a href=\"!DIATHEKE_URL!"); + if (token[1] == 'H') { + pushString(buf, "BDB"); + } + else if (token[1] == 'G') { + pushString(buf, "Thayer"); + } + pushString(buf, "=on&verse="); + for (i = 2; i < strlen(token); i++) + *(*buf)++ = token[i]; + *(*buf)++ = '\"'; + *(*buf)++ = '>'; + for (i = 2; i < strlen(token); i++) + *(*buf)++ = token[i]; + pushString(buf, "</a>></em></small>"); + } + + else if (!strncmp(token, "WTG", 3) || !strncmp(token, "WTH", 3)) { // strong's numbers tense + pushString(buf, " <small><em><<a href=\"!DIATHEKE_URL!"); + if (token[2] == 'H') { + pushString(buf, "BDB"); + } + else if (token[2] == 'G') { + pushString(buf, "Thayer"); + } + pushString(buf, "=on&verse="); + for (i = 3; i < strlen(token); i++) + *(*buf)++ = token[i]; + *(*buf)++ = '\"'; + *(*buf)++ = '>'; + for (i = 3; i < strlen(token); i++) + *(*buf)++ = token[i]; + pushString(buf, "</a>></em></small>"); + } + + else if (!strncmp(token, "WT", 2)) { // morph tags + pushString(buf, " <small><em>(<a href=\"!DIATHEKE_URL!Packard=on&verse="); + for (i = 1; i < strlen(token); i++) + *(*buf)++ = token[i]; + *(*buf)++ = '\"'; + *(*buf)++ = '>'; + for (i = 1; i < strlen(token); i++) + *(*buf)++ = token[i]; + pushString(buf, "</a>)</em></small>"); + } + + else if (!strncmp(token, "RB", 2)) { + pushString(buf, "<i>"); + userData["hasFootnotePreTag"] = "true"; + } + + else if (!strncmp(token, "RF", 2)) { + if(userData["hasFootnotePreTag"] == "true") { + userData["hasFootnotePreTag"] = "false"; + pushString(buf, "</i> "); + } + pushString(buf, "<font color=\"#800000\"><small> ("); + } + + else if (!strncmp(token, "FN", 2)) { + pushString(buf, "<font face=\""); + for (i = 2; i < strlen(token); i++) + *(*buf)++ = token[i]; + *(*buf)++ = '\"'; + *(*buf)++ = '>'; + } + + else if (!strncmp(token, "CA", 2)) { // ASCII value + *(*buf)++ = (char)atoi(&token[2]); + } + + else { + return false; + } + } + return true; +} diff --git a/apps/console/diatheke/gbfcgi.h b/apps/console/diatheke/gbfcgi.h new file mode 100644 index 0000000..51b0d6c --- /dev/null +++ b/apps/console/diatheke/gbfcgi.h @@ -0,0 +1,33 @@ +/*-************************************************************************* + gbfcgi.h - description + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef GBFCGI_H +#define GBFCGI_H + +#include <swbasicfilter.h> + +#include <defs.h> + +/** this filter converts GBF text to Diatheke/CGI format + */ +class SWDLLEXPORT GBFCGI : public SWBasicFilter { +protected: + virtual bool handleToken(char **buf, const char *token, DualStringMap &userData); +public: + GBFCGI (); +}; + +#endif diff --git a/apps/console/diatheke/thmlcgi.cpp b/apps/console/diatheke/thmlcgi.cpp new file mode 100644 index 0000000..2bb7720 --- /dev/null +++ b/apps/console/diatheke/thmlcgi.cpp @@ -0,0 +1,192 @@ +/*************************************************************************** + thmlcgi.cpp - ThML to Diatheke/CGI format + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#include <stdlib.h> +#include <string.h> +#include "thmlcgi.h" + +ThMLCGI::ThMLCGI() { + setTokenStart("<"); + setTokenEnd(">"); + + setTokenCaseSensitive(true); + + addTokenSubstitute("note", " <font color=\"#008000\"><small>("); + addTokenSubstitute("/note", ")</small></font> "); +} + + +bool ThMLCGI::handleToken(char **buf, const char *token, DualStringMap &userData) { + unsigned long i; + if (!substituteToken(buf, token)) { + // manually process if it wasn't a simple substitution + if (!strncmp(token, "sync ", 5)) { + pushString(buf, "<a href=\"!DIATHEKE_URL!"); + char* pbuf; + char typ[32]; typ[0] = 0; + char val[32]; val[0] = 0; + char cls[32]; cls[0] = 0; + for (unsigned int j = 5; j < strlen(token); j++) { + if (!strncmp(token+j, "type=\"", 6)) { + pbuf = typ; + j += 6; + for (;token[j] != '\"'; j++) + *(pbuf)++ = token[j]; + *(pbuf) = 0; + } + else if (!strncmp(token+j, "value=\"", 7)) { + pbuf = val; + j += 7; + for (;token[j] != '\"'; j++) + *(pbuf)++ = token[j]; + *(pbuf) = 0; + } + else if (!strncmp(token+j, "class=\"", 7)) { + pbuf = cls; + j += 7; + for (;token[j] != '\"'; j++) + *(pbuf)++ = token[j]; + *(pbuf) = 0; + } + } + if (*cls && *val) { + pushString(buf, "%s=on&verse=%s", cls, val); + } + else if (*typ && *val) { + if (!strnicmp(typ, "Strongs", 7)) { + if (*val == 'G') { + pushString(buf, "Thayer=on&verse=%s", val + 1); + } + else if (*val == 'H') { + pushString(buf, "BDB=on&verse=%s", val + 1); + } + } + + else if (!strnicmp(typ, "Morph", 5)) { + if (*val == 'G') { + pushString(buf, "Thayer=on&verse=%s", val + 1); + } + else if (*val == 'H') { + pushString(buf, "BDB=on&verse=%s", val + 1); + } + else { + pushString(buf, "Packard=on&verse=%s", val); + } + } + else { + pushString(buf, "%s=on&verse=%s", typ, val); + } + } + *(*buf)++ = '\"'; + *(*buf)++ = '>'; + + if (*val) { + pushString(buf, val); + } + pushString(buf, "</a>"); + } + + else if (!strncmp(token, "scripRef p", 10) || !strncmp(token, "scripRef v", 10)) { + userData["inscriptRef"] = "true"; + pushString(buf, "<a href=\"!DIATHEKE_URL!"); + for (i = 9; i < strlen(token); i++) { + if (!strncmp(token+i, "version=\"", 9)) { + i += 9; + for (;token[i] != '\"'; i++) + *(*buf)++ = token[i]; + pushString(buf, "=on&"); + } + if (!strncmp(token+i, "passage=\"", 9)) { + i += 9; + pushString(buf, "verse="); + for (;token[i] != '\"'; i++) { + if (token[i] == ' ') *(*buf)++ = '+'; + else *(*buf)++ = token[i]; + } + *(*buf)++ = '&'; + } + } + *(*buf)++ = '\"'; + *(*buf)++ = '>'; + } + + // we're starting a scripRef like "<scripRef>John 3:16</scripRef>" + else if (!strcmp(token, "scripRef")) { + userData["inscriptRef"] = "false"; + // let's stop text from going to output + userData["suspendTextPassThru"] = "true"; + } + + // we've ended a scripRef + else if (!strcmp(token, "/scripRef")) { + if (userData["inscriptRef"] == "true") { // like "<scripRef passage="John 3:16">John 3:16</scripRef>" + userData["inscriptRef"] = "false"; + pushString(buf, "</a>"); + } + + else { // like "<scripRef>John 3:16</scripRef>" + pushString(buf, "<a href=\"!DIATHEKE_URL!verse="); + + char* vref = (char*)userData["lastTextNode"].c_str(); + while (*vref) { + if (*vref == ' ') *(*buf)++ = '+'; + else *(*buf)++ = *vref; + vref++; + } + *(*buf)++ = '\"'; + *(*buf)++ = '>'; + pushString(buf, userData["lastTextNode"].c_str()); + // let's let text resume to output again + userData["suspendTextPassThru"] = "false"; + pushString(buf, "</a>"); + } + } + + else if (!strncmp(token, "div class=\"sechead\"", 19)) { + userData["SecHead"] = "true"; + pushString(buf, "<br /><b><i>"); + } + else if (!strncmp(token, "div class=\"title\"", 19)) { + userData["SecHead"] = "true"; + pushString(buf, "<br /><b><i>"); + } + else if (!strncmp(token, "/div", 4)) { + if (userData["SecHead"] == "true") { + pushString(buf, "</i></b><br />"); + userData["SecHead"] = "false"; + } + } + + else if(!strncmp(token, "note", 4)) { + pushString(buf, " <small><font color=\"#008000\">{"); + } + + else { + *(*buf)++ = '<'; + for (i = 0; i < strlen(token); i++) + *(*buf)++ = token[i]; + *(*buf)++ = '>'; + //return false; // we still didn't handle token + } + } + return true; +} + + + + + + diff --git a/apps/console/diatheke/thmlcgi.h b/apps/console/diatheke/thmlcgi.h new file mode 100644 index 0000000..c164f0d --- /dev/null +++ b/apps/console/diatheke/thmlcgi.h @@ -0,0 +1,33 @@ +/*************************************************************************** + thmlcgi.h - description + ------------------- + begin : 2001-11-12 + copyright : 2001 by CrossWire Bible Society + ***************************************************************************/ + +/*************************************************************************** + * * + * 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. * + * * + ***************************************************************************/ + +#ifndef THMLCGI_H +#define THMLCGI_H + +#include <swbasicfilter.h> + +#include <defs.h> + +/** this filter converts ThML text to Diatheke/CGI format + */ +class SWDLLEXPORT ThMLCGI : public SWBasicFilter { +protected: + virtual bool handleToken(char **buf, const char *token, DualStringMap &userData); +public: + ThMLCGI(); +}; + +#endif diff --git a/apps/windoze/CBuilder1/mainform.cpp b/apps/windoze/CBuilder1/mainform.cpp new file mode 100644 index 0000000..0118d7b --- /dev/null +++ b/apps/windoze/CBuilder1/mainform.cpp @@ -0,0 +1,31 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include "mainform.h" +//--------------------------------------------------------------------------- +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Button1Click(TObject *Sender) +{ + webster->SetKey(Edit1->Text.c_str()); + Memo1->Text = webster->operator char*(); + +} +//--------------------------------------------------------------------- +void __fastcall TForm1::FormCreate(TObject *Sender) +{ + webster = new RawText("../../../modules/texts/rawtext/orthjbc/", "Webster", "Webster Text"); +} +//--------------------------------------------------------------------- +void __fastcall TForm1::FormDestroy(TObject *Sender) +{ + delete webster; +} +//---------------------------------------------------------------------
\ No newline at end of file diff --git a/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp b/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp new file mode 100644 index 0000000..0528c7f --- /dev/null +++ b/apps/windoze/CBuilder4/BibleCS/vrslstfrm.cpp @@ -0,0 +1,48 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "vrslstfrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TVerseListFrm *VerseListFrm; +//--------------------------------------------------------------------------- +__fastcall TVerseListFrm::TVerseListFrm(TComponent* Owner, ListKey &iVerseList) + : TForm(Owner), verseList(iVerseList) { + pvrtf = new SWDispRTF(this); + + pvrtf->Parent = plPreview; + pvrtf->Align = alClient; + pvrtf->ScrollBars = ssVertical; + pvrtf->ReadOnly = true; +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender) { + ModMap::iterator target; + target = Form1->mainmgr->Modules.find(Form1->PageControl1->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + SWKey *savekey = *(*target).second; + (*target).second->SetKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str()); + pvrtf->Display(*(*target).second); + (*target).second->SetKey(*savekey); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListFrm::ListBox1DblClick(TObject *Sender) +{ + Form1->DefaultVSKey = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str(); + Form1->TextKeyChanged(); +} +//--------------------------------------------------------------------------- +void __fastcall TVerseListFrm::FormShow(TObject *Sender) +{ + for (verseList = TOP; (!verseList.Error()); verseList++) + ListBox1->Items->Add((const char *)verseList); +} +//--------------------------------------------------------------------------- + + + diff --git a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.cpp b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.cpp new file mode 100644 index 0000000..b76b9b1 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.cpp @@ -0,0 +1,122 @@ +//--------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "AboutBoxfrm.h" +#include "mainfrm.h" +//--------------------------------------------------------------------- +#pragma resource "*.dfm" +TAboutBox *AboutBox; +//--------------------------------------------------------------------- +__fastcall TAboutBox::TAboutBox(TComponent* AOwner) : TForm(AOwner) { +} + + +//--------------------------------------------------------------------- +void __fastcall TAboutBox::FormShow(TObject *Sender) { + int i; + static char *modtypes[] = {"Biblical Texts", "Commentaries", "Lexicons / Dictionaries", "Generic Books"}; + + string newtext, tmptext; + ModMap::iterator it; + SectionMap::iterator it2; + ConfigEntMap::iterator it3; + TMemoryStream *RTFStream = new TMemoryStream(); + + newtext = "{\\rtf1\\ansi{\\fonttbl{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;}"; + newtext += "\\pard\\qc\\cf2\\nowidctlpar{\\fs30\\b Installed Modules } \\par \\pard \\nowidctlpar \\cf0 "; + + for (i = 0; i < 4; i++) { + newtext += "\\par {\\fs28\\b "; + newtext += modtypes[i]; + newtext += " }\\par \\par "; + for (it = Form1->mainmgr->Modules.begin(); it != Form1->mainmgr->Modules.end(); it++) { + if (!strcmp((*it).second->Type(), modtypes[i])) { + it2 = Form1->mainmgr->config->Sections.find((*it).second->Name()); + if (it2 != Form1->mainmgr->config->Sections.end()) { + newtext = newtext + "{\\fs24\\cf1\\b " + (*it).second->Name() + " }\t"; + newtext = newtext + "{\\fs24\\i " + (*it).second->Description() + " } \\par "; + it3 = (*it2).second.find("About"); + if (it3 != (*it2).second.end()) + newtext = newtext + "{\\fs20\\cf0 " + (*it3).second.c_str() + " }\\par \\par"; + } + } + } + } + newtext += "{\\fs24 \\par }}"; + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.length()); + RTFStream->Position = 0; + ModulesAbout->Lines->LoadFromStream(RTFStream); + + newtext = "{\\rtf1\\ansi{\\fonttbl{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;}"; + newtext += "\\fs20 Thanx to God for His GREAT MERCY and LOVE: Never did anyone have so much, give it up so completely, to humble Himself and die such a death, all for such an ENEMY as me. -Philippians 2:6-8; Romans 5:6-10 \\par\\par "; + newtext += "For the latest updates and info, visit us on the net at: \\par "; + newtext += "http://www.crosswire.org \\par\\par "; + newtext += "Send us feedback, bug reports, or patches/additions: \\par "; + newtext += "sword-feedback@crosswire.org \\par "; + newtext += "sword-bugs@crosswire.org \\par "; + newtext += "sword-patches@crosswire.org (please include unified diffs if possible (diff -u)) \\par\\par "; + newtext += "To be on our mailing list: \\par "; + newtext += "sword-list-info@crosswire.org \\par\\par "; + newtext += "This software is provided free for the study of God and His Word. You DO NOT NEED TO license or pay for this software. Please: copy it freely and distribute it to athiests in Russia :), post it on your favorite FTP site, write your own modules and features for it, include it on your lastest freeware CDROM, incorporate all the cool utility classes into a product of your own, write a tract module for the program and sneak it onto all of your co-workers' computers and blame it on a virus, make fun of your pastor for spending $400 dollars on a similar package, give it to your pastor who can't figure out how to use his $400 dollar package :) \\par\\par "; + newtext += "OK, if you still feel the need, you can help our organization out at: \\par\\par "; + newtext += "CrossWire Software & Bible Society \\par "; + newtext += "P. O. Box 2528 \\par "; + newtext += "Tempe, AZ 85280-2528 \\par\\par "; + newtext += "... but I must warn you, your contributions will probably just go toward paying my way through college, or to give me a little more time to spend on the project :) \\par\\par "; + newtext += "\tMay the peace of GOD consume your heart, \\par "; + newtext += "\t\tThe SWORD Project Development Team \\par "; + newtext += "_________________________________________ \\par "; + newtext += "Thanks be to God for all the wonderful people who have contributed in so many ways to make this project possible. These are just a few (I could not possibly name them all) who have directly contributed an abundance of their time and talents: \\par\\par "; + newtext += "Chris Little (the module-making machine!); All the people at The Source in Scottsdale for testing and suggestions; "; + newtext += "The Bible Foundation: Jerry Kingery, Jerry Hastings; Geoffrey W. Hastings; "; + newtext += "William Dicks; Everyone on b-greek@franklin.oit.unc.edu; Michael Paul Johnson; "; + newtext += "Roland Nygren; Bayu Gunawan; Bill Kincaid; Mark Fuller; Larry Pierce; Franklin Bratcher; "; + newtext += "Gregory Hall; Luis Cortes; Steve Hiner; Kristof Petr; Paul Gear and OpenBible; Chris Bitmead (go Scheme!); "; + newtext += "Brook Humphrey; Torsten Uhlmann, Joachim Ansorg, Darwin Gregory, Martin Gruner and the BibleTime Team; "; + newtext += "Darren DeMeulenaere; Terry Biggs and the GnomeSword Team; Daniel Glassey; David Trotz Jr.; Karl-Heinz Troyer and BibleWorkshop"; + newtext += "\\par\\par "; + newtext += "{\\i And the list goes on...} \\par \\par "; + newtext += "{\\fs24 \\par }}"; + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.length()); + RTFStream->Position = 0; + CreditAbout->Lines->LoadFromStream(RTFStream); + delete RTFStream; +} +//--------------------------------------------------------------------------- + + + + +void __fastcall TAboutBox::ProgramIconMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + if ((Shift.Contains(ssCtrl)) && (!Shift.Contains(ssAlt)) && (Button == mbRight)) { + TMemoryStream *RTFStream = new TMemoryStream(); + string newtext = "{\\rtf1\\ansi{\\fonttbl{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}}{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;}"; + newtext += "\\fs20 mainmgr->config: \\par\\par "; + + SectionMap::iterator section; + ConfigEntMap::iterator entry; + + for (section = Form1->mainmgr->config->Sections.begin(); section != Form1->mainmgr->config->Sections.end(); section++) { + newtext += "["; newtext += section->first.c_str(); newtext += "] \\par "; + for (entry = (*section).second.begin(); entry != (*section).second.end(); entry++) { + newtext += entry->first.c_str(); newtext += "="; newtext += entry->second.c_str(); newtext += "\\par "; + } + newtext += "\\par "; + } + + + newtext += "{\\fs24 \\par }}"; + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.length()); + RTFStream->Position = 0; + CreditAbout->Lines->LoadFromStream(RTFStream); + delete RTFStream; + } +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm new file mode 100644 index 0000000..07cecd8 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/AboutBoxfrm.dfm @@ -0,0 +1,161 @@ +object AboutBox: TAboutBox
+ Left = 291
+ Top = 107
+ BorderStyle = bsDialog
+ Caption = 'About The SWORD Project'
+ ClientHeight = 448
+ ClientWidth = 417
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 417
+ Height = 407
+ Align = alClient
+ BevelInner = bvRaised
+ BevelOuter = bvLowered
+ ParentColor = True
+ TabOrder = 0
+ object ProgramIcon: TImage
+ Left = 8
+ Top = 8
+ Width = 33
+ Height = 33
+ Picture.Data = {
+ 055449636F6E0000010001002020100000000000E80200001600000028000000
+ 2000000040000000010004000000000080020000000000000000000000000000
+ 0000000000000000000080000080000000808000800000008000800080800000
+ 80808000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000
+ FFFFFF0066666666666666666666666666666666688888888888888888088888
+ 8888888668888888888888888880888888888886688888888888888888808888
+ 8888888668888008888088008880800080008800688888088880880808808080
+ 8080880068888808888088080880800880888806688888008880080808880080
+ 8080880668888808080080800800080088008000688888080888888888888888
+ 8888880668888000088888888888888888888806688888888888888888880888
+ 8888888660088808880888877777777878888F86088088088808887888877788
+ 888888F60880800888078788888878878888888F680080808087878888887887
+ 8888888F6088808087878788888877788888888F088808808788778888887888
+ 8888888F08080888788878788887788888F888F6000000877787778777777778
+ 88FFFF8668888880888888888888888888888886688888880888888888888888
+ 8888888668008880808800088888888888888886688088808808080888888888
+ 8888888668808880080800888888888888888886688088800008080888888888
+ 8888888668808880880880088888888888888886088080808888888888888888
+ 8888888600000080888888888888888888888886688888808888888888888888
+ 8888888668888888088888888888888888888886666666660666666666666666
+ 6666666600000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 00000000}
+ Stretch = True
+ OnMouseDown = ProgramIconMouseDown
+ IsControl = True
+ end
+ object ProductName: TLabel
+ Left = 52
+ Top = 8
+ Width = 285
+ Height = 17
+ AutoSize = False
+ Caption = 'The SWORD Project'
+ IsControl = True
+ end
+ object Version: TLabel
+ Left = 52
+ Top = 24
+ Width = 213
+ Height = 21
+ AutoSize = False
+ Caption = 'v1.5.4betaX'
+ IsControl = True
+ end
+ object Copyright: TLabel
+ Left = 8
+ Top = 48
+ Width = 398
+ Height = 17
+ Anchors = [akLeft, akTop, akRight]
+ AutoSize = False
+ Caption = '(c) 2002; GNU GPL Copyleft, CrossWire Bible Society'
+ WordWrap = True
+ IsControl = True
+ end
+ object CreditAbout: TRichEdit
+ Left = 8
+ Top = 245
+ Width = 401
+ Height = 155
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ Color = clBtnFace
+ ReadOnly = True
+ ScrollBars = ssVertical
+ TabOrder = 0
+ end
+ object ModulesAbout: TRichEdit
+ Left = 8
+ Top = 68
+ Width = 401
+ Height = 169
+ Anchors = [akLeft, akTop, akRight]
+ Color = clBtnFace
+ ReadOnly = True
+ ScrollBars = ssVertical
+ TabOrder = 1
+ end
+ end
+ object Panel2: TPanel
+ Left = 0
+ Top = 407
+ Width = 417
+ Height = 41
+ Align = alBottom
+ TabOrder = 1
+ object OKButton: TButton
+ Left = 318
+ Top = 8
+ Width = 93
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'OK'
+ Default = True
+ ModalResult = 1
+ TabOrder = 0
+ end
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp new file mode 100644 index 0000000..d336056 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.cpp @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- + +#include <vcl.h> +#pragma hdrstop + +#include "DevOfTheDay.h" +#include "mainfrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TDevOfTheDay2 *DevOfTheDay2; +//--------------------------------------------------------------------------- +__fastcall TDevOfTheDay2::TDevOfTheDay2(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- + + +void __fastcall TDevOfTheDay2::btnOKClick(TObject *Sender) +{ + DevOfTheDay2->Hide(); + ConfigEntMap emap; + SWConfig * optionsconf; + optionsconf = dynamic_cast<TForm1*>(Application->MainForm)->optionsconf; + if(optionsconf) + { + emap = optionsconf->Sections["General"]; + emap.erase("TipOfTheDay"); + emap.insert(ConfigEntMap::value_type("TipOfTheDay", (DevOfTheDay2->ckShowTip->Checked) ? "Devotional" : "")); + optionsconf->Sections["General"] = emap; + optionsconf->Save(); + } + +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm new file mode 100644 index 0000000..9c3f8b9 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.dfm @@ -0,0 +1,383 @@ +object DevOfTheDay2: TDevOfTheDay2 + Left = 405 + Top = 100 + Width = 427 + Height = 368 + BiDiMode = bdLeftToRight + Caption = 'Devotion for Today' + Color = clBtnFace + Constraints.MinHeight = 277 + Constraints.MinWidth = 362 + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + FormStyle = fsStayOnTop + OldCreateOrder = False + ParentBiDiMode = False + Position = poScreenCenter + Scaled = False + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 69 + Width = 419 + Height = 231 + Align = alClient + AutoSize = True + BevelOuter = bvNone + Caption = 'Panel1' + TabOrder = 0 + object RichTip: TRichEdit + Left = 0 + Top = 0 + Width = 419 + Height = 231 + Align = alClient + BorderStyle = bsNone + PlainText = True + ReadOnly = True + ScrollBars = ssVertical + TabOrder = 0 + end + end + object Panel3: TPanel + Left = 0 + Top = 300 + Width = 419 + Height = 41 + Align = alBottom + TabOrder = 1 + object ckShowTip: TCheckBox + Left = 8 + Top = 12 + Width = 152 + Height = 17 + Anchors = [akLeft, akBottom] + Caption = 'Show Devotional at Startup' + TabOrder = 0 + end + object btnOK: TButton + Left = 338 + Top = 9 + Width = 73 + Height = 24 + Anchors = [akRight, akBottom] + Caption = '&Close' + TabOrder = 1 + OnClick = btnOKClick + end + end + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 419 + Height = 69 + Align = alTop + BevelOuter = bvNone + Caption = 'Panel4' + Color = clWindow + TabOrder = 2 + object bmpDev: TImage + Left = 0 + Top = 0 + Width = 52 + Height = 69 + Align = alLeft + Enabled = False + Picture.Data = { + 07544269746D61700E220000424D0E2200000000000076000000280000005601 + 0000320000000100040000000000982100000000000000000000100000000000 + 0000000000000000800000800000008080008000000080008000808000008080 + 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF + FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00000000000000000000 + 000000000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF + FFFF01100000000000077000000000000110FFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF00FFFFFFFF01077777777770000000777777777010FFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF010777000000 + 07700077000000777010FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF00FFFFFFFF01000088877777000807777888000010FFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0088888887770070088007788888 + 8800FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0088 + 8888800077080888800088888800FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00F + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF00FFFFFFFF00888800088777080888888800088800FFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00800088888770880888 + 8888FFF00000FFFFFFFFFFFFFFFFFF000FFFFFFF000FFFFFF00000FFFF00FFFF + FF0000F00FFFF00000FFFFFFFFFFFF00FFFFFFFF00000FFFFFFFFFF00000000F + F00FFFFF0FFFFFFF00000FFFFFFFFFF00000000FFFFFFF00FFFFF00FFF00FFF0 + 0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF + FFFF0080FF888887708808888888FFFFF000FFFFFFFFFFFFFFFFFF000FFFFFFF + 000FFFFF0000000FFF00FFFFF00000000FFF0000000FFFFFFFFFFF00FFFFFFF0 + 000000FFFFFFFFF00000000FF00FFFF000FFFFF0000000FFFFFFFFF000000000 + FFFFFF00FFFFF00FFF00FFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF00FFFFFFFF0080FF888887088808888888FFFFF000FFFF + FFFFFFFFFFFFF00F00FFFFF00F00FFF000FFF000FF00FFFF000FFF000FF00FFF + F00FFFFFFFFFFF00FFFFFF000FFF000FFFFFFFF00FFFFFFFF00FFFF000FFFF00 + 0FFFF00FFFFFFFF00FFFFF000FFFF0000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0080FF888880 + 888808888888FFFFF000FFFFFFFFFFFFFFFFF00F00FFFFF00F00FFF00FFFFF00 + FF00FFFF00FFFFF00FFFFFFF000FFFFFFFFFFF00FFFFFF00FFFFF00FFFFFFFF0 + 0FFFFFFFF00FFF00F00FFF00FFFFFFFFFFFFFFF00FFFFFF00FFFF0000FFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF00FFFFFFFF0080FF888808888808888888FFFFF000FFFFFFFFFFFFFFFFF00F + 00FFFFF00F00FFF00FFFFF00FF00FFFF00FFFFF00FFFFF0000FFFFFFFFFFFF00 + FFFFFF00FFFFF00FFFFFFFF00FFFFFFFF00FFF00F00FFF000000000FFFFFFFF0 + 0FFFFFF00FFF00F00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0080FF8000F8888808888888FFFF + F000FFFFFFFFFFFFFFFFF00FF00FFF00FF00FFF00FFFFF00FF00FFFF00FFFFF0 + 0FFF0000FFFFFFFFFFFFFF00FFFFFF00FFFFF00FFFFFFFF00FFFFFFFF00FF00F + FF00FF000000000FFFFFFFF00FFFFF00FFFF00FF00FFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF0080 + FF80FFF8888808888888FFFFF000FFFFFFFFFFFFFFFFF00FF00FFF00FF00FFF0 + 0FFFFF00FF00FFFF00FFFFF00FF000FFFFFFFFFFFFFFFF00FFFFFF00FFFFF00F + FFFFFFF00FFFFFFFF00FF00FFF00FF00FFFFF00FFFFFFFF00000000FFFF00FFF + 00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF00FFFFFFFF0080FF80FFF8888808888888FFFFF000FFFFFFFFFFFF + FFFF00FFF00FFF00FFF00FF000FFF000FF000FFF000FFF000FF00FFFF00FFFFF + FFFFFF00FFFFFF000FFF000FFFFFFFF00FFFFFFFF00FF00FFF00FF000FFF00FF + FFFFFFF00000000FFFF00FFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00880F80FFF888880888 + 8888FFFF0F00FFFFFFFFFFFFFFFF00FFF00FFF00FFF00FFF0000000FFF00000F + F00000000FF0000000FFFFFFFFFFFF00FFFFFFF0000000FFFFFFFFF00FFFFFFF + F00F00FFFFF00FF0000000FFFFFFFFF00FFFF000FF00FFFFF00FFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF + FFFF00880F80FFF8888808888888FFFF0F00FFFFFFFFFFFFFFFF00FFFF00F00F + FFF00FFFF00000FFFF00F00FFF0000F00FFF00000FFFFFFFFFFFFF00FFFFFFFF + 00000FFFFFFFFFF00FFFFFFFF00F00FFFFF00FFF00000FFFFFFFFFF00FFFFF00 + FF00FFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF00FFFFFFFF00880F80FFF8888000088888FFFF0F00FFFF + FFFFFFFFFFFF00FFFF00F00FFFF00FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFF + FFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFF00FFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFF00880F80FFF8 + 880088008888FFFF0F00FFFFFFFFFFFFFFFF00FFFF00F00FFFF00FFFFFFFFFFF + FFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFF0 + 0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF000FFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF00FFFFFFFF00880F80FFF8880777708888FFFF0F00FFFFFFFFFFFFFFF00FFF + FFF000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFF000000 + 0000FFFFFFFFFFFFFFFFFFF00FFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFF0 + 0000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFF0880F80FFF8880888808888FFFF + 0F0FFFFFFFFFFFFFFFF00FFFFFF000FFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFF0 + 0FFFFFFFFFFFFFFFFF0000000000FFFFFFFFFFFFFFFFFFF00FFFFFFFF00FFFFF + FFFFFFFFFFFFFFFFFFFFFFF0000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFF088 + 0F80FFF8880777708888FFFF0F0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF00FFFFFFFFF0880F880FF8880BBBB08888FFFF0F0FFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFF0000F880FF880BBBBBB + 0888FFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF + FFFFFFFF0F880FF80BBB00BBB088FFF000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF0F880FF0BBBB00BBBB08FFF0FFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF0F880F0B + BBBBBBBBBBB00000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF00FFFFFFFFFFFF00000F0BBBBB00BBBBBB0FFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFF00BBBBBB00BBBBBB0FFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFB + FBFB00BBBBBB00BBBBBB0FBFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF00FFFFFFFFFFF8887000BBBBBB00BBBBBB0F07888FFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFBFBFBF0BBBBBB00BB + BBBB0FBFBFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF + FFFFFFFFFFFFF0BBBBBB00BBBBBB0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFF0FF0BBBBB00BBBBB0FF0FFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFF0 + BBBBBBBBBB0FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF00FFFFFFFFFFFFFFFFFFFF00BBBBBB00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFB0FFFF000000FFFF0BFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFF + FFFF7BFFFFFFFFFFFFFFB7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFF00FFFFFFFFFFFFFFB8FFFF0FFB0BFF0FFFFF8BFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFF8BFFFFFFFF7FFF + FFFFFFBFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFF + FFFFFFFFFFFFFFFFFFFB7BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFF8FFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFF + FFFB8BFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFF00FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF + FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF00} + Transparent = True + end + object Label1: TLabel + Left = 52 + Top = 0 + Width = 367 + Height = 69 + Align = alClient + Caption = 'Words To Live By...' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -21 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentColor = False + ParentFont = False + Layout = tlCenter + end + end +end diff --git a/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h new file mode 100644 index 0000000..267330a --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/DevOfTheDay.h @@ -0,0 +1,33 @@ +//--------------------------------------------------------------------------- + +#ifndef DevOfTheDayH +#define DevOfTheDayH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <ComCtrls.hpp> +#include <ExtCtrls.hpp> +#include <Graphics.hpp> +//--------------------------------------------------------------------------- +class TDevOfTheDay2 : public TForm +{ +__published: // IDE-managed Components + TRichEdit *RichTip; + TPanel *Panel1; + TPanel *Panel3; + TCheckBox *ckShowTip; + TButton *btnOK; + TPanel *Panel4; + TImage *bmpDev; + TLabel *Label1; + void __fastcall btnOKClick(TObject *Sender); +private: // User declarations +public: // User declarations + __fastcall TDevOfTheDay2(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TDevOfTheDay2 *DevOfTheDay2; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/BibleCS/ModVisFrm.cpp b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.cpp new file mode 100644 index 0000000..64f791e --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.cpp @@ -0,0 +1,50 @@ +//--------------------------------------------------------------------------- + +#include <vcl.h> +#pragma hdrstop + +#include "ModVisFrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TModVisForm *ModVisForm; +//--------------------------------------------------------------------------- +__fastcall TModVisForm::TModVisForm(TComponent* Owner) + : TForm(Owner) +{ + section = 0; // set this before calling Show... + mgr = 0; // set this before calling Show... +} +//--------------------------------------------------------------------------- + +void __fastcall TModVisForm::FormShow(TObject *Sender) +{ + ConfigEntMap::iterator it; + ModMap::iterator mit; + TListItem *item; + modList->Items->Clear(); + for (it = section->begin(); it != section->end(); it++) { + mit = mgr->Modules.find(it->first); + SWModule *module = (mit != mgr->Modules.end()) ? mit->second : 0; + if (module) { + item = modList->Items->Add(); + item->Caption = it->first.c_str(); + item->SubItems->Add(module->Description()); + item->Checked = (it->second == "true"); + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TModVisForm::FormClose(TObject *Sender, + TCloseAction &Action) +{ + if (this->ModalResult == mrOk) { + for (int i = 0; i < modList->Items->Count; i++) { + string name = modList->Items->Item[i]->Caption.c_str(); + (*section)[name] = (modList->Items->Item[i]->Checked) ? "true" : "false"; + } + } +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/ModVisFrm.h b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.h new file mode 100644 index 0000000..d3fa99d --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/ModVisFrm.h @@ -0,0 +1,37 @@ +//--------------------------------------------------------------------------- + +#ifndef ModVisFrmH +#define ModVisFrmH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <Buttons.hpp> +#include <CheckLst.hpp> +#include <ExtCtrls.hpp> +#include <swconfig.h> +#include <swmgr.h> +#include <ComCtrls.hpp> +//--------------------------------------------------------------------------- +class TModVisForm : public TForm +{ +__published: // IDE-managed Components + TPanel *Panel2; + TPanel *Panel1; + TBitBtn *OkBtn; + TBitBtn *CancelBtn; + TListView *modList; + void __fastcall FormShow(TObject *Sender); + void __fastcall FormClose(TObject *Sender, TCloseAction &Action); +private: // User declarations +public: // User declarations + ConfigEntMap *section; + SWMgr *mgr; + + __fastcall TModVisForm(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TModVisForm *ModVisForm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp new file mode 100644 index 0000000..9d6b85f --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.cpp @@ -0,0 +1,441 @@ +//--------------------------------------------------------------------------- + +#include <vcl.h> +#pragma hdrstop + +#include "PrintFrm.h" +#include "mainfrm.h" +#include <Printers.hpp> +#include <Math.hpp> +#include <localemgr.h> +#include "PreviewForm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma link "RxCombos" +#pragma resource "*.dfm" +TPrintForm *PrintForm; + +//--------------------------------------------------------------------------- +__fastcall TPrintForm::TPrintForm(TComponent* Owner) + : TForm(Owner) +{ + rtfPrint = new TRxRichEditX(this); + rtfPrint->Parent = this; + rtfPrint->Visible = false; + rtfPrint->Font->Name = "Arial"; + + // Put in the RXLib Font combobox component + cmbFont = new TFontComboBox(this); + cmbFont->Parent = pnlFontComboBox; + cmbFont->Align = alClient; + cmbFont->Font->Size = 12; + cmbFont->ParentFont = true; + cmbFont->UseFonts = true; + cmbFont->ItemIndex = cmbFont->Items->IndexOf("Arial"); +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::FormShow(TObject *Sender) +{ + + if(Form1->optionsconf->Sections["Printing"]["Notice"] != "1"){ + Application->MessageBox("This release of The Sword Printer is preliminary and is not yet fully functional, therefore some of the features here have been disabled. Please be sure to take a look at the formatting options to be able to fully take control of how your page will look. Also be sure to use the \"Print Preview\" feature to preview how your page(s) will look on paper before printing. Enjoy! From, The Sword Project Development Team!", "The Sword Printer", MB_ICONINFORMATION | MB_OK); + Form1->optionsconf->Sections["Printing"]["Notice"] = "1"; + Form1->optionsconf->Save(); + } + ConfigEntMap::iterator eit; + AnsiString fontName; + BibleCSMGR *manager = Form1->mainmgr; + ModMap::iterator mods; + TPageControl* pc; + + if ((Form1->ActiveControl == Form1->CommentaryPageControl) || (IsChild(Form1->CommentaryPageControl->Handle, Form1->ActiveControl->Handle))){ + pc = Form1->CommentaryPageControl; + radComm->Checked = true; + staticRange->Caption = "Verse Range or List"; + editStart->Text = Form1->DefaultVSKey->getText(); + } + else if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle))){ + pc = Form1->LexDictPageControl; + radLD->Checked = true; + staticRange->Caption = "Lookup Range"; + editStart->Text = Form1->DictKeyEdit->Text; + } + else{ + pc = Form1->TextPageControl; + radText->Checked = true; + staticRange->Caption = "Verse Range or List"; + editStart->Text = Form1->DefaultVSKey->getText(); + } + FillModuleCombo(); + + AnsiString temp; + for(int count = 0; count < cmbModule->Items->Count; count++){ + temp = cmbModule->Items->Strings[count].SubString(2, cmbModule->Items->Strings[count].Pos("]") - 2); + if(temp == pc->ActivePage->Caption) + cmbModule->ItemIndex = count; + } + SetHint(); + fontName = ((eit = Form1->optionsconf->Sections["PrintPrefs"].find("PrintFontName")) != Form1->optionsconf->Sections["PrintPrefs"].end())? (*eit).second.c_str() : "Times New Roman"; + cmbFont->ItemIndex = cmbFont->Items->IndexOf(fontName); + PageControl1->ActivePage = shtSelection; + + SetDefaultOps(); + +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::btnCloseClick(TObject *Sender) +{ + Close(); +} +//--------------------------------------------------------------------------- + + +void TPrintForm::FillModuleCombo() +{ + TStringList *moduleNames = new TStringList; + BibleCSMGR *manager = Form1->mainmgr; + ModMap::iterator mods; + AnsiString modName; + + for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) { + modName = "[" + (AnsiString)mods->second->Name() + "] " + (AnsiString)mods->second->Description(); + if(!strncmp(mods->second->Type(), "Bibl", 4) && radText->Checked){ + moduleNames->Add(modName); + }else if(!strncmp(mods->second->Type(), "Comm", 4) && radComm->Checked){ + moduleNames->Add(modName); + }else if(!strncmp(mods->second->Type(), "Lexi", 4) && radLD->Checked){ + moduleNames->Add(modName); + } + } + cmbModule->Items = moduleNames; + cmbModule->ItemIndex = 0; +} + +void __fastcall TPrintForm::radTextClick(TObject *Sender) +{ + cmbModule->Enabled = true; + staticRange->Caption = _tr("Verse Range or List"); + SetHint(); + FillModuleCombo(); + SetDefaultOps(); +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::radCommClick(TObject *Sender) +{ + staticRange->Caption = _tr("Verse Range or List"); + SetHint(); + FillModuleCombo(); + SetDefaultOps(); +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::radLDClick(TObject *Sender) +{ + cmbModule->Enabled = true; + staticRange->Caption = _tr("Lookup Entry"); + SetHint(); + FillModuleCombo(); + SetDefaultOps(); +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::spinLeftClick(TObject *Sender, + TUDBtnType Button) +{ + if(Button == Comctrls::btNext) + editLeft->Text = FloatToStr(StrToFloat(editLeft->Text) + .05); + else + editLeft->Text = FloatToStr(StrToFloat(editLeft->Text) - .05); + +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::spinRightClick(TObject *Sender, + TUDBtnType Button) +{ + if(Button == Comctrls::btNext) + editRight->Text = FloatToStr(StrToFloat(editRight->Text) + .05); + else + editRight->Text = FloatToStr(StrToFloat(editRight->Text) - .05); +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::spinBottomClick(TObject *Sender, + TUDBtnType Button) +{ + if(Button == Comctrls::btNext) + editBottom->Text = FloatToStr(StrToFloat(editBottom->Text) + .05); + else + editBottom->Text = FloatToStr(StrToFloat(editBottom->Text) - .05); +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::spinTopClick(TObject *Sender, + TUDBtnType Button) +{ + if(Button == Comctrls::btNext) + editTop->Text = FloatToStr(StrToFloat(editTop->Text) + .05); + else + editTop->Text = FloatToStr(StrToFloat(editTop->Text) - .05); +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::btnPrintClick(TObject *Sender) +{ + if(cmbModule->Text.data() != NULL && editStart->Text.data() != NULL){ + PrepareRTF(); + OnPrint(rtfPrint); + } + +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::OnPrint(TRxRichEdit* rtfPrint) +{ +/* TODO 2 -oDavid -cPrinting : Add Printing of Headers and Footers */ + float leftMargin = StrToFloat(editLeft->Text), + rightMargin = StrToFloat(editRight->Text), + topMargin = StrToFloat(editTop->Text), + bottomMargin = StrToFloat(editBottom->Text); + + // Sets the font we will use for the headers and footers + Printer()->Canvas->Font->Name = "Arial"; + Printer()->Canvas->Font->Size = -8; + Printer()->Canvas->Font->Color = clBlack; + + int wPage = ::GetDeviceCaps(Printer()->Handle, PHYSICALWIDTH); + int hPage = ::GetDeviceCaps(Printer()->Handle, PHYSICALHEIGHT); + + int xPPI = ::GetDeviceCaps(Printer()->Handle, LOGPIXELSX); + int yPPI = ::GetDeviceCaps(Printer()->Handle, LOGPIXELSY); + + int wTwips = ::MulDiv(wPage, 1440, xPPI); + int hTwips = ::MulDiv(hPage, 1440, yPPI); + /* + // Adjust for the headers and footers if needed + if(ckHeader->Checked){ + int headerCoord = hTwips; + hTwips -= (Printer()->Canvas->Font->Height + (.25 * Printer()->Canvas->Font->Height)); + } + if(ckFooter->Checked){ + int footerCoord = hTwips; + hTwips -= (Printer()->Canvas->Font->Height + (.25 * Printer()->Canvas->Font->Height)); + } + */ + + RECT pageRect; + pageRect.left = pageRect.top = 0; + pageRect.right = wTwips; + pageRect.bottom = hTwips; + + RECT rendRect; + rendRect.left = rendRect.top = 0; + rendRect.right = pageRect.right - 1440 * (leftMargin + rightMargin); + rendRect.bottom = pageRect.bottom - 1440 * (topMargin + bottomMargin); + + std::vector<TPageOffsets> FPageOffsets; + + TPageOffsets po; + po.Start = 0; + + TFormatRange fr; + fr.hdc = Printer()->Handle; + fr.hdcTarget = Printer()->Handle; + fr.chrg.cpMin = po.Start; + fr.chrg.cpMax = -1; + + int lastOffset = ::SendMessage(rtfPrint->Handle, WM_GETTEXTLENGTH, 0, 0); + + ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 0, (LPARAM) 0); + + ::SaveDC(fr.hdc); + ::SetMapMode(fr.hdc, MM_TEXT); + int xOffset = -::GetDeviceCaps(Printer()->Handle, PHYSICALOFFSETX); + int yOffset = -::GetDeviceCaps(Printer()->Handle, PHYSICALOFFSETY); + xOffset += ::MulDiv((leftMargin * 1440), xPPI, 1440); + yOffset += ::MulDiv((topMargin * 1440), yPPI, 1440); + ::SetViewportOrgEx(fr.hdc, xOffset, yOffset, NULL); + + do { + fr.rc = rendRect; + fr.rcPage = pageRect; + po.Start = fr.chrg.cpMin; + fr.chrg.cpMin = ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE,(WPARAM) 0, (LPARAM) &fr); + // I don't know why I need to do this, but there is an apparent bug in the TRXRichEdit control + // and it doesn't handle the last page properly if there are more than 3 pages of text. + if(fr.chrg.cpMin == po.End) + fr.chrg.cpMin = lastOffset; + po.End = fr.chrg.cpMin - 1; + po.rendRect = fr.rc; + if(fr.chrg.cpMin < lastOffset) + FPageOffsets.push_back(po); + } while (fr.chrg.cpMin != -1 && fr.chrg.cpMin < lastOffset); + + int pageCount = FPageOffsets.size(); + ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 0, (LPARAM) 0); + ::RestoreDC(fr.hdc, -1); + + Printer()->BeginDoc(); + fr.hdc = Printer()->Handle; + fr.hdcTarget = Printer()->Handle; + ::SaveDC(fr.hdc); + /* + if(ckHeader->Checked == true){ + Printer()->Canvas->TextOut(100,100,"This is my test"); + } + */ + + bool firstPage = true; + int currPage = 0; + + do { + if (firstPage) firstPage = false; + else Printer()->NewPage(); + ::SetViewportOrgEx(fr.hdc, xOffset, yOffset, NULL); + fr.rc = FPageOffsets[currPage].rendRect; + fr.rcPage = pageRect; + fr.chrg.cpMin = FPageOffsets[currPage].Start; + fr.chrg.cpMax = FPageOffsets[currPage].End; + fr.chrg.cpMin = ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 1, (LPARAM) &fr); + } while (++currPage < pageCount); + + ::RestoreDC(fr.hdc, -1); + Printer()->EndDoc(); + + ::SendMessage(rtfPrint->Handle, EM_FORMATRANGE, (WPARAM) 0, (LPARAM) 0); + FPageOffsets.erase(FPageOffsets.begin(), FPageOffsets.end()); +} + +void TPrintForm::SetHint() +{ + TStringList* strList = new TStringList; + if(radText->Checked || radComm->Checked){ + strList->Add("Examples:"); + strList->Add("John 1:1 Prints John chapter 1 verse 1"); + strList->Add("John 1 Prints the entire first chapter of John"); + strList->Add("John 1,2 Prints chapters 1 and 2 of John"); + strList->Add("John 3:16;Rom 3:23 Prints John 3:16 and Romans 3:23"); + }else{ + strList->Add("Examples:"); + /* TODO 2 -oDavid -cPrinting : Make printing ranges of dictionaries work */ + // The ranges don't work yet. + //strList->Add("Aaron - David Prints dictionary entries from Aaron to David"); + strList->Add("Jesus Prints dictionary entry for Jesus"); + //strList->Add("0051 - 0054 Prints dictionary entry for range 0051 to 0054"); + strList->Add("0051 Prints dictionary entry for 0051"); + } + editStart->Hint = strList->Text; + delete strList; +} + +void __fastcall TPrintForm::btnSetupClick(TObject *Sender) +{ + PrinterSetupDialog->Execute(); +} +//--------------------------------------------------------------------------- +void __fastcall TPrintForm::BitBtn5Click(TObject *Sender) +{ + //To do +} +//--------------------------------------------------------------------------- + +void TPrintForm::PrepareRTF() +{ + BibleCSMGR* manager = Form1->mainmgr; + RTF_FORMAT format; + AnsiString newtext = ""; + AnsiString moduleName = cmbModule->Text.SubString(2,cmbModule->Text.Pos("]") - 2); + SWModule *module = manager->Modules[moduleName.c_str()]; + ListKey lstKey; + StrKey testKey; + + format.bkFontHeadSize = 2 * editHeading->Text.ToInt(); + format.bodyFontSize = 2 * editBody->Text.ToInt(); + format.vsNumFontSize = 2 * editNumbers->Text.ToInt(); + format.chFontHeadSize = 2 * editHeading->Text.ToInt(); + format.fontFace = cmbFont->Text; + format.paragraph = ckParagraph->Checked; + format.prBookHeadings = ckBookHead->Checked; + format.prChHeadings = ckChHead->Checked; + format.prPreFix = ckPrefix->Checked; + format.prPostFix = ckPostfix->Checked; + format.prVerseNum = ckVSNum->Checked; + format.superVSNum = ckSuperVS->Checked; + + lstKey.Persist(1); + if(!radLD->Checked){ + lstKey = VerseKey().ParseVerseList(editStart->Text.c_str(),*(Form1->DefaultVSKey), true); + module->SetKey(&lstKey); + rtfPrint->RenderModule(module, format); + module->SetKey(Form1->DefaultVSKey); + } + else{ + testKey.setText(WideStringToUTF8(editStart->Text).c_str()); + lstKey << testKey; + module->SetKey(&lstKey); + rtfPrint->RenderModule(module, format); + module->SetKey(Form1->DefaultStrKey); + } +} + +void __fastcall TPrintForm::btnPreviewClick(TObject *Sender) +{ + if(cmbModule->Text.data() != NULL && editStart->Text.data() != NULL){ + PrepareRTF(); + PreviewForm->currPage = 0; + if(PreviewForm->ShowModal() == mrOk) + OnPrint(rtfPrint); + } +} +void __fastcall TPrintForm::ckHeaderClick(TObject *Sender) +{ + editHeader->Enabled = ckHeader->Checked; +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::ckFooterClick(TObject *Sender) +{ + editFooter->Enabled = ckFooter->Checked; +} +//--------------------------------------------------------------------------- + +void __fastcall TPrintForm::ckVSNumClick(TObject *Sender) +{ + ckSuperVS->Enabled = ckVSNum->Checked; +} +//--------------------------------------------------------------------------- + + +void TPrintForm::SetDefaultOps() +{ + if(radText->Checked){ + ckBookHead->Checked = true; + ckChHead->Checked = true; + ckParagraph->Checked = true; + ckVSNum->Checked = true; + ckSuperVS->Checked = true; + ckPrefix->Checked = false; + ckPostfix->Checked = false; + }else if(radComm->Checked){ + ckBookHead->Checked = false; + ckChHead->Checked = false; + ckParagraph->Checked = false; + ckVSNum->Checked = false; + ckSuperVS->Checked = false; + ckPrefix->Checked = false; + ckPostfix->Checked = true; + }else if(radLD->Checked){ + ckBookHead->Checked = false; + ckChHead->Checked = false; + ckParagraph->Checked = false; + ckVSNum->Checked = false; + ckSuperVS->Checked = false; + ckPrefix->Checked = false; + ckPostfix->Checked = false; + } + +} + diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm b/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm new file mode 100644 index 0000000..2385ae1 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.dfm @@ -0,0 +1,565 @@ +object PrintForm: TPrintForm + Left = 384 + Top = 205 + Width = 550 + Height = 310 + AutoSize = True + Caption = 'The Sword Printer' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + OldCreateOrder = False + Position = poMainFormCenter + Scaled = False + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 450 + Top = 0 + Width = 92 + Height = 283 + Align = alRight + BevelOuter = bvNone + TabOrder = 0 + object btnPrint: TBitBtn + Left = 6 + Top = 21 + Width = 80 + Height = 25 + Caption = '&Print' + TabOrder = 0 + OnClick = btnPrintClick + Glyph.Data = { + 66010000424D6601000000000000760000002800000014000000140000000100 + 040000000000F000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00666666666666 + 6666666600006666666666666666666600006666666666666666666600006666 + 0000000000066666000066608888888880806666000066000000000000080666 + 0000660888888BBB880006660000660888888777880806660000660000000000 + 0008806600006608888888888080806600006660000000000808006600006666 + 0FFFFFFFF08080660000666660F00000F00006660000666660FFFFFFFF066666 + 00006666660F00000F06666600006666660FFFFFFFF066660000666666600000 + 0000666600006666666666666666666600006666666666666666666600006666 + 66666666666666660000} + Margin = 2 + end + object btnSetup: TBitBtn + Left = 7 + Top = 90 + Width = 80 + Height = 25 + Caption = 'Printer&s...' + TabOrder = 1 + OnClick = btnSetupClick + Glyph.Data = { + 66010000424D6601000000000000760000002800000014000000140000000100 + 040000000000F000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFF00FFFFF0000FFFF + FFFFFFFF4EC0FFFF0000FFFF00000004ECC0FFFF0000FFF08888884ECC80FFFF + 0000FF00000000ECC0080FFF0000FF08870078CC88000FFF0000FF0878E80777 + 88080FFF0000FF07FE8E8000000880FF0000FF07EFE8E088808080FF0000FFF7 + FEFE8000080800FF0000FFFF7FEF0FFFF08080FF0000FFFFF770F000F0000FFF + 0000FFFFF0FFFFFFFF0FFFFF0000FFFFFF0F00000F0FFFFF0000FFFFFF0FFFFF + FFF0FFFF0000FFFFFFF000000000FFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF + FFFFFFFFFFFFFFFF0000} + Margin = 2 + end + object btnPreview: TBitBtn + Left = 7 + Top = 55 + Width = 80 + Height = 25 + Caption = 'P&review...' + TabOrder = 2 + OnClick = btnPreviewClick + Glyph.Data = { + 66010000424D6601000000000000760000002800000014000000140000000100 + 040000000000F000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00666666666666 + 6666666600006666666666666666666600006666666666666666600600006600 + 00000000006607060000660FFFFFFFFFF06070660000660FFFFFFF0000070666 + 0000660FFFFFF078870066660000660FFFFF0788E77066660000660FFFFF0888 + 878066660000660FFFFF08E8878066660000660FFFFF07EE877066660000660F + FFFFF078870666660000660FFFFFFF00006666660000660FFFFFFFFFF0666666 + 0000660FFFFFFF00006666660000660FFFFFFF7F066666660000660FFFFFFF70 + 6666666600006600000000066666666600006666666666666666666600006666 + 66666666666666660000} + Margin = 2 + end + object btnClose: TBitBtn + Left = 7 + Top = 125 + Width = 80 + Height = 25 + Caption = '&Close' + TabOrder = 3 + OnClick = btnCloseClick + Glyph.Data = { + 66010000424D6601000000000000760000002800000014000000140000000100 + 040000000000F000000000000000000000001000000000000000000000000000 + 8000008000000080800080000000800080008080000080808000C0C0C0000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF + FFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF + F0FFFFFFFFFF0FFF0000FFFF000FFFFFFFFFFFFF0000FFFF0000FFFFFFF0FFFF + 0000FFFFF000FFFFFF0FFFFF0000FFFFFF000FFFF00FFFFF0000FFFFFFF000FF + 00FFFFFF0000FFFFFFFF00000FFFFFFF0000FFFFFFFFF000FFFFFFFF0000FFFF + FFFF00000FFFFFFF0000FFFFFFF000FF00FFFFFF0000FFFFF0000FFFF00FFFFF + 0000FFFF0000FFFFFF00FFFF0000FFFF000FFFFFFFFF0FFF0000FFFFFFFFFFFF + FFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFFFFFFFFFFFFFFFFFF0000FFFF + FFFFFFFFFFFFFFFF0000} + Margin = 2 + end + end + object PageControl1: TPageControl + Left = 0 + Top = 0 + Width = 450 + Height = 283 + ActivePage = shtSelection + Align = alClient + TabOrder = 1 + object shtSelection: TTabSheet + Caption = 'Print Selection' + object GroupBox1: TGroupBox + Left = 10 + Top = 14 + Width = 420 + Height = 123 + Caption = 'Print Source' + TabOrder = 0 + object lblModName: TLabel + Left = 9 + Top = 75 + Width = 66 + Height = 13 + Caption = 'Module Name' + end + object radText: TRadioButton + Left = 8 + Top = 17 + Width = 105 + Height = 17 + Caption = 'Bible Text' + Checked = True + TabOrder = 0 + TabStop = True + OnClick = radTextClick + end + object radComm: TRadioButton + Left = 8 + Top = 35 + Width = 105 + Height = 17 + Caption = 'Commentary Text' + TabOrder = 1 + OnClick = radCommClick + end + object radLD: TRadioButton + Left = 8 + Top = 54 + Width = 137 + Height = 17 + Caption = 'Lexicon/Dictionary Text' + TabOrder = 2 + OnClick = radLDClick + end + object cmbModule: TComboBox + Left = 8 + Top = 91 + Width = 264 + Height = 21 + ItemHeight = 13 + TabOrder = 3 + end + end + object GroupBox2: TGroupBox + Left = 10 + Top = 152 + Width = 420 + Height = 71 + Caption = 'Print Range' + TabOrder = 1 + object staticRange: TLabel + Left = 8 + Top = 16 + Width = 46 + Height = 13 + Caption = 'Verse List' + end + object editStart: TEdit + Left = 8 + Top = 31 + Width = 264 + Height = 21 + Hint = + 'Examples:'#13#10'John 1:1 Prints John ' + + 'chapter 1 verse 1'#13#10'John 1 Pri' + + 'nts the entire first chapter of John'#13#10'John 1,2 ' + + ' Prints chapters 1 and 2 of John'#13#10'John 3:16;Rom 3:' + + '23 Prints John 3:16 and Romans 3:23' + ParentShowHint = False + ShowHint = True + TabOrder = 0 + end + end + end + object shtSetup: TTabSheet + Caption = 'Page Setup' + ImageIndex = 1 + object GroupBox4: TGroupBox + Left = 8 + Top = 8 + Width = 204 + Height = 153 + Caption = 'Margins (Inches)' + TabOrder = 0 + object labelLeft: TLabel + Left = 15 + Top = 38 + Width = 21 + Height = 13 + Caption = 'Left:' + end + object labelBot: TLabel + Left = 122 + Top = 91 + Width = 36 + Height = 13 + Caption = 'Bottom:' + end + object labelRight: TLabel + Left = 123 + Top = 40 + Width = 28 + Height = 13 + Caption = 'Right:' + end + object labelTop: TLabel + Left = 15 + Top = 88 + Width = 22 + Height = 13 + Caption = 'Top:' + end + object editLeft: TEdit + Left = 15 + Top = 53 + Width = 44 + Height = 21 + TabOrder = 0 + Text = '0.50' + end + object spinLeft: TUpDown + Left = 59 + Top = 53 + Width = 17 + Height = 21 + Min = 0 + Position = 50 + TabOrder = 1 + Thousands = False + Wrap = False + OnClick = spinLeftClick + end + object editBottom: TEdit + Left = 122 + Top = 105 + Width = 44 + Height = 21 + TabOrder = 2 + Text = '0.75' + end + object spinBottom: TUpDown + Left = 166 + Top = 105 + Width = 17 + Height = 21 + Min = 0 + Position = 50 + TabOrder = 3 + Wrap = False + OnClick = spinBottomClick + end + object spinRight: TUpDown + Left = 166 + Top = 55 + Width = 17 + Height = 21 + Min = 0 + Position = 50 + TabOrder = 4 + Wrap = False + OnClick = spinRightClick + end + object editRight: TEdit + Left = 122 + Top = 55 + Width = 44 + Height = 21 + TabOrder = 5 + Text = '0.50' + end + object spinTop: TUpDown + Left = 59 + Top = 103 + Width = 17 + Height = 21 + Min = 0 + Position = 50 + TabOrder = 6 + Wrap = False + OnClick = spinTopClick + end + object editTop: TEdit + Left = 15 + Top = 103 + Width = 44 + Height = 21 + TabOrder = 7 + Text = '0.50' + end + end + object GroupBox5: TGroupBox + Left = 221 + Top = 8 + Width = 209 + Height = 153 + Caption = 'Header/Foooter' + TabOrder = 1 + object labelHeader: TLabel + Left = 10 + Top = 39 + Width = 59 + Height = 13 + Caption = 'Header Text' + Enabled = False + end + object labelFooter: TLabel + Left = 10 + Top = 104 + Width = 54 + Height = 13 + Caption = 'Footer Text' + Enabled = False + end + object editHeader: TEdit + Left = 10 + Top = 54 + Width = 183 + Height = 21 + Enabled = False + TabOrder = 0 + Text = '&d' + end + object editFooter: TEdit + Left = 10 + Top = 120 + Width = 183 + Height = 21 + Enabled = False + TabOrder = 1 + Text = 'Page &p of &t' + end + object ckHeader: TCheckBox + Left = 10 + Top = 19 + Width = 97 + Height = 17 + Caption = 'Print Header' + Enabled = False + TabOrder = 2 + OnClick = ckHeaderClick + end + object ckFooter: TCheckBox + Left = 10 + Top = 84 + Width = 97 + Height = 17 + Caption = 'Print Footer' + Enabled = False + TabOrder = 3 + OnClick = ckFooterClick + end + end + end + object shtFormat: TTabSheet + Caption = 'Formatting Options' + ImageIndex = 2 + object GroupBox3: TGroupBox + Left = 8 + Top = 8 + Width = 425 + Height = 201 + Caption = 'Font and Size' + TabOrder = 0 + object Label10: TLabel + Left = 8 + Top = 20 + Width = 83 + Height = 13 + Caption = 'Chapter Heading:' + end + object Label11: TLabel + Left = 8 + Top = 46 + Width = 51 + Height = 13 + Caption = 'Body Text:' + end + object Label12: TLabel + Left = 8 + Top = 73 + Width = 75 + Height = 13 + Caption = 'Verse Numbers:' + end + object labelFont: TLabel + Left = 173 + Top = 18 + Width = 43 + Height = 13 + Caption = 'labelFont' + end + object UpDown5: TUpDown + Left = 147 + Top = 16 + Width = 16 + Height = 21 + Associate = editHeading + Min = 10 + Max = 24 + Position = 16 + TabOrder = 0 + Wrap = False + end + object editHeading: TEdit + Left = 103 + Top = 16 + Width = 44 + Height = 21 + TabOrder = 1 + Text = '16' + end + object UpDown6: TUpDown + Left = 147 + Top = 42 + Width = 16 + Height = 21 + Associate = editBody + Min = 8 + Max = 20 + Position = 12 + TabOrder = 2 + Wrap = False + end + object editBody: TEdit + Left = 103 + Top = 42 + Width = 44 + Height = 21 + TabOrder = 3 + Text = '12' + end + object UpDown7: TUpDown + Left = 147 + Top = 69 + Width = 16 + Height = 21 + Associate = editNumbers + Min = 6 + Max = 20 + Position = 10 + TabOrder = 4 + Wrap = False + end + object editNumbers: TEdit + Left = 103 + Top = 69 + Width = 44 + Height = 21 + TabOrder = 5 + Text = '10' + end + object pnlFontComboBox: TPanel + Left = 173 + Top = 34 + Width = 148 + Height = 29 + BevelOuter = bvNone + Caption = 'Font ComboBox' + TabOrder = 6 + end + object ckChHead: TCheckBox + Left = 8 + Top = 125 + Width = 105 + Height = 17 + Caption = 'Chapter Headings' + TabOrder = 7 + end + object ckPrefix: TCheckBox + Left = 144 + Top = 146 + Width = 161 + Height = 17 + Caption = 'Prefixed (John 1:1 KJV)...' + TabOrder = 8 + end + object ckParagraph: TCheckBox + Left = 8 + Top = 146 + Width = 113 + Height = 17 + Caption = 'Paragraph Format' + TabOrder = 9 + end + object ckPostfix: TCheckBox + Left = 144 + Top = 168 + Width = 161 + Height = 17 + Caption = 'Postfixed ...(John 1:1 KJV)' + TabOrder = 10 + end + object ckVSNum: TCheckBox + Left = 144 + Top = 104 + Width = 105 + Height = 17 + Caption = 'Verse Numbers' + TabOrder = 11 + OnClick = ckVSNumClick + end + object ckSuperVS: TCheckBox + Left = 168 + Top = 125 + Width = 97 + Height = 17 + Caption = 'Superscripted' + Enabled = False + TabOrder = 12 + end + object ckBookHead: TCheckBox + Left = 8 + Top = 104 + Width = 81 + Height = 17 + Caption = 'Book Name' + TabOrder = 13 + end + end + end + end + object PrinterSetupDialog: TPrinterSetupDialog + Left = 496 + Top = 160 + end +end diff --git a/apps/windoze/CBuilder5/BibleCS/PrintFrm.h b/apps/windoze/CBuilder5/BibleCS/PrintFrm.h new file mode 100644 index 0000000..d358e9b --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/PrintFrm.h @@ -0,0 +1,117 @@ +//--------------------------------------------------------------------------- + +#ifndef PrintFrmH +#define PrintFrmH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <Buttons.hpp> +#include <ComCtrls.hpp> +#include <ExtCtrls.hpp> +#include <Menus.hpp> +#include "RxRichEditX.h" +#include <Dialogs.hpp> +#include "RxCombos.hpp" +#include <swmodule.h> + +typedef struct tagTPageOffset { + long int Start; + long int End; + RECT rendRect; +} TPageOffsets; + +//--------------------------------------------------------------------------- +class TPrintForm : public TForm +{ +__published: // IDE-managed Components + TPanel *Panel1; + TPageControl *PageControl1; + TTabSheet *shtSelection; + TTabSheet *shtSetup; + TBitBtn *btnPrint; + TBitBtn *btnSetup; + TBitBtn *btnPreview; + TBitBtn *btnClose; + TGroupBox *GroupBox1; + TRadioButton *radText; + TRadioButton *radComm; + TRadioButton *radLD; + TGroupBox *GroupBox2; + TEdit *editStart; + TLabel *staticRange; + TComboBox *cmbModule; + TLabel *lblModName; + TGroupBox *GroupBox3; + TGroupBox *GroupBox4; + TGroupBox *GroupBox5; + TLabel *labelLeft; + TLabel *labelBot; + TLabel *labelRight; + TLabel *labelTop; + TEdit *editLeft; + TUpDown *spinLeft; + TEdit *editBottom; + TUpDown *spinBottom; + TEdit *editTop; + TUpDown *spinTop; + TEdit *editRight; + TUpDown *spinRight; + TLabel *labelHeader; + TLabel *labelFooter; + TEdit *editHeader; + TEdit *editFooter; + TLabel *Label10; + TLabel *Label11; + TLabel *Label12; + TUpDown *UpDown5; + TEdit *editHeading; + TUpDown *UpDown6; + TEdit *editBody; + TUpDown *UpDown7; + TEdit *editNumbers; + TPrinterSetupDialog *PrinterSetupDialog; + TLabel *labelFont; + TPanel *pnlFontComboBox; + TCheckBox *ckChHead; + TCheckBox *ckPrefix; + TCheckBox *ckParagraph; + TCheckBox *ckPostfix; + TCheckBox *ckVSNum; + TCheckBox *ckSuperVS; + TTabSheet *shtFormat; + TCheckBox *ckBookHead; + TCheckBox *ckHeader; + TCheckBox *ckFooter; + void __fastcall FormShow(TObject *Sender); + void __fastcall btnCloseClick(TObject *Sender); + void __fastcall radTextClick(TObject *Sender); + void __fastcall radCommClick(TObject *Sender); + void __fastcall radLDClick(TObject *Sender); + void __fastcall spinLeftClick(TObject *Sender, TUDBtnType Button); + void __fastcall spinRightClick(TObject *Sender, TUDBtnType Button); + void __fastcall spinBottomClick(TObject *Sender, TUDBtnType Button); + void __fastcall spinTopClick(TObject *Sender, TUDBtnType Button); + void __fastcall btnPrintClick(TObject *Sender); + void __fastcall OnPrint(TRxRichEdit* rtfPrint); + void __fastcall btnSetupClick(TObject *Sender); + void __fastcall BitBtn5Click(TObject *Sender); + void __fastcall btnPreviewClick(TObject *Sender); + void __fastcall ckHeaderClick(TObject *Sender); + void __fastcall ckFooterClick(TObject *Sender); + void __fastcall ckVSNumClick(TObject *Sender); +private: // User declarations +public: // User declarations + TFontComboBox *cmbFont; + TRxRichEditX* rtfPrint; + __fastcall TPrintForm(TComponent* Owner); + void FillModuleCombo(); + void SetHint(); + void PrepareRTF(); + void SetDefaultOps(); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TPrintForm *PrintForm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/BibleCS/RangeMaintFrm.h b/apps/windoze/CBuilder5/BibleCS/RangeMaintFrm.h new file mode 100644 index 0000000..e279783 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/RangeMaintFrm.h @@ -0,0 +1,64 @@ +//--------------------------------------------------------------------------- + +#ifndef RangeMaintFrmH +#define RangeMaintFrmH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <Buttons.hpp> +#include <ExtCtrls.hpp> +#include <swconfig.h> +//--------------------------------------------------------------------------- +class TRangeMaintForm : public TForm +{ +__published: // IDE-managed Components + TPanel *Panel4; + TSpeedButton *SpeedButton3; + TSpeedButton *SpeedButton4; + TPanel *Panel2; + TPanel *Panel1; + TPanel *Panel3; + TSpeedButton *SpeedButton1; + TSpeedButton *SpeedButton2; + TListBox *ListBox1; + TPanel *Panel5; + TLabel *Label1; + TLabel *Label2; + TEdit *NameEdit; + TEdit *TextEdit; + TPanel *Panel6; + TListBox *ListBox2; + TLabel *Label3; + void __fastcall FormShow(TObject *Sender); + void __fastcall FormClose(TObject *Sender, TCloseAction &Action); + void __fastcall SpeedButton4Click(TObject *Sender); + void __fastcall ListBox1Click(TObject *Sender); + void __fastcall NameEditChange(TObject *Sender); + void __fastcall TextEditChange(TObject *Sender); + void __fastcall SpeedButton2Click(TObject *Sender); + void __fastcall SpeedButton1Click(TObject *Sender); + void __fastcall SpeedButton3Click(TObject *Sender); + void __fastcall Button1Click(TObject *Sender); +private: // User declarations + SWConfig *config; +public: // User declarations + __fastcall TRangeMaintForm(TComponent* Owner); +}; + +class TCustomRange : public TObject { +public: + string name; + string text; + TCustomRange(const char *name, const char *text) { + this->name = name; + this->text = text; + } +}; + + +//--------------------------------------------------------------------------- +extern PACKAGE TRangeMaintForm *RangeMaintForm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp new file mode 100644 index 0000000..52876ab --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.cpp @@ -0,0 +1,860 @@ +//--------------------------------------------------------------------------- + +#include <vcl.h> +#pragma hdrstop + +#include "RxRichEditX.h" +#include <clipbrd.hpp> +#include <swdisprtf.h> +#include <swdisprtfchap.h> +#include "mainfrm.h" +#include <localemgr.h> +#include <unicodertf.h> + +char TRxRichEditX::platformID = 0; + +TRxRichEditX::TRxRichEditX(TWinControl *parent) : TRxRichEdit(parent) +{ + OSVERSIONINFO osvi; + memset(&osvi, 0, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + platformID = osvi.dwPlatformId; + type = "Default"; +} + +void TRxRichEditX::RenderModule(SWModule* module, RTF_FORMAT format) +{ + format_ops = format; + + TMemoryStream* RTFStream = new TMemoryStream(); + AnsiString rtfText = "{\\rtf1\\ansi{\\fonttbl{\\f0\\fdecor\\fprq2 "; + rtfText += format_ops.fontFace; + rtfText += ";}}{\\colortbl;\\red0\\green0\\blue0;}"; + rtfText += "{\\fs8\\cf1\\par\\pard} "; + + //if(!strcmp(module->Type(), "Biblical Texts")) + rtfText += GetFormattedBible(module); + /* + else if(!strcmp(module->Type(), "Commentaries")) + rtfText += GetFormattedComm(module); + else if(!strcmp(module->Type(), "Lexicons / Dictionaries")) + rtfText += GetFormattedLD(module); + else + rtfText += GetFormattedBook(module); + */ + rtfText += "{ \\par }}"; + RTFStream->Clear(); + RTFStream->WriteBuffer(rtfText.c_str(), rtfText.Length()); + RTFStream->Position = 0; + Lines->LoadFromStream(RTFStream); + delete RTFStream; + + // clear HTML link tags + while (true) { + int start, len, foundAt, endAt; + + start = (SelLength) ? SelStart + SelLength : 0; + len = Text.Length() - start; + foundAt = this->SearchText("<a href=\"\">", start, len, TRichSearchTypes()); + if (foundAt == -1) + break; + + SelStart = foundAt; + SelLength = 11; + this->SelText = ""; + endAt = this->SearchText("</a>", foundAt, len, TRichSearchTypes()); + if (foundAt == -1) + break; + SelStart = endAt; + SelLength = 4; + this->SelText = ""; + SelStart = foundAt; + SelLength = endAt - foundAt; + //this->SelAttributes->Link = true; + } + SelLength = 0; +} + +AnsiString TRxRichEditX::GetFormattedBible(SWModule* module) +{ + AnsiString rtfText = ""; + VerseKey key; + int lastChap, lastBook; + AnsiString bookName; + + key = (VerseKey)module->Key(); + lastChap = key.Chapter(); + lastBook = key.Book(); + bookName = (AnsiString)key.getText(); + bookName = bookName.SubString(0,bookName.Pos(lastChap) - 2); + + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, bookName); + + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, lastChap); + + for ((*module) = TOP; !module->Error(); (*module)++){ + key = (VerseKey)module->Key(); + if(key.Book() != lastBook){ + rtfText += "\\par\\par"; + bookName = (AnsiString)key.getText(); + bookName = bookName.SubString(0,bookName.Pos(key.Chapter()) - 2); + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, bookName); + lastBook = key.Book(); + lastChap = -1; // Reset the last Chapter since we could jump from Jude 1 to Revelation 1 + } + if(key.Chapter() != lastChap){ + rtfText += "\\par"; + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, key.Chapter()); + lastChap = key.Chapter(); + } + rtfText += PrintEntry(module, key.Verse()); + } + + return rtfText; +} +/* +AnsiString TRxRichEditX::GetFormattedComm(SWModule* module) +{ + AnsiString rtfText = ""; + VerseKey key; + int lastChap; + AnsiString lastBook; + + key = (VerseKey)module->Key(); + lastChap = key.Chapter(); + lastBook = (AnsiString)key.Book(); + + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, lastBook); + + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, lastChap); + + for ((*module) = TOP; !module->Error(); (*module)++){ + key = (VerseKey)module->Key(); + if((AnsiString)key.Book() == lastBook){ + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, lastBook); + lastBook = key.Book(); + } + if(key.Chapter() != lastChap){ + rtfText += "\\par\\par"; + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, key.Chapter()); + lastChap = key.Chapter(); + } + rtfText += PrintEntry(module, key.Verse()); + } + + return rtfText; +} + +AnsiString TRxRichEditX::GetFormattedLD(SWModule* module) +{ + AnsiString rtfText = ""; + VerseKey key; + int lastChap; + AnsiString lastBook; + + key = (VerseKey)module->Key(); + lastChap = key.Chapter(); + lastBook = (AnsiString)key.Book(); + + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, lastBook); + + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, lastChap); + + for ((*module) = TOP; !module->Error(); (*module)++){ + key = (VerseKey)module->Key(); + if((AnsiString)key.Book() == lastBook){ + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, lastBook); + lastBook = key.Book(); + } + if(key.Chapter() != lastChap){ + rtfText += "\\par\\par"; + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, key.Chapter()); + lastChap = key.Chapter(); + } + rtfText += PrintEntry(module, key.Verse()); + } + + return rtfText; +} + +AnsiString TRxRichEditX::GetFormattedBook(SWModule* module) +{ + AnsiString rtfText = ""; + VerseKey key; + int lastChap; + AnsiString lastBook; + + key = (VerseKey)module->Key(); + lastChap = key.Chapter(); + lastBook = (AnsiString)key.Book(); + + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, lastBook); + + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, lastChap); + + for ((*module) = TOP; !module->Error(); (*module)++){ + key = (VerseKey)module->Key(); + if((AnsiString)key.Book() == lastBook){ + rtfText += "\\par\\par"; + if(format_ops.prBookHeadings) + rtfText += BookHeading(module, lastBook); + lastBook = key.Book(); + } + if(key.Chapter() != lastChap){ + rtfText += "\\par\\par"; + if(format_ops.prChHeadings) + rtfText += ChapterHeading(module, key.Chapter()); + lastChap = key.Chapter(); + } + rtfText += PrintEntry(module, key.Verse()); + } + + return rtfText; +} +*/ +AnsiString TRxRichEditX::PrintEntry(SWModule* module, int nVerse) +{ + AnsiString rtfText = ""; + if (module->Direction() == DIRECTION_RTL) { + rtfText += "\\qr "; + }else + rtfText += "\\ql "; + if (module->Direction() == DIRECTION_RTL && (platformID == WINNT && (!strnicmp(module->Lang(), "he", 2) || !strnicmp(module->Lang(), "ar", 2)))) { + rtfText = rtfText + "\\rtlpar "; + } + + if(!format_ops.paragraph) + rtfText += "\\par"; + if(format_ops.prPreFix) + rtfText += PrintFix(module) + (AnsiString)" "; + + if(format_ops.prVerseNum){ + rtfText += (AnsiString)"{\\fs" + format_ops.vsNumFontSize; + if(format_ops.superVSNum) + rtfText += "\\super "; + else rtfText += " "; + rtfText += IntToStr(nVerse); + rtfText += " }"; + } + rtfText += (AnsiString)"{\\fs" + format_ops.bodyFontSize + (AnsiString)" "; + rtfText += module->RenderText(); + rtfText += " }"; + if(format_ops.prPostFix) + rtfText += (AnsiString)" " + PrintFix(module); + + return rtfText; +} + +AnsiString TRxRichEditX::ChapterHeading(SWModule* module, int nChapter) +{ + AnsiString rtfText = ""; + rtfText += (AnsiString)" \\qc{\\f1\\cf7\\fs" + format_ops.bkFontHeadSize + (AnsiString)"\\b "; + rtfText += _tr("Chapter"); + rtfText += " "; + rtfText += IntToStr(nChapter); + rtfText += "\\par\\par}"; + return rtfText; +} + +AnsiString TRxRichEditX::BookHeading(SWModule* module, AnsiString name) +{ + AnsiString rtfText = ""; + rtfText += (AnsiString)" \\qc{\\f1\\cf7\\fs" + format_ops.bkFontHeadSize + (AnsiString)"\\b\\ul "; + rtfText += name; + rtfText += "\\par\\par}"; + return rtfText; +} + + +AnsiString TRxRichEditX::PrintFix(SWModule* module) +{ + AnsiString rtfText = ""; + rtfText += (AnsiString)"{\\fs" + format_ops.vsNumFontSize; + rtfText += (AnsiString)"(" + (AnsiString)module->KeyText() + (AnsiString)" " + (AnsiString)module->Name() + (AnsiString)")}"; + return rtfText; +} + + +int TRxRichEditX::paintTo(HDC hdc, TRect *size, int margin) { + TFormatRange Range; + int LastChar, MaxLen, LogX, LogY, OldMap; + TRect SaveRect; + TGetTextLengthEx TextLenEx; + bool calcBestSize = (size) ? IsRectEmpty(size): true; + TRect trySizeRect[] = { + TRect(0, 0, 200, 50), + TRect(0, 0, 200, 100), + TRect(0, 0, 250, 100), + TRect(0, 0, 300, 50), + TRect(0, 0, 300, 100), + TRect(0, 0, 350, 100), + TRect(0, 0, 400, 50), + TRect(0, 0, 400, 100), + TRect(0, 0, 400, 150), + TRect(0, 0, 400, 200), + TRect(0, 0, 500, 100), + TRect(0, 0, 500, 150), + TRect(0, 0, 500, 200), + TRect(0, 0, 500, 250), + TRect(0, 0, 550, 300), + TRect(0, 0, 550, 350), + TRect(0, 0, 0, 0) + }; + int trySize = 0; + TRect *dispSize = size; + + LogX = GetDeviceCaps(hdc, LOGPIXELSX); + LogY = GetDeviceCaps(hdc, LOGPIXELSY); + + do { + + if (calcBestSize) { + dispSize = &trySizeRect[trySize++]; + if (IsRectEmpty(dispSize)) { + dispSize = &trySizeRect[trySize-2]; + break; + } + } + + memset(&Range, 0, sizeof(TFormatRange)); + // with Printer, Range do begin + Range.hdc = hdc; + Range.hdcTarget = Range.hdc; +// if (IsRectEmpty(&PageRect)) { +// Range.rc.right = dispSize->Right * 1440 / LogX; +// Range.rc.bottom = dispSize->Bottom * 1440 / LogY; +// } +// else { + Range.rc.left = (dispSize->Left + margin) * 1440 / LogX; + Range.rc.top = (dispSize->Top + margin) * 1440 / LogY; + Range.rc.right = dispSize->Right * 1440 / LogX; + Range.rc.bottom = (dispSize->Bottom)* 1440 / LogY; +// } + Range.rcPage = Range.rc; + SaveRect = Range.rc; +// Range.rcPage.top = Range.rcPage.top + (5 * 1440) / LogY; +// Range.rcPage.bottom = Range.rcPage.bottom + (5 * 1440) / LogY; + LastChar = 0; + if (RichEditVersion >= 2) { + // with TextLenEx do begin + TextLenEx.flags = GTL_DEFAULT; + TextLenEx.codepage = CP_ACP; + MaxLen = Perform(EM_GETTEXTLENGTHEX, (WPARAM)&TextLenEx, 0); + } + else MaxLen = GetTextLen(); + Range.chrg.cpMax = -1; + // { ensure printer DC is in text map mode } + OldMap = SetMapMode(hdc, MM_TEXT); + SendMessage(Handle, EM_FORMATRANGE, 0, 0); // { flush buffer } + try { + Range.rc = SaveRect; + Range.chrg.cpMin = LastChar; + LastChar = SendMessage(Handle, EM_FORMATRANGE, 1, Longint(&Range)); +// if ((LastChar < MaxLen) && (LastChar != -1)) ;//NewPage(); + // } while ((LastChar >= MaxLen) || (LastChar = -1)); + } + __finally { + SendMessage(Handle, EM_FORMATRANGE, 0, 0);// { flush buffer } + SetMapMode(hdc, OldMap); // { restore previous map mode } + } + LastChar = (LastChar < 0) ? 0: MaxLen - LastChar; + LastChar = (LastChar < 0) ? 0: LastChar; + } while (LastChar && calcBestSize); + + if (calcBestSize && size) + *size = *dispSize; + + return LastChar; +} + + +void TRxRichEditX::fillWithRTFString(SWModule *module, const char *text, const char *type) { + + TMemoryStream *RTFStream = new TMemoryStream(); + System::AnsiString newtext, tmptext; + + this->module = module; + this->type = type; + recalcAppearance(); + + newtext = RTFHeader; + newtext += RTFHeadMargin; + newtext += "\\pard \\nowidctlpar \\cf7\\f0 "; + + newtext += "{"; + + tmptext = ""; + for (const char *loop = text; *loop; loop++) { + if (*loop == '\n') { + tmptext += "\\par "; + } + else tmptext += *loop; + } + newtext += RTFVersePre + tmptext + RTFVersePost; + newtext += "}"; + + newtext += RTFTrailer; + + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.Length()); + RTFStream->Position = 0; + Lines->LoadFromStream(RTFStream); + Repaint(); + + delete RTFStream; +} + + +void TRxRichEditX::fillWithVerses(SWModule *module, ListKey *verses, bool heading, bool verseNum, const char *type, bool stripNewlines) { + string fontname; + TMemoryStream *RTFStream = new TMemoryStream(); + System::AnsiString newtext, tmptext; + + this->module = module; + this->type = type; + recalcAppearance(); + + newtext = RTFHeader; + + newtext += RTFHeadMargin; +// newtext += "\\pard\\nowidctlpar\\cf7\\f0 "; + + if (module->Direction() == DIRECTION_RTL) { + newtext += "\\qr "; + } + if (module->Direction() == DIRECTION_RTL && (platformID == WINNT && (!strnicmp(module->Lang(), "he", 2) || !strnicmp(module->Lang(), "ar", 2)))) { + newtext += "\\rtlpar "; + } + + verses->Persist(1); + SWKey *saveKey = (*module); + if (!saveKey->Persist()) + saveKey = 0; + module->SetKey(verses); + + SWKey *lastKey = 0; + bool first = true; + while (!module->Error() && newtext.Length() < 10000 ) { + SWKey *testKey = verses->GetElement(); + VerseKey *element = SWDYNAMIC_CAST(VerseKey, testKey); + if (heading) { + if (element) { + if (lastKey != element) { + if (!first) + newtext += "\\par\\par "; + newtext += RTFHeadingPre; + newtext += ((string(element->LowerBound()) + " - " + string(element->UpperBound())).c_str()); + newtext += ":"; + newtext += RTFHeadingPost; + newtext += "\\par "; + } + } + else { + if (!first) + newtext += "\\par\\par "; + newtext += RTFHeadingPre; + newtext += module->KeyText(); + newtext += ":"; + newtext += RTFHeadingPost; + newtext += "\\par "; + } +// newtext += RTFHeadingPost; + } + else { // hack to make searchlist entries fit in box better + newtext += ""; + } + lastKey = element; + first = false; + + newtext = newtext + "{"; + + tmptext = ""; + for (const char *loop = (const char *)*module; *loop; loop++) { + if (stripNewlines) { + if (!strnicmp(loop, "\\par", 4)) { + loop += (loop[4] == 'd') ? 4 : 3; + continue; + } + } + if (*loop == '\n') { + if (!stripNewlines) + tmptext += "\\par "; + } + else tmptext += *loop; + + } + + if (tmptext.Length() > 3) { // make sure we have an entry + if (module->Direction() == DIRECTION_RTL && (SWDispRTFChap::platformID == WIN9X || (module->Lang() && strnicmp(module->Lang(), "he", 2) && strnicmp(module->Lang(), "ar", 2)))) { + newtext = newtext + RTFVersePre + tmptext + RTFVersePost; + if (verseNum) + newtext = newtext + RTFVerseMarkPre + IntToStr(VerseKey(module->KeyText()).Verse()) + RTFVerseMarkPost; + newtext = newtext + "\\par "; + } + else { + if (verseNum) + newtext = newtext + RTFVerseMarkPre + IntToStr(VerseKey(module->KeyText()).Verse()) + RTFVerseMarkPost; + newtext = newtext + RTFVersePre + tmptext + RTFVersePost; + } + } + newtext = newtext + "}"; + (*module)++; + } + + if (saveKey) + module->SetKey(saveKey); + + newtext += RTFTrailer; + + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.Length()); + RTFStream->Position = 0; + Lines->LoadFromStream(RTFStream); + Repaint(); + + delete RTFStream; +} + + + +void TRxRichEditX::getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*, const char *type*/) { + + + string keyBackColor = (string)getType().c_str() + "BackColor"; + string backColor = Form1->optionsconf->Sections["Appearance"][keyBackColor]; + // This portion of the code sets the default values (If needed) of the background + // for either typical windows or for popup windows + if (backColor == "") { + if (getType() == "Popup") { + attribs->backColor = 14680063; + } + else attribs->backColor = clWindow; + } + else attribs->backColor = StrToInt((AnsiString)backColor.c_str()); + + string keyFontColor = (string)getType().c_str() + "FontColor"; + string fontColor = Form1->optionsconf->Sections["Appearance"][keyFontColor]; + // This portion of the code sets the default values (If needed) of the background + // for either typical windows or for popup windows + if (backColor == "") { + attribs->fontColor = clBlack; + } + else attribs->fontColor = StrToInt((AnsiString)fontColor.c_str()); + + // If the module uses it's own font load that else we will try the config file else we will use the default + ConfigEntMap::const_iterator eit = module->getConfig().find("Font"); + if (eit != module->getConfig().end()) + attribs->fontName = (*eit).second.c_str(); + else { + string keyFontName = (string)getType().c_str() + "FontName"; + attribs->fontName = (AnsiString)Form1->optionsconf->Sections["Appearance"][keyFontName].c_str(); + } + // If we still have no name we will set it to a default value + if (attribs->fontName == "") + attribs->fontName = "MS Sans Serif"; + + string keyFontSize = (string)getType().c_str() + "FontSize"; + string fontSize = Form1->optionsconf->Sections["Appearance"][keyFontSize]; + if (fontSize == "") + attribs->fontSize = 10; + else attribs->fontSize = StrToInt((AnsiString)fontSize.c_str()); + + string entryColor = Form1->optionsconf->Sections["Appearance"]["CurrentVSColor"]; + if (entryColor == "") + attribs->entryKeyColor = clBlue; + else attribs->entryKeyColor = StrToInt((AnsiString)entryColor.c_str()); + + string morphColor = Form1->optionsconf->Sections["Appearance"]["MorphColor"]; + if (morphColor == "") + attribs->morphColor = clBlue; + else attribs->morphColor = StrToInt((AnsiString)morphColor.c_str()); + + string strongColor = Form1->optionsconf->Sections["Appearance"]["StrongsColor"]; + if (strongColor == "") + attribs->strongsColor = clBlue; + else attribs->strongsColor = StrToInt((AnsiString)strongColor.c_str()); + + string fieldColor = Form1->optionsconf->Sections["Appearance"]["FieldColor"]; + if (fieldColor == "") + attribs->lookupFieldColor = clBlue; + else attribs->lookupFieldColor = StrToInt((AnsiString)fieldColor.c_str()); + + string autoVSColor = Form1->optionsconf->Sections["Appearance"]["AutoVSColor"]; + if (autoVSColor == "") + attribs->markCurrentVerse = true; + else attribs->markCurrentVerse = (atoi(autoVSColor.c_str())) ? true : false; +} + + +void TRxRichEditX::recalcAppearance() { + + char buf[4096]; + + getDisplayPrefs(&dispAttribs, module /*, type.c_str()*/); + + Color = dispAttribs.backColor; + Font->Name = dispAttribs.fontName; + Font->Size = dispAttribs.fontSize; + + RTFHeadMargin = "{\\cf1\\pard}"; + RTFVerseMarkPost = "}"; + RTFVersePost = " }"; + + buildRTFHeader(); + + // build headers with proportional font sizes to single user selected + // font size. + double fontBase = dispAttribs.fontSize; + fontBase /= 4.0; + + sprintf(buf, + "{\\fs%d \\par }}", + (int)(fontBase * 8)); + RTFTrailer = buf; + + const char *chap = _tr("Chapter"); + sprintf(buf, + "\\pard \\qc\\nowidctlpar{\\f1\\cf7\\fs%d\\b %s ", + (int)(fontBase * 10), chap); + RTFChapterMarkPre = buf; + + sprintf(buf, + "\\par\\fs%d\\par}", + (int)(fontBase * 4)); + RTFChapterMarkPost = buf; + + sprintf(buf, + "{\\fs%d\\cf1\\b ", + (int)(fontBase * 7)); + RTFHeadingPre = buf; + RTFHeadingPost = "}"; + sprintf(buf, + "{\\fs%d\\cf1\\super ", + (int)(fontBase * 7)); + RTFVerseMarkPre = buf; + + sprintf(buf, + "{\\fs%d\\cf7 ", + (int)(fontBase * 8)); + RTFVersePre = buf; +} + + +void TRxRichEditX::TColorToRGB(const TColor& color, int& red, int& green, int& blue) { + red = (color & 0xFF); + green = ((color >> 8) & 0xFF); + blue =((color >> 16) & 0xFF); +} + +void TRxRichEditX::buildRTFHeader() { + char buf1[1024], buf2[1024]; + SectionMap::iterator sit; + string value; + ConfigEntMap::iterator entry; + int CurrVSRed, CurrVSGreen, CurrVSBlue, BodyRed, BodyGreen, BodyBlue, + VSNumRed, VSNumGreen, VSNumBlue, MorphRed, MorphGreen, MorphBlue, + StrongsRed, StrongsGreen, StrongsBlue; + TColor CurrVSColor, VSNumColor, BodyColor, MorphColor, StrongsColor; + + sprintf(buf1, "{\\rtf1\\ansi"); + if (dispAttribs.fontName.Length()) { + // Font Table + // 0: Text Body + sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}" , dispAttribs.fontName.c_str()); + strcat(buf1, buf2); + // 1: Chapter Heading + sprintf(buf2, "{\\f1\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str()); + strcat(buf1, buf2); + // 2: Unknown + sprintf(buf2, "{\\f2\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str()); + strcat(buf1, buf2); + // 3: Unknown + sprintf(buf2, "{\\f3\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str()); + strcat(buf1, buf2); + // 4: Unknown + sprintf(buf2, "{\\f4\\froman\\fcharset0\\fprq2 %s;}", dispAttribs.fontName.c_str()); + strcat(buf1, buf2); + // 7, 8: Unknown + strcat(buf1, "{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}"); + } + else { + sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}"); + strcat(buf1, buf2); + } + + if ((sit = Form1->optionsconf->Sections.find("Appearance")) != Form1->optionsconf->Sections.end()) { + ConfigEntMap §ion = (*sit).second; + + CurrVSColor = TColor((((entry = section.find("CurrentVSColor")) != section.end()) ? atoi((*entry).second.c_str()) : 16711680)); + TColorToRGB(CurrVSColor, CurrVSRed, CurrVSGreen, CurrVSBlue); + + VSNumColor = TColor((((entry = section.find("VSNumberColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); + TColorToRGB(VSNumColor, VSNumRed, VSNumGreen, VSNumBlue); + + StrongsColor = TColor((((entry = section.find("StrongsColor")) != section.end()) ? atoi((*entry).second.c_str()) : 16711935)); + TColorToRGB(StrongsColor, StrongsRed, StrongsGreen, StrongsBlue); + + MorphColor = TColor((((entry = section.find("MorphColor")) != section.end()) ? atoi((*entry).second.c_str()) : 60534)); + TColorToRGB(MorphColor, MorphRed, MorphGreen, MorphBlue); + + if (getType() == "Text") { + BodyColor = TColor((((entry = section.find("TextFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); + TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); + } + else if (getType() == "Comment") { + BodyColor = TColor((((entry = section.find("CommentFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); + TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); + } + else if (getType()== "LD") { + BodyColor = TColor((((entry = section.find("LDFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); + TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); + } + else if (getType() == "Popup") { + BodyColor = TColor((((entry = section.find("PopupFontColor")) != section.end()) ? atoi((*entry).second.c_str()) : 0)); + TColorToRGB(BodyColor, BodyRed, BodyGreen, BodyBlue); + } + else { + BodyRed = 0; + BodyGreen = 0; + BodyBlue = 0; + } + + // Color Table: + // 1: Verse Number/ Verse info + sprintf(buf2, "{\\colortbl;\\red%d\\green%d\\blue%d;" , VSNumRed, VSNumGreen, VSNumBlue); + strcat(buf1, buf2); + // 2: Current Verse Color + sprintf(buf2, "\\red%d\\green%d\\blue%d;", CurrVSRed, CurrVSGreen, CurrVSBlue); + strcat(buf1, buf2); + // 3: Strong's Def + sprintf(buf2, "\\red%d\\green%d\\blue%d;", StrongsRed, StrongsGreen, StrongsBlue); + strcat(buf1, buf2); + // 4: Strongs' Tense (Morph) + sprintf(buf2, "\\red%d\\green%d\\blue%d;", MorphRed, MorphGreen, MorphBlue); + strcat(buf1, buf2); + // 5: Unknown + strcat(buf1, "\\red0\\green0\\blue255;"); + // 6: Unknown + strcat(buf1, "\\red255\\green0\\blue0;"); + // 7: Verse/Body Text Color + sprintf(buf2, "\\red%d\\green%d\\blue%d;}",BodyRed, BodyGreen, BodyBlue); + strcat(buf1, buf2); + } + else { + sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;\\red0\\green\\blue0;\\red0\\green\\blue0;\\red0\\green\\blue0;}"); + strcat(buf1, buf2); + } + RTFHeader = buf1; +} + + +AnsiString TRxRichEditX::getType() { + AnsiString retVal; + if (!strcmp(type.c_str(), "Default")) { + if (!strcmp(module->Type(), "Biblical Texts")) + retVal = "Text"; + if ((!strcmp(module->Type(), "Commentaries")) || + (!strcmp(module->Type(), "Generic Books"))) + retVal = "Comment"; + if (!strcmp(module->Type(), "Lexicons / Dictionaries")) + retVal = "LD"; + } + else retVal = type; + + return retVal; +} + + +WideString __fastcall TRxRichEditX::GetText() { + int MaxLen; + + if (RichEditVersion >= 2) { + TGetTextLengthEx TextLenEx; + // with TextLenEx do begin + TextLenEx.flags = GTL_DEFAULT; + TextLenEx.codepage = 1200; + MaxLen = Perform(EM_GETTEXTLENGTHEX, (WPARAM)&TextLenEx, 0); + } + else MaxLen = GetTextLen(); + wchar_t *buf = new wchar_t [ MaxLen + 2 ]; + GETTEXTEX params; + params.cb = (MaxLen + 1) * sizeof(wchar_t); + params.flags = GT_DEFAULT; + params.codepage = 1200; //CP_ACP; + params.lpDefaultChar = 0; + params.lpUsedDefChar = 0; + + LONG lResult; + lResult = SendMessage(Handle, EM_GETTEXTEX, (WPARAM)¶ms, (LPARAM)buf); + WideString Result = buf; + delete [] buf; + return Result; +} + + + + +WideString __fastcall TRxRichEditX::GetTextRange(int StartPos, int EndPos) { + + WideString Result = GetText(); + + Result = Result.SubString(StartPos+1, (EndPos - StartPos)); + return Result; +} + + +WideString TRxRichEditX::Trim(WideString &src) { + WideString Result = src; + int length = Result.Length(); + int start = 1; + while (length) { + if (Result[length] != ' ') + break; + Result.SetLength(--length); + } + while (start < length) { + if (Result[start] != ' ') + break; + start++; + } + if (start > 1) + Result = Result.SubString(start, length - start); + return Result; +} + + +WideString __fastcall TRxRichEditX::WordAtCursor(void) { + + TCharRange Range; + WideString Result = ""; + + if (HandleAllocated()) { + Range.cpMax = SelStart; + if (!Range.cpMax) + Range.cpMin = 0; + else if (SendMessage(Handle, EM_FINDWORDBREAK, WB_ISDELIMITER, Range.cpMax)) + Range.cpMin = SendMessage(Handle, EM_FINDWORDBREAK, WB_MOVEWORDLEFT, Range.cpMax); + else Range.cpMin = SendMessage(Handle, EM_FINDWORDBREAK, WB_LEFT, Range.cpMax); + while (SendMessage(Handle, EM_FINDWORDBREAK, WB_ISDELIMITER, Range.cpMin)) + Range.cpMin++; + Range.cpMax = SendMessage(Handle, EM_FINDWORDBREAK, WB_RIGHTBREAK, Range.cpMax); + Result = Trim(GetTextRange(Range.cpMin, Range.cpMax)); + } + return Result; +} + diff --git a/apps/windoze/CBuilder5/BibleCS/RxRichEditX.h b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.h new file mode 100644 index 0000000..9d117fb --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/RxRichEditX.h @@ -0,0 +1,100 @@ +#ifndef TRxRichEditX_ +#define TRxRichEditX_ + +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <RxRichEdit.hpp> +#include <ExtCtrls.hpp> +#include <swmodule.h> +#include <listkey.h> + + +struct RTF_FORMAT { + AnsiString fontFace; // Font Name + int chFontHeadSize; // Chapter Name Heading Size + int bkFontHeadSize; // Book Name Heading Size + int bodyFontSize; // Body Font Size + int vsNumFontSize; // VerseNumbering or Pre/Post-Fix Size + bool prChHeadings; // Print Heading + bool prBookHeadings; // Print Book Name + bool prPreFix; // Print Verse Prefix (James 1:19 KJV) + bool prPostFix; // Print Verse Postfix + bool prVerseNum; // Print Verse Number + bool paragraph; // Print Bible Text as a paragraph rather than seperate lines + bool superVSNum; // Verse Numbers superscripted +}; + +struct DISP_ATTRIBS { + AnsiString fontName; // Font Name (Type Dependant) + int fontSize; // Font Size (Type Dependant) + bool markCurrentVerse; // whether or not to mark current verse + int backColor; // Background Color (Type Dependant) + int fontColor; // Foreground Color (Type Dependant) + int entryKeyColor; // Verse Number Color (Should be type dependant but isn't yet) + int currentVSColor; // Current Verse Color + int morphColor; // MorphTags Color + int strongsColor; // Strongs Tags Color + int lookupFieldColor; // Lookup Key Fields color +}; + +/* +typedef struct { + TCharRange chrg; + PWideChar lpstrText; +} TTextRangeW; + +*/ +class TRxRichEditX : public TRxRichEdit { +private: + AnsiString GetFormattedBible(SWModule* module); + //AnsiString GetFormattedComm(SWModule* module); + //AnsiString GetFormattedLD(SWModule* module); + //AnsiString GetFormattedBook(SWModule* module); + AnsiString ChapterHeading(SWModule* module, int nChapter); + AnsiString BookHeading(SWModule* module, AnsiString name); + AnsiString PrintEntry(SWModule* module, int nVerse); + AnsiString PrintFix(SWModule* module); + RTF_FORMAT format_ops; + void buildRTFHeader(); + +public: + static char platformID; + static void TColorToRGB(const TColor& color, int& red, int& green, int& blue); + + AnsiString RTFHeader; + AnsiString RTFHeadMargin; + AnsiString RTFTrailer; + + AnsiString RTFChapterMarkPre; + AnsiString RTFChapterMarkPost; + + AnsiString RTFHeadingPre; + AnsiString RTFHeadingPost; + + AnsiString RTFVerseMarkPre; + AnsiString RTFVerseMarkPost; + + AnsiString RTFVersePre; + AnsiString RTFVersePost; + DISP_ATTRIBS dispAttribs; + + TRxRichEditX(TWinControl *parent); + int paintTo(HDC, TRect *size, int margin = 4); + void fillWithVerses(SWModule *module, ListKey *verses, bool heading = true, bool verseNum = true, const char* type = "Default", bool stripNewlines = true); + void fillWithRTFString(SWModule *module, const char *text, const char *type = "Default"); + void getDisplayPrefs(DISP_ATTRIBS *attribs, SWModule *module /*,const char *type = "Default"*/); + void drawTo(HDC dc) { PaintControls(dc, 0); } + void RenderModule(SWModule* module, RTF_FORMAT format); + SWModule *module; + AnsiString type; + void recalcAppearance(); + AnsiString getType(); + static WideString Trim(WideString &src); + WideString __fastcall GetText(); + WideString __fastcall GetTextRange(int StartPos, int EndPos); + WideString __fastcall WordAtCursor(void); +}; + +#endif // TRxRichEditX_ diff --git a/apps/windoze/CBuilder5/BibleCS/TModuleFonts.cpp b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.cpp new file mode 100644 index 0000000..03a2e99 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.cpp @@ -0,0 +1,138 @@ +//--------------------------------------------------------------------------- + +#include <vcl.h> +#pragma hdrstop + +#include "TModuleFonts.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma link "RxCombos" +#pragma resource "*.dfm" + +TModuleFonts *ModuleFonts; +//--------------------------------------------------------------------------- +__fastcall TModuleFonts::TModuleFonts(TComponent* Owner) + : TForm(Owner) +{ + // Put in the RXLib Font combobox component + cmbFontSel = new TFontComboBox(this); + cmbFontSel->Parent = pnlFontComboBox; + cmbFontSel->Align = alClient; +// cmbFontSel->Font->Height = -15; + cmbFontSel->ParentFont = true; + cmbFontSel->UseFonts = true; + cmbFontSel->ItemIndex = cmbFontSel->Items->IndexOf("Arial"); + cmbFontSel->OnChange = cmbFontSelChange; +} +//--------------------------------------------------------------------------- +void __fastcall TModuleFonts::FormShow(TObject *Sender) +{ + FillList(); +} +//--------------------------------------------------------------------------- +void __fastcall TModuleFonts::viewAllClick(TObject *Sender) +{ + viewAll->Checked = true; + viewUnicode->Checked = false; + FillList(); +} +//--------------------------------------------------------------------------- +void __fastcall TModuleFonts::viewUnicodeClick(TObject *Sender) +{ + viewUnicode->Checked = true; + viewAll->Checked = false; + FillList(); +} +//--------------------------------------------------------------------------- + +void TModuleFonts::FillList() +{ + BibleCSMGR *manager; + ModMap::iterator mods; + TTreeNode *node; + string nodeName; + manager = Form1->mainmgr; + + installTree->Items->Clear(); + + if (!manager->configPath) + return; + + for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) { + for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling()) { + if (!strcmp(node->Text.c_str(), mods->second->Type())) { + break; + } + } + if(mods->second->isUnicode() || viewAll->Checked){ + if (!node) { // Add Section + if (!strncmp(mods->second->Type(), "Bibl", 4)) // If Bibles, put first in list + node = installTree->Items->AddChildFirst(0, mods->second->Type()); + else node = installTree->Items->AddChild(0, mods->second->Type()); + } + nodeName = "["; + nodeName += mods->second->Name(); + nodeName += "] "; + nodeName += mods->second->Description(); + node = installTree->Items->AddChildObject(node, nodeName.c_str(), mods->second->Name()); + } + } + //for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling()) + // node->Expand(true); + node = installTree->Items->GetFirstNode(); + if (node) + node->MakeVisible(); + +} +void __fastcall TModuleFonts::installTreeChange(TObject *Sender, + TTreeNode *Node) +{ + TTreeNode* currNode = installTree->Selected; + BibleCSMGR *manager; + AnsiString modName, fontName; + ModMap::iterator it; + manager = Form1->mainmgr; + + if(!currNode->HasChildren){ + modName = currNode->Text.SubString(2, currNode->Text.Pos("]") - 2); + it = manager->Modules.find(modName.c_str()); + fontName = (*it).second->getConfigEntry("Font"); + cmbFontSel->ItemIndex = cmbFontSel->Items->IndexOf(fontName); + } + +} +//--------------------------------------------------------------------------- + +void __fastcall TModuleFonts::cmbFontSelChange(TObject *Sender) +{ + TTreeNode* currNode = installTree->Selected; + BibleCSMGR *manager = Form1->mainmgr; + manager->applyUserPrefs(); + AnsiString modName; + ModMap::iterator it; + if(!currNode->HasChildren){ + modName = currNode->Text.SubString(2, currNode->Text.Pos("]") - 2); + manager->getUserPrefs()[modName.c_str()]["Font"] = cmbFontSel->Items->Strings[cmbFontSel->ItemIndex].c_str(); + } + manager->applyUserPrefs(); +} +//--------------------------------------------------------------------------- + +void __fastcall TModuleFonts::btnResetClick(TObject *Sender) +{ + BibleCSMGR *manager; + SectionMap::iterator sit; + ModMap::iterator it; + manager = Form1->mainmgr; + + sit = manager->getUserPrefs().Sections.begin(); + while(sit != manager->getUserPrefs().Sections.end()) + { + (*sit).second.erase("Font"); + sit++; + } + manager->applyUserPrefs(); +} +//--------------------------------------------------------------------------- + + diff --git a/apps/windoze/CBuilder5/BibleCS/TModuleFonts.dfm b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.dfm new file mode 100644 index 0000000..ca772c4 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.dfm @@ -0,0 +1,156 @@ +object ModuleFonts: TModuleFonts + Left = 523 + Top = 262 + Width = 354 + Height = 462 + Caption = 'Select Module Fonts' + Color = clBtnFace + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + KeyPreview = True + Menu = MainMenu1 + OldCreateOrder = False + Position = poScreenCenter + Scaled = False + OnShow = FormShow + PixelsPerInch = 96 + TextHeight = 13 + object Panel1: TPanel + Left = 0 + Top = 375 + Width = 346 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 0 + object btnReset: TBitBtn + Left = 136 + Top = 8 + Width = 102 + Height = 29 + Anchors = [akRight, akBottom] + Caption = '&Reset All' + TabOrder = 0 + OnClick = btnResetClick + Glyph.Data = { + DE010000424DDE01000000000000760000002800000024000000120000000100 + 0400000000006801000000000000000000001000000000000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333444444 + 33333333333F8888883F33330000324334222222443333388F3833333388F333 + 000032244222222222433338F8833FFFFF338F3300003222222AAAAA22243338 + F333F88888F338F30000322222A33333A2224338F33F8333338F338F00003222 + 223333333A224338F33833333338F38F00003222222333333A444338FFFF8F33 + 3338888300003AAAAAAA33333333333888888833333333330000333333333333 + 333333333333333333FFFFFF000033333333333344444433FFFF333333888888 + 00003A444333333A22222438888F333338F3333800003A2243333333A2222438 + F38F333333833338000033A224333334422224338338FFFFF8833338000033A2 + 22444442222224338F3388888333FF380000333A2222222222AA243338FF3333 + 33FF88F800003333AA222222AA33A3333388FFFFFF8833830000333333AAAAAA + 3333333333338888883333330000333333333333333333333333333333333333 + 0000} + Margin = 1 + NumGlyphs = 2 + end + object btnOK: TBitBtn + Left = 248 + Top = 8 + Width = 94 + Height = 29 + Anchors = [akRight, akBottom] + TabOrder = 1 + Kind = bkOK + end + end + object Panel2: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 334 + Align = alClient + BevelOuter = bvNone + Caption = 'Panel2' + Font.Charset = DEFAULT_CHARSET + Font.Color = clWindowText + Font.Height = -11 + Font.Name = 'MS Sans Serif' + Font.Style = [] + ParentFont = False + TabOrder = 1 + object Panel4: TPanel + Left = 0 + Top = 0 + Width = 346 + Height = 32 + Align = alTop + BevelOuter = bvNone + TabOrder = 0 + object Label1: TLabel + Left = 3 + Top = 8 + Width = 82 + Height = 13 + Caption = 'Installed Modules' + end + end + object installTree: TTreeView + Left = 0 + Top = 32 + Width = 346 + Height = 302 + Align = alClient + Indent = 19 + ReadOnly = True + TabOrder = 1 + OnChange = installTreeChange + end + end + object Panel3: TPanel + Left = 0 + Top = 334 + Width = 346 + Height = 41 + Align = alBottom + BevelOuter = bvNone + TabOrder = 2 + object Label2: TLabel + Left = 7 + Top = 8 + Width = 52 + Height = 13 + Anchors = [akLeft, akBottom] + Caption = 'Font Name' + end + object pnlFontComboBox: TPanel + Left = 85 + Top = 4 + Width = 258 + Height = 25 + Anchors = [akLeft, akTop, akRight] + BevelOuter = bvNone + Caption = 'Font ComboBox' + TabOrder = 0 + end + end + object MainMenu1: TMainMenu + Left = 200 + object menuView: TMenuItem + Caption = '&View' + Checked = True + object viewAll: TMenuItem + Caption = 'Show &All Installed' + GroupIndex = 1 + OnClick = viewAllClick + end + object viewUnicode: TMenuItem + Caption = 'Show &Unicode Only' + Checked = True + GroupIndex = 1 + OnClick = viewUnicodeClick + end + end + end +end diff --git a/apps/windoze/CBuilder5/BibleCS/TModuleFonts.h b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.h new file mode 100644 index 0000000..5579f1c --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/TModuleFonts.h @@ -0,0 +1,56 @@ +//--------------------------------------------------------------------------- + +#ifndef TModuleFontsH +#define TModuleFontsH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <RxCombos.hpp> +#include <Buttons.hpp> +#include <ComCtrls.hpp> +#include <Menus.hpp> +#include <dirent.h> +#include <io.h> +#include <dir.h> +// Sword includes +#include <swmgr.h> +#include <swconfig.h> +#include "mainfrm.h" +#include <ExtCtrls.hpp> + +//--------------------------------------------------------------------------- +class TModuleFonts : public TForm +{ +__published: // IDE-managed Components + TMainMenu *MainMenu1; + TMenuItem *menuView; + TMenuItem *viewAll; + TMenuItem *viewUnicode; + TPanel *Panel1; + TPanel *Panel2; + TPanel *Panel3; + TBitBtn *btnReset; + TBitBtn *btnOK; + TLabel *Label2; + TPanel *pnlFontComboBox; + TPanel *Panel4; + TTreeView *installTree; + TLabel *Label1; + void __fastcall FormShow(TObject *Sender); + void __fastcall viewAllClick(TObject *Sender); + void __fastcall viewUnicodeClick(TObject *Sender); + void __fastcall installTreeChange(TObject *Sender, TTreeNode *Node); + void __fastcall cmbFontSelChange(TObject *Sender); + void __fastcall btnResetClick(TObject *Sender); +private: + void FillList(); +public: // User declarations + TFontComboBox *cmbFontSel; + __fastcall TModuleFonts(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TModuleFonts *ModuleFonts; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/BibleCS/biblecsmgr.cpp b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.cpp new file mode 100644 index 0000000..b2e0ba5 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.cpp @@ -0,0 +1,130 @@ +//--------------------------------------------------------------------------- +#include "BibleCSMGR.h" +#include <swconfig.h> +#include <markupfiltmgr.h> +#ifdef _ICU_ +//#include <utf8arshaping.h> +#include <utf8bidireorder.h> +#include <utf8transliterator.h> +#endif +//--------------------------------------------------------------------------- +BibleCSMGR::BibleCSMGR(TModInstFrm *iModInstFrm) : SWMgr(0, 0, false, new MarkupFilterMgr(FMT_RTF, ENC_RTF)) +{ +#ifdef _ICU_ +// arshaping = new UTF8arShaping(); + bidireorder = new UTF8BiDiReorder(); +// transliterator = new UTF8Transliterator(); +#endif + ModInstFrm = iModInstFrm; + userPrefs = 0; + Load(); + + OSVERSIONINFO osvi; + memset(&osvi, 0, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + platformID = osvi.dwPlatformId; +} + + +BibleCSMGR::~BibleCSMGR() +{ +#ifdef _ICU_ +// if (arshaping) +// delete arshaping; + if (bidireorder) + delete bidireorder; +// if (transliterator) +// delete transliterator; +#endif + if (userPrefs) { + userPrefs->Save(); + delete userPrefs; + } +} + + +void BibleCSMGR::AddRenderFilters(SWModule *module, ConfigEntMap §ion) +{ + string lang; + ConfigEntMap::iterator entry; + + lang = ((entry = section.find("Lang")) != section.end()) ? (*entry).second : (string)"en"; + + if (module->Direction() == DIRECTION_RTL) { +#ifdef _ICU_ +// if (!strnicmp(lang.c_str(), "ar", 2)) { +// module->AddRenderFilter(arshaping); +// } + if (platformID == WIN9X || (strnicmp(lang.c_str(), "he", 2) && strnicmp(lang.c_str(), "ar", 2))) { + module->AddRenderFilter(bidireorder); + + } +#endif + } + SWMgr::AddRenderFilters(module, section); +} + + +char BibleCSMGR::AddModToConfig(int conffd, const char *fname) +{ + SWConfig modconf(fname); + SectionMap::iterator section; + AnsiString abouttext = ""; + int logflag; + TMemoryStream *RTFStream = new TMemoryStream(); + char retval; + + section = modconf.Sections.begin(); + + ModInstFrm->ModText->Caption = ""; + ModInstFrm->ModText->Caption = ModInstFrm->ModText->Caption + "Found new module [ " + (*(*section).second.find("Description")).second.c_str() + " ]. Installing..."; + + abouttext = abouttext + "{\\fs20\\cf0 " + (*(*section).second.find("About")).second.c_str() + " }"; + RTFStream->Clear(); + RTFStream->WriteBuffer(abouttext.c_str(), abouttext.Length()); + RTFStream->Position = 0; + ModInstFrm->AboutText->Lines->LoadFromStream(RTFStream); + delete RTFStream; + + ModInstFrm->ShowModal(); + + logflag = SWLog::systemlog->getLogLevel(); + SWLog::systemlog->setLogLevel(0); + retval = SWMgr::AddModToConfig(conffd, fname); + SWLog::systemlog->setLogLevel(logflag); + + return retval; +} + +signed char BibleCSMGR::Load () { + signed char retval = SWMgr::Load(); +#ifdef _ICU_ +// optionFilters.insert(FilterMap::value_type("UTF8Transliterator", transliterator)); +// options.push_back(transliterator->getOptionName()); +#endif + userPrefs = new SWConfig("./userprefs.conf"); + applyUserPrefs(); + return retval; +}; + +void BibleCSMGR::applyUserPrefs() { + (*config) += (*userPrefs); +} + +void BibleCSMGR::AddGlobalOptions (SWModule * module, ConfigEntMap & section, + ConfigEntMap::iterator start, + ConfigEntMap::iterator end) { + + SWMgr::AddGlobalOptions(module, section, start, end); +#ifdef _ICU_ +// module->AddOptionFilter(transliterator); +#endif +}; + +/* maybe force a section for each module and set a per module userConfig. "But not like this. Not like this." +void BibleCSMGR::AddLocalOptions(SWModule *module, ConfigEntMap §ion, ConfigEntMap::iterator start, ConfigEntMap::iterator end) +{ + userPrefs[module->Name()]["Font"]; +} +*/ diff --git a/apps/windoze/CBuilder5/BibleCS/biblecsmgr.h b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.h new file mode 100644 index 0000000..d9dbc97 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/biblecsmgr.h @@ -0,0 +1,34 @@ +//--------------------------------------------------------------------------- +#ifndef biblecsmgrH +#define biblecsmgrH +#include <swmgr.h> +#include "ModInstForm.h" +//--------------------------------------------------------------------------- + +enum PlatformIDs { WIN32S = 0, WIN9X, WINNT, WINCE }; + +class BibleCSMGR : public SWMgr { + TModInstFrm *ModInstFrm; +// SWFilter *arshaping; + SWFilter *bidireorder; + SWFilter *transliterator; + char platformID; + SWConfig *userPrefs; + +protected: + virtual char AddModToConfig(int conffd, const char *fname); + virtual void AddRenderFilters(SWModule *module, ConfigEntMap §ion); + virtual signed char Load (); + virtual void AddGlobalOptions (SWModule * module, ConfigEntMap & section, + ConfigEntMap::iterator start, + ConfigEntMap::iterator end); + +public: + BibleCSMGR(TModInstFrm *iModInstFrm); + virtual ~BibleCSMGR(); + SWConfig &getUserPrefs() { return *userPrefs; } + void applyUserPrefs(); +}; + +#endif + diff --git a/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.cpp b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.cpp new file mode 100644 index 0000000..4429c5d --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.cpp @@ -0,0 +1,221 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include "bookmarkfrm.h" +#include <swconfig.h> +#include <dirent.h> +#include "mainfrm.h" +#include "newbmfilefrm.h" +#include <io.h> +#include <dir.h> + +//--------------------------------------------------------------------------- +#pragma resource "*.dfm" +TbookmarkForm *bookmarkForm; +//--------------------------------------------------------------------------- +__fastcall TbookmarkForm::TbookmarkForm(TComponent* Owner) + : TForm(Owner) +{ + SWConfig *bookmarks; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + TTreeNode *node; + + DIR *dir; + struct dirent *ent; + string conffile; + bmdir = ""; + + bmtree->Items->Clear(); + + if ((sit = Form1->optionsconf->Sections.find("Bookmarks")) != Form1->optionsconf->Sections.end()) + bmdir = ((eit = (*sit).second.find("Directory")) != (*sit).second.end()) ? (*eit).second : (string)""; + +// Add Personal Bookmarks first, or if they don't exist, ADD A BLANK BRANCH first in the tree +// -------------------------------------------------------------------------- + + if (bmdir == "") + bmdir = "./bookmarks/"; + + if (access(bmdir.c_str(), 0)) { // directory does not exist + _mkdir(bmdir.c_str()); + } + + conffile = bmdir + "personal.conf"; + bookmarks = new SWConfig(conffile.c_str()); + if ((sit = bookmarks->Sections.find("ROOT")) != bookmarks->Sections.end()) { + if ((eit = (*sit).second.begin()) != (*sit).second.end()) { + node = bmtree->Items->AddObject(bmtree->Selected, (*eit).second.c_str(), *bmfiles.insert(bmfiles.begin(), new String(conffile.c_str()))); + AddSection(bookmarks, bmtree, node, (*eit).first.c_str()); + } + } + else bmtree->Items->AddObject(bmtree->Selected, "Personal Bookmarks", *bmfiles.insert(bmfiles.begin(), new String(conffile.c_str()))); + delete bookmarks; +// -------------------------------------------------------------------------- + +// Add all other bookmark files --------------------------------------------- + if (dir = opendir(bmdir.c_str())) { + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, "personal.conf")) && (strcmp(ent->d_name, "."))&& (strcmp(ent->d_name, ".."))) { + conffile = bmdir; + conffile += ent->d_name; + bookmarks = new SWConfig(conffile.c_str()); + if ((sit = bookmarks->Sections.find("ROOT")) != bookmarks->Sections.end()) { + if ((eit = (*sit).second.begin()) != (*sit).second.end()) { // Currently supports only ONE topsection per file because on save, each topsection designates which file to rewrite + node = bmtree->Items->AddObject(bmtree->Selected, (*eit).second.c_str(), *bmfiles.insert(bmfiles.begin(), new String(conffile.c_str()))); + AddSection(bookmarks, bmtree, node, (*eit).first.c_str()); + } + } + delete bookmarks; + } + } + closedir(dir); + } +} + + +__fastcall TbookmarkForm::~TbookmarkForm() { + list <String *>::iterator it; + + SaveBookmarks(); + + for (it = bmfiles.begin(); it != bmfiles.end(); it++) + delete *it; +} + + +//--------------------------------------------------------------------------- + +void TbookmarkForm::AddSection(SWConfig *config, TTreeView *tree, TTreeNode *parent, String section) +{ + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + TTreeNode *node; + + if ((sit = config->Sections.find(section.c_str())) != config->Sections.end()) { + for (eit = (*sit).second.begin(); eit != (*sit).second.end(); eit++) { + node = tree->Items->AddChild(parent, (*eit).second.c_str()); + AddSection(config, tree, node, (*eit).first.c_str()); + } + } +} + + +void __fastcall TbookmarkForm::bmtreeDragDrop(TObject *Sender, TObject *Source, + int X, int Y) +{ + bmtree->Selected->MoveTo(bmtree->DropTarget, naAddChildFirst); +} +//--------------------------------------------------------------------------- +void __fastcall TbookmarkForm::bmtreeDragOver(TObject *Sender, TObject *Source, + int X, int Y, TDragState State, bool &Accept) +{ + Accept = false; + + if (String(Source->ClassName()) == "TTreeView") { + if (Source == bmtree) { + if (bmtree->Selected->Data) { + if (strcmp((*(String*)(bmtree->Selected->Data)).c_str(),(bmdir + "personal.conf").c_str())) { + Accept = true; + } + } + else Accept = true; + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TbookmarkForm::bmtreeDblClick(TObject *Sender) +{ + if (!bmtree->Selected->getFirstChild()) { + *(Form1->DefaultVSKey) = bmtree->Selected->Text.c_str(); + Form1->TextKeyChanged(); + } + +} +//--------------------------------------------------------------------------- +void __fastcall TbookmarkForm::AddChild1Click(TObject *Sender) +{ + bmtree->Selected->Expand(false); + bmtree->Items->AddChildFirst(bmtree->Selected, "New Topic")->EditText(); +} +//--------------------------------------------------------------------------- +void __fastcall TbookmarkForm::Delete1Click(TObject *Sender) +{ + if (bmtree->Selected->Data) { + if (strcmp((*(String*)(bmtree->Selected->Data)).c_str(),(bmdir + "personal.conf").c_str())) { + bmtree->Selected->Delete(); + } + } + else bmtree->Selected->Delete(); +} +//--------------------------------------------------------------------------- +void __fastcall TbookmarkForm::Rename1Click(TObject *Sender) +{ + bmtree->Selected->EditText(); +} +//--------------------------------------------------------------------------- + +void TbookmarkForm::SaveBookmarks() +{ + TTreeNode *tree = 0; + SWConfig *bmconf; + ConfigEntMap emap; + SectionMap::iterator sit; + char buf[15]; + bool personal, other; + list <String *>::iterator it; + string persfile; + + if (bmtree->Items->Count) + tree = bmtree->Items->Item[0]; + + if ((sit = Form1->optionsconf->Sections.find("Bookmarks")) != Form1->optionsconf->Sections.end()) { + personal = (atoi((*(*sit).second.find("AutoSavePersonal")).second.c_str())) ? true:false; + other = (atoi((*(*sit).second.find("AutoSaveOther")).second.c_str())) ? true:false; + } + + persfile = bmdir + "personal.conf"; + for (it = bmfiles.begin(); it != bmfiles.end(); it++) { // delete all bookmark files before saving in case a top level was deleted + if (((!strcmp((*it)->c_str(), persfile.c_str())) && personal) || ((strcmp((*it)->c_str(), persfile.c_str())) && other)) + unlink((*it)->c_str()); + } + + for (;tree;tree = tree->getNextSibling()) { + if (((*((String *)tree->Data) == persfile.c_str()) && personal) || ((*((String *)tree->Data) != persfile.c_str()) && other)) { + bmconf = new SWConfig(((String *)tree->Data)->c_str()); + emap = bmconf->Sections["ROOT"]; + sprintf(buf, "branch%d", tree->AbsoluteIndex); + emap.erase(buf); emap.insert(ConfigEntMap::value_type(buf, tree->Text.c_str())); + AddSectionToConf(bmconf, buf, tree); + bmconf->Sections["ROOT"] = emap; + bmconf->Save(); + delete bmconf; + } + } +} + + +void TbookmarkForm::AddSectionToConf(SWConfig *config, String section, TTreeNode *tree) { + ConfigEntMap sit; + char buf[15]; + + if (tree = tree->getFirstChild()) { + sit = config->Sections[section.c_str()]; + for (; tree; tree = tree->getNextSibling()) { + sprintf(buf, "branch%d", tree->AbsoluteIndex); + sit.erase(buf); sit.insert(ConfigEntMap::value_type(buf, tree->Text.c_str())); + AddSectionToConf(config, buf, tree); + } + config->Sections[section.c_str()] = sit; + } +} + +void __fastcall TbookmarkForm::NewBookmarkFile1Click(TObject *Sender) +{ + if (NewBMfrm->ShowModal() == mrOk) { + bmtree->Items->AddObject(bmtree->Items->Item[0], NewBMfrm->bmtitle->Text, *bmfiles.insert(bmfiles.begin(), new String(String(bmdir.c_str()) + NewBMfrm->bmfile->Text + String(".conf")))); + } +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.h b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.h new file mode 100644 index 0000000..41c606a --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/bookmarkfrm.h @@ -0,0 +1,48 @@ +//--------------------------------------------------------------------------- +#ifndef bookmarkfrmH +#define bookmarkfrmH +//--------------------------------------------------------------------------- +#include <vcl\Classes.hpp> +#include <vcl\Controls.hpp> +#include <vcl\StdCtrls.hpp> +#include <vcl\Forms.hpp> +#include <vcl\ComCtrls.hpp> +#include <swconfig.h> +#include <vcl\Menus.hpp> +#include <list> +//--------------------------------------------------------------------------- +class TbookmarkForm : public TForm +{ +__published: // IDE-managed Components + TTreeView *bmtree; + TPopupMenu *BMPopup; + TMenuItem *Delete1; + TMenuItem *AddChild1; + TMenuItem *Rename1; + TMenuItem *N1; + TMenuItem *NewBookmarkFile1; + void __fastcall bmtreeDragDrop(TObject *Sender, TObject *Source, int X, int Y); + void __fastcall bmtreeDragOver(TObject *Sender, TObject *Source, int X, int Y, + TDragState State, bool &Accept); + void __fastcall bmtreeDblClick(TObject *Sender); + void __fastcall AddChild1Click(TObject *Sender); + void __fastcall Delete1Click(TObject *Sender); + void __fastcall Rename1Click(TObject *Sender); + void __fastcall NewBookmarkFile1Click(TObject *Sender); +private: // User declarations + void AddSection(SWConfig *config, TTreeView *tree, TTreeNode *parent, String section); + list <String *> bmfiles; // so we can delete each display we create + + +public: // User declarations + string bmdir; + __fastcall TbookmarkForm(TComponent* Owner); + __fastcall ~TbookmarkForm(); + void SaveBookmarks(); + void AddSectionToConf(SWConfig *config, String section, TTreeNode *tree); +}; +//--------------------------------------------------------------------------- +extern TbookmarkForm *bookmarkForm; +//--------------------------------------------------------------------------- +#endif +
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.bpr b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.bpr new file mode 100644 index 0000000..1059c12 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.bpr @@ -0,0 +1,113 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.05.03"/> + <PROJECT value="cdstartup.exe"/> + <OBJFILES value="cdstartup.obj mainfrm.obj"/> + <RESFILES value="cdstartup.res"/> + <IDLFILES value=""/> + <IDLGENFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES) mainfrm.dfm"/> + <LIBFILES value=""/> + <LIBRARIES value="vcl50.lib"/> + <SPARELIBS value="vcl50.lib"/> + <PACKAGES value="vclx50.bpi vcl50.bpi vcldb50.bpi vclbde50.bpi vcldbx50.bpi ibsmp50.bpi + bcbsmp50.bpi dclocx50.bpi qrpt50.bpi teeui50.bpi vclsmp50.bpi teedb50.bpi + tee50.bpi dss50.bpi nmfast50.bpi inetdb50.bpi inet50.bpi vclmid50.bpi"/> + <PATHCPP value=".;"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value="$(BCB)\lib\debug"/> + <RELEASELIBPATH value="$(BCB)\lib\release"/> + <LINKER value="ilink32"/> + <USERDEFINES value=""/> + <SYSDEFINES value="NO_STRICT"/> + <MAINSOURCE value="cdstartup.cpp"/> + <INCLUDEPATH value="$(BCB)\include;$(BCB)\include\vcl"/> + <LIBPATH value="$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + </MACROS> + <OPTIONS> + <IDLCFLAGS value="-I$(BCB)\include -I$(BCB)\include\vcl -src_suffix cpp -boa"/> + <CFLAG1 value="-O2 -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- + -k- -vi -c -tW -tWM"/> + <PFLAGS value="-$YD -v -M -JPHNE"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zn"/> + <LFLAGS value="-D"" -aa -Tpe -x"/> + </OPTIONS> + <LINKER> + <ALLOBJ value="c0w32.obj $(OBJFILES)"/> + <ALLRES value="$(RESFILES)"/> + <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/> + </LINKER> + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=5 +Release=3 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName=CrossWire Software & Bible Society +FileDescription=The SWORD Project CD Installer +FileVersion=1.5.3.0 +InternalName=cdstartup +LegalCopyright=(c) 2002 CrossWire Software under the GNU General Public License +LegalTrademarks= +OriginalFilename= +ProductName=The SWORD Project +ProductVersion=1.5.3 +Comments=Seek Him and you will find Him + +[HistoryLists\hlIncludePath] +Count=1 +Item0=$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=1 +Item0=$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.res b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.res Binary files differnew file mode 100644 index 0000000..e6b3991 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/cdstartup.res diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.cpp new file mode 100644 index 0000000..843adef --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.cpp @@ -0,0 +1,70 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include "mainfrm.h" +#include <shellapi.h> +#include <dir.h> +#include <stdio.h> +//--------------------------------------------------------------------------- +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ + char buf[2048]; + char buf2[2048]; + + sprintf("SWORD_PATH=%s", getcwd(buf2, 2047)); + putenv(buf); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BitBtn1Click(TObject *Sender) +{ + WinExec(".\\Disk Images\\disk1\\setup.exe", SW_SHOWNORMAL); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BitBtn2Click(TObject *Sender) +{ +/* + static char *file = ".\\Windows\\sword.exe"; + static char dir[2048]; // = "\\"; + SHELLEXECUTEINFO sei; + memset(&sei, 0, sizeof(SHELLEXECUTEINFO)); + sei.cbSize = sizeof(SHELLEXECUTEINFO); + sei.fMask = SEE_MASK_NOCLOSEPROCESS; + sei.hwnd = this->WindowHandle; + sei.lpFile = file; + sei.lpDirectory = getcwd(dir, 2047); + MessageBox(0, sei.lpDirectory, "cwd", MB_OK); + sei.nShow = SW_SHOWNORMAL; +*/ + WinExec(".\\Windows\\sword.exe", SW_SHOWNORMAL); +// ShellExecute(this->Handle, "open", ".\\Windows\\sword.exe", NULL, "\\", SW_SHOWNORMAL); +// ShellExecuteEx(&sei); + +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormShow(TObject *Sender) +{ +// AddFontResource("\\sword\\modules\\texts\\rawtext\\nu\\greek.ttf"); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BitBtn3Click(TObject *Sender) +{ + ShellExecute(this->Handle, "open", "http://www.crosswire.org", NULL, NULL, SW_SHOWNORMAL); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BitBtn4Click(TObject *Sender) +{ + ShellExecute(this->Handle, "open", ".\\", NULL, NULL, SW_SHOWNORMAL); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::BitBtn5Click(TObject *Sender) +{ + WinExec(".\\fonts\\setup.exe", SW_SHOWNORMAL); +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.dfm b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.dfm Binary files differnew file mode 100644 index 0000000..6bb62ad --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/cdstartup/mainfrm.dfm diff --git a/apps/windoze/CBuilder5/BibleCS/editentryfrm.cpp b/apps/windoze/CBuilder5/BibleCS/editentryfrm.cpp new file mode 100644 index 0000000..01935e0 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/editentryfrm.cpp @@ -0,0 +1,352 @@ +#include <vcl.h> +#pragma hdrstop +#include <windows.hpp> +#include <stdlib.h> +#include <stdio.h> +#include "editentryfrm.h" +#include <swdisprtf.h> +#include "rxricheditx.h" + +const float RulerAdj = 4.0/3.0; +const int GutterWid = 6; +//---------------------------------------------------------------------------- +#pragma resource "*.dfm" +TEditEntryForm *EditEntryForm; +//---------------------------------------------------------------------------- +__fastcall TEditEntryForm::TEditEntryForm(TComponent *Owner) : TForm(Owner) { + ResultBuf = 0; + RichEdit1 = new TRxRichEditX(this); + + RichEdit1->Parent = pnlRichEdit; + RichEdit1->Align = alClient; + RichEdit1->ScrollBars = ssVertical; +} + + +__fastcall TEditEntryForm::~TEditEntryForm() { + if (ResultBuf) + delete [] ResultBuf; +} + + +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::SelectionChange(TObject */*Sender*/) { + char sizebuf[6]; + + try { + FUpdating = True; + FirstInd->Left = int(RichEdit1->Paragraph->FirstIndent*RulerAdj)- + 4+GutterWid; + LeftInd->Left = int((RichEdit1->Paragraph->LeftIndent+ + RichEdit1->Paragraph->FirstIndent)*RulerAdj)- + 4+GutterWid; + RightInd->Left = Ruler->ClientWidth-6-int( + (RichEdit1->Paragraph->RightIndent+GutterWid)*RulerAdj); + + BoldButton->Down = RichEdit1->SelAttributes->Style.Contains(fsBold); + ItalicButton->Down = RichEdit1->SelAttributes->Style.Contains(fsItalic); + UnderlineButton->Down = RichEdit1->SelAttributes->Style.Contains(fsUnderline); + + BulletsButton->Down = bool(RichEdit1->Paragraph->Numbering); + + FontSize->Text = itoa(RichEdit1->SelAttributes->Size, sizebuf, 10); + + switch((int)RichEdit1->Paragraph->Alignment) + { case 0: LeftAlign->Down = True; break; + case 1: RightAlign->Down = True; break; + case 2: CenterAlign->Down = True; break; + } + } + catch (...) { + FUpdating = False; + } + FUpdating = False; +} + + +//---------------------------------------------------------------------------- +TRxTextAttributes *__fastcall TEditEntryForm::CurrText(void) +{ + return RichEdit1->SelAttributes; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::CheckFileSave(void) +{ + if ( RichEdit1->Modified ) { + switch(MessageBox(Handle, "Save Changes?","Modify Comment",MB_YESNOCANCEL | MB_ICONQUESTION)) { + case ID_YES : ExtractRTF(); break; + case ID_CANCEL : Abort(); break; + default: + if (ResultBuf) + delete [] ResultBuf; + ResultBuf = 0; + break; + }; + } +} + + +void __fastcall TEditEntryForm::SetupRuler(void) +{ int iCtr = 1; + char sTmp[201]; + while (iCtr < 200) { + sTmp[iCtr] = 9; + iCtr++; + sTmp[iCtr] = '|'; + iCtr++; + } + Ruler->Caption = (AnsiString)sTmp; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::SetEditRect(void) +{ TRect Rct = Rect(GutterWid, 0, RichEdit1->ClientWidth-GutterWid, + ClientHeight); + SendMessage(RichEdit1->Handle, EM_SETRECT, 0, long(&Rct)); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::FormCreate(TObject* /*Sender*/) +{ Application->OnHint = &ShowHint; + SetupRuler(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::ShowHint(TObject* /*Sender*/) +{ StatusBar->SimpleText = Application->Hint; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::EditUndoClick(TObject* /*Sender*/) +{ if ( RichEdit1->HandleAllocated() ) + SendMessage(RichEdit1->Handle, EM_UNDO, 0, 0); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::EditCutClick(TObject* /*Sender*/) +{ RichEdit1->CutToClipboard(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::EditCopyClick(TObject* /*Sender*/) +{ RichEdit1->CopyToClipboard(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::EditPasteClick(TObject* /*Sender*/) +{ RichEdit1->PasteFromClipboard(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::RulerResize(TObject* /*Sender*/) +{ RulerLine->Width = (int)Ruler->ClientWidth - (RulerLine->Left*2); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::FormResize(TObject* Sender) +{ SetEditRect(); + SelectionChange(Sender); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::FormPaint(TObject* /*Sender*/) +{ SetEditRect(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::BoldButtonClick(TObject* /*Sender*/) +{ if ( !FUpdating ) + { if ( BoldButton->Down ) + CurrText()->Style = CurrText()->Style << fsBold; + else + CurrText()->Style = CurrText()->Style >> fsBold; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::ItalicButtonClick(TObject* /*Sender*/) +{ if ( !FUpdating ) + { + if ( ItalicButton->Down ) + CurrText()->Style = CurrText()->Style << fsItalic; + else + CurrText()->Style = CurrText()->Style >> fsItalic; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::UnderlineButtonClick(TObject* /*Sender*/) +{ + if ( !FUpdating ) { + if ( UnderlineButton->Down ) + CurrText()->Style = CurrText()->Style << fsUnderline; + else CurrText()->Style = CurrText()->Style >> fsUnderline; + } +} + + +void __fastcall TEditEntryForm::FontSizeChange(TObject* /*Sender*/) +{ + int fontsize = atoi(FontSize->Text.c_str()); + + if ((!FUpdating) && (fontsize)) { + if (fontsize < 1) { + ShowMessage("Please Enter a Number betweek 1 and 1638"); + FontSize->Text = 1; + } + else if (fontsize > 1638) { + ShowMessage("Please Enter a Number betweek 1 and 1638"); + FontSize->Text = 1638; + } + CurrText()->Size = atoi(FontSize->Text.c_str()); + } +} + + +void __fastcall TEditEntryForm::AlignClick(TObject* Sender) +{ + if ( !FUpdating ) { + TControl *oAliBtn = (TControl*)(Sender); + RichEdit1->Paragraph->Alignment = (TAlignment)oAliBtn->Tag; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::BulletsButtonClick(TObject* /*Sender*/) +{ if ( !FUpdating ) + RichEdit1->Paragraph->Numbering = (TNumberingStyle)BulletsButton->Down; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::FormCloseQuery(TObject* /*Sender*/, + bool & CanClose) +{ try { + CheckFileSave(); + } + catch (...) { + CanClose = False; + } +} +//---------------------------------------------------------------------------- + +//*************************** +//***Ruler Indent Dragging*** +//*************************** + +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::RulerItemMouseDown(TObject * Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ TLabel * oTmpLabel = (TLabel *)Sender; + FDragOfs = oTmpLabel->Width / 2; + oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs; + FDragging = True; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::RulerItemMouseMove(TObject *Sender, TShiftState Shift, int X, int /*Y*/) { + if (FDragging) { + TLabel *oTmpLabel = (TLabel *)Sender; + oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs; + oTmpLabel->Left -= oTmpLabel->Left % 10; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::FirstIndMouseUp(TObject *Sender, TMouseButton + Button, TShiftState Shift, int X, int Y) +{ FDragging = False; + RichEdit1->Paragraph->FirstIndent = int((FirstInd->Left+FDragOfs-GutterWid) / RulerAdj); + LeftIndMouseUp(Sender, Button, Shift, X, Y); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::LeftIndMouseUp(TObject *Sender, TMouseButton + /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/) +{ FDragging = False; + RichEdit1->Paragraph->LeftIndent = int((LeftInd->Left+FDragOfs-GutterWid)/ + RulerAdj)-RichEdit1->Paragraph->FirstIndent; + SelectionChange(Sender); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::RightIndMouseUp(TObject *Sender, TMouseButton + /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/) +{ FDragging = False; + RichEdit1->Paragraph->RightIndent = + int((Ruler->ClientWidth-RightInd->Left+FDragOfs-2) / + RulerAdj)-2*GutterWid; + SelectionChange(Sender); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntryForm::FormActivate(TObject *Sender) +{ + System::AnsiString newtext, tmptext; + + if (Module) { + TMemoryStream *RTFStream = new TMemoryStream(); + newtext = RTFDisplay->RTFHeader; + Module->Error(); // clear error; + newtext = newtext + "\\pard \\nowidctlpar \\cf0 "; + (const char *)*Module; // force key to snap to entry before pulling out the text of the key + tmptext = Module->getRawEntry(); + + newtext = newtext + RTFDisplay->RTFVersePre + " " + tmptext + RTFDisplay->RTFVersePost; + newtext = newtext + RTFDisplay->RTFTrailer; + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.Length()); + RTFStream->Position = 0; + RichEdit1->Lines->LoadFromStream(RTFStream); + delete RTFStream; + } + SelectionChange(this); + RichEdit1->SetFocus(); + if (ResultBuf) + delete [] ResultBuf; + ResultBuf = 0; +} +//--------------------------------------------------------------------- + +void TEditEntryForm::ExtractRTF() +{ + System::AnsiString newtext, tmptext; + TMemoryStream *RTFStream = new TMemoryStream(); + char *tmpbuf, *datastart; + + RTFStream->Clear(); + RichEdit1->Lines->SaveToStream(RTFStream); + RTFStream->Position = 0; + if (ResultBuf) + delete [] ResultBuf; + tmpbuf = new char [ RTFStream->Size + 1]; + RTFStream->ReadBuffer(tmpbuf, RTFStream->Size); + tmpbuf[RTFStream->Size] = 0; + char *tbl = strstr(tmpbuf, "colortbl"); + if (!tbl) + tbl = strstr(tmpbuf, "fonttbl"); + if (tbl) { + strtok(tbl, "}"); +// strtok(NULL, "}"); + datastart = strtok(NULL, ""); + ResultBuf = new char [ strlen(datastart) + 2 ]; + ResultBuf[0] = '{'; + strcpy(ResultBuf+1, datastart); + delete [] tmpbuf; + delete RTFStream; + //-------- Change all fonts to \f1 + for (int i = 0; i < strlen(ResultBuf)-4; i++) { + if (ResultBuf[i] == '\\') { + if (ResultBuf[i+1] == '\\') { // skip a real '\' character + i += 1; + continue; + } + if (ResultBuf[i+1] == 'f') { + if (isdigit(ResultBuf[i+2])) { + ResultBuf[i+2] = '1'; + if (isdigit(ResultBuf[i+3])) { + memmove(&ResultBuf[i+3], &ResultBuf[i+4], strlen(&ResultBuf[i+3])); + } + } + } + if (ResultBuf[i+1] == 'c') { + if (ResultBuf[i+2] == 'f') { + if (isdigit(ResultBuf[i+3])) { + ResultBuf[i+3] = '7'; + if (isdigit(ResultBuf[i+4])) { + memmove(&ResultBuf[i+4], &ResultBuf[i+5], strlen(&ResultBuf[i+4])); + } + } + } + } + } + } + } +} + + +__fastcall TCharsetObject::TCharsetObject(int FCharset) + : TObject() +{ + Charset = FCharset; +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp new file mode 100644 index 0000000..3aee541 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.cpp @@ -0,0 +1,2821 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#include <vcl/clipbrd.hpp> +#pragma hdrstop + +#include "mainfrm.h" +#include "swdisprtfchap.h" +#include "searchfrm.h" +#include "swwinlog.h" +#include "AboutBoxfrm.h" +#include "ModInstForm.h" +#include "biblecsmgr.h" +#include "Greek2Greek.h" +#include "bookmarkfrm.h" +#include "optionfrm.h" +#include "vrslstfrm.h" +#include <utilstr.h> +#include <filemgr.h> +#include <localemgr.h> +#include "editentryfrm.h" +#include "versesel.h" +#include "splashfrm.h" +#include "ModVisFrm.h" +#include "DevOfTheDay.h" +#include "SplashPage.h" +//#include "nsEmbedAPI.h" +#include <graphics.hpp> +#include "sword.h" +#include "rtfhintfrm.h" +#include "newbmfilefrm.h" +#include "RangeMaintFrm.h" +#include "PrintFrm.h" +#include "PreviewForm.h" +//--------------------------------------------------------------------------- +#pragma link "RxRichEd" +//#pragma link "MOZILLACONTROLLib_OCX" +//#pragma link "SHDocVw_OCX" +#pragma resource "*.dfm" + +static const char *rtfclasses[] = {"RTFDisp", "SWDisplay", "SWObject", 0}; +SWClass RTFDisp::classdef(rtfclasses); + +TForm1 *Form1; +//--------------------------------------------------------------------------- + + +/* +inline AnsiString& operator=(AnsiString& dest, const string& src) { + dest = src.c_str(); + return dest; +} + +*/ + +void __fastcall TForm1::AppMessage(tagMSG &Msg, bool &Handled) +{ + if (Msg.message == WM_VERSE) + { + HKEY hkey; + LONG result; + unsigned long verSize = 32; + result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "sword\\OpenVerse", NULL, KEY_READ | KEY_WRITE, &hkey); + result = RegQueryValueEx(hkey, NULL, NULL, NULL, NULL, &verSize); + char* verStr = new char[verSize]; + result = RegQueryValueEx(hkey, NULL, NULL, NULL, verStr, &verSize); + result = RegCloseKey(hkey); + result = RegDeleteKey(HKEY_CLASSES_ROOT, "sword\\OpenVerse"); + NavigateVerseURL(verStr); + Handled = true; + } +} + +void TForm1::NavigateVerseURL (char* verStrIN) +{ + unsigned long verSize = strlen(verStrIN) + 1; + char * verStr = new char[verSize]; + strcpy (verStr, verStrIN); + char * verStr2 = new char[verSize]; + unsigned long verSize2 = 0; + if (*(verStr + verSize - 2) == '\"') { + *(verStr + verSize - 2) = 0; + } + verSize = 0; + if (strstr(verStr, "libronix")) { + char* bib = strstr(verStr, "bible:"); + if (bib) { + verSize = 6 + (unsigned long)(bib - verStr); + } + } + else if (strstr(verStr, "sword://")) { + verSize = 9; + } + else if (*verStr == '\"') { + verSize = 1; + } + + while (verStr[verSize] != 0) { + verStr2[verSize2] = verStr[verSize]; + verSize++; + verSize2++; + } + verStr2[verSize2] = 0; + + char * verse = strstr(verStr2, "/"); + if (verse) { + *verse = 0; + verse++; + } + else { + verse = verStr2; + verStr2 = 0; + } + + freeHandLookup->Text = verse; + freeHandLookupoldKeyPress(0, '\r'); + + delete [] verStr; + delete [] verStr2; +} + +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ + optionsconf = new SWConfig("./options.conf"); + + // add our ui locale info to sword's system localemgr + LocaleMgr::systemLocaleMgr.loadConfigDir("./uilocales.d"); + + Lookup->Text = "[ SWORD DDE Lookup ]"; + Search->Text = "[ SWORD DDE Search ]"; + modstates.clear(); + displays.clear(); + ctrlstates.clear(); + DefaultVSKey = 0; + DefaultStrKey = 0; + clickText = ""; + + lbDictKeysOld->Visible = false; + DictKeyEditOld->Visible = false; + lbDictKeys = new TTntListBox(this); + lbDictKeys->Parent = Panel2; + lbDictKeys->Align = alClient; + lbDictKeys->Font->Name = "Code2000"; + lbDictKeys->OnClick = lbDictKeysOldClick; + + DictKeyEdit = new TTntEdit(this); + DictKeyEdit->Parent = Panel2; + DictKeyEdit->Align = alTop; + DictKeyEdit->Font->Name = "Code2000"; + DictKeyEdit->OnChange = DictKeyEditOldChange; + renderingHint = false; + closing = false; +} + +void __fastcall TForm1::DisplayHint(TObject* Sender) +{ + StatusBar1->SimpleText = GetLongHint(Application->Hint); +} + +//--------------------------------------------------------------------------- +__fastcall TForm1::~TForm1() +{ + + list <SWDisplay *>::iterator it; + int loop; + + + if (mainmgr) + delete mainmgr; + for (it = displays.begin(); it != displays.end(); it++) + delete *it; + + if (layoutconf) + delete layoutconf; + + if (optionsconf) + delete optionsconf; + + for (loop = 0; loop < 10; loop++) { + if (ctrlstates[loop]) + delete ctrlstates[loop]; + } + + if (DefaultVSKey) + delete DefaultVSKey; + if (DefaultStrKey) + delete DefaultStrKey; + + list <ModState *>::iterator mit; + for (mit = modstates.begin(); mit != modstates.end(); mit++) { + delete (*mit); + } +} +//--------------------------------------------------------------------------- + +char TForm1::CreateTextPane(SWModule *mod, char *font) { + TTabSheet *newtab = new TTabSheet(this); + SWDispRTFChap *newrtf = new SWDispRTFChap(this); + char buf[1024]; + SectionMap::iterator sit; + + newtab->Caption = mod->Name(); + newtab->Hint = mod->Description(); + newtab->ParentShowHint = true; + newtab->PageControl = TextPageControl; + newrtf->Parent = newtab; + newrtf->Align = alClient; + newrtf->ScrollBars = ssVertical; + newrtf->ReadOnly = true; + newrtf->PopupMenu = (strcmp(mod->Name(), "N27U4")) ? PopupMenu2 : PopupMenu1; + newrtf->OnMouseDown = RTFMouseDown; + newrtf->Name = String("TextRTF")+mod->Name(); + + newrtf->module = mod; + newrtf->recalcAppearance(); + + SWDisplay *disp = new RTFDisp(newrtf); + mod->Disp(disp); + displays.insert(displays.begin(), disp); + mod->SetKey(*DefaultVSKey); + + return 0; +} +//--------------------------------------------------------------------------- +char TForm1::CreateCommentPane(SWModule *mod, char* font) { + TTabSheet *newtab = new TTabSheet(this); + TWinControl *newrtf; + char buf[1024]; + SectionMap::iterator sit; + + if ((*mainmgr->config->Sections[mod->Name()].find("ModDrv")).second == "HREFCom") { +// if (mainmgr->config->Sections[mod->Name()]["External"] == "1") { + newrtf = new TPanel(this); + ((TPanel *)newrtf)->Caption = "Syncronizing to External Viewer"; + SWDisplay *disp = new DispExternal(); + mod->Disp(*displays.insert(displays.begin(), disp)); +/* + } + else { + // newrtf = new THTML(this->Handle); + // newrtf = new SWDispRTF(this); + newrtf = HTML1; + newrtf->Visible = true; + mod->Disp(*displays.insert(displays.begin(), new HREFDisp((THTML *)newrtf))); + // mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf))); + } +*/ + } + else { +/* IE Control + newrtf = new TCppWebBrowser(this); + HREFDisp *disp = new HREFDisp((TCppWebBrowser *)newrtf); + newrtf->Visible = true; + mod->Disp(*displays.insert(displays.begin(), disp)); + ((TCppWebBrowser *)newrtf)->OnBeforeNavigate2 = CppWebBrowser1BeforeNavigate2; +*/ + newrtf = new SWDispRTF(this); + + SWDisplay *disp = new RTFDisp((SWDispRTF *)newrtf); + mod->Disp(*displays.insert(displays.begin(), disp)); + ((SWDispRTF *)newrtf)->ScrollBars = ssVertical; + ((SWDispRTF *)newrtf)->ReadOnly = true; + ((SWDispRTF *)newrtf)->Name = String("CommentRTF")+mod->Name(); + + if ((*mainmgr->config->Sections[mod->Name()].find("ModDrv")).second == "RawFiles") { + ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3; + ((SWDispRTF *)newrtf)->ExpandNewLine = false; + } + else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2; + ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown; + ((SWDispRTF *)newrtf)->OnURLClick = RTFURLClick; + } + + newtab->Caption = mod->Name(); + newtab->Hint = mod->Description(); + newtab->ParentShowHint = true; + newtab->PageControl = CommentaryPageControl; + + newrtf->Parent = newtab; + newrtf->Align = alClient; + ((SWDispRTF *)newrtf)->module = mod; + ((SWDispRTF *)newrtf)->recalcAppearance(); + + mod->SetKey(*DefaultVSKey); + return 0; +} +//--------------------------------------------------------------------------- +char TForm1::CreateLDPane(SWModule *mod, char* font) { + TTabSheet *newtab = new TTabSheet(this); + SWDispRTF *newrtf = new SWDispRTF(this); + SectionMap::iterator sit; + char buf[1024]; + + newtab->Caption = mod->Name(); + newtab->Hint = mod->Description(); + newtab->ParentShowHint = true; + newtab->PageControl = LexDictPageControl; + + newrtf->Parent = newtab; + newrtf->Align = alClient; + newrtf->ScrollBars = ssVertical; + newrtf->ReadOnly = true; + newrtf->Name = String("LexDictRTF")+mod->Name(); + newrtf->PopupMenu = PopupMenu2; + newrtf->OnMouseDown = RTFMouseDown; + newrtf->OnURLClick = RTFURLClick; + newrtf->module = mod; + newrtf->recalcAppearance(); + + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) { + if ((*sit).second.find("LDBackColor") != (*sit).second.end()) { + lbDictKeys->Color = TColor((atoi((*(*sit).second.find("LDBackColor")).second.c_str()))); + } + if ((*sit).second.find("LDFontColor") != (*sit).second.end()) + lbDictKeys->Font->Color = TColor((atoi((*(*sit).second.find("LDFontColor")).second.c_str()))); + } + SWDisplay *disp = new RTFDisp(newrtf); + mod->Disp(*displays.insert(displays.begin(), disp)); + mod->SetKey(*DefaultStrKey); + return 0; +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::BookTOCChange(TObject* Sender, TTreeNode* Node) { + ModMap::iterator it; + + if (mainmgr) { + it = mainmgr->Modules.find(CommentaryPageControl->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + ((TreeKeyIdx *)(SWKey *)*(it->second))->setOffset((long)Node->Data); + (*it).second->Display(); + if (logmodstate) + modstates.insert(modstates.begin(), new ModState(CommentaryPageControl, CommentaryPageControl->ActivePage, (*it).second->KeyText())); + } + } +} + + +char TForm1::CreateBookPane(SWModule *mod, char* font) { + TTabSheet *newtab = new TTabSheet(this); + TWinControl *newrtf; + char buf[1024]; + SectionMap::iterator sit; + TTreeView *toc = new TTreeView(this); + + newtab->Caption = mod->Name(); + newtab->Hint = mod->Description(); + newtab->ParentShowHint = true; + newtab->PageControl = CommentaryPageControl; + + TSplitter *splitter = new TSplitter(this); + splitter->Parent = newtab; + splitter->Align = alLeft; + + toc->Parent = newtab; + toc->Align = alLeft; + toc->OnChange = BookTOCChange; + toc->Items->Clear(); + + newrtf = new SWDispRTF(this); + SWDisplay *disp = new RTFBookDisp((SWDispRTF *)newrtf, toc); + mod->Disp(*displays.insert(displays.begin(), disp)); + ((SWDispRTF *)newrtf)->ScrollBars = ssVertical; + ((SWDispRTF *)newrtf)->ReadOnly = true; + + if ((*mainmgr->config->Sections[mod->Name()].find("ModDrv")).second == "RawFiles") { + ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3; + ((SWDispRTF *)newrtf)->ExpandNewLine = false; + } + else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2; + ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown; + newrtf->Parent = newtab; + newrtf->Align = alClient; + ((SWDispRTF *)newrtf)->module = mod; + ((SWDispRTF *)newrtf)->recalcAppearance(); + + + +// mod->SetKey(*DefaultVSKey); + return 0; +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::TextPageControlChange(TObject *Sender) +{ + RefreshActiveSheet(TextPageControl); + Form1->ActiveControl = TextPageControl; +} +//--------------------------------------------------------------------------- +void TForm1::RefreshActiveSheet(TPageControl *pc) +{ + ModMap::iterator it; + + if (mainmgr) { + it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + SWModule *module = it->second; + module->Display(); + if (logmodstate) + modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, module->KeyText())); + if (pc == LexDictPageControl) + FillDictKeys(); + } + } +} + + +void TForm1::TextKeyChanged() +{ + cbBook->ItemIndex = cbBook->Items->IndexOf(DefaultVSKey->books[DefaultVSKey->Testament()-1][DefaultVSKey->Book()-1].name); + CHBox->Text = DefaultVSKey->Chapter(); + VSBox->Text = DefaultVSKey->Verse(); + freeHandLookup->Text = (const char *)*DefaultVSKey; + RefreshActiveSheet(TextPageControl); + logmodstate = false; // only log state once + RefreshActiveSheet(CommentaryPageControl); + logmodstate = true; +} + + +void __fastcall TForm1::btnLookupClick(TObject *Sender) +{ + if (!(StrToInt(CHBox->Text)) || (!StrToInt(VSBox->Text))) + DefaultVSKey->AutoNormalize(0); + + if (StrToInt(CHBox->Text) < 0) + CHBox->Text = StrToInt(CHBox->Text) + 1; + if (StrToInt(VSBox->Text) < 0) + VSBox->Text = StrToInt(VSBox->Text) + 1; + + (*DefaultVSKey) = (cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text).c_str(); + TextKeyChanged(); + DefaultVSKey->AutoNormalize(1); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::CommentaryPageControlChange(TObject *Sender) +{ + RefreshActiveSheet(CommentaryPageControl); + Form1->ActiveControl = CommentaryPageControl; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::DictKeyEditOldChange(TObject *Sender) +{ + if (DefaultStrKey) { +// if (DictKeyEdit->Modified) { + *DefaultStrKey = WideStringToUTF8(DictKeyEdit->Text).c_str(); + RefreshActiveSheet(LexDictPageControl); + DictKeyEdit->Modified = false; +// } + } +} + +void TForm1::FillDictKeys() { + ModMap::iterator it; + int index = 0; + SWKey saveKey; + ConfigEntMap::const_iterator const_eit; + string fontname; + + if (mainmgr) { + it = mainmgr->Modules.find(LexDictPageControl->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + SWModule *module = (*it).second; + RTFDisp *disp = SWDYNAMIC_CAST(RTFDisp, module->Disp()); + if (disp) { + SWDispRTF *rtfDisp = (SWDispRTF*) disp->editControl(); + rtfDisp->recalcAppearance(); + lbDictKeys->Font->Name = rtfDisp->dispAttribs.fontName; + lbDictKeys->Font->Size = rtfDisp->dispAttribs.fontSize; + + DictKeyEdit->Font->Name = rtfDisp->dispAttribs.fontName; + DictKeyEdit->Font->Size = rtfDisp->dispAttribs.fontSize; + } + + module->KeyText(); // snap to entry + saveKey = module->KeyText(); + int count = lbDictKeys->Height / lbDictKeys->ItemHeight; + lbDictKeys->Items->Clear(); + for (int i = 0; i < (count / 2); i++) + (*module)++; + for (int i = 0; i < count-1; i++) + (*module)--; + module->Error(); + for (;!module->Error() && count;count--,(*module)++) { + lbDictKeys->Items->Add(UTF8ToWideString(module->KeyText())); + if (saveKey == module->Key()) + index = lbDictKeys->Items->Count-1; + } + lbDictKeys->ItemIndex = index; + } + } +} + + +//--------------------------------------------------------------------------- +void __fastcall TForm1::LexDictPageControlChange(TObject *Sender) +{ + *DefaultStrKey = WideStringToUTF8(DictKeyEdit->Text).c_str(); + RefreshActiveSheet(LexDictPageControl); + Form1->ActiveControl = LexDictPageControl; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::NewSearchWindow1Click(TObject *Sender) { + + searchForm->Show(); +} + +//--------------------------------------------------------------------------- +void __fastcall TForm1::Exit1Click(TObject *Sender) +{ + Close(); +} + +void __fastcall TForm1::About1Click(TObject *Sender) +{ + AboutBox->ShowModal(); +} + + +WideString TForm1::TrimJunk(WideString src) { + bool hasDigit = false; + bool hasAlpha = false; + WideString retVal = ""; + + int len = src.Length(); + for (int i = 1; i <=len; i++) { + if (isdigit(src[i])) + hasDigit = true; + if (isalpha(src[i]) || (src[i] > 255)) + hasAlpha = true; + } + for (int i = 1; i <= len; i++) { + if (hasDigit && !hasAlpha) { // number + if (isdigit(src[i])) retVal += src[i]; + } + else if (hasAlpha) { // alpha + if (isalpha(src[i]) || (src[i] > 255)) retVal += src[i]; + } + else retVal += src[i]; + } + return retVal; +} + + +//--------------------------------------------------------------------------- +void __fastcall TForm1::DictionaryLookup1Click(TObject *Sender) +{ + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + int wordstart; + int saveSelStart = rtf->SelStart; + String lookupKey; + ConfigEntMap::iterator eit; + char preChar = 0; + + if (!rtf->SelLength) { + preChar = (rtf->WordAtCursor().Length()) ? rtf->WordAtCursor()[1] : 0; + lookupKey = TrimJunk(rtf->WordAtCursor()); + } + else { + preChar = rtf->Text[(rtf->SelStart)?rtf->SelStart:0]; + lookupKey = Trim(rtf->SelText); + } + + // check if all digits (strongs) + int i; + for (i = 0; i < strlen(lookupKey.c_str()); i++) { + if (!isdigit(lookupKey.c_str()[i])) + break; + } + + if ((i == strlen(lookupKey.c_str())) && (i)) { + String curLex = LexDictPageControl->ActivePage->Caption; + String feature = (DefaultVSKey->Testament() == 1)?"Hebrew":"Greek"; + feature += (preChar == '(')?"Parse":"Def"; + if (!strncmp(rtf->Name.c_str(), "TextRTFLXX", 10)) + feature = "GreekDef"; + if (!hasFeature(mainmgr, curLex.c_str(), feature.c_str())) { + string tmpval = ((eit = optionsconf->Sections["ModDefaults"].find(feature.c_str())) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + for (int i = 0; i < LexDictPageControl->PageCount; i++) { + if (!stricmp(LexDictPageControl->Pages[i]->Caption.c_str(), tmpval.c_str())) { + LexDictPageControl->ActivePageIndex = i; + break; + } + } + } + } + + DictKeyEdit->Text = UTF8ToWideString(lookupKey); +} + + +void __fastcall TForm1::verseLookupClick(TObject *Sender) +{ + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + int wordstart; + int saveSelStart = rtf->SelStart; + + if (!rtf->SelLength) { + for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--); + rtf->SelStart = (wordstart > -1) ? wordstart: 0; + for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++); + rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length()) - rtf->SelStart - 1; + freeHandLookup->Text = Trim(rtf->SelText); + rtf->SelStart = saveSelStart; + rtf->SelLength = 0; + } + else freeHandLookup->Text = Trim(rtf->SelText); + char ret = '\r'; + freeHandLookupoldKeyPress(Sender, ret); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::SaveLayout1Click(TObject *Sender) +{ + ConfigEntMap sit; + sit = layoutconf->Sections["Screen"]; + if(Form1->WindowState == wsMaximized) { + sit["Maximized"] = "true"; + } + else { + sit["Maximized"] = "false"; + sit["MainTop"] = IntToStr(Form1->Top).c_str(); + sit["MainLeft"] = IntToStr(Form1->Left).c_str(); + sit["MainHeight"] = IntToStr(Form1->Height).c_str(); + sit["MainWidth"] = IntToStr(Form1->Width).c_str(); + } + sit["TextComHeight"] = IntToStr(pnlTextCom->Height).c_str(); + sit["TextWidth"] = IntToStr(pnlText->Width).c_str(); + + if(searchForm->WindowState == wsMaximized) { + sit["SearchMaximized"] = "true"; + } + else { + sit["SearchMaximized"] = "false"; + sit["SearchTop"] = IntToStr(searchForm->Top).c_str(); + sit["SearchLeft"] = IntToStr(searchForm->Left).c_str(); + sit["SearchWidth"] = IntToStr(searchForm->Width).c_str(); + sit["SearchHeight"] = IntToStr(searchForm->Height).c_str(); + } + + OptionsList options = mainmgr->getGlobalOptions(); + for (OptionsList::iterator it = options.begin(); it != options.end(); it++) { + string value = mainmgr->getGlobalOption(it->c_str()); + (*layoutconf)["ModuleOptions"][it->c_str()] = value; + } + layoutconf->Sections["Screen"] = sit; + layoutconf->Save(); +} + + +void TForm1::fillVKeySelector(VerseKey *vk) { + VerseKey *myVk = (VerseKey *)vk->clone(); + myVk->Error(); //clear error + (*myVk) = TOP; + cbBook->Clear(); + while (!myVk->Error()) { + AnsiString s1 = (const char *)(*myVk); + s1.SetLength(s1.Length() - 4); + cbBook->Items->Add(s1); + myVk->Book(myVk->Book() + 1); + } + delete myVk; +} + + +void TForm1::i12ize(const char *lang) { + LocaleMgr::systemLocaleMgr.setDefaultLocaleName(lang); + + // TODO 5 -cConfiguration Ops -oScribe: add mainmgr->configpath, or something, to beginning of these image names ??? + const char *tmp; + Graphics::TBitmap *bitmap = 0; + TPicture *pic = new TPicture(); + + ImageList1->Clear(); + + tmp = _tr("BackBtnImage"); + if (strcmp("BackBtnImage", tmp)) { + pic->LoadFromFile(tmp); + bitmap = pic->Bitmap; + } + else bitmap = BackBtnImage->Picture->Bitmap; + + TColor transColor = bitmap->Canvas->Pixels[0][0]; + ImageList1->AddMasked(bitmap, transColor); + + tmp = _tr("SearchBtnImage"); + if (strcmp("SearchBtnImage", tmp)) { + pic->LoadFromFile(tmp); + bitmap = pic->Bitmap; + } + else bitmap = SearchBtnImage->Picture->Bitmap; + + transColor = bitmap->Canvas->Pixels[0][0]; + ImageList1->AddMasked(bitmap, transColor); + + bitmap = BookmarkBtnImage->Picture->Bitmap; + transColor = bitmap->Canvas->Pixels[0][0]; + ImageList2->AddMasked(bitmap, transColor); + + delete pic; + + // MainForm + File1->Caption = _tr("&File"); + SaveLayout1->Caption = _tr("S&ave Layout"); + Print1->Caption = _tr("&Print..."); + Exit1->Caption = _tr("E&xit"); + Edit1->Caption = _tr("&Edit"); + Copy1->Caption = _tr("&Copy"); + Copy2->Caption = _tr("&Copy"); + Copy3->Caption = _tr("&Copy"); + Copy4->Caption = _tr("&Copy"); + CopyasBGreekTransliteration1->Caption = _tr("Copy as &B-Greek Transliteration"); + MenuItem1->Caption = _tr("Dictionary Lookup"); + Copy4->Caption = _tr("&Copy"); + Copy4->Caption = _tr("&Copy"); + Copy4->Caption = _tr("&Copy"); + Options2->Caption = _tr("Options"); + Options1->Caption = _tr("&Preferences..."); + Search1->Caption = _tr("&Search"); + NewSearchWindow1->Caption = _tr("&New Search Window"); + Tools1->Caption = _tr("&Tools"); + InstallManager1->Caption = _tr("Install Manager"); + Help1->Caption = _tr("&Help"); + Contents1->Caption = _tr("Contents"); + DevotionaloftheDay1->Caption = _tr("Devotional of the Day"); + About1->Caption = _tr("&About"); + Bookmarkbtn->Caption = _tr("Bookmark"); + DictionaryLookup1->Caption = _tr("Dictionary Lookup"); + DictionaryLookup2->Caption = _tr("Dictionary Lookup"); + EditEntry1->Caption = _tr("&Edit Entry"); + DeleteEntry1->Caption = _tr("&Delete Entry"); + LinktoVerse1->Caption = _tr("Link to Comment for Verse..."); + AddBookmark1->Caption = _tr("&Add Bookmark"); + EditBookmarks1->Caption = _tr("&Edit Bookmarks / Tree View..."); + HideShowModules1->Caption = _tr("Hide / Show Modules"); + ToolButton3->Hint = _tr("Go Back To Previous Location"); + ToolButton4->Hint = _tr("Bring Up Search Window"); + TextPageControl->Hint = _tr("Biblical Texts"); + CommentaryPageControl->Hint = _tr("Commentaries"); + LexDictPageControl->Hint = _tr("Lexicons / Dictionaries"); + // AboutBox + AboutBox->Caption = _tr("About The SWORD Project"); + AboutBox->OKButton->Caption = _tr("OK"); + + // bookmarkForm + bookmarkForm->Caption = _tr("Bookmarks"); + + // DevOfTheDay2 + DevOfTheDay2->Caption = _tr("Devotion for Today"); + DevOfTheDay2->ckShowTip->Caption = _tr("Show Devotional at Startup"); + DevOfTheDay2->btnOK->Caption = _tr("&Close"); + DevOfTheDay2->Label1->Caption = _tr("Words To Live By..."); + + // EditEntryForm + EditEntryForm->Caption = _tr("Edit Entry"); + EditEntryForm->Label1->Caption = _tr("Font Size:"); + + + + // ModInstForm + ModInstFrm->Caption = _tr("Found New Module..."); + ModInstFrm->OkBtn->Caption = _tr("OK"); + + // ModVisForm + ModVisForm->Caption = _tr("Check Modules To Show As Tabs"); + ModVisForm->modList->Columns->Items[0]->Caption = _tr("Module"); + ModVisForm->modList->Columns->Items[1]->Caption = _tr("Description"); + ModVisForm->OkBtn->Caption = _tr("OK"); + ModVisForm->CancelBtn->Caption = _tr("Cancel"); + + // NewBMfrm + NewBMfrm->Caption = _tr("Add New Bookmark File"); + NewBMfrm->Label1->Caption = _tr("File Name (without extension):"); + NewBMfrm->Label2->Caption = _tr("Bookmark Section Title:"); + NewBMfrm->OkBtn->Caption = _tr("OK"); + NewBMfrm->CancelBtn->Caption = _tr("Cancel"); + + // OptionsForm + Optionsfrm->Caption = _tr("Preferences"); + Optionsfrm->TabSheet1->Caption = _tr("General"); + Optionsfrm->TabSheet2->Caption = _tr("Special Modules"); + Optionsfrm->TabSheet3->Caption = _tr("Display"); + Optionsfrm->gbPersonalize->Caption = _tr("Personalize"); + Optionsfrm->AutoBMPersonal->Caption = _tr("Save Personal Bookmarks"); + Optionsfrm->AutoBMOther->Caption = _tr("Save Other Bookmarks"); + Optionsfrm->HintPopups->Caption = _tr("Show Hint Pop-ups"); + Optionsfrm->Label4->Caption = _tr("Language"); + Optionsfrm->AutoLayout->Caption = _tr("Save Screen Layout"); + Optionsfrm->HintStrongs->Caption = _tr("Show Hint Over Strongs Numbers"); + Optionsfrm->OkBtn->Caption = _tr("OK"); + Optionsfrm->CancelBtn->Caption = _tr("Cancel"); + Optionsfrm->gbDefModules->Caption = _tr("Original Language Support - Default Modules"); + Optionsfrm->Label7->Caption = _tr("Definitions"); + Optionsfrm->Label8->Caption = _tr("Parsing"); + Optionsfrm->Label5->Caption = _tr("Greek"); + Optionsfrm->Label6->Caption = _tr("Hebrew"); + Optionsfrm->Label10->Caption = _tr("Strong's Numbered Text"); + Optionsfrm->gbDevos->Caption = _tr("Daily Devotionals"); + Optionsfrm->Label9->Caption = _tr("Default Devotional"); + Optionsfrm->devSplashCB->Caption = _tr("Show Devotional Splash Screen on Startup"); + Optionsfrm->devsAsDictsCB->Caption = _tr("Show Devotionals as Dictionaries"); + Optionsfrm->gbGloss->Caption = _tr("Glossaries"); + Optionsfrm->glosAsDictsCB->Caption = _tr("Show Glossaries as Dictionaries"); + Optionsfrm->gbColors->Caption = _tr("Display Colors"); + Optionsfrm->Label2->Caption = _tr("Preview"); + Optionsfrm->Label3->Caption = _tr("Module Type"); + Optionsfrm->Label14->Caption = _tr("Scheme"); + Optionsfrm->Label11->Caption = _tr("Text Font"); + Optionsfrm->btnFont->Caption = _tr("Select Font..."); + Optionsfrm->Label13->Caption = _tr("Verse Number Color"); + Optionsfrm->btnNumClr->Caption = _tr("Select Color..."); + Optionsfrm->AutoVSColor->Caption = _tr("Current Verse Color"); + Optionsfrm->btnCurrVerse->Caption = _tr("Select Color..."); + Optionsfrm->Label15->Caption = _tr("Combo/Edit Fields"); + Optionsfrm->btnFieldClr->Caption = _tr("Select Color..."); + Optionsfrm->Label1->Caption = _tr("Individual Modules (Font Only)"); + Optionsfrm->btnModFonts->Caption = _tr("Select Font..."); + Optionsfrm->Label12->Caption = _tr("Strong's Numbers <...>"); + Optionsfrm->Label16->Caption = _tr("Strong's Tense (...)"); + Optionsfrm->btnStrongClr->Caption = _tr("Select Color..."); + Optionsfrm->btnMorphClr->Caption = _tr("Select Color..."); + + // RangeMaintForm + RangeMaintForm->Caption = _tr("Maintain Custom Ranges"); + RangeMaintForm->Label1->Caption = _tr("Range Name"); + RangeMaintForm->Label2->Caption = _tr("Range Text"); + RangeMaintForm->Label3->Caption = _tr("eg. mat-jo;rev4"); + RangeMaintForm->SpeedButton1->Caption = _tr("&Add"); + RangeMaintForm->SpeedButton2->Caption = _tr("&Remove"); + RangeMaintForm->SpeedButton3->Caption = _tr("&Save"); + RangeMaintForm->SpeedButton4->Caption = _tr("&Cancel"); + + // searchForm + searchForm->Caption = _tr("Search..."); + searchForm->searchBtn->Caption = _tr("Search"); + searchForm->searchTypeGroup->Caption = _tr("Search Type"); + searchForm->searchTypeGroup->Items->CommaText = _tr("\"Mult Word\",\"Phrase\",\"Regular Expression\""); + searchForm->caseSensitiveCkBx->Caption = _tr("Case Sensitive"); + searchForm->searchOptionsGroup->Caption = _tr("Search Options"); + searchForm->scopeGroup->Caption = _tr("Scope"); + searchForm->scopeGroup->Items->CommaText = _tr("\"Entire Module\",\"Current Results\",\"Custom Range\""); + searchForm->customRangeBtn->Caption = _tr("Define Custom Range"); + searchForm->resultsLV->Columns->Items[0]->Caption = _tr("Reference"); + searchForm->resultsLV->Columns->Items[1]->Caption = _tr("Preview..."); + searchForm->lblChooseModule->Caption = _tr("Choose Module"); + searchForm->Button2->Caption = _tr("&Help"); + + // VerseSelFrm + VerseSelFrm->Caption = _tr("Type Verse"); + VerseSelFrm->OkBtn->Caption = _tr("OkBtn"); + VerseSelFrm->CancelBtn->Caption = _tr("Cancel"); + + // VerseListFrm + VerseListFrm->Caption = _tr("Verse List"); + + // Print Form + PrintForm->shtSelection->Caption = _tr("Print Selection"); + PrintForm->radText->Caption = _tr("Bible Text"); + PrintForm->radComm->Caption = _tr("Commentary Text"); + PrintForm->radLD->Caption = _tr("Lexicon/Dictionary Text"); + PrintForm->lblModName->Caption = _tr("Module Name"); + PrintForm->GroupBox1->Caption = _tr("Print Source"); + PrintForm->GroupBox2->Caption = _tr("Print Range"); + PrintForm->staticRange->Caption = _tr("Verse List"); + PrintForm->shtSetup->Caption = _tr("Page Setup"); + PrintForm->labelLeft->Caption = _tr("Left:"); + PrintForm->labelRight->Caption = _tr("Right:"); + PrintForm->labelTop->Caption = _tr("Top:"); + PrintForm->labelBot->Caption = _tr("Bottom:"); + PrintForm->ckHeader->Caption = _tr("Print Header"); + PrintForm->labelHeader->Caption = _tr("Header Text:"); + PrintForm->ckFooter->Caption = _tr("Print Footer"); + PrintForm->labelFooter->Caption = _tr("Footer Text:"); + PrintForm->editFooter->Text = _tr("Page &p of &t"); + PrintForm->GroupBox4->Caption = _tr("Margins (Inches)"); + PrintForm->GroupBox5->Caption = _tr("Header/Footer"); + PrintForm->shtFormat->Caption = _tr("Formatting Options"); + PrintForm->GroupBox3->Caption = _tr("Font and Size"); + PrintForm->Label10->Caption = _tr("Chapter Heading"); + PrintForm->Label11->Caption = _tr("Body Text:"); + PrintForm->Label12->Caption = _tr("Verse Numbers:"); + PrintForm->ckBookHead->Caption = _tr("Book Name"); + PrintForm->ckChHead->Caption = _tr("Chapter Headings"); + PrintForm->ckParagraph->Caption = _tr("Paragraph Format"); + PrintForm->labelFont->Caption = _tr("Font:"); + PrintForm->ckVSNum->Caption = _tr("Verse Numbers"); + PrintForm->ckSuperVS->Caption = _tr("Superscripted"); + PrintForm->ckPrefix->Caption = _tr("Prefixed (John 1:1 KJV)..."); + PrintForm->ckPostfix->Caption = _tr("Postfixed ...(John 1:1 KJV)"); + PrintForm->btnPrint->Caption = _tr("&Print"); + PrintForm->btnPreview->Caption = _tr("P&review..."); + PrintForm->btnSetup->Caption = _tr("Printer&s..."); + PrintForm->btnClose->Caption = _tr("&Close"); + + // Print Preview Form + PreviewForm->btnPrint->Caption = "Print"; + PreviewForm->btnClose->Caption = "&Close"; + +} + + +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormShow(TObject *Sender) +{ + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit, eitend; + AnsiString s1; + char textFont[128]; + char commentFont[128]; + char LDFont[128]; + char tempTextFont[128]; + char tempCommFont[128]; + char tempLDFont[128]; + int loop; + int maxFiles; + TColor fieldColor; + string tmpval; + bool showDevos; + bool showGlos; + bool showDevOfDay = false; + +/* + showLocked = true; + for (int i=0;i<=ParamCount();i++) { + if (LowerCase(ParamStr(i)) == "-noLocked") + showLocked = false; + } +*/ + + logmodstate = true; + freshdict = true; + if (SWLog::systemlog) + delete SWLog::systemlog; + SWLog::systemlog = new SWWinLog(this->Handle); // set the system logger to our MSWindows specific SWLog class + tmpval = ((eit = optionsconf->Sections["System"].find("MaxFiles")) != optionsconf->Sections["System"].end())? (*eit).second : (string)""; + if ((maxFiles = atoi(tmpval.c_str()))) { + FileMgr::systemFileMgr.maxFiles = maxFiles; + } + + + tmpval = ((eit = optionsconf->Sections["Hints"].find("On")) != optionsconf->Sections["Hints"].end())? (*eit).second : (string)"1"; + + if (atoi(tmpval.c_str())) + Form1->ShowHint = true; + else Form1->ShowHint = false; + + tmpval = ((eit = optionsconf->Sections["General"].find("DevsAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)""; + showDevos = (!stricmp(tmpval.c_str(), "true")); + + tmpval = ((eit = optionsconf->Sections["General"].find("GlosAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)""; + showGlos = !(!stricmp(tmpval.c_str(), "false")); + + tmpval = ((eit = optionsconf->Sections["Appearance"].find("locale")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"en_us"; + i12ize(tmpval.c_str()); + + DefaultVSKey = new VerseKey(); + DefaultStrKey = new StrKey(); + + +// DefaultVSKey->setLocale(tmpval.c_str()); + + tmpval = ((eit = optionsconf->Sections["Appearance"].find("TextFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman"; + strcpy(tempTextFont, tmpval.c_str()); // Temporary holding place for text font + + tmpval = ((eit = optionsconf->Sections["Appearance"].find("CommentFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman"; + strcpy(tempCommFont, tmpval.c_str()); + + tmpval = ((eit = optionsconf->Sections["Appearance"].find("LDFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman"; + strcpy(tempLDFont, tmpval.c_str()); + + fillVKeySelector(DefaultVSKey); + + cbBook->ItemIndex = cbBook->Items->IndexOf("James"); + + DefaultVSKey->Persist(1); // when set to a module, make the module hold on to this actual key and not a copy + *DefaultVSKey = "James 1:19"; // set to our standard starting verse + DefaultStrKey->Persist(1); + *DefaultStrKey = ""; + + mainmgr = new BibleCSMGR(ModInstFrm); + + // Load devotion and show form + String devoKey = TDateTime::CurrentDate().FormatString("mm.dd"); + tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("DailyDevotion")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) { + it->second->SetKey(devoKey.c_str()); + DevOfTheDay2->RichTip->Text = it->second->StripText(); + } + tmpval = ((eit = optionsconf->Sections["General"].find("TipOfTheDay")) != optionsconf->Sections["General"].end())? (*eit).second : (string)""; + if (!stricmp(tmpval.c_str(), "Devotional")) { + DevOfTheDay2->ckShowTip->Checked = true; + showDevOfDay = true; + } + // If no devotional text is shown then a general how-to is diplayed. + if(DevOfTheDay2->RichTip->Text == "") + DevOfTheDay2->RichTip->Text = "A Daily Devotional is not installed or is not configured for use with the \"Devotional of the Day.\n\nTo configure an installed devotional for use with this dialog box open the Preferences dialog box by going to the \"Options\" menu and selecting \"Preferences...\"; then click the \"Special Modules\" tab. Find the \"Default Devotional\" option and select a devotional to use from the list. If nothing shows up in the pull-down list you will need to install a devotional. This can be done by using the Install Manager. Some examples of devotionals are \"Spurgeon's Morning and Evening\" or \"Jonathan Bagster's Daily Light\".\n\nVisit our website at www.crosswire.org for more information."; + + + for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) { + bool devotional = false; + bool glossary = false; + + // leave out enciphered texts with no key + if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) { + if ((eit = (*sit).second.find("CipherKey")) != (*sit).second.end()) { + const char *cipherKey = (char *)(*eit).second.c_str(); + if (strlen(cipherKey) < 1) + continue; + } + + for (eit = (*sit).second.lower_bound("Feature"), eitend = (*sit).second.upper_bound("Feature"); eit != eitend; eit++) { + const char *feature = eit->second.c_str(); + if (!stricmp(feature, "StrongsNumbers")) { + Optionsfrm->strongsNumsCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name()); + if (optionsconf->Sections["ModDefaults"].find("StrongsNumbers") == optionsconf->Sections["ModDefaults"].end()) + (*optionsconf)["ModDefaults"]["StrongsNumbers"] = it->second->Name(); + } + if (!stricmp(feature, "GreekDef")) { + Optionsfrm->greekDefCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name()); + if (optionsconf->Sections["ModDefaults"].find("GreekDef") == optionsconf->Sections["ModDefaults"].end()) + (*optionsconf)["ModDefaults"]["GreekDef"] = it->second->Name(); + } + if (!stricmp(feature, "GreekParse")) { + Optionsfrm->greekParseCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name()); + if (optionsconf->Sections["ModDefaults"].find("GreekParse") == optionsconf->Sections["ModDefaults"].end()) + (*optionsconf)["ModDefaults"]["GreekParse"] = it->second->Name(); + } + if (!stricmp(feature, "HebrewDef")) { + Optionsfrm->hebrewDefCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name()); + if (optionsconf->Sections["ModDefaults"].find("HebrewDef") == optionsconf->Sections["ModDefaults"].end()) + (*optionsconf)["ModDefaults"]["HebrewDef"] = it->second->Name(); + } + if (!stricmp(feature, "HebrewParse")) { + Optionsfrm->hebrewParseCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name()); + if (optionsconf->Sections["ModDefaults"].find("HebrewParse") == optionsconf->Sections["ModDefaults"].end()) + (*optionsconf)["ModDefaults"]["HebrewParse"] = it->second->Name(); + } + if (!stricmp(feature, "DailyDevotion")) { + Optionsfrm->dailyDefaultCB->Items->AddObject(it->second->Description(), (TObject *)it->second->Name()); + devotional = true; + if (optionsconf->Sections["ModDefaults"].find("DailyDevotion") == optionsconf->Sections["ModDefaults"].end()) + (*optionsconf)["ModDefaults"]["DailyDevotion"] = it->second->Name(); + } + if (!stricmp(feature, "Glossary")) { + glossary = true; + } + optionsconf->Save(); + } + } + + if (!strcmp((*it).second->Type(), "Biblical Texts")) { + strcpy(textFont, tempTextFont); + if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + strcpy(textFont,(char *)(*eit).second.c_str()); + } + } + CreateTextPane((*it).second, textFont); + } + if (!strcmp((*it).second->Type(), "Commentaries")) { + strcpy(commentFont, tempCommFont); + if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + strcpy(commentFont,(char *)(*eit).second.c_str()); + } + } + CreateCommentPane((*it).second, commentFont); + } + if (!strcmp((*it).second->Type(), "Generic Books")) { + strcpy(commentFont, tempCommFont); + if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + strcpy(commentFont,(char *)(*eit).second.c_str()); + } + } + CreateBookPane((*it).second, commentFont); + } + if (!strcmp((*it).second->Type(), "Lexicons / Dictionaries")) { + strcpy(LDFont, tempLDFont); + if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + strcpy(LDFont,(char *)(*eit).second.c_str()); + } + } + if ((!devotional && !glossary) || + (showDevos && devotional) || + (showGlos && glossary)) + CreateLDPane((*it).second, LDFont); + } + } + + layoutconf = new SWConfig("./layout.conf"); + + if ((sit = layoutconf->Sections.find("Screen")) != layoutconf->Sections.end()) { + + if ((eit = (*sit).second.find("MainTop")) != (*sit).second.end()) + Form1->Top = atoi((*eit).second.c_str()); + if ((eit = (*sit).second.find("MainLeft")) != (*sit).second.end()) + Form1->Left = atoi((*eit).second.c_str()); + if ((eit = (*sit).second.find("MainHeight")) != (*sit).second.end()) + Form1->Height = atoi((*eit).second.c_str()); + if ((eit = (*sit).second.find("MainWidth")) != (*sit).second.end()) + Form1->Width = atoi((*eit).second.c_str()); + + Form1->WindowState = (sit->second["Maximized"] == "true") ? wsMaximized : wsNormal; + + if ((eit = (*sit).second.find("TextComHeight")) != (*sit).second.end()) + pnlTextCom->Height = atoi((*eit).second.c_str()); + if ((eit = (*sit).second.find("TextWidth")) != (*sit).second.end()) + pnlText->Width = atoi((*eit).second.c_str()); + if ((eit = (*sit).second.find("SearchTop")) != (*sit).second.end()){ + searchForm->Top = atoi((*eit).second.c_str()); + searchForm->Position = poDesigned; + } + + if ((eit = (*sit).second.find("SearchLeft")) != (*sit).second.end()) + searchForm->Left = atoi((*eit).second.c_str()); + if ((eit = (*sit).second.find("SearchHeight")) != (*sit).second.end()) + searchForm->Height = atoi((*eit).second.c_str()); + if ((eit = (*sit).second.find("SearchWidth")) != (*sit).second.end()) + searchForm->Width = atoi((*eit).second.c_str()); + + searchForm->WindowState = (sit->second["SearchMaximized"] == "true") ? wsMaximized : wsNormal; + } + + + for (loop = 0; loop < 10; loop++) + ctrlstates.insert(ctrlstates.begin(), 0); + + + + // Add options to Options Main Menu choice + sit = layoutconf->Sections.find("ModuleOptions"); + OptionsList options = mainmgr->getGlobalOptions(); + for (OptionsList::iterator it = options.begin(); it != options.end(); it++) { + TMenuItem *newitem = new TMenuItem(MainMenu1); + newitem->Caption = it->c_str(); + newitem->Default = false; + newitem->OnClick = OptionShowVals; + newitem->Hint = mainmgr->getGlobalOptionTip(it->c_str()); + if (sit != layoutconf->Sections.end()) { + if ((eit = sit->second.find(it->c_str())) != sit->second.end()) + mainmgr->setGlobalOption(it->c_str(), eit->second.c_str()); + } + OptionsList values = mainmgr->getGlobalOptionValues(it->c_str()); + for (OptionsList::iterator it2 = values.begin(); it2 != values.end(); it2++) { + TMenuItem *newitem2 = new TMenuItem(MainMenu1); + newitem2->Caption = it2->c_str(); + newitem2->Default = false; + newitem2->OnClick = GlobalOptionChange; + newitem->Add(newitem2); + } +// Mainmenu->Items->Add(newitem); + Options2->Add(newitem); + } + + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()){ + if ((eit = (*sit).second.find("FieldColor")) != (*sit).second.end()) + fieldColor = TColor(atoi((*eit).second.c_str())); + else fieldColor = clAqua; + } + + cbBook->Color = fieldColor; + CHBox->Color = fieldColor; + VSBox->Color = fieldColor; + freeHandLookup->Color = fieldColor; + DictKeyEdit->Color = fieldColor; + + if ((sit = layoutconf->Sections.find("History")) != layoutconf->Sections.end()) { + + eitend = (*sit).second.upper_bound("SearchText"); + for (eit = (*sit).second.lower_bound("SearchText"); eit != eitend; eit++) + searchForm->SearchText->Items->Add(UTF8ToWideString(eit->second.c_str())); + + eitend = (*sit).second.upper_bound("LookupText"); + for (eit = (*sit).second.lower_bound("LookupText"); eit != eitend; eit++) + freeHandLookup->Items->Add(eit->second.c_str()); + + if ((eit = (*sit).second.find("LastTextModule")) != (*sit).second.end()) { + for (int i = 0; i < TextPageControl->PageCount; i++) { + if (!strcmp(TextPageControl->Pages[i]->Caption.c_str(), (*eit).second.c_str())) { + TextPageControl->ActivePageIndex = i; + break; + } + } + } + if ((eit = (*sit).second.find("LastComModule")) != (*sit).second.end()) { + for (int i = 0; i < CommentaryPageControl->PageCount; i++) { + if (!strcmp(CommentaryPageControl->Pages[i]->Caption.c_str(), (*eit).second.c_str())) { + CommentaryPageControl->ActivePageIndex = i; + break; + } + } + } + if (this->Tag) { + NavigateVerseURL((char*)(this->Tag)); + } + else if ((eit = (*sit).second.find("LastVerse")) != (*sit).second.end()) { + freeHandLookup->Text = (*eit).second.c_str(); + char ret = '\r'; + freeHandLookupoldKeyPress(0, ret); + } + } + + ConfigEntMap *section; + TPageControl *pc = 0; + for (int pcs = 0; pcs < 3; pcs++) { + switch (pcs) { + case 0: + pc = TextPageControl; + section = &(*layoutconf)["TextView"]; + break; + case 1: + pc = CommentaryPageControl; + section = &(*layoutconf)["CommentView"]; + break; + case 2: + pc = LexDictPageControl; + section = &(*layoutconf)["LDView"]; + break; + } + + for (int i = 0; i < pc->PageCount; i++) { + string heading = pc->Pages[i]->Caption.c_str(); + pc->Pages[i]->TabVisible = !((*section)[heading.c_str()] == "false"); // !false allows default to be true + } + } + + SplashPg->Hide(); + if(showDevOfDay){ + DevOfTheDay2->Show(); + } + RefreshActiveSheet(LexDictPageControl); + RefreshActiveSheet(CommentaryPageControl); + RefreshActiveSheet(TextPageControl); +} + +bool TForm1::hasFeature(SWMgr *mgr, const char *modName, const char *feature) { + SectionMap::iterator sit; + ConfigEntMap::iterator eit, eitend; + + if ((sit = mgr->config->Sections.find(modName)) != mgr->config->Sections.end()) { + for (eit = (*sit).second.lower_bound("Feature"), eitend = (*sit).second.upper_bound("Feature"); eit != eitend; eit++) { + const char *tfeature = eit->second.c_str(); + if (!stricmp(tfeature, feature)) + return true; + } + } + return false; +} + + +//--------------------------------------------------------------------------- +void __fastcall TForm1::LookupPokeData(TObject *Sender) +{ + char buf[255]; + char *token; + ModMap::iterator it; + + strncpy(buf, Lookup->Text.c_str(), 254); + buf[254] = 0; + token = strtok(buf, " "); + if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) { + token = strtok(NULL, ""); + (*it).second->SetKey(token); + Lookup->Text = (const char *)(*(*it).second); + } + else Lookup->Text = ""; + +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::SearchPokeData(TObject *Sender) +{ + char buf[255]; + char *token; + ModMap::iterator it; + AnsiString retval = ""; + + strncpy(buf, Search->Text.c_str(), 254); + buf[254] = 0; + token = strtok(buf, " "); + if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) { + token = strtok(NULL, ""); + ListKey &results = (*it).second->Search(token, REG_ICASE); + while (!results.Error()) { + retval = retval + (const char *)results + "; "; + results++; + } + Search->Text = retval; + } + else Search->Text = ""; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::UpDown3Click(TObject *Sender, TUDBtnType Button) +{ + ModMap::iterator it; + + it = mainmgr->Modules.find(LexDictPageControl->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + if (Button == btNext) + (*((*it).second))++; + else (*((*it).second))--; + DictKeyEdit->Text = UTF8ToWideString(((*it).second)->KeyText()); + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::UpDown1Click(TObject *Sender, TUDBtnType Button) +{ + if (Sender == UpDown1) + UpDown2->Position = 1; + btnLookupClick(Sender); +} +//--------------------------------------------------------------------------- + +void TForm1::RestoreState(ModState *state) +{ + ModMap::iterator it; + + if (state) { + state->pc->ActivePage = (TTabSheet *)state->ap; + if ((state->pc == TextPageControl) || (state->pc == CommentaryPageControl)) { + if (mainmgr) { + it = mainmgr->Modules.find(state->pc->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + SWModule *module = it->second; + if (!strcmp(module->Type(0), "Generic Books")) { + module->SetKey(state->key); + } + else { + *DefaultVSKey = state->key; + TextKeyChanged(); + } + } + } + } + if (state->pc == LexDictPageControl) { + DictKeyEdit->Text = UTF8ToWideString((const char *)state->key); + } + if (state->pc->ActivePage->ControlCount){ + Form1->SetFocusedControl( (TWinControl *)state->pc->ActivePage->Controls[0] ); + } + } +} + + +void __fastcall TForm1::BackbtnClick(TObject *Sender) +{ + list <ModState *>::iterator it; + logmodstate = false; + it = modstates.begin(); + if (it != modstates.end()) { + it++; + + if (it != modstates.end()) { + RestoreState(*it); + delete *modstates.begin(); + modstates.erase(modstates.begin(), it); + } + } + logmodstate = true; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Button1Click(TObject *Sender) +{ +/* + list <ModState *>::iterator it; + ListBox1->Clear(); + for (it = modstates.begin(); it != modstates.end(); it++) { + ListBox1->Items->Add((*it)->ap->Caption.c_str()); + } +*/ +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::CopyasBGreekTransliteration1Click(TObject *Sender) +{ + char *retbuf; + int len; + TClipboard *clip = new TClipboard(); + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + len = rtf->SelText.Length() * 2; + retbuf = new char [ len ]; + if (!Greek2bGreek(retbuf, rtf->SelText.c_str(), len)) { + clip->SetTextBuf(retbuf); + } + delete clip; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Copy1Click(TObject *Sender) +{ + int wordstart; + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + if (!rtf->SelLength) { + for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--); + rtf->SelStart = (wordstart > -1) ? wordstart: 0; + for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++); + rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length()) - rtf->SelStart - 1; + } + rtf->CopyToClipboard(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BookmarkItemClick(TObject *Sender) +{ + TMenuItem *menuchoice = (TMenuItem *)Sender; + const char *source = menuchoice->Caption.c_str(); + char *value = new char [strlen(source) + 1]; + int k = 0; + for (unsigned int j = 0; j < strlen(source); j++) { + if (source[j] != '&') + value[k++] = source[j]; + } + value[k] = 0; + *DefaultVSKey = value; + delete [] value; + TextKeyChanged(); +} + +void __fastcall TForm1::AddBookmark1Click(TObject *Sender) +{ +// TMenuItem *newitem; + + bookmarkForm->bmtree->Items->AddChild(bookmarkForm->bmtree->Items->Item[0], (const char *)*DefaultVSKey); +} + +void TForm1::AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree) +{ + TMenuItem *newitem; + + for (tree = tree->getFirstChild(); tree; tree = tree->getNextSibling()) { + newitem = new TMenuItem(menu); + newitem->Caption = tree->Text; + if (!tree->getFirstChild()) + newitem->OnClick = BookmarkItemClick; + item->Add(newitem); + AddSectionToMenu(menu, newitem, tree); + } +} + +void TForm1::RefreshBookmarksMenu(TMenu *menu, TTreeView *treeview) +{ + TMenuItem *newitem; + TTreeNode *tree = 0; + + if (treeview->Items->Count) + tree = treeview->Items->Item[0]; + + while (menu->Items->Count > 3) + menu->Items->Delete(3); + + for (;tree;tree = tree->getNextSibling()) { + newitem = new TMenuItem(menu); + newitem->Caption = tree->Text; + menu->Items->Add(newitem); + AddSectionToMenu(menu, newitem, tree); + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BookmarkbtnClick(TObject *Sender) +{ + TPoint menup, point; + point.x = 0; + point.y = Bookmarkbtn->Height; + menup = Bookmarkbtn->ClientToScreen(point); + RefreshBookmarksMenu(BookmarkPopup, bookmarkForm->bmtree); + BookmarkPopup->Popup(menup.x, menup.y); +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::EditBookmarks1Click(TObject *Sender) +{ + bookmarkForm->Show(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + char buf[5]; + int val; + ModMap::iterator it; + TPageControl *pc = TextPageControl; + + if ((Shift.Contains(ssCtrl)) && (!Shift.Contains(ssAlt))) { + if ((Key >= '0') && (Key <= '9')) { + sprintf(buf, "%c", Key); + val = atoi(buf); + + if (!Shift.Contains(ssShift)) { + if ((Screen->ActiveControl == CommentaryPageControl) || (IsChild(CommentaryPageControl->Handle, Screen->ActiveControl->Handle))) + pc = CommentaryPageControl; + if ((Screen->ActiveControl == LexDictPageControl) || (IsChild(LexDictPageControl->Handle, Screen->ActiveControl->Handle))) + pc = LexDictPageControl; + + it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + if (ctrlstates[val]) + delete ctrlstates[val]; + + ctrlstates[val] = new ModState(pc, pc->ActivePage, (*it).second->KeyText()); + } + } + else RestoreState(ctrlstates[val]); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Options1Click(TObject *Sender) +{ + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + ConfigEntMap emap; + int color; + string tmpval; + + //********************************* + //Initialize Preferences Dialog Box + + Optionsfrm->LoadDispSettings(optionsconf); + /* + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) { + if ((*sit).second.find("AutoVSColor") != (*sit).second.end()) + Optionsfrm->AutoVSColor->Checked = (((atoi((*(*sit).second.find("AutoVSColor")).second.c_str()))) ? true:false); + else Optionsfrm->AutoVSColor->Checked = true; + + if ((*sit).second.find("TextBackColor") != (*sit).second.end()) + Optionsfrm->FontDialogText->BackColor = TColor(atoi((*(*sit).second.find("TextBackColor")).second.c_str())); + else Optionsfrm->FontDialogText->BackColor = TColor(clWhite); + + if ((*sit).second.find("CommentBackColor") != (*sit).second.end()) + Optionsfrm->FontDialogComment->BackColor = TColor(atoi((*(*sit).second.find("CommentBackColor")).second.c_str())); + else Optionsfrm->FontDialogComment->BackColor = TColor(clWhite); + + if ((*sit).second.find("LDBackColor") != (*sit).second.end()) + Optionsfrm->FontDialogLD->BackColor = TColor(atoi((*(*sit).second.find("LDBackColor")).second.c_str())); + else Optionsfrm->FontDialogLD->BackColor = TColor(clWhite); + + if ((*sit).second.find("PopupBackColor") != (*sit).second.end()) + Optionsfrm->FontDialogPopup->BackColor = TColor(atoi((*(*sit).second.find("PopupBackColor")).second.c_str())); + else Optionsfrm->FontDialogPopup->BackColor = TColor(clInfoText); + + if ((*sit).second.find("TextFontName") != (*sit).second.end()) + Optionsfrm->FontDialogText->Font->Name = ((*(*sit).second.find("TextFontName")).second.c_str()); + else Optionsfrm->FontDialogText->Font->Name = "Times New Roman"; + + if ((*sit).second.find("CommentFontName") != (*sit).second.end()) + Optionsfrm->FontDialogComment->Font->Name = ((*(*sit).second.find("CommentFontName")).second.c_str()); + else Optionsfrm->FontDialogComment->Font->Name = "Times New Roman"; + + if ((*sit).second.find("LDFontName") != (*sit).second.end()) + Optionsfrm->FontDialogLD->Font->Name = ((*(*sit).second.find("LDFontName")).second.c_str()); + else Optionsfrm->FontDialogLD->Font->Name = "Times New Roman"; + + if ((*sit).second.find("PopupFontName") != (*sit).second.end()) + Optionsfrm->FontDialogPopup->Font->Name = ((*(*sit).second.find("PopupFontName")).second.c_str()); + else Optionsfrm->FontDialogPopup->Font->Name = "MS Sans Serif"; + + if ((*sit).second.find("TextFontSize") != (*sit).second.end()) + Optionsfrm->FontDialogText->Font->Size = (atoi ((*(*sit).second.find("TextFontSize")).second.c_str())); + else Optionsfrm->FontDialogText->Font->Size = 10; + + if ((*sit).second.find("CommentFontSize") != (*sit).second.end()) + Optionsfrm->FontDialogComment->Font->Size = (atoi ((*(*sit).second.find("CommentFontSize")).second.c_str())); + else Optionsfrm->FontDialogComment->Font->Size = 10; + + if ((*sit).second.find("LDFontSize") != (*sit).second.end()) + Optionsfrm->FontDialogLD->Font->Size = (atoi ((*(*sit).second.find("LDFontSize")).second.c_str())); + else Optionsfrm->FontDialogLD->Font->Size = 10; + + if ((*sit).second.find("PopupFontSize") != (*sit).second.end()) + Optionsfrm->FontDialogPopup->Font->Size = (atoi ((*(*sit).second.find("PopupFontSize")).second.c_str())); + else Optionsfrm->FontDialogPopup->Font->Size = 10; + + if ((*sit).second.find("TextFontColor") != (*sit).second.end()) + Optionsfrm->FontDialogText->Font->Color = TColor(atoi ((*(*sit).second.find("TextFontColor")).second.c_str())); + else Optionsfrm->FontDialogText->Font->Color = clBlack; + + if ((*sit).second.find("CommentFontColor") != (*sit).second.end()) + Optionsfrm->FontDialogComment->Font->Color = TColor(atoi ((*(*sit).second.find("CommentFontColor")).second.c_str())); + else Optionsfrm->FontDialogComment->Font->Color = clBlack; + + if ((*sit).second.find("LDFontColor") != (*sit).second.end()) + Optionsfrm->FontDialogLD->Font->Color = TColor(atoi ((*(*sit).second.find("LDFontColor")).second.c_str())); + else Optionsfrm->FontDialogLD->Font->Color = clBlack; + + if ((*sit).second.find("PopupFontColor") != (*sit).second.end()) + Optionsfrm->FontDialogPopup->Font->Color = TColor(atoi ((*(*sit).second.find("PopupFontColor")).second.c_str())); + else Optionsfrm->FontDialogPopup->Font->Color = clBlack; + } + */ + if ((sit = optionsconf->Sections.find("Bookmarks")) != optionsconf->Sections.end()) { + Optionsfrm->AutoBMPersonal->Checked = ((atoi(sit->second["AutoSavePersonal"].c_str()))?true:false); + Optionsfrm->AutoBMOther->Checked = ((atoi(sit->second["AutoSaveOther"].c_str()))?true:false); + } + if ((sit = optionsconf->Sections.find("Layout")) != optionsconf->Sections.end()) { + Optionsfrm->AutoLayout->Checked = ((atoi(sit->second["AutoSaveLayout"].c_str()))?true:false); + + } + + Optionsfrm->HintStrongs->Checked = true; + tmpval = ((eit = optionsconf->Sections["HintStrongs"].find("On")) != optionsconf->Sections["HintStrongs"].end())? (*eit).second : (string)"1"; + if (!atoi(tmpval.c_str())) + Optionsfrm->HintStrongs->Checked = false; + + Optionsfrm->HintPopups->Checked = true; + tmpval = ((eit = optionsconf->Sections["Hints"].find("On")) != optionsconf->Sections["Hints"].end())? (*eit).second : (string)"1"; + if (!atoi(tmpval.c_str())) + Optionsfrm->HintPopups->Checked = false; + + Optionsfrm->devsAsDictsCB->Checked = false; + tmpval = ((eit = optionsconf->Sections["General"].find("DevsAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"false"; + if (!stricmp(tmpval.c_str(), "true")) + Optionsfrm->devsAsDictsCB->Checked = true; + + Optionsfrm->glosAsDictsCB->Checked = true; + tmpval = ((eit = optionsconf->Sections["General"].find("GlosAsDicts")) != optionsconf->Sections["General"].end())? (*eit).second : (string)"true"; + if (stricmp(tmpval.c_str(), "false")) + Optionsfrm->glosAsDictsCB->Checked = true; + + Optionsfrm->devSplashCB->Checked = false; + tmpval = ((eit = optionsconf->Sections["General"].find("TipOfTheDay")) != optionsconf->Sections["General"].end())? (*eit).second : (string)""; + if (!stricmp(tmpval.c_str(), "Devotional")) + Optionsfrm->devSplashCB->Checked = true; + + const char *localeName = LocaleMgr::systemLocaleMgr.getDefaultLocaleName(); + SWLocale *defLocale = LocaleMgr::systemLocaleMgr.getLocale(localeName); + Optionsfrm->localeCB->ItemIndex = Optionsfrm->localeCB->Items->IndexOf((defLocale)?defLocale->getDescription():"English (US)"); + + tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("GreekDef")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) { + Optionsfrm->greekDefCB->ItemIndex = Optionsfrm->greekDefCB->Items->IndexOf(it->second->Description()); + } + + tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("GreekParse")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) { + Optionsfrm->greekParseCB->ItemIndex = Optionsfrm->greekParseCB->Items->IndexOf(it->second->Description()); + } + + tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("HebrewDef")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) { + Optionsfrm->hebrewDefCB->ItemIndex = Optionsfrm->hebrewDefCB->Items->IndexOf(it->second->Description()); + } + + tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("HebrewParse")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) { + Optionsfrm->hebrewParseCB->ItemIndex = Optionsfrm->hebrewParseCB->Items->IndexOf(it->second->Description()); + } + + tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("DailyDevotion")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) { + Optionsfrm->dailyDefaultCB->ItemIndex = Optionsfrm->dailyDefaultCB->Items->IndexOf(it->second->Description()); + } + + tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("StrongsNumbers")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if ((it = mainmgr->Modules.find(tmpval)) != mainmgr->Modules.end()) { + Optionsfrm->strongsNumsCB->ItemIndex = Optionsfrm->strongsNumsCB->Items->IndexOf(it->second->Description()); + } + //********************************* + // Show Dialog Box + if (Optionsfrm->ShowModal() == mrOk) { + // Save Preferences settings :) + emap = optionsconf->Sections["Appearance"]; + emap.erase("AutoVSColor"); emap.insert(ConfigEntMap::value_type("AutoVSColor", IntToStr((Optionsfrm->AutoVSColor->Checked)?1:0).c_str())); + emap.erase("CurrentVSColor"); emap.insert(ConfigEntMap::value_type("CurrentVSColor", IntToStr(Optionsfrm->ColorDialogVS->Color).c_str())); + emap.erase("StrongsColor"); emap.insert(ConfigEntMap::value_type("StrongsColor", IntToStr(Optionsfrm->ColorDialogStrongs->Color).c_str())); + emap.erase("MorphColor"); emap.insert(ConfigEntMap::value_type("MorphColor", IntToStr(Optionsfrm->ColorDialogMorph->Color).c_str())); + emap.erase("VSNumberColor"); emap.insert(ConfigEntMap::value_type("VSNumberColor", IntToStr(Optionsfrm->ColorDialogVerseNum->Color).c_str())); + emap.erase("FieldColor"); emap.insert(ConfigEntMap::value_type("FieldColor", IntToStr(Optionsfrm->ColorDialogField->Color).c_str())); + + emap.erase("TextBackColor"); emap.insert(ConfigEntMap::value_type("TextBackColor", IntToStr(Optionsfrm->FontDialogText->BackColor).c_str())); + emap.erase("CommentBackColor"); emap.insert(ConfigEntMap::value_type("CommentBackColor", IntToStr(Optionsfrm->FontDialogComment->BackColor).c_str())); + emap.erase("LDBackColor"); emap.insert(ConfigEntMap::value_type("LDBackColor", IntToStr(Optionsfrm->FontDialogLD->BackColor).c_str())); + emap.erase("PopupBackColor"); emap.insert(ConfigEntMap::value_type("PopupBackColor", IntToStr(Optionsfrm->FontDialogPopup->BackColor).c_str())); + + emap.erase("TextFontName"); emap.insert(ConfigEntMap::value_type("TextFontName", (Optionsfrm->FontDialogText->Font->Name).c_str())); + emap.erase("CommentFontName"); emap.insert(ConfigEntMap::value_type("CommentFontName", (Optionsfrm->FontDialogComment->Font->Name).c_str())); + emap.erase("LDFontName"); emap.insert(ConfigEntMap::value_type("LDFontName", (Optionsfrm->FontDialogLD->Font->Name).c_str())); + emap.erase("PopupFontName"); emap.insert(ConfigEntMap::value_type("PopupFontName", (Optionsfrm->FontDialogPopup->Font->Name).c_str())); + + emap.erase("TextFontSize"); emap.insert(ConfigEntMap::value_type("TextFontSize", IntToStr(Optionsfrm->FontDialogText->Font->Size).c_str())); + emap.erase("CommentFontSize"); emap.insert(ConfigEntMap::value_type("CommentFontSize", IntToStr(Optionsfrm->FontDialogComment->Font->Size).c_str())); + emap.erase("LDFontSize"); emap.insert(ConfigEntMap::value_type("LDFontSize", IntToStr(Optionsfrm->FontDialogLD->Font->Size).c_str())); + emap.erase("PopupFontSize"); emap.insert(ConfigEntMap::value_type("PopupFontSize", IntToStr(Optionsfrm->FontDialogPopup->Font->Size).c_str())); + + emap.erase("TextFontColor"); emap.insert(ConfigEntMap::value_type("TextFontColor", IntToStr(Optionsfrm->FontDialogText->Font->Color).c_str())); + emap.erase("CommentFontColor"); emap.insert(ConfigEntMap::value_type("CommentFontColor", IntToStr(Optionsfrm->FontDialogComment->Font->Color).c_str())); + emap.erase("LDFontColor"); emap.insert(ConfigEntMap::value_type("LDFontColor", IntToStr(Optionsfrm->FontDialogLD->Font->Color).c_str())); + emap.erase("PopupFontColor"); emap.insert(ConfigEntMap::value_type("PopupFontColor", IntToStr(Optionsfrm->FontDialogPopup->Font->Color).c_str())); + + emap.erase("locale"); emap.insert(ConfigEntMap::value_type("locale", (const char *)Optionsfrm->localeCB->Items->Objects[Optionsfrm->localeCB->ItemIndex])); + optionsconf->Sections["Appearance"] = emap; + + emap = optionsconf->Sections["ModDefaults"]; + + if (Optionsfrm->greekDefCB->ItemIndex > -1) { + emap.erase("GreekDef"); emap.insert(ConfigEntMap::value_type("GreekDef", (const char *)Optionsfrm->greekDefCB->Items->Objects[Optionsfrm->greekDefCB->ItemIndex])); + } + if (Optionsfrm->greekParseCB->ItemIndex > -1) { + emap.erase("GreekParse"); emap.insert(ConfigEntMap::value_type("GreekParse", (const char *)Optionsfrm->greekParseCB->Items->Objects[Optionsfrm->greekParseCB->ItemIndex])); + } + if (Optionsfrm->hebrewDefCB->ItemIndex > -1) { + emap.erase("HebrewDef"); emap.insert(ConfigEntMap::value_type("HebrewDef", (const char *)Optionsfrm->hebrewDefCB->Items->Objects[Optionsfrm->hebrewDefCB->ItemIndex])); + } + if (Optionsfrm->hebrewParseCB->ItemIndex > -1) { + emap.erase("HebrewParse"); emap.insert(ConfigEntMap::value_type("HebrewParse", (const char *)Optionsfrm->hebrewParseCB->Items->Objects[Optionsfrm->hebrewParseCB->ItemIndex])); + } + if (Optionsfrm->dailyDefaultCB->ItemIndex > -1) { + emap.erase("DailyDevotion"); emap.insert(ConfigEntMap::value_type("DailyDevotion", (const char *)Optionsfrm->dailyDefaultCB->Items->Objects[Optionsfrm->dailyDefaultCB->ItemIndex])); + } + if (Optionsfrm->strongsNumsCB->ItemIndex > -1) { + emap.erase("StrongsNumbers"); emap.insert(ConfigEntMap::value_type("StrongsNumbers", (const char *)Optionsfrm->strongsNumsCB->Items->Objects[Optionsfrm->strongsNumsCB->ItemIndex])); + } + optionsconf->Sections["ModDefaults"] = emap; + + + emap = optionsconf->Sections["Bookmarks"]; + emap.erase("AutoSavePersonal"); emap.insert(ConfigEntMap::value_type("AutoSavePersonal", IntToStr((Optionsfrm->AutoBMPersonal->Checked)?1:0).c_str())); + emap.erase("AutoSaveOther"); emap.insert(ConfigEntMap::value_type("AutoSaveOther", IntToStr((Optionsfrm->AutoBMOther->Checked)?1:0).c_str())); + optionsconf->Sections["Bookmarks"] = emap; + + emap = optionsconf->Sections["Layout"]; + emap.erase("AutoSaveLayout"); emap.insert(ConfigEntMap::value_type("AutoSaveLayout", IntToStr((Optionsfrm->AutoLayout->Checked)?1:0).c_str())); + optionsconf->Sections["Layout"] = emap; + + emap = optionsconf->Sections["Hints"]; + emap.erase("On"); emap.insert(ConfigEntMap::value_type("On", IntToStr((Optionsfrm->HintPopups->Checked)?1:0).c_str())); + optionsconf->Sections["Hints"] = emap; + + emap = optionsconf->Sections["HintStrongs"]; + emap.erase("On"); emap.insert(ConfigEntMap::value_type("On", IntToStr((Optionsfrm->HintStrongs->Checked)?1:0).c_str())); + optionsconf->Sections["HintStrongs"] = emap; + + emap = optionsconf->Sections["General"]; + emap.erase("TipOfTheDay"); emap.insert(ConfigEntMap::value_type("TipOfTheDay", (Optionsfrm->devSplashCB->Checked)?"Devotional":"")); + emap.erase("DevsAsDicts"); emap.insert(ConfigEntMap::value_type("DevsAsDicts", (Optionsfrm->devsAsDictsCB->Checked)?"true":"false")); + emap.erase("GlosAsDicts"); emap.insert(ConfigEntMap::value_type("GlosAsDicts", (Optionsfrm->glosAsDictsCB->Checked)?"true":"false")); + optionsconf->Sections["General"] = emap; + + optionsconf->Save(); + RefRTFHeaders(); + } + + tmpval = ((eit = optionsconf->Sections["Hints"].find("On")) != optionsconf->Sections["Hints"].end())? (*eit).second : (string)"1"; + + if (atoi(tmpval.c_str())) + Form1->ShowHint = true; + else Form1->ShowHint = false; + + tmpval = ((eit = optionsconf->Sections["Appearance"].find("locale")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"en_us"; + i12ize(tmpval.c_str()); + DefaultVSKey->setLocale(tmpval.c_str()); + fillVKeySelector(DefaultVSKey); + TextKeyChanged(); + RefreshActiveSheet(LexDictPageControl); + +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::cbBookChange(TObject *Sender) +{ + CHBox->Text = "1"; + VSBox->Text = "1"; + if (Screen->ActiveControl == cbBook) + btnLookupClick(Sender); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormCreate(TObject *Sender) +{ +// Application->OnHint = DisplayHint; +// Application->ShowHint = true; +// this->ShowHint = true; +// nsresult rv; +// rv = NS_InitEmbedding(nsnull, nsnull); + + Application->OnMessage = AppMessage; + Application->Title = "The SWORD Project for Windows"; +} + + +void TForm1::AddVerseChoices(TPopupMenu *menu, const char *buf, TRxRichEdit *rtf) { + TMenuItem *newitem; + + tmpVerseList = DefaultVSKey->ParseVerseList((char *)buf, *DefaultVSKey); + + ModMap::iterator target; + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + char *keytext = 0; // check for and remove return at end of keytext + stdstr(&keytext, (*(*target).second).KeyText()); + if (keytext[strlen(keytext)-1] == '\r') + keytext[strlen(keytext)-1] = 0; + + tmpVerseListCaption = String("VerseList from- ") + (*target).first.c_str() + ": " + keytext; + delete [] keytext; // --------------------------------- + } + newitem = new TMenuItem(menu); + newitem->Caption = "-"; + menu->Items->Add(newitem); + newitem = new TMenuItem(menu); + newitem->Caption = _tr("Create Verse List"); + newitem->Hint = _tr("Create a New Verse List Window"); + newitem->Default = true; + newitem->OnClick = createVerseList; + menu->Items->Add(newitem); + int breakcnt = 3; + while (!tmpVerseList.Error()) { + breakcnt++; + newitem = new TMenuItem(menu); + newitem->Caption = (const char *)tmpVerseList; + newitem->OnClick = BookmarkItemClick; + if (!(breakcnt%15)) + newitem->Break = mbBreak; + menu->Items->Add(newitem); + tmpVerseList++; + } + + + +} + + +void __fastcall TForm1::PopupMenuPopup(TObject *Sender) { + + int versestart, verseend; + TPopupMenu *menu = (TPopupMenu *)Sender; + int staticMenuItemsCount = 0; + TMenuItem *newitem; + + if (menu == PopupMenu1) + staticMenuItemsCount = 4; + else if (menu == PopupMenu2) + staticMenuItemsCount = 3; + else if (menu == PopupMenu3) + staticMenuItemsCount = 7; + + while (menu->Items->Count > staticMenuItemsCount) + menu->Items->Delete(staticMenuItemsCount); + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + if (clickText.Length()) { + string highlight = Trim(clickText).c_str(); + tmpVerseList = DefaultVSKey->ParseVerseList((char *)highlight.c_str(), *DefaultVSKey); + if (tmpVerseList.Count()) + AddVerseChoices(menu, highlight.c_str(), rtf); + } + else if (!rtf->SelLength) { + int entrylen = strlen(rtf->Text.c_str()); + char *entrytext = new char [ entrylen + 1 ]; + int selstart = rtf->SelStart; + strcpy(entrytext, rtf->Text.c_str()); +// for (versestart = rtf->SelStart; ((versestart)&&(rtf->Text[versestart] != '#')); versestart--); + for (versestart = selstart; ((versestart)&&(entrytext[versestart] != '#')); versestart--); + if (versestart) { + for (verseend = versestart; ((verseend < entrylen) && (entrytext[verseend] != '|')); verseend++); + if ((verseend < entrylen) && (verseend > selstart)) { + int len = (verseend - versestart) + 1; + char *buf = new char [ len + 1 ]; + memset(buf, 0 , len + 1); + strncpy(buf, &entrytext[versestart+1], len - 2); // strip the # and | from the string + int buflen = strlen(buf); + for (int i = 0; i < buflen; i++) { + if ((buf[i] == 10) || (buf[i] == 13)) + buf[i] = ' '; + } + AddVerseChoices(menu, buf, rtf); + delete [] buf; + } + } + delete [] entrytext; + } + else { + string highlight = Trim(rtf->SelText).c_str(); + tmpVerseList = DefaultVSKey->ParseVerseList((char *)highlight.c_str(), *DefaultVSKey); + if (tmpVerseList.Count()) + AddVerseChoices(menu, highlight.c_str(), rtf); + +// newitem = new TMenuItem(menu); +// newitem->Caption = "Verse Lookup"; +// newitem->Hint = "Attempt to lookup highlighted text as a verse"; +// newitem->OnClick = verseLookupClick; +// menu->Items->Add(newitem); + } + clickText = ""; + +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::createVerseList(TObject *Sender) +{ + TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList); + tmpForm->Caption = tmpVerseListCaption; + tmpForm->Show(); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::freeHandLookupoldKeyPress(TObject *Sender, char &Key) +{ + if (Key == '\r') { + ListKey tmpVerseList = DefaultVSKey->ParseVerseList(freeHandLookup->Text.c_str(), *DefaultVSKey); + + if (tmpVerseList.Count()) { + int index = freeHandLookup->Items->IndexOf(freeHandLookup->Text); + freeHandLookup->Items->Insert(0, freeHandLookup->Text); + + if (index >= 0) + freeHandLookup->Items->Delete(index+1); + + freeHandLookup->ItemIndex = 0; + + if (tmpVerseList.Count() > 1) { + TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList); + tmpForm->Caption = _tr("User Verse List"); + tmpForm->Show(); + } + + tmpVerseList = TOP; + *DefaultVSKey = tmpVerseList; + TextKeyChanged(); + } + } +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y) { + ((TWinControl *)Sender)->SetFocus(); + TRichEdit *rtf = (TRichEdit *)Sender; + if (Button == mbRight) { + if (!rtf->SelLength) + SendMessage(rtf->Handle, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(X, Y)); + TPoint menup, point; + point.x = X; + point.y = Y; + menup = rtf->ClientToScreen(point); + rtf->PopupMenu->Popup(menup.x, menup.y); + } +} + +void __fastcall TForm1::RTFURLClick(TObject *Sender, const AnsiString URLText, TMouseButton Button) { + if (!renderingHint) { + TRichEdit *rtf = (TRichEdit *)Sender; + clickText = URLText; + rtf->PopupMenu->Popup(Mouse->CursorPos.x, Mouse->CursorPos.y); + } +} + + +//--------------------------------------------------------------------------- + +void __fastcall TForm1::EditEntry1Click(TObject *Sender) +{ + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + SWModule *module; +// EditEntry->RichEdit1->Text = rtf->Text; + ModMap::iterator target; + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + EditEntryForm->Module = module = (*target).second; + EditEntryForm->RTFDisplay = rtf; + } + else EditEntryForm->Module = module = 0; + EditEntryForm->ShowModal(); + if (EditEntryForm->ResultBuf) { + if (module) +// DictKeyEdit->Text = EditEntry->ResultBuf; // for testing purposes + *module << EditEntryForm->ResultBuf; + } + RefreshActiveSheet(CommentaryPageControl); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::DeleteEntry1Click(TObject *Sender) +{ + if (MessageBox(Handle, "Are you sure you wish to delete this entry?", "Delete Entry", MB_YESNO) == IDYES) { + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + SWModule *module; + ModMap::iterator target; + + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + module = (*target).second; + module->deleteEntry(); + } + RefreshActiveSheet(CommentaryPageControl); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::LinktoVerse1Click(TObject *Sender) +{ + if (VerseSelFrm->ShowModal() == mrOk) { + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + SWModule *module; + ModMap::iterator target; + SWKey *linkkey = new VerseKey(VerseSelFrm->Panel2->Caption.c_str()); + + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + module = (*target).second; + *module << linkkey; + } + RefreshActiveSheet(CommentaryPageControl); + } +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::GlobalOptionChange(TObject *Sender) +{ +// ModMap::iterator it; +// SectionMap::iterator sit; +// ConfigEntMap::iterator eit, eitend; + ConfigEntMap::iterator eit; + TMenuItem *menuchoice = (TMenuItem *)Sender; + const char *source = menuchoice->Caption.c_str(); + char *value = new char [strlen(source) + 1]; + int k = 0; + for (unsigned int j = 0; j < strlen(source); j++) { + if (source[j] != '&') + value[k++] = source[j]; + } + value[k] = 0; + source = menuchoice->Parent->Caption.c_str(); + char *option = new char [strlen(source) + 1]; + k = 0; + for (unsigned int j = 0; j < strlen(source); j++) { + if (source[j] != '&') + option[k++] = source[j]; + } + option[k] = 0; + mainmgr->setGlobalOption(option, value); + + if ((!stricmp(option, "Strong's Numbers")) && (!stricmp(value, "On"))) { + string curText = TextPageControl->ActivePage->Caption.c_str(); + if (!hasFeature(mainmgr, curText.c_str(), "StrongsNumbers")) { + string tmpval = ((eit = optionsconf->Sections["ModDefaults"].find("StrongsNumbers")) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + for (int i = 0; i < TextPageControl->PageCount; i++) { + if (!stricmp(TextPageControl->Pages[i]->Caption.c_str(), tmpval.c_str())) { + TextPageControl->ActivePageIndex = i; + break; + } + } + } + } + + + delete [] option; + delete [] value; + TextKeyChanged(); +} +//--------------------------------------------------------------------------- + + + +void __fastcall TForm1::OptionShowVals(TObject *Sender) +{ + TMenuItem *menuChoice = (TMenuItem *)Sender; + + string option = menuChoice->Caption.c_str(); + int k = 0; + const char *source = option.c_str(); + char *caption = new char [strlen(source) + 1]; + for (unsigned int j = 0; j < strlen(source); j++) { + if (source[j] != '&') + caption[k++] = source[j]; + } + caption[k] = 0; + + string value = mainmgr->getGlobalOption(caption); + delete [] caption; + for (int i = 0; i < menuChoice->Count; i++) { + int k = 0; + char *source = menuChoice->Items[i]->Caption.c_str(); + char *caption = new char [strlen(source) + 1]; + for (unsigned int j = 0; j < strlen(source); j++) { + if (source[j] != '&') + caption[k++] = source[j]; + } + caption[k] = 0; + if (!stricmp(caption, value.c_str())) + menuChoice->Items[i]->Checked = true; + else menuChoice->Items[i]->Checked = false; + delete [] caption; + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::Contents1Click(TObject *Sender) +{ + string helpDir; + ConfigEntMap::iterator it = optionsconf->Sections["Help"].find("Directory"); + if (it != optionsconf->Sections["Help"].end()) + helpDir = (*it).second; + else helpDir = ".\\help"; + + string helpExe = helpDir + "\\sword.chm"; + + if ((int)ShellExecute(this->Handle, "open", helpExe.c_str(), NULL, NULL, SW_SHOWNORMAL) < 33) { + helpExe = helpDir + "\\index.html"; + ShellExecute(this->Handle, "open", helpExe.c_str(), NULL, NULL, SW_SHOWNORMAL); + } +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::FormClose(TObject *Sender, TCloseAction &Action) +{ + int saveCount = 5; + closing = true; + + ConfigEntMap section; + ConfigEntMap::iterator entryIt; + + + section = layoutconf->Sections["History"]; + entryIt = section.find("SearchSaveCount"); + if (entryIt != section.end()) + saveCount = atoi(entryIt->second.c_str()); + else section.insert(ConfigEntMap::value_type("SearchSaveCount", "5")); + + section.erase("SearchText"); + for (int loop = 0; ((loop < saveCount) && (loop < searchForm->SearchText->Items->Count)); loop++) { + WideString entry = searchForm->SearchText->Items->Strings[loop]; + section.insert(ConfigEntMap::value_type("SearchText", WideStringToUTF8(entry).c_str())); + } + + entryIt = section.find("LookupSaveCount"); + if (entryIt != section.end()) + saveCount = atoi(entryIt->second.c_str()); + else section.insert(ConfigEntMap::value_type("LookupSaveCount", "5")); + + section.erase("LookupText"); + for (int loop = 0; ((loop < saveCount) && (loop < freeHandLookup->Items->Count)); loop++) + section.insert(ConfigEntMap::value_type("LookupText", freeHandLookup->Items->Strings[loop].c_str())); + + section.erase("LastVerse"); + section.insert(ConfigEntMap::value_type("LastVerse", (const char *)*DefaultVSKey)); + + section.erase("LastTextModule"); + section.insert(ConfigEntMap::value_type("LastTextModule", TextPageControl->ActivePage->Caption.c_str())); + + section.erase("LastComModule"); + section.insert(ConfigEntMap::value_type("LastComModule", CommentaryPageControl->ActivePage->Caption.c_str())); + + layoutconf->Sections["History"] = section; + layoutconf->Save(); + +// NS_TermEmbedding(); + + section = optionsconf->Sections["Layout"]; + entryIt = section.find("AutoSaveLayout"); + if(entryIt != section.end()){ + if(atoi(entryIt->second.c_str())) + SaveLayout1Click(this); + } + +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::lbDictKeysOldClick(TObject *Sender) +{ + DictKeyEdit->Text = lbDictKeys->Items->Strings[lbDictKeys->ItemIndex]; +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::HideShowModules1Click(TObject *Sender) +{ + ConfigEntMap *section; + TMenuItem *menuItem = (TMenuItem *)Sender; + TPopupMenu *menu = (TPopupMenu *)menuItem->GetParentMenu(); + TComponent *comp = menu->PopupComponent; + TPageControl *pc = 0; + + if ((comp == TextPageControl) || (comp == pnlText)) { + pc = TextPageControl; + section = &(*layoutconf)["TextView"]; + } + if ((comp == CommentaryPageControl) || (comp == pnlComment)) { + pc = CommentaryPageControl; + section = &(*layoutconf)["CommentView"]; + } + if ((comp == LexDictPageControl) || (comp == pnlDict)) { + pc = LexDictPageControl; + section = &(*layoutconf)["LDView"]; + } + + if (!pc) return; // assert pc + + for (int i = 0; i < pc->PageCount; i++) { + string heading = pc->Pages[i]->Caption.c_str(); + (*section)[heading.c_str()] = ((pc->Pages[i]->TabVisible) ? "true" : "false"); + } + ModVisForm->mgr = mainmgr; + ModVisForm->section = section; + if (ModVisForm->ShowModal() == mrOk) { + for (int i = 0; i < pc->PageCount; i++) { + string heading = pc->Pages[i]->Caption.c_str(); + pc->Pages[i]->TabVisible = ((*section)[heading.c_str()] == "true"); + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::DevotionaloftheDay1Click(TObject *Sender) { + DevOfTheDay2->Show(); +} +//--------------------------------------------------------------------------- + +void dehtmlize(char *buf) { + bool deref = false; + int nums = 0; + while (*buf) { + if (deref) { + if (!isdigit(*buf)) + deref = false; + else { + *buf = ' '; + nums++; + } + if (nums > 1) + deref = false; + } + if (*buf == '%') { + deref = true; + nums = 0; + *buf = ' '; + } + buf++; + } +} + +void __fastcall TForm1::CppWebBrowser1BeforeNavigate2(TObject *Sender, + LPDISPATCH pDisp, TVariant *URL, TVariant *Flags, + TVariant *TargetFrameName, TVariant *PostData, TVariant *Headers, + TOLEBOOL *Cancel) +{ + AnsiString url = *URL; + string stuff = url.c_str(); + char *offset = strstr(url.c_str(), "passage"); + if (offset > 0) { + string verse = (offset+8); + char * buf = new char [ verse.length() + 1 ]; + strcpy(buf, verse.c_str()); + dehtmlize(buf); + (*Cancel) = true; + *DefaultVSKey = (buf); + TextKeyChanged(); + delete [] buf; + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::InstallManager1Click(TObject *Sender) +{ + WinExec("InstallMgr.exe", SW_SHOWNORMAL); +} +//--------------------------------------------------------------------------- + + +void TForm1::RefRTFHeaders() +{ + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit, eitend; + char textFont[128]; + char commentFont[128]; + char LDFont[128]; + char tempTextFont[128]; + char tempCommFont[128]; + char tempLDFont[128]; + char buf[1024]; + TColor fieldColor; + string tmpval; + SWDispRTFChap* rtfDispChapter; + SWDispRTF* rtfDisp; + + // Store fonts here: needed for being able to switch back to original font name if it changes + tmpval = ((eit = optionsconf->Sections["Appearance"].find("TextFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman"; + strcpy(tempTextFont, tmpval.c_str()); + tmpval = ((eit = optionsconf->Sections["Appearance"].find("CommentFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman"; + strcpy(tempCommFont, tmpval.c_str()); + tmpval = ((eit = optionsconf->Sections["Appearance"].find("LDFontName")) != optionsconf->Sections["Appearance"].end())? (*eit).second : (string)"Times New Roman"; + strcpy(tempLDFont, tmpval.c_str()); + + // Change the panels attributes here + for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) { + SWModule *module = it->second; + RTFDisp *disp = SWDYNAMIC_CAST(RTFDisp, module->Disp()); + if (disp) { + rtfDisp = (SWDispRTF*) disp->editControl(); + rtfDisp->recalcAppearance(); + } + } + + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) + if ((*sit).second.find("LDBackColor") != (*sit).second.end()) + lbDictKeys->Color = TColor((atoi((*(*sit).second.find("LDBackColor")).second.c_str()))); + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) + if ((*sit).second.find("LDFontColor") != (*sit).second.end()) + lbDictKeys->Font->Color = TColor((atoi((*(*sit).second.find("LDFontColor")).second.c_str()))); + + // Change the text entry field color + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()){ + if ((eit = (*sit).second.find("FieldColor")) != (*sit).second.end()) + fieldColor = TColor(atoi((*eit).second.c_str())); + else fieldColor = clAqua; + } + cbBook->Color = fieldColor; + CHBox->Color = fieldColor; + VSBox->Color = fieldColor; + freeHandLookup->Color = fieldColor; + DictKeyEdit->Color = fieldColor; +} + + +void __fastcall TForm1::ApplicationEvents1Hint(TObject *Sender) +{ + StatusBar1->SimpleText = GetLongHint(Application->Hint); +} + + +void __fastcall TForm1::ApplicationEvents1ShowHint(AnsiString &HintStr, + bool &CanShow, THintInfo &HintInfo) +{ + ConfigEntMap::const_iterator const_eit; + string fontname; + char buf[1024]; + static TRect lastRect(0,0,0,0); + bool selected = false; + bool link = false; + static WideString lastWord = ""; + String verseList = ""; + WideString targetWord; + // assert we are in a sword module rtf window and we're not grinding + if (HintInfo.HintControl == searchForm->resultsLV) { + HintStr = ""; + } + if ((strncmp(HintInfo.HintControl->Name.c_str(), "TextRTF", 7)) && + (strncmp(HintInfo.HintControl->Name.c_str(), "CommentRTF", 10)) && + (strncmp(HintInfo.HintControl->Name.c_str(), "LexDictRTF", 10))) { + return; + } + +// Application->HintHidePause = HintDisplayTime; + HintInfo.HintWindowClass = __classid(THintWindow); + + if (!Form1->Active) + return; + + ConfigEntMap::iterator eit; + string tmpval = ((eit = optionsconf->Sections["HintStrongs"].find("On")) != optionsconf->Sections["HintStrongs"].end())? (*eit).second : (string)"1"; + + SWDispRTF *rtf = 0; + if (atoi(tmpval.c_str())) { + do { + ConfigEntMap::iterator eit; + + HintInfo.HideTimeout = 32000; + HintInfo.HintWindowClass = __classid(TRTFHintWindow); + HintInfo.CursorRect = lastRect; + HintStr = ""; + + rtf = (SWDispRTF *)HintInfo.HintControl; + + renderingHint = true; +// HintTimer->Enabled = false; +// HintTimer->Enabled = true; + + if (!rtf->SelLength) { + SendMessage(rtf->Handle, WM_LBUTTONDOWN, MK_LBUTTON, MAKELONG(HintInfo.CursorPos.x, HintInfo.CursorPos.y)); + selected = false; + targetWord = rtf->WordAtCursor(); + + int entrylen = strlen(rtf->Text.c_str()); + char *entrytext = new char [ entrylen + 1 ]; + int selstart = rtf->SelStart; + int versestart, verseend; + strcpy(entrytext, rtf->Text.c_str()); + // for (versestart = rtf->SelStart; ((versestart)&&(rtf->Text[versestart] != '#')); versestart--); + for (versestart = selstart; ((versestart)&&(entrytext[versestart] != '#')); versestart--); + if (versestart) { + for (verseend = versestart; ((verseend < entrylen) && (entrytext[verseend] != '|')); verseend++); + if ((verseend < entrylen) && (verseend > selstart)) { + int len = (verseend - versestart) + 1; + char *buf = new char [ len + 1 ]; + memset(buf, 0 , len + 1); + strncpy(buf, &entrytext[versestart+1], len - 2); // strip the # and | from the string + int buflen = strlen(buf); + for (int i = 0; i < buflen; i++) { + if ((buf[i] == 10) || (buf[i] == 13)) + buf[i] = ' '; + } + verseList = buf; + delete [] buf; + } + } + delete [] entrytext; + } + else { + selected = true; + targetWord = rtf->SelText; + } + +// TPoint currentChar = rtf->GetCharPos(rtf->SelStart); + TPoint currentChar = rtf->ScreenToClient(Mouse->CursorPos); + HintInfo.CursorRect = TRect(TPoint(currentChar.x-15, currentChar.y-15), TPoint(currentChar.x+15, currentChar.y+15)); + lastRect = HintInfo.CursorRect; + + +// HintInfo.CursorRect = TRect(TPoint(currentChar.x-12, currentChar.y-12), TPoint(currentChar.x+12, currentChar.y+12)); +// HintInfo.HideTimeout = 65000; +// HintInfo.ReshowTimeout = 2000; +// if (!rtf->SelLength) { +// rtf->SelLength = 1; + if (!selected) { + rtf->SelLength = 1; + if (rtf->SelAttributes->Link) { + link = true; + int saveStart = rtf->SelStart; + int last = -1; + while ((rtf->SelStart != last) && (rtf->SelAttributes->Link)) { + last = rtf->SelStart; + rtf->SelStart -= 1; + rtf->SelLength = 1; + } + int start = rtf->SelStart + 1; + rtf->SelStart++; + rtf->SelLength = 1; + last = -1; + while ((rtf->SelStart != last) && (rtf->SelAttributes->Link)) { + last = rtf->SelStart; + rtf->SelStart += 1; + rtf->SelLength = 1; + } + int len = (rtf->SelStart - start); + rtf->SelStart = saveStart; + verseList = rtf->GetTextRange(start, start+len); + } + rtf->SelLength = 0; + } + else { + if (rtf->SelAttributes->Link) { + link = true; + } + } + + // use cache if same word + if (targetWord.Length() && (targetWord == lastWord) && (currentRTF == rtf)) { + HintStr = "reshow same text"; + break; + } + currentRTF = rtf; + lastWord = targetWord; + + // currently assume all links are verselists + if (verseList.Length()) { + ModMap::iterator it; + it = mainmgr->Modules.find(TextPageControl->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + SWModule *module = it->second; + ListKey verses = DefaultVSKey->ParseVerseList(verseList.c_str(), *DefaultVSKey, true); + if (verses.Count()) { + RTFHintForm->rtfDrawer->fillWithVerses(module, &verses, true, true, "Popup"); + HintStr = "show rtf"; + } + else HintStr = ""; + break; + } + } + + // see if strongs number + char preChar = (targetWord.Length()) ? targetWord[1] : 0; + targetWord = TrimJunk(targetWord); + + // check if all digits (strongs) + int i; + for (i = 1; i <= targetWord.Length(); i++) { + if (!isdigit(targetWord[i])) + break; + } + + if ((i == targetWord.Length()+1) && (i-1)) { + String feature = (DefaultVSKey->Testament() == 1)?"Hebrew":"Greek"; + feature += (preChar == '(')?"Parse":"Def"; + if (!strncmp(HintInfo.HintControl->Name.c_str(), "TextRTFLXX", 10)) + feature = "GreekDef"; + string tmpval = ((eit = optionsconf->Sections["ModDefaults"].find(feature.c_str())) != optionsconf->Sections["ModDefaults"].end())? (*eit).second : (string)""; + if (tmpval.size()) { + SWModule *defMod = mainmgr->Modules[tmpval]; + if (!defMod) { + HintStr = ""; + break; + } + defMod->SetKey(WideStringToUTF8(targetWord).c_str()); + HintStr = defMod->RenderText(); + defMod->SetKey(DefaultStrKey); + + // Color attributes for the strongs portion of the hint are here. + // If the module uses it's own font load that else we will try the config file else we will use the default + RTFHintForm->rtfDrawer->module = defMod; + RTFHintForm->rtfDrawer->type = "Popup"; + RTFHintForm->rtfDrawer->recalcAppearance(); + + if (HintStr.Length()) { + TMemoryStream *RTFStream = new TMemoryStream(); + System::AnsiString newtext, tmptext; + + newtext = RTFHintForm->rtfDrawer->RTFHeader; + newtext += RTFHintForm->rtfDrawer->RTFHeadMargin; + newtext += "\\pard \\nowidctlpar \\cf7\\f0 "; + + tmptext = HintStr.c_str(); + newtext += RTFHintForm->rtfDrawer->RTFVersePre + " " + tmptext + RTFHintForm->rtfDrawer->RTFVersePost; + newtext += RTFHintForm->rtfDrawer->RTFTrailer; + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.Length()); + RTFStream->Position = 0; + RTFHintForm->rtfDrawer->Lines->LoadFromStream(RTFStream); + RTFHintForm->rtfDrawer->Repaint(); + + delete RTFStream; + HintStr = "show rtf"; + break; + } + } + } + HintStr = ""; + } while (false); + if (!HintStr.Length()) + lastWord = ""; + } +} +//--------------------------------------------------------------------------- + + +__fastcall TRTFHintWindow::TRTFHintWindow(Classes::TComponent* AOwner) + : THintWindow(AOwner) +{ + Canvas->Font->Name = "Arial"; + Canvas->Font->Color = clWindowText; +} + +__fastcall TRTFHintWindow::~TRTFHintWindow(void) { +// RTFHintForm->Hide(); +} + + +//------------------------------------------------------------------------------------------// + +void __fastcall TRTFHintWindow::CreateParams(TCreateParams &Params) +{ + inherited::CreateParams(Params); + + Params.Style = WS_POPUP; + Params.WindowClass.style = Params.WindowClass.style | CS_SAVEBITS; + + if(NewStyleControls) + { + Params.ExStyle = WS_EX_TOOLWINDOW; + AddBiDiModeExStyle(Params.ExStyle); + } +} +//------------------------------------------------------------------------------------------// + +void __fastcall TRTFHintWindow::Paint(void) +{ + TRect Rect = ClientRect; + + TColor penColor; + string strColor; + strColor = Form1->optionsconf->Sections["Appearance"]["PopupFontColor"]; + if(strColor == "") + penColor = clBlack; + else + penColor = StrToInt((AnsiString)strColor.c_str()); + + TColor backColor; + strColor = Form1->optionsconf->Sections["Appearance"]["PopupBackColor"]; + if(strColor == "") + backColor = 14680063; + else + backColor = StrToInt((AnsiString)strColor.c_str()); + + Canvas->Brush->Color = penColor; + Canvas->FillRect(Rect); + + Rect.Left += 4; + Rect.Top += 4; + Rect.Right -= 4; + Rect.Bottom -= 4; + + Frame3D(Canvas, Rect, clBtnShadow, clBtnHighlight, 1); + + Canvas->Brush->Color = backColor;//TColor(0xB4CDBB); + Canvas->FillRect(Rect); + + + Graphics::TMetafile *AMetaFile= new Graphics::TMetafile(); + Graphics::TMetafileCanvas *AMetaFileCanvas = new Graphics::TMetafileCanvas(AMetaFile, 0); + Rect = ClientRect; + Rect.Right -= 12; + Rect.Bottom -=12; + bool jagged = RTFHintForm->rtfDrawer->paintTo(AMetaFileCanvas->Handle, &Rect); + delete AMetaFileCanvas; + Canvas->Draw(7,7,AMetaFile); + delete AMetaFile; + + if (jagged) { + int triCount = (Rect.Right/60) + 1; + Canvas->Pen->Color = penColor; //clBlack; // TColor(0xA4BDAB); + Canvas->Brush->Color = penColor; //clBlack; + int i; + for (i = 0; i < triCount; i++) { + TPoint points[3]; + points[0].x = i * 60; + points[0].y = ClientRect.Bottom; + points[1].x = (i * 60) + 30; + points[1].y = ClientRect.Bottom-15; + points[2].x = (i+1) * 60; + points[2].y = ClientRect.Bottom; + Canvas->Polygon(points, 2); + } +/* + Canvas->Pen->Color = clBlack; + TPoint points[4]; + points[0].x = 0; points[0].y = Rect.Bottom-1; + points[1].x = Rect.Right; points[1].y = Rect.Bottom-1; + points[2].x = Rect.Right; points[2].y = Rect.Bottom; + points[3].x = 0; points[3].y = Rect.Bottom; + Canvas->Polygon(points, 3); +*/ + } + +// RTFHintForm->rtfDrawer->PaintTo(Canvas->Handle, 4, 4); + +// RTFHintForm->Repaint(); +// RTFHintForm->rtfDrawer->Repaint(); +// Graphics::TBitmap *hintBit = RTFHintForm->GetFormImage(); +// Clipboard()->Assign(hintBit); +// Canvas->CopyRect(Rect, hintBit->Canvas, Rect); +// delete hintBit; + +/* + Rect.Left += 1; + Rect.Top += 5; + Rect.Right -= 1; + Rect.Bottom -= 1; + + DrawText( Canvas->Handle, + Caption.c_str(), + -1, + &Rect, + DT_RIGHT|DT_NOPREFIX|DT_WORDBREAK|DrawTextBiDiModeFlagsReadingOnly() ); + */ +} +//------------------------------------------------------------------------------------------// + +void __fastcall TRTFHintWindow::ActivateHint(const /*Windows::*/TRect& Rect, + const AnsiString AHint) +{ + inherited::ActivateHint(Rect, AHint); +} +//------------------------------------------------------------------------------------------// + +void __fastcall TRTFHintWindow::ActivateHintData(const /*Windows::*/TRect& Rect, + const AnsiString AHint, + void* AData) +{ + TRect newRect = Rect; + // for dual head monitors, be sure we're all on one monitor + TForm1::ClipOrCenterRectToMonitor(&newRect, MONITOR_CLIP); + inherited::ActivateHintData(newRect, AHint, AData); +} +//------------------------------------------------------------------------------------------// + +bool __fastcall TRTFHintWindow::IsHintMsg(tagMSG& Msg) +{ + bool retVal = inherited::IsHintMsg(Msg); + if (retVal) + Form1->renderingHint = false; + return retVal; +} + +//------------------------------------------------------------------------------------------// + +/*Windows::*/TRect __fastcall TRTFHintWindow::CalcHintRect(int MaxWidth, + const AnsiString AHint, + void* AData) +{ + TRect Rect(0, 0, 0, 0); // EmptyRect asks for size + + Graphics::TMetafile *AMetaFile= new Graphics::TMetafile(); + Graphics::TMetafileCanvas *AMetaFileCanvas = new Graphics::TMetafileCanvas(AMetaFile, 0); + RTFHintForm->rtfDrawer->paintTo(AMetaFileCanvas->Handle, &Rect); + delete AMetaFileCanvas; + delete AMetaFile; + + Rect.Right += 12; + Rect.Bottom += 12; + return Rect; +} +//------------------------------------------------------------------------------------------// + + +void __fastcall TForm1::Print1Click(TObject *Sender) +{ + PrintForm->ShowModal(); +} +//--------------------------------------------------------------------------- + + + +void __fastcall TForm1::SearchForWord1Click(TObject *Sender) +{ + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + int wordstart; + int saveSelStart = rtf->SelStart; + WideString lookupKey; + ConfigEntMap::iterator eit; + + if (!rtf->SelLength) { + lookupKey = rtf->WordAtCursor(); + lookupKey = TrimJunk(lookupKey); + + int entrylen = strlen(rtf->Text.c_str()); + WideString entrytext = rtf->GetText(); + int selstart = rtf->SelStart; + int versestart, verseend; + for (versestart = selstart; versestart; versestart--) { + if (!isdigit(entrytext[versestart])) + break; + } + if ((entrytext[versestart] == '<') || + (entrytext[versestart] == '(')) { + for (verseend = versestart+1; (verseend < entrylen); verseend++) { + if (!isdigit(entrytext[verseend])) + break; + } + if ((entrytext[verseend] == '>') || + (entrytext[verseend] == ')')) { + if ((verseend < entrylen) && (verseend > selstart)) { + int len = (verseend - versestart) + 1; + lookupKey = entrytext.SubString(versestart, len); + } + } + } + } + else { + lookupKey = TRxRichEditX::Trim(rtf->GetTextRange(rtf->SelStart, rtf->SelStart + rtf->SelLength)); + } + + searchForm->SearchText->Text = lookupKey; + searchForm->Show(); +} +//--------------------------------------------------------------------------- + +// +// ClipOrCenterRectToMonitor +// +// The most common problem apps have when running on a +// multimonitor system is that they "clip" or "pin" windows +// based on the SM_CXSCREEN and SM_CYSCREEN system metrics. +// Because of app compatibility reasons these system metrics +// return the size of the primary monitor. +// +// This shows how you use the multi-monitor functions +// to do the same thing. +// +void TForm1::ClipOrCenterRectToMonitor(LPRECT prc, UINT flags) { + HMONITOR hMonitor; + MONITORINFO mi; + RECT rc; + int w = prc->right - prc->left; + int h = prc->bottom - prc->top; + + // + // get the nearest monitor to the passed rect. + // + hMonitor = MonitorFromRect(prc, MONITOR_DEFAULTTONEAREST); + + // + // get the work area or entire monitor rect. + // + mi.cbSize = sizeof(mi); + GetMonitorInfo(hMonitor, &mi); + + if (flags & MONITOR_WORKAREA) + rc = mi.rcWork; + else + rc = mi.rcMonitor; + + // + // center or clip the passed rect to the monitor rect + // + if (flags & MONITOR_CENTER) + { + prc->left = rc.left + (rc.right - rc.left - w) / 2; + prc->top = rc.top + (rc.bottom - rc.top - h) / 2; + prc->right = prc->left + w; + prc->bottom = prc->top + h; + } + else + { + prc->left = max(rc.left, min(rc.right-w, prc->left)); + prc->top = max(rc.top, min(rc.bottom-h, prc->top)); + prc->right = prc->left + w; + prc->bottom = prc->top + h; + } +} + + +void TForm1::ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags) { + RECT rc; + GetWindowRect(hwnd, &rc); + ClipOrCenterRectToMonitor(&rc, flags); + SetWindowPos(hwnd, NULL, rc.left, rc.top, 0, 0, SWP_NOSIZE | SWP_NOZORDER | SWP_NOACTIVATE); +} + diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm b/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm new file mode 100644 index 0000000..7a30ec1 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.dfm @@ -0,0 +1,738 @@ +object Form1: TForm1
+ Left = 414
+ Top = 117
+ Width = 686
+ Height = 510
+ Caption = 'The SWORD Project'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -10
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ KeyPreview = True
+ Menu = MainMenu1
+ OldCreateOrder = True
+ Position = poDefault
+ Scaled = False
+ ShowHint = True
+ OnClose = FormClose
+ OnCreate = FormCreate
+ OnKeyDown = FormKeyDown
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Splitter2: TSplitter
+ Left = 0
+ Top = 282
+ Width = 678
+ Height = 5
+ Cursor = crVSplit
+ Align = alTop
+ ResizeStyle = rsUpdate
+ end
+ object pnlTextCom: TPanel
+ Left = 0
+ Top = 46
+ Width = 678
+ Height = 236
+ Align = alTop
+ BevelOuter = bvNone
+ Caption = 'pnlTextCom'
+ TabOrder = 0
+ object Splitter1: TSplitter
+ Left = 368
+ Top = 0
+ Width = 5
+ Height = 236
+ Cursor = crHSplit
+ ResizeStyle = rsUpdate
+ end
+ object pnlText: TPanel
+ Left = 0
+ Top = 0
+ Width = 368
+ Height = 236
+ Align = alLeft
+ BevelOuter = bvNone
+ Constraints.MinHeight = 10
+ Constraints.MinWidth = 10
+ PopupMenu = PopupMenu4
+ TabOrder = 0
+ object TextPageControl: TPageControl
+ Left = 0
+ Top = 0
+ Width = 368
+ Height = 236
+ Hint = 'Biblical Texts'
+ Align = alClient
+ Font.Charset = ANSI_CHARSET
+ Font.Color = clBlack
+ Font.Height = -9
+ Font.Name = 'Arial'
+ Font.Style = []
+ HotTrack = True
+ MultiLine = True
+ ParentFont = False
+ PopupMenu = PopupMenu4
+ TabHeight = 14
+ TabOrder = 0
+ OnChange = TextPageControlChange
+ end
+ end
+ object pnlComment: TPanel
+ Left = 373
+ Top = 0
+ Width = 305
+ Height = 236
+ Align = alClient
+ BevelOuter = bvNone
+ Constraints.MinHeight = 10
+ Constraints.MinWidth = 10
+ PopupMenu = PopupMenu4
+ TabOrder = 1
+ object CommentaryPageControl: TPageControl
+ Left = 0
+ Top = 0
+ Width = 305
+ Height = 236
+ Hint = 'Commentaries'
+ Align = alClient
+ Font.Charset = ANSI_CHARSET
+ Font.Color = clBlack
+ Font.Height = -9
+ Font.Name = 'Arial'
+ Font.Style = []
+ HotTrack = True
+ MultiLine = True
+ ParentFont = False
+ PopupMenu = PopupMenu4
+ TabHeight = 14
+ TabOrder = 0
+ OnChange = CommentaryPageControlChange
+ end
+ end
+ end
+ object pnlDict: TPanel
+ Left = 0
+ Top = 287
+ Width = 678
+ Height = 162
+ Align = alClient
+ BevelOuter = bvNone
+ Constraints.MinHeight = 10
+ Constraints.MinWidth = 10
+ PopupMenu = PopupMenu4
+ TabOrder = 1
+ object Splitter3: TSplitter
+ Left = 488
+ Top = 0
+ Width = 5
+ Height = 162
+ Cursor = crHSplit
+ Align = alRight
+ end
+ object LexDictPageControl: TPageControl
+ Left = 0
+ Top = 0
+ Width = 488
+ Height = 162
+ Hint = 'Lexicons / Dictionaries'
+ Align = alClient
+ Font.Charset = ANSI_CHARSET
+ Font.Color = clBlack
+ Font.Height = -9
+ Font.Name = 'Arial'
+ Font.Style = []
+ HotTrack = True
+ MultiLine = True
+ ParentFont = False
+ PopupMenu = PopupMenu4
+ TabHeight = 14
+ TabOrder = 0
+ OnChange = LexDictPageControlChange
+ end
+ object Panel2: TPanel
+ Left = 493
+ Top = 0
+ Width = 185
+ Height = 162
+ Align = alRight
+ Caption = 'Panel2'
+ TabOrder = 1
+ object DictKeyEditOld: TRichEdit
+ Left = 1
+ Top = 1
+ Width = 183
+ Height = 24
+ Align = alTop
+ Color = clAqua
+ MaxLength = 128
+ PlainText = True
+ TabOrder = 0
+ WantReturns = False
+ WordWrap = False
+ OnChange = DictKeyEditOldChange
+ end
+ object lbDictKeysOld: TListBox
+ Left = 1
+ Top = 25
+ Width = 183
+ Height = 136
+ Align = alClient
+ ItemHeight = 13
+ TabOrder = 1
+ OnClick = lbDictKeysOldClick
+ end
+ end
+ end
+ object StatusBar1: TStatusBar
+ Left = 0
+ Top = 449
+ Width = 678
+ Height = 15
+ Panels = <>
+ SimplePanel = True
+ end
+ object CoolBar1: TCoolBar
+ Left = 0
+ Top = 0
+ Width = 678
+ Height = 46
+ AutoSize = True
+ Bands = <
+ item
+ Control = ToolBar2
+ ImageIndex = -1
+ MinHeight = 40
+ Width = 106
+ end
+ item
+ Break = False
+ Control = Panel1
+ ImageIndex = -1
+ MinHeight = 42
+ Width = 250
+ end
+ item
+ Break = False
+ Control = ToolBar1
+ ImageIndex = -1
+ Width = 314
+ end>
+ object BackBtnImage: TImage
+ Left = 16
+ Top = 0
+ Width = 38
+ Height = 34
+ AutoSize = True
+ Picture.Data = {
+ 07544269746D61701E030000424D1E0300000000000076000000280000002600
+ 0000220000000100040000000000A80200000000000000000000100000001000
+ 0000FFFFFF00FFCFCE00B5AECE00848284009CFF31002120210000FF00008482
+ 0000008200003934000000000000000000000000000000000000000000000000
+ 0000777777777777777777777777777777777777770077777777777777777777
+ 777777777777A77777007777777777777777777777777777777A777777007777
+ 7AA7AAA77AA77AA77AAA77A777A7777777007777777A777A7A7A7A77A777A7A7
+ 77A7777777007777777A777A7A7AAA77A777A7AA7A77777777007777777A777A
+ 7A777A77A777777AAA77777777007777777A77AA77A77A77A777777A77A77777
+ 77007777777AAAA777A77A77A777A77AA77A777777007777777A77AA777A7A77
+ 7A77A77A7A7A777777007777777A777A7777AA7777AAA77A77AA777777007777
+ 777A777A777777777777777A77777777770077777AAAAAA7777777775577777A
+ 777777777700777777777777777777768577777A777777777700777777777777
+ 7777776868777777A777777777007777777777777777768688777777A7777777
+ 77007777777777777777686868777777A7777777770077777777777777768686
+ 88777777AA777777770077777777777777686868687777777777777777007777
+ 7777777776868686868697777777777777007777777777776868686868683777
+ 7777777777007777777777768686868686865777777777777700777777777778
+ 6848686868685777777777777700777777777774214141616161577777777777
+ 7700777777777777421414161616377777777777770077777777777774214141
+ 6161977777777777770077777777777777421414187777777777777777007777
+ 7777777777742141687777777777777777007777777777777777421418777777
+ 7777777777007777777777777777742168777777777777777700777777777777
+ 7777774218777777777777777700777777777777777777742577777777777777
+ 7700777777777777777777774377777777777777770077777777777777777777
+ 77777777777777777700}
+ Transparent = True
+ Visible = False
+ end
+ object SearchBtnImage: TImage
+ Left = 56
+ Top = 0
+ Width = 38
+ Height = 34
+ AutoSize = True
+ Picture.Data = {
+ 07544269746D61701E030000424D1E0300000000000076000000280000002600
+ 0000220000000100040000000000A80200000000000000000000100000001000
+ 0000FFFFFF00F2F5FF00FFF7E100BAC0CF007E828F00DBB97700C4862300F6FF
+ 0C0002000600B5AECE0000000000000000000000000000000000000000000000
+ 0000999999999999999999999999999999998999990099999999999999999999
+ 9999999999999899990099999999999999999999999999999999989999009988
+ 8999888998899889899999888998998999009899989889989898989989999899
+ 9898999899009899989899989898889988999899989889989900999998988899
+ 9899989988999899999889998900999989989988998998998899989999988899
+ 8900998899989998998998998989989998988899890098899999899899989898
+ 8888998998998989890098999999988999998899989899988899899889009889
+ 8999999999999999999999999999899999009988899998889999999999999999
+ 9999899999009999999986668999999999999999999989999900999999996776
+ 6899999999999999999989999900999999995677868999999999999999999899
+ 9900999999999568786899999999999999999899990099999999995687868999
+ 9999999999999889990099999999999568744844888889999999999999009999
+ 9999999956734488888888899999999999009999999999999561488822222288
+ 9999999999009999999999999953888222222228899999999900999999999999
+ 9998882222222222899999999900999999999999999882222222222228999999
+ 9900999999999999999882222222222224999999990099999999999999984222
+ 2222222224999999990099999999999999984222222222222499999999009999
+ 9999999999984222222222222499999999009999999999999998422222222222
+ 2499999999009999999999999999822222222222499999999900999999999999
+ 9999892222222222499999999900999999999999999994922222222499999999
+ 9900999999999999999999442222244999999999990099999999999999999999
+ 44444999999999999900}
+ Transparent = True
+ Visible = False
+ end
+ object ToolBar2: TToolBar
+ Left = 9
+ Top = 1
+ Width = 93
+ Height = 40
+ AutoSize = True
+ ButtonHeight = 40
+ ButtonWidth = 45
+ EdgeBorders = []
+ Flat = True
+ Images = ImageList1
+ TabOrder = 0
+ object ToolButton3: TToolButton
+ Left = 0
+ Top = 0
+ Hint = 'Go Back To Previous Location'
+ Caption = 'Back'
+ ImageIndex = 0
+ OnClick = BackbtnClick
+ end
+ object ToolButton4: TToolButton
+ Left = 45
+ Top = 0
+ Hint = 'Bring Up Search Window'
+ Caption = 'ToolButton4'
+ ImageIndex = 1
+ OnClick = NewSearchWindow1Click
+ end
+ end
+ object Panel1: TPanel
+ Left = 117
+ Top = 0
+ Width = 237
+ Height = 42
+ BevelOuter = bvNone
+ TabOrder = 2
+ object btnLookup: TSpeedButton
+ Left = 212
+ Top = 0
+ Width = 21
+ Height = 21
+ Hint = 'Lookup'
+ Flat = True
+ Glyph.Data = {
+ 76010000424D7601000000000000760000002800000020000000100000000100
+ 0400000000000001000000000000000000001000000010000000000000000000
+ 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00555555555555
+ 555555555555555555555555555555555555555555FF55555555555559055555
+ 55555555577FF5555555555599905555555555557777F5555555555599905555
+ 555555557777FF5555555559999905555555555777777F555555559999990555
+ 5555557777777FF5555557990599905555555777757777F55555790555599055
+ 55557775555777FF5555555555599905555555555557777F5555555555559905
+ 555555555555777FF5555555555559905555555555555777FF55555555555579
+ 05555555555555777FF5555555555557905555555555555777FF555555555555
+ 5990555555555555577755555555555555555555555555555555}
+ NumGlyphs = 2
+ OnClick = btnLookupClick
+ end
+ object cbBook: TComboBox
+ Left = 0
+ Top = 0
+ Width = 121
+ Height = 21
+ Style = csDropDownList
+ Color = clAqua
+ ItemHeight = 13
+ TabOrder = 0
+ OnChange = cbBookChange
+ end
+ object CHBox: TEdit
+ Left = 128
+ Top = 0
+ Width = 25
+ Height = 22
+ Color = clAqua
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'Arial'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 1
+ Text = '1'
+ end
+ object UpDown1: TUpDown
+ Left = 153
+ Top = 0
+ Width = 22
+ Height = 22
+ Associate = CHBox
+ Min = -1
+ Max = 200
+ Position = 1
+ TabOrder = 2
+ Wrap = False
+ OnClick = UpDown1Click
+ end
+ object VSBox: TEdit
+ Left = 168
+ Top = 0
+ Width = 25
+ Height = 22
+ Color = clAqua
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clBlack
+ Font.Height = -11
+ Font.Name = 'Arial'
+ Font.Style = []
+ ParentFont = False
+ TabOrder = 3
+ Text = '19'
+ end
+ object UpDown2: TUpDown
+ Left = 193
+ Top = 0
+ Width = 22
+ Height = 22
+ Associate = VSBox
+ Min = -1
+ Max = 200
+ Position = 19
+ TabOrder = 4
+ Wrap = False
+ OnClick = UpDown1Click
+ end
+ object freeHandLookup: TComboBox
+ Left = 0
+ Top = 21
+ Width = 233
+ Height = 21
+ Color = clAqua
+ ItemHeight = 13
+ TabOrder = 5
+ OnKeyPress = freeHandLookupoldKeyPress
+ end
+ end
+ object ToolBar1: TToolBar
+ Left = 369
+ Top = 8
+ Width = 301
+ Height = 25
+ AutoSize = True
+ ButtonHeight = 23
+ ButtonWidth = 82
+ EdgeBorders = []
+ Images = ImageList2
+ TabOrder = 3
+ object Bookmarkbtn: TSpeedButton
+ Left = 0
+ Top = 2
+ Width = 101
+ Height = 23
+ Caption = 'Bookmark'
+ Glyph.Data = {
+ 76010000424D7601000000000000760000002800000020000000100000000100
+ 0400000000000001000000000000000000001000000010000000000000000000
+ 800000800000008080008000000080008000808000007F7F7F00BFBFBF000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00333333333333
+ 333333333333FF3333333333333C0C333333333333F777F3333333333CC0F0C3
+ 333333333777377F33333333C30F0F0C333333337F737377F333333C00FFF0F0
+ C33333F7773337377F333CC0FFFFFF0F0C3337773F33337377F3C30F0FFFFFF0
+ F0C37F7373F33337377F00FFF0FFFFFF0F0C7733373F333373770FFFFF0FFFFF
+ F0F073F33373F333373730FFFFF0FFFFFF03373F33373F333F73330FFFFF0FFF
+ 00333373F33373FF77333330FFFFF000333333373F333777333333330FFF0333
+ 3333333373FF7333333333333000333333333333377733333333333333333333
+ 3333333333333333333333333333333333333333333333333333}
+ Layout = blGlyphRight
+ NumGlyphs = 2
+ OnClick = BookmarkbtnClick
+ end
+ object BookmarkBtnImage: TImage
+ Left = 101
+ Top = 5
+ Width = 75
+ Height = 16
+ AutoSize = True
+ Picture.Data = {
+ 07544269746D6170F6020000424DF60200000000000076000000280000004B00
+ 0000100000000100040000000000800200000000000000000000100000001000
+ 0000000000000000800000800000008080008000000080008000808000008080
+ 8000C0C0C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFF
+ FF00888888888888888888888888888888888888888888888888888888888888
+ 8888888888888880000088888888888888888888888888888888888888888888
+ 888888888888888888C0C8888888888000008888888888888888888888888888
+ 88888888888888888888888888888888CC0F0C88888888800000888888888888
+ 88888888888888888888888888888888888888888888888C80F0F0C888888880
+ 00008888000088880008880008808880808808808800008088088808888888C0
+ 0FFF0F0C88888880000088880888088088808088808088088088088080888080
+ 880880888888CC0FFFFFF0F0C888888000008888088808808880808880808088
+ 808808808088808088080888888C80F0FFFFFF0F0C8888800000888808880880
+ 888080888080088880880880880000808800888888800FFF0FFFFFF0F0C88880
+ 000088880000888088808088808080888088088088888080880808888880FFFF
+ F0FFFFFF0F088880000088880888088800088800088088088000800888000880
+ 0808808888880FFFFF0FFFFFF088888000008888088808888888888888808888
+ 888888888888888888088888888880FFFFF0FFF0088888800000888808880888
+ 88888888888088888888888888888888880888888888880FFFFF000888888880
+ 0000888800008888888888888880888888888888888888888808888888888880
+ FFF0888888888880000088888888888888888888888888888888888888888888
+ 8888888888888888000888888888888000008888888888888888888888888888
+ 8888888888888888888888888888888888888888888888800000888888888888
+ 8888888888888888888888888888888888888888888888888888888888888880
+ 0000}
+ Visible = False
+ end
+ end
+ object pnlSpeed: TPanel
+ Left = 12
+ Top = 0
+ Width = 0
+ Height = 49
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 1
+ end
+ end
+ object MainMenu1: TMainMenu
+ Left = 572
+ Top = 4
+ object File1: TMenuItem
+ Caption = '&File'
+ object SaveLayout1: TMenuItem
+ Caption = 'S&ave Layout'
+ OnClick = SaveLayout1Click
+ end
+ object N5: TMenuItem
+ Caption = '-'
+ end
+ object Print1: TMenuItem
+ Caption = '&Print...'
+ OnClick = Print1Click
+ end
+ object N1: TMenuItem
+ Caption = '-'
+ end
+ object Exit1: TMenuItem
+ Caption = 'E&xit'
+ OnClick = Exit1Click
+ end
+ end
+ object Edit1: TMenuItem
+ Caption = '&Edit'
+ object Copy3: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ end
+ object Options2: TMenuItem
+ Caption = 'Options'
+ object Options1: TMenuItem
+ Caption = '&Preferences...'
+ OnClick = Options1Click
+ end
+ end
+ object Search1: TMenuItem
+ Caption = '&Search'
+ object NewSearchWindow1: TMenuItem
+ Caption = '&New Search Window'
+ ShortCut = 114
+ OnClick = NewSearchWindow1Click
+ end
+ end
+ object Tools1: TMenuItem
+ Caption = '&Tools'
+ object InstallManager1: TMenuItem
+ Caption = 'Install Manager'
+ OnClick = InstallManager1Click
+ end
+ end
+ object Help1: TMenuItem
+ Caption = '&Help'
+ object Contents1: TMenuItem
+ Caption = 'Contents'
+ OnClick = Contents1Click
+ end
+ object DevotionaloftheDay1: TMenuItem
+ Caption = 'Devotional of the Day'
+ OnClick = DevotionaloftheDay1Click
+ end
+ object SEPERATOR: TMenuItem
+ Caption = '-'
+ end
+ object About1: TMenuItem
+ Caption = '&About'
+ OnClick = About1Click
+ end
+ end
+ end
+ object PopupMenu2: TPopupMenu
+ OnPopup = PopupMenuPopup
+ Left = 273
+ Top = 246
+ object Copy2: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ object DictionaryLookup1: TMenuItem
+ Caption = 'Dictionary Lookup'
+ OnClick = DictionaryLookup1Click
+ end
+ object SearchForWord2: TMenuItem
+ Caption = 'Search For Word'
+ OnClick = SearchForWord1Click
+ end
+ end
+ object Search: TDdeServerItem
+ ServerConv = Bible
+ OnPokeData = SearchPokeData
+ Left = 684
+ Top = 60
+ end
+ object Lookup: TDdeServerItem
+ ServerConv = Bible
+ OnPokeData = LookupPokeData
+ Left = 656
+ Top = 60
+ end
+ object Bible: TDdeServerConv
+ Left = 624
+ Top = 60
+ end
+ object PopupMenu1: TPopupMenu
+ OnPopup = PopupMenuPopup
+ Left = 245
+ Top = 246
+ object Copy1: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ object CopyasBGreekTransliteration1: TMenuItem
+ Caption = 'Copy as &B-Greek Transliteration'
+ OnClick = CopyasBGreekTransliteration1Click
+ end
+ object MenuItem1: TMenuItem
+ Caption = 'Dictionary Lookup'
+ OnClick = DictionaryLookup1Click
+ end
+ object SearchForWord1: TMenuItem
+ Caption = 'Search For Word'
+ OnClick = SearchForWord1Click
+ end
+ end
+ object BookmarkPopup: TPopupMenu
+ Left = 600
+ object AddBookmark1: TMenuItem
+ Caption = '&Add Bookmark'
+ Hint = 'Add Current Verse to Personal Bookmarks'
+ OnClick = AddBookmark1Click
+ end
+ object EditBookmarks1: TMenuItem
+ Caption = '&Edit Bookmarks / Tree View...'
+ Hint = 'Edit Bookmarks / View Bookmarks in a Tree View'
+ OnClick = EditBookmarks1Click
+ end
+ object N2: TMenuItem
+ Caption = '-'
+ end
+ end
+ object ImageList1: TImageList
+ BlendColor = clBtnFace
+ DrawingStyle = dsTransparent
+ Height = 34
+ Width = 38
+ Left = 14
+ Top = 4
+ end
+ object ImageList2: TImageList
+ Masked = False
+ Width = 75
+ Left = 518
+ Top = 2
+ end
+ object PopupMenu3: TPopupMenu
+ OnPopup = PopupMenuPopup
+ Left = 301
+ Top = 246
+ object EditEntry1: TMenuItem
+ Caption = '&Edit Entry'
+ OnClick = EditEntry1Click
+ end
+ object DeleteEntry1: TMenuItem
+ Caption = '&Delete Entry'
+ OnClick = DeleteEntry1Click
+ end
+ object LinktoVerse1: TMenuItem
+ Caption = 'Link to Comment for Verse...'
+ OnClick = LinktoVerse1Click
+ end
+ object N3: TMenuItem
+ Caption = '-'
+ end
+ object Copy4: TMenuItem
+ Caption = '&Copy'
+ OnClick = Copy1Click
+ end
+ object DictionaryLookup2: TMenuItem
+ Caption = 'Dictionary Lookup'
+ OnClick = DictionaryLookup1Click
+ end
+ object SearchForWord3: TMenuItem
+ Caption = 'Search For Word'
+ OnClick = SearchForWord1Click
+ end
+ end
+ object PopupMenu4: TPopupMenu
+ Left = 328
+ Top = 58
+ object HideShowModules1: TMenuItem
+ Caption = 'Hide / Show Modules'
+ OnClick = HideShowModules1Click
+ end
+ end
+ object ApplicationEvents1: TApplicationEvents
+ OnHint = ApplicationEvents1Hint
+ OnShowHint = ApplicationEvents1ShowHint
+ Left = 547
+ Top = 19
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/mainfrm.h b/apps/windoze/CBuilder5/BibleCS/mainfrm.h new file mode 100644 index 0000000..cd23e99 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/mainfrm.h @@ -0,0 +1,418 @@ +//--------------------------------------------------------------------------- +#ifndef mainfrmH +#define mainfrmH +//--------------------------------------------------------------------------- +#include <vcl\Classes.hpp> +#include <vcl\Controls.hpp> +#include <vcl\StdCtrls.hpp> +#include <vcl\Forms.hpp> +#include <vcl\ExtCtrls.hpp> +#include <vcl\ComCtrls.hpp> +#include "biblecsmgr.h" +#include <swtext.h> +#include <strkey.h> +#include <regex.h> +#include <listkey.h> +#include <swgenbook.h> +#include "swdisprtfchap.h" +#include <AppEvnts.hpp> +#include <Buttons.hpp> +#include <DdeMan.hpp> +#include <Graphics.hpp> +#include <ImgList.hpp> +#include <Menus.hpp> +#include <ToolWin.hpp> +#include <vcl\Buttons.hpp> +#include <vcl\Menus.hpp> +#include <vcl\DdeMan.hpp> +#include <OleCtrls.hpp> +#include <ToolWin.hpp> +#include <shellapi.h> +#include <Graphics.hpp> +#include <ImgList.hpp> +#include <jpeg.hpp> +#include "RxRichEdit.hpp" +//#include "MOZILLACONTROLLib_OCX.h" +#include "SHDocVw_OCX.h" +#include <AppEvnts.hpp> +#include <TntStdCtrls.hpp> + +#ifndef USEOLDRTF +#include "RxRichEdit.hpp" +#else +#define TRxRichEdit TRichEdit +#endif + +#include <list> +#include <vector> + +#define _tr(text) LocaleMgr::systemLocaleMgr.translate(text) +#define MONITOR_CENTER 0x0001 // center rect to monitor +#define MONITOR_CLIP 0x0000 // clip rect to monitor +#define MONITOR_WORKAREA 0x0002 // use monitor work area +#define MONITOR_AREA 0x0000 // use monitor entire area + + +class RTFDisp : public SWDisplay { + SWDispRTF *edit; + static SWClass classdef; +public: + RTFDisp(SWDispRTF *iedit) { myclass = &classdef; edit = iedit; } + virtual SWDispRTF *editControl() { return edit; } + RTFDisp() {} + virtual char Display(SWModule &imodule) { + return edit->Display(imodule); + } +}; + +class RTFBookDisp : public RTFDisp { + SWDispRTF *edit; + TTreeView *toc; +public: + RTFBookDisp(SWDispRTF *iedit, TTreeView *itoc) : RTFDisp(iedit) { toc = itoc;} + RTFBookDisp() {} + + void fillTreeTOC(TreeKeyIdx treeKey, TTreeView *tree, TTreeNode *parent) { + TTreeNode *node = tree->Items->AddChildObject(parent, treeKey.getLocalName(), (void *)treeKey.getOffset()); + if (treeKey.firstChild()) { + fillTreeTOC(treeKey, tree, node); + treeKey.parent(); + } + if (treeKey.nextSibling()) + fillTreeTOC(treeKey, tree, parent); + } + + virtual char Display(SWModule &imodule) { + if (!toc->Items->GetFirstNode()) { + //edit->Text = "Loading TOC..."; + imodule = TOP; + ((TreeKeyIdx *)((SWKey *)imodule))->firstChild(); + fillTreeTOC(*(TreeKeyIdx *)((SWKey *)imodule), toc, toc->Selected); + } + return RTFDisp::Display(imodule); + } +}; + +class HREFDisp : public SWDisplay { + TCppWebBrowser *edit; +public: + HREFDisp(TCppWebBrowser *iedit) { edit = iedit; } + HREFDisp() {} + char Display(SWModule &imodule) { + + TMemoryStream *stm = new TMemoryStream(); + + if ( stm == NULL ) + return 1; + + stm->Clear(); + string modText = (string)"<HTML><BODY>" + (string)imodule.RenderText() + (string)"</BODY></HTML>"; + stm->WriteBuffer(modText.c_str(), modText.length()); + + IPersistStreamInit *psi = NULL; + + stm->Seek( 0, 0 ); + + // If you pass soOwned instead, the stream will be freed for you + TStreamAdapter *sa = new TStreamAdapter( stm, soReference ); + + if ( sa == NULL ) { + delete stm; + return 1; + } + + _di_IDispatch doc = edit->Document; + if ( doc == NULL ) { + TVariant url = "about:blank"; + edit->Navigate2( &url ); + while ( doc == NULL ) { + Application->ProcessMessages(); + doc = edit->Document; + } + } + +// if ( doc->QueryInterface(IID_IPersistStreamInit, (void**)&psi ) == S_OK ) { + HRESULT result = doc->QueryInterface(IID_IPersistStreamInit, (void**)&psi ); + if (result == S_OK) { +// if ( doc->QueryInterface(IID_IWrite, (void**)"test" ) == S_OK ) { + if ( psi ) + psi->Load( *sa ); + } + else + delete sa; + + delete stm; + +// edit->SetTextBuf("yo mama"); +// edit->RequestDoc((char *)imodule); + return 0; + } +}; + +class DispExternal : public SWDisplay { +public: + DispExternal() {} + char Display(SWModule &imodule) { + SHELLEXECUTEINFO info; + info.cbSize = sizeof(SHELLEXECUTEINFO); + info.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_CLASSNAME; + info.hwnd = GetFocus(); + info.lpVerb = "open"; + info.lpFile = (const char *)imodule; + info.lpParameters = NULL; + info.lpDirectory = NULL; + info.nShow = 0; +// info.lpClass = ".html"; + ShellExecuteEx(&info); +// ShellExecute(edit->Handle, "open", (char *)imodule, NULL, NULL, SW_SHOWNORMAL); + return 0; + } +}; + + +class ModState { +public: + ModState(TPageControl *ipc, TTabSheet *iap, SWKey ikey) { pc = ipc; ap = iap; key = ikey; } + ModState(); + TPageControl *pc; + TTabSheet* ap; + SWKey key; +}; + +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + TPanel *pnlTextCom; + TSplitter *Splitter2; + TPanel *pnlText; + TPanel *pnlComment; + TSplitter *Splitter1; + TPanel *pnlDict; + TPageControl *TextPageControl; + TPageControl *CommentaryPageControl; + TStatusBar *StatusBar1; + TPageControl *LexDictPageControl; + TMainMenu *MainMenu1; + TMenuItem *Search1; + TMenuItem *NewSearchWindow1; + TMenuItem *Help1; + TMenuItem *About1; + TPopupMenu *PopupMenu2; + TMenuItem *DictionaryLookup1; + TMenuItem *File1; + TMenuItem *SaveLayout1; + TMenuItem *Exit1; + TMenuItem *N1; + TDdeServerItem *Search; + TDdeServerItem *Lookup; + TDdeServerConv *Bible; + TPopupMenu *PopupMenu1; + TMenuItem *MenuItem1; + TMenuItem *Copy1; + TMenuItem *CopyasBGreekTransliteration1; + TMenuItem *Copy2; + TMenuItem *Edit1; + TMenuItem *Copy3; + TPopupMenu *BookmarkPopup; + TMenuItem *AddBookmark1; + TMenuItem *N2; + TMenuItem *EditBookmarks1; + TMenuItem *Options1; + TCoolBar *CoolBar1; + TImageList *ImageList1; + TImage *BackBtnImage; + TImage *SearchBtnImage; + TToolBar *ToolBar2; + TToolButton *ToolButton3; + TToolButton *ToolButton4; + TPanel *pnlSpeed; + TPanel *Panel1; + TComboBox *cbBook; + TEdit *CHBox; + TUpDown *UpDown1; + TEdit *VSBox; + TUpDown *UpDown2; + TSpeedButton *btnLookup; + TToolBar *ToolBar1; + TImageList *ImageList2; + TImage *BookmarkBtnImage; + TSpeedButton *Bookmarkbtn; + TPopupMenu *PopupMenu3; + TMenuItem *Copy4; + TMenuItem *DictionaryLookup2; + TMenuItem *N3; + TMenuItem *EditEntry1; + TMenuItem *DeleteEntry1; + TMenuItem *LinktoVerse1; + TMenuItem *Options2; + TMenuItem *Contents1; + TComboBox *freeHandLookup; + TPanel *Panel2; + TSplitter *Splitter3; + TRichEdit *DictKeyEditOld; + TListBox *lbDictKeysOld; + TPopupMenu *PopupMenu4; + TMenuItem *HideShowModules1; + TMenuItem *DevotionaloftheDay1; + TMenuItem *Tools1; + TMenuItem *InstallManager1; + TMenuItem *SEPERATOR; + TApplicationEvents *ApplicationEvents1; + TMenuItem *Print1; + TMenuItem *N5; + TMenuItem *SearchForWord1; + TMenuItem *SearchForWord2; + TMenuItem *SearchForWord3; + void __fastcall TextPageControlChange(TObject *Sender); + void __fastcall btnLookupClick(TObject *Sender); + void __fastcall CommentaryPageControlChange(TObject *Sender); + + + + void __fastcall DictKeyEditOldChange(TObject *Sender); + void __fastcall LexDictPageControlChange(TObject *Sender); + void __fastcall NewSearchWindow1Click(TObject *Sender); + + void __fastcall Exit1Click(TObject *Sender); + void __fastcall About1Click(TObject *Sender); + void __fastcall DictionaryLookup1Click(TObject *Sender); + void __fastcall SaveLayout1Click(TObject *Sender); + + + void __fastcall FormShow(TObject *Sender); + + void __fastcall LookupPokeData(TObject *Sender); + + void __fastcall SearchPokeData(TObject *Sender); + void __fastcall UpDown3Click(TObject *Sender, TUDBtnType Button); + void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button); + + + void __fastcall BackbtnClick(TObject *Sender); + void __fastcall Button1Click(TObject *Sender); + void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender); + void __fastcall Copy1Click(TObject *Sender); + + + + void __fastcall AddBookmark1Click(TObject *Sender); + void __fastcall BookmarkItemClick(TObject *Sender); + void __fastcall BookmarkbtnClick(TObject *Sender); + void __fastcall EditBookmarks1Click(TObject *Sender); + + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall Options1Click(TObject *Sender); + void __fastcall cbBookChange(TObject *Sender); + + void __fastcall FormCreate(TObject *Sender); + void __fastcall PopupMenuPopup(TObject *Sender); + void __fastcall createVerseList(TObject *Sender); + void __fastcall freeHandLookupoldKeyPress(TObject *Sender, char &Key); + void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall RTFURLClick(TObject *Sender, const AnsiString URLText, TMouseButton Button); + void __fastcall EditEntry1Click(TObject *Sender); + void __fastcall DeleteEntry1Click(TObject *Sender); + void __fastcall LinktoVerse1Click(TObject *Sender); + void __fastcall BookTOCChange(TObject* Sender, TTreeNode* Node); + + void __fastcall GlobalOptionChange(TObject *Sender); + + + void __fastcall OptionShowVals(TObject *Sender); + void __fastcall Contents1Click(TObject *Sender); + void __fastcall FormClose(TObject *Sender, TCloseAction &Action); + void __fastcall lbDictKeysOldClick(TObject *Sender); + void __fastcall verseLookupClick(TObject *Sender); + void __fastcall HideShowModules1Click(TObject *Sender); + void __fastcall DevotionaloftheDay1Click(TObject *Sender); + void __fastcall CppWebBrowser1BeforeNavigate2(TObject *Sender, + LPDISPATCH pDisp, TVariant *URL, TVariant *Flags, + TVariant *TargetFrameName, TVariant *PostData, TVariant *Headers, + TOLEBOOL *Cancel); + void __fastcall InstallManager1Click(TObject *Sender); + void __fastcall ApplicationEvents1Hint(TObject *Sender); + void __fastcall ApplicationEvents1ShowHint(AnsiString &HintStr, + bool &CanShow, THintInfo &HintInfo); + void __fastcall Print1Click(TObject *Sender); + void __fastcall SearchForWord1Click(TObject *Sender); +private: // User declarations + list <SWDisplay *> displays; // so we can delete each display we create + list <ModState *> modstates; + vector <ModState *> ctrlstates; + bool logmodstate; + bool freshdict; + String clickText; + + char CreateTextPane(SWModule *mod, char *font = 0); + char CreateCommentPane(SWModule *mod, char *font = 0); + char CreateLDPane(SWModule *mod, char *font = 0); + char CreateBookPane(SWModule *mod, char *font = 0); + void PushState(); + void BackState(); + void ForwardState(); + void AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree); + void FillDictKeys(); + void AddVerseChoices(TPopupMenu *menu, const char *buf, TRxRichEdit *rtf); + void fillVKeySelector(VerseKey *vk); + static bool hasFeature(SWMgr *mgr, const char *modName, const char *feature); + void NavigateVerseURL(char* verStr); + void RefRTFHeaders(); + +public: // User declarations + TTntListBox *lbDictKeys; + TTntEdit *DictKeyEdit; + VerseKey *DefaultVSKey; + SWKey *DefaultStrKey; + BibleCSMGR *mainmgr; + SWConfig *layoutconf; + SWConfig *optionsconf; + SWDispRTF *currentRTF; + __fastcall TForm1(TComponent* Owner); + __fastcall ~TForm1(); + void __fastcall DisplayHint(TObject* Sender); + void RefreshActiveSheet(TPageControl *ts); + void TextKeyChanged(); // updates dependents on TextKeyChanged + void RefreshBookmarksMenu(TMenu *menu, TTreeView *tree); + void RestoreState(ModState *state); + void i12ize(const char *lang); + static WideString TrimJunk(WideString src); + void __fastcall AppMessage(tagMSG &Msg, bool &Handled); + static void ClipOrCenterRectToMonitor(LPRECT prc, UINT flags); + static void ClipOrCenterWindowToMonitor(HWND hwnd, UINT flags); + ListKey tmpVerseList; + String tmpVerseListCaption; + bool renderingHint; + bool closing; +}; + +class TRTFHintWindow : public THintWindow { + typedef THintWindow inherited; + +protected: + virtual void __fastcall Paint(void); + virtual void __fastcall CreateParams(TCreateParams &Params); + +public: + __fastcall virtual TRTFHintWindow(Classes::TComponent* AOwner); + __fastcall TRTFHintWindow(HWND ParentWindow) : THintWindow(ParentWindow) { } + __fastcall virtual ~TRTFHintWindow(void); + virtual void __fastcall ActivateHint(const /*Windows::*/TRect& Rect, const AnsiString AHint); + virtual void __fastcall ActivateHintData(const /*Windows::*/TRect& Rect, const AnsiString AHint, void* AData); + virtual /*Windows::*/TRect __fastcall CalcHintRect(int MaxWidth, const AnsiString AHint, void* AData); + virtual bool __fastcall IsHintMsg(tagMSG& Msg); + + __property BiDiMode ; + __property Caption ; + __property Color ; + __property Canvas ; + __property Font ; + +}; + + +//--------------------------------------------------------------------------- +extern TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp new file mode 100644 index 0000000..5cff2a7 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.cpp @@ -0,0 +1,644 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include <localemgr.h> +#include <list> +#include <string> +#include <dirent.h> +#include <io.h> +#include <dir.h> +#include "TModuleFonts.h" +#include "optionfrm.h" +#include "mainfrm.h" + + +//--------------------------------------------------------------------------- +#pragma resource "*.dfm" +TOptionsfrm *Optionsfrm; + +const char *TOptionsfrm::defaultLocaleName = "en_us"; +const char *TOptionsfrm::defaultLocaleDescription = "English (US)"; +//--------------------------------------------------------------------------- +__fastcall TOptionsfrm::TOptionsfrm(TComponent* Owner) + : TForm(Owner) +{ + FontDialogText = new TFontSelFrm(this); + FontDialogComment = new TFontSelFrm(this); + FontDialogLD = new TFontSelFrm(this); + FontDialogPopup = new TFontSelFrm(this); +} +//--------------------------------------------------------------------------- +void __fastcall TOptionsfrm::btnCurrVerseClick(TObject *Sender) +{ + ColorDialogVS->Execute(); + shpCurrVSClr->Brush->Color = ColorDialogVS->Color; + UpdatePreview(); +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::FormCreate(TObject *Sender) +{ + list<string> locales; + + localeCB->Clear(); + localeCB->Items->AddObject(defaultLocaleDescription, (TObject *)defaultLocaleName); + + locales = LocaleMgr::systemLocaleMgr.getAvailableLocales(); + + for (list<string>::iterator it = locales.begin(); it != locales.end(); it++) { + const char *name = LocaleMgr::systemLocaleMgr.getLocale(it->c_str())->getName(); + const char *description = LocaleMgr::systemLocaleMgr.getLocale(it->c_str())->getDescription(); + localeCB->Items->AddObject(description, (TObject *)name); + } + localeCB->ItemIndex = 0; +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::FormShow(TObject *Sender) +{ + PageControl1->ActivePage = TabSheet1; + FindSchemeNames(); + cmbTextSelect->ItemIndex = 0; + UpdatePreview(); +} + + + +void __fastcall TOptionsfrm::btnFontClick(TObject *Sender) +{ + + TFontSelFrm* tempFrm = new TFontSelFrm(this); + switch (cmbTextSelect->ItemIndex) + { + case 0: + CopyFontDlg(tempFrm, FontDialogText); + if(FontDialogText->ShowModal() == mrOk){ + CopyFontDlg(FontDialogComment, FontDialogText); + CopyFontDlg(FontDialogLD, FontDialogText); + CopyFontDlg(FontDialogPopup, FontDialogText); + UpdatePreview(); + }else CopyFontDlg(FontDialogText, tempFrm); + break; + case 1: + CopyFontDlg(tempFrm, FontDialogText); + if(FontDialogText->ShowModal() == mrOk) + UpdatePreview(); + else CopyFontDlg(FontDialogText, tempFrm); + break; + case 2: + CopyFontDlg(tempFrm, FontDialogComment); + if(FontDialogComment->ShowModal() == mrOk) + UpdatePreview(); + else CopyFontDlg(FontDialogComment, tempFrm); + break; + case 3: + CopyFontDlg(tempFrm, FontDialogLD); + if(FontDialogLD->ShowModal() == mrOk) + UpdatePreview(); + else CopyFontDlg(FontDialogLD, tempFrm); + break; + case 4: + CopyFontDlg(tempFrm, FontDialogPopup); + if(FontDialogPopup->ShowModal() == mrOk) + UpdatePreview(); + else CopyFontDlg(FontDialogPopup, tempFrm); + break; + } + delete tempFrm; +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionsfrm::shpCurrVSClrMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + btnCurrVerseClick(Sender); +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionsfrm::btnNumClrClick(TObject *Sender) +{ + ColorDialogVerseNum->Execute(); + shpNumClr->Brush->Color = ColorDialogVerseNum->Color; + UpdatePreview(); + +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::btnFieldClrClick(TObject *Sender) +{ + ColorDialogField->Execute(); + shpFieldClr->Brush->Color = ColorDialogField->Color; + UpdatePreview(); +} +//--------------------------------------------------------------------------- + +// TODO 2 -cOptions: add new category, Search Results +void __fastcall TOptionsfrm::cmbTextSelectChange(TObject *Sender) +{ + UpdatePreview(); +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::cmbSchemeSelectChange(TObject *Sender) +{ + AnsiString tempName = ExtractFilePath(Application->ExeName) + COLOR_DIR + cmbSchemeSelect->Text + COLOR_EXT; + SWConfig schemesconf(tempName.c_str()); + LoadDispSettings(&schemesconf); + UpdatePreview(); +} +//--------------------------------------------------------------------------- + +// TODO 1 -cOptions: Change to use RxRichEditX somehow, so we're consistent with look and feel of real control +void TOptionsfrm::UpdatePreview() +{ + char buffTemp[512], buffFinal[512], font[64]; + char* verse = "Why, my beloved brothers, let every man be swift to hear, slow to speak, slow to wrath"; + int vsColorRed, vsColorGreen, vsColorBlue, numColorRed, numColorGreen, numColorBlue; + int fontSize; + TMemoryStream * RTFStream = new TMemoryStream; + + strcpy(buffFinal, "{\\rtf1\\ansi"); + + switch (cmbTextSelect->ItemIndex) + { + case 2: + TRxRichEditX::TColorToRGB(FontDialogComment->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); + TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); + strcpy(font, FontDialogComment->Font->Name.c_str()); + fontSize = FontDialogComment->Font->Size; + RTFPreview->Color = FontDialogComment->BackColor; + break; + case 3: + TRxRichEditX::TColorToRGB(FontDialogLD->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); + TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); + strcpy(font, FontDialogLD->Font->Name.c_str()); + fontSize = FontDialogLD->Font->Size; + RTFPreview->Color = FontDialogLD->BackColor; + break; + default: + TRxRichEditX::TColorToRGB(FontDialogText->Font->Color, vsColorRed, vsColorGreen, vsColorBlue); + TRxRichEditX::TColorToRGB(ColorDialogVerseNum->Color, numColorRed, numColorGreen, numColorBlue); + strcpy(font, FontDialogText->Font->Name.c_str()); + fontSize = FontDialogText->Font->Size; + RTFPreview->Color = FontDialogText->BackColor; + } + + // This is a strange way to deal with font size but I can't think of a different way to do it. + // So for now I will use the current system. + fontSize -= 12; + sprintf(buffTemp, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}}" , font); + strcat(buffFinal, buffTemp); + sprintf(buffTemp, "{\\colortbl;\\red%d\\green%d\\blue%d;\\red%d\\green%d\\blue%d;}" , vsColorRed, vsColorGreen, vsColorBlue, numColorRed, numColorGreen, numColorBlue); + strcat(buffFinal, buffTemp); + + sprintf(buffTemp, "\\pard \\qc\\nowidctlpar{\\f1\\fs%d\\cf1\\b Chapter 1 ", (30 + fontSize)); + strcat(buffFinal, buffTemp); + sprintf(buffTemp, "\\par\\fs%d\\par}", (10 + fontSize)); + strcat(buffFinal, buffTemp); + + sprintf(buffTemp, "{\\fs%d\\cf2\\super 19}", (10 + fontSize)); + strcat(buffFinal, buffTemp); + + sprintf(buffTemp, "\\ql\\nowidctlpar \\cf1\\f0\\fs%d ", (24 + fontSize)); + strcat(buffFinal, buffTemp); + strcat(buffFinal, verse); + + strcat(buffFinal, " }"); + + RTFStream->WriteBuffer(buffFinal, 512); + RTFStream->Position = 0; + RTFPreview->Lines->LoadFromStream(RTFStream); + GetCurrentScheme(); +} + +TOptionsfrm::CopyFontDlg(TFontSelFrm* lhs, const TFontSelFrm* rhs) +{ + lhs->BackColor = rhs->BackColor; + lhs->Font->Color = rhs->Font->Color; + lhs->Font->Size = rhs->Font->Size; + lhs->Font->Name = rhs->Font->Name; +} + +void __fastcall TOptionsfrm::btnSaveScheme(TObject *Sender) +{ + TPoint menup, point; + point.x = 0; + point.y = btnSave->Height; + menup = btnSave->ClientToScreen(point); + SavePopup->Popup(menup.x, menup.y); +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionsfrm::SaveSchemeClick(TObject *Sender) +{ + + ConfigEntMap emap; + AnsiString strName = cmbSchemeSelect->Text; + if(strName != "" && !strName.Pos("/") && !strName.Pos("\\") + && !strName.Pos(":") && !strName.Pos("*") + && !strName.Pos("?") && !strName.Pos("\"") + && !strName.Pos("<") && !strName.Pos(">") + && !strName.Pos("|")) { + + AnsiString strName = COLOR_DIR + cmbSchemeSelect->Text + COLOR_EXT; + SWConfig schemeconf(strName.c_str()); + + emap = schemeconf.Sections["Appearance"]; + emap.erase("AutoVSColor"); emap.insert(ConfigEntMap::value_type("AutoVSColor", IntToStr((AutoVSColor->Checked)?1:0).c_str())); + emap.erase("CurrentVSColor"); emap.insert(ConfigEntMap::value_type("CurrentVSColor", IntToStr(shpCurrVSClr->Brush->Color).c_str())); + emap.erase("VSNumberColor"); emap.insert(ConfigEntMap::value_type("VSNumberColor", IntToStr(ColorDialogVerseNum->Color).c_str())); + emap.erase("FieldColor"); emap.insert(ConfigEntMap::value_type("FieldColor", IntToStr(ColorDialogField->Color).c_str())); + emap.erase("StrongsColor"); emap.insert(ConfigEntMap::value_type("StrongsColor", IntToStr(ColorDialogStrongs->Color).c_str())); + emap.erase("MorphColor"); emap.insert(ConfigEntMap::value_type("MorphColor", IntToStr(ColorDialogMorph->Color).c_str())); + + emap.erase("TextBackColor"); emap.insert(ConfigEntMap::value_type("TextBackColor", IntToStr(FontDialogText->BackColor).c_str())); + emap.erase("CommentBackColor"); emap.insert(ConfigEntMap::value_type("CommentBackColor", IntToStr(FontDialogComment->BackColor).c_str())); + emap.erase("LDBackColor"); emap.insert(ConfigEntMap::value_type("LDBackColor", IntToStr(FontDialogLD->BackColor).c_str())); + emap.erase("PopupBackColor"); emap.insert(ConfigEntMap::value_type("PopupBackColor", IntToStr(FontDialogPopup->BackColor).c_str())); + + emap.erase("TextFontName"); emap.insert(ConfigEntMap::value_type("TextFontName", (FontDialogText->Font->Name).c_str())); + emap.erase("CommentFontName"); emap.insert(ConfigEntMap::value_type("CommentFontName", (FontDialogComment->Font->Name).c_str())); + emap.erase("LDFontName"); emap.insert(ConfigEntMap::value_type("LDFontName", (FontDialogLD->Font->Name).c_str())); + emap.erase("PopupFontName"); emap.insert(ConfigEntMap::value_type("PopupFontName", (FontDialogPopup->Font->Name).c_str())); + + emap.erase("TextFontSize"); emap.insert(ConfigEntMap::value_type("TextFontSize", IntToStr(FontDialogText->Font->Size).c_str())); + emap.erase("CommentFontSize"); emap.insert(ConfigEntMap::value_type("CommentFontSize", IntToStr(FontDialogComment->Font->Size).c_str())); + emap.erase("LDFontSize"); emap.insert(ConfigEntMap::value_type("LDFontSize", IntToStr(FontDialogLD->Font->Size).c_str())); + emap.erase("PopupFontSize"); emap.insert(ConfigEntMap::value_type("PopupFontSize", IntToStr(FontDialogPopup->Font->Size).c_str())); + + emap.erase("TextFontColor"); emap.insert(ConfigEntMap::value_type("TextFontColor", IntToStr(FontDialogText->Font->Color).c_str())); + emap.erase("CommentFontColor"); emap.insert(ConfigEntMap::value_type("CommentFontColor", IntToStr(FontDialogComment->Font->Color).c_str())); + emap.erase("LDFontColor"); emap.insert(ConfigEntMap::value_type("LDFontColor", IntToStr(FontDialogLD->Font->Color).c_str())); + emap.erase("PopupFontColor"); emap.insert(ConfigEntMap::value_type("PopupFontColor", IntToStr(FontDialogPopup->Font->Color).c_str())); + + schemeconf.Sections["Appearance"] = emap; + schemeconf.Save(); + }else{ + Application->MessageBox("Scheme name missing or invalid.","Oops", MB_OK); + } + SetCurrentDir(ExtractFilePath(Application->ExeName)); + FindSchemeNames(); +} +//--------------------------------------------------------------------------- + + +void TOptionsfrm::FindSchemeNames() +{ + DIR *dir; + struct dirent *ent; + string conffile; + AnsiString strName; + AnsiString strPath = COLOR_DIR; + + TStringList *schemeNames = new TStringList; + cmbSchemeSelect->Clear(); + + if (access(strPath.c_str(), 0)) { // directory does not exist + _mkdir(strPath.c_str()); + } + + if (dir = opendir(strPath.c_str())) { + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, "."))&& (strcmp(ent->d_name, "..")) && !strcmp(ExtractFileExt(ent->d_name).c_str(), COLOR_EXT.c_str())) { + strName = ent->d_name; + schemeNames->Add(strName.SubString(1, strName.Length() - 4).c_str()); + } + } + closedir(dir); + cmbSchemeSelect->Items = schemeNames; + } + delete schemeNames; +} + +void __fastcall TOptionsfrm::ExportClick(TObject *Sender) +{ + AnsiString name = cmbSchemeSelect->Text; + AnsiString newFileName; + AnsiString exName; + AnsiString subdir = ExtractFilePath(Application->ExeName) + COLOR_DIR; + if(name != ""){ + SaveSchDlg->FileName = name; + if(SaveSchDlg->Execute()){ + exName = subdir + name + COLOR_EXT; + newFileName = SaveSchDlg->FileName.c_str(); + if(!CopyFileA(exName.c_str(), newFileName.c_str(),1)) + Application->MessageBox("Export Failed." , "Oops", MB_OK); + } + }else{ + Application->MessageBox("No Scheme Selected to Export. Please Select a Scheme and Retry" , "Oops", MB_OK); + } + SetCurrentDir(ExtractFilePath(Application->ExeName)); +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionsfrm::ImportClick(TObject *Sender) +{ + AnsiString newFileName; + AnsiString exName, newPath; + AnsiString subdir = ExtractFilePath(Application->ExeName) + COLOR_DIR; + if(OpenSchDlg->Execute()){ + exName = OpenSchDlg->FileName.c_str(); + newFileName = ExtractFileName(exName); + newPath = subdir + newFileName; + if(!CopyFileA(exName.c_str(), newPath.c_str(),1)) + MessageBox(this, "Import Failed." , "Oops", MB_OK); + } + SetCurrentDir(ExtractFilePath(Application->ExeName)); + FindSchemeNames(); +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionsfrm::DeleteClick(TObject *Sender) +{ + AnsiString name = cmbSchemeSelect->Text; + AnsiString fullName = ExtractFilePath(Application->ExeName) + COLOR_DIR + name + COLOR_EXT; + if(name != ""){ + DeleteFile(fullName); + }else{ + Application->MessageBox("No Scheme Selected to Delete. Please Select a Scheme and Retry" , "Oops", MB_OK); + } + SetCurrentDir(ExtractFilePath(Application->ExeName)); + FindSchemeNames(); +} +//--------------------------------------------------------------------------- + + +void TOptionsfrm::GetCurrentScheme() +{ + + AnsiString tempName; + SWConfig *schemesconf; + SectionMap::iterator sit, oit; + + SWConfig *optionsconf = dynamic_cast<TForm1*>(Application->MainForm)->optionsconf; + for(int count = 0; count < cmbSchemeSelect->Items->Count; count++) + { + tempName = ExtractFilePath(Application->ExeName) + COLOR_DIR + cmbSchemeSelect->Items->Strings[count] + COLOR_EXT; + schemesconf = new SWConfig(tempName.c_str()); + if( schemesconf->Sections["Appearance"]["CurrentVSColor"] == optionsconf->Sections["Appearance"]["CurrentVSColor"] && + schemesconf->Sections["Appearance"]["VSNumberColor"] == optionsconf->Sections["Appearance"]["VSNumberColor"] && + schemesconf->Sections["Appearance"]["StrongsColor"] == optionsconf->Sections["Appearance"]["StrongsColor"] && + schemesconf->Sections["Appearance"]["MorphColor"] == optionsconf->Sections["Appearance"]["MorphColor"] && + schemesconf->Sections["Appearance"]["FieldColor"] == optionsconf->Sections["Appearance"]["FieldColor"] && + + schemesconf->Sections["Appearance"]["TextBackColor"] == optionsconf->Sections["Appearance"]["TextBackColor"] && + schemesconf->Sections["Appearance"]["CommentBackColor"] == optionsconf->Sections["Appearance"]["CommentBackColor"] && + schemesconf->Sections["Appearance"]["LDBackColor"] == optionsconf->Sections["Appearance"]["LDBackColor"] && + schemesconf->Sections["Appearance"]["PopupBackColor"] == optionsconf->Sections["Appearance"]["PopupBackColor"] && + + schemesconf->Sections["Appearance"]["TextFontName"] == optionsconf->Sections["Appearance"]["TextFontName"] && + schemesconf->Sections["Appearance"]["CommentFontName"] == optionsconf->Sections["Appearance"]["CommentFontName"] && + schemesconf->Sections["Appearance"]["LDFontName"] == optionsconf->Sections["Appearance"]["LDFontName"] && + schemesconf->Sections["Appearance"]["PopupFontName"] == optionsconf->Sections["Appearance"]["PopupFontName"] && + + schemesconf->Sections["Appearance"]["TextFontSize"] == optionsconf->Sections["Appearance"]["TextFontSize"] && + schemesconf->Sections["Appearance"]["CommentFontSize"] == optionsconf->Sections["Appearance"]["CommentFontSize"] && + schemesconf->Sections["Appearance"]["LDFontSize"] == optionsconf->Sections["Appearance"]["LDFontSize"] && + schemesconf->Sections["Appearance"]["PopupFontSize"] == optionsconf->Sections["Appearance"]["PopupFontSize"] && + + schemesconf->Sections["Appearance"]["TextFontColor"] == optionsconf->Sections["Appearance"]["TextFontColor"] && + schemesconf->Sections["Appearance"]["CommentFontColor"] == optionsconf->Sections["Appearance"]["CommentFontColor"] && + schemesconf->Sections["Appearance"]["LDFontColor"] == optionsconf->Sections["Appearance"]["LDFontColor"] && + schemesconf->Sections["Appearance"]["PopupFontColor"] == optionsconf->Sections["Appearance"]["PopupFontColor"]){ cmbSchemeSelect->ItemIndex = count; + count = cmbSchemeSelect->Items->Count; // Basically we are done and can move on :) + } + delete schemesconf; + } +} + + + +void __fastcall TOptionsfrm::btnModFontsClick(TObject *Sender) +{ + TModuleFonts *pDlg = new TModuleFonts(this); + pDlg->ShowModal(); + + delete pDlg; +} +//--------------------------------------------------------------------------- + + + +// TODO 1 -cOptions: add hint verselist preview toggle +void __fastcall TOptionsfrm::HintStrongsClick(TObject *Sender) +{ + //In order for HintStrongs to work HintPopups has to be on + if(HintStrongs->Checked){ + HintPopups->Checked = true; + } + +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionsfrm::HintPopupsClick(TObject *Sender) +{ + // If we turn off HintPopups we have to turn off HintStrongs + // because HintStrongs will not work if hints are off + if(!HintPopups->Checked) + HintStrongs->Checked = false; +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::btnStrongClrClick(TObject *Sender) +{ + ColorDialogStrongs->Execute(); + shpStrongClr->Brush->Color = ColorDialogStrongs->Color; + UpdatePreview(); + +} +//--------------------------------------------------------------------------- + +void __fastcall TOptionsfrm::btnMorphClrClick(TObject *Sender) +{ + ColorDialogMorph->Execute(); + shpMorphClr->Brush->Color = ColorDialogMorph->Color; + UpdatePreview(); +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::shpFieldClrMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + btnFieldClrClick(Sender); +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::shpStrongClrMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + btnStrongClrClick(Sender); +} +//--------------------------------------------------------------------------- + + +void __fastcall TOptionsfrm::shpMorphClrMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + btnMorphClrClick(Sender); +} +//--------------------------------------------------------------------------- + + + + +void TOptionsfrm::LoadDispSettings(SWConfig* config) +{ + SectionMap::iterator sit; + + if ((sit = config->Sections.find("Appearance")) != config->Sections.end()) { + if ((*sit).second.find("CurrentVSColor") != (*sit).second.end()){ + shpCurrVSClr->Brush->Color = TColor(atoi((*(*sit).second.find("CurrentVSColor")).second.c_str())); + ColorDialogVS->Color = TColor(atoi((*(*sit).second.find("CurrentVSColor")).second.c_str())); + } + else { + shpCurrVSClr->Brush->Color = TColor(clBlue); + ColorDialogVS->Color = TColor(clBlue); + } + if ((*sit).second.find("AutoVSColor") != (*sit).second.end()) { + AutoVSColor->Checked = (atoi((*(*sit).second.find("AutoVSColor")).second.c_str()) == 0) ? false : true; + } + else { + AutoVSColor->Checked = true; + } + + if ((*sit).second.find("StrongsColor") != (*sit).second.end()){ + shpStrongClr->Brush->Color = TColor(atoi((*(*sit).second.find("StrongsColor")).second.c_str())); + ColorDialogStrongs->Color = TColor(atoi((*(*sit).second.find("StrongsColor")).second.c_str())); + } + else{ + shpStrongClr->Brush->Color = TColor(16711935); // Magenta + ColorDialogStrongs->Color = TColor(16711935); + } + + if ((*sit).second.find("MorphColor") != (*sit).second.end()){ + shpMorphClr->Brush->Color = TColor(atoi((*(*sit).second.find("MorphColor")).second.c_str())); + ColorDialogMorph->Color = TColor(atoi((*(*sit).second.find("MorphColor")).second.c_str())); + } + else{ + shpMorphClr->Brush->Color = TColor(60534); // Light Green + ColorDialogMorph->Color = TColor(60534); + } + + if ((*sit).second.find("VSNumberColor") != (*sit).second.end()){ + shpNumClr->Brush->Color = TColor(atoi((*(*sit).second.find("VSNumberColor")).second.c_str())); + ColorDialogVerseNum->Color = TColor(atoi((*(*sit).second.find("VSNumberColor")).second.c_str())); + } + else{ + shpNumClr->Brush->Color = TColor(clBlue); + ColorDialogVerseNum->Color = TColor(clBlue); + } + + if ((*sit).second.find("FieldColor") != (*sit).second.end()){ + shpFieldClr->Brush->Color = TColor(atoi((*(*sit).second.find("FieldColor")).second.c_str())); + ColorDialogField->Color = TColor(atoi((*(*sit).second.find("FieldColor")).second.c_str())); + } + else{ + shpFieldClr->Brush->Color = TColor(clAqua); + ColorDialogField->Color = TColor(clAqua); + } + + + if ((*sit).second.find("VSNumberColor") != (*sit).second.end()) + ColorDialogVerseNum->Color = TColor(atoi ((*(*sit).second.find("VSNumberColor")).second.c_str())); + else + ColorDialogVerseNum->Color = clBlue; + + //**** Font BackColor ****// + if ((*sit).second.find("TextBackColor") != (*sit).second.end()) + FontDialogText->BackColor = TColor(atoi((*(*sit).second.find("TextBackColor")).second.c_str())); + else + FontDialogText->BackColor = TColor(clWhite); + + if ((*sit).second.find("CommentBackColor") != (*sit).second.end()) + FontDialogComment->BackColor = TColor(atoi((*(*sit).second.find("CommentBackColor")).second.c_str())); + else + FontDialogComment->BackColor = TColor(clWhite); + + if ((*sit).second.find("LDBackColor") != (*sit).second.end()) + FontDialogLD->BackColor = TColor(atoi((*(*sit).second.find("LDBackColor")).second.c_str())); + else + FontDialogLD->BackColor = TColor(clWhite); + if ((*sit).second.find("PopupBackColor") != (*sit).second.end()) + FontDialogPopup->BackColor = TColor(atoi((*(*sit).second.find("PopupBackColor")).second.c_str())); + else + FontDialogPopup->BackColor = TColor(14680063); // 13434879 == cream color + + //**** Font Face Name ****// + if ((*sit).second.find("TextFontName") != (*sit).second.end()) + FontDialogText->Font->Name = ((*(*sit).second.find("TextFontName")).second.c_str()); + else + FontDialogText->Font->Name = "Times New Roman"; + + if ((*sit).second.find("CommentFontName") != (*sit).second.end()) + FontDialogComment->Font->Name = ((*(*sit).second.find("CommentFontName")).second.c_str()); + else + FontDialogComment->Font->Name = "Times New Roman"; + + if ((*sit).second.find("LDFontName") != (*sit).second.end()) + FontDialogLD->Font->Name = ((*(*sit).second.find("LDFontName")).second.c_str()); + else + FontDialogLD->Font->Name = "Times New Roman"; + if ((*sit).second.find("PopupFontName") != (*sit).second.end()) + FontDialogPopup->Font->Name = ((*(*sit).second.find("PopupFontName")).second.c_str()); + else + FontDialogPopup->Font->Name = "Times New Roman"; + + //**** Font Size ****// + if ((*sit).second.find("TextFontSize") != (*sit).second.end()) + FontDialogText->Font->Size = (atoi ((*(*sit).second.find("TextFontSize")).second.c_str())); + else + FontDialogText->Font->Size = 10; + if ((*sit).second.find("CommentFontSize") != (*sit).second.end()) + FontDialogComment->Font->Size = (atoi ((*(*sit).second.find("CommentFontSize")).second.c_str())); + else + FontDialogComment->Font->Size = 10; + + if ((*sit).second.find("LDFontSize") != (*sit).second.end()) + FontDialogLD->Font->Size = (atoi ((*(*sit).second.find("LDFontSize")).second.c_str())); + else + FontDialogLD->Font->Size = 10; + if ((*sit).second.find("PopupFontSize") != (*sit).second.end()) + FontDialogPopup->Font->Size = (atoi ((*(*sit).second.find("PopupFontSize")).second.c_str())); + else + FontDialogPopup->Font->Size = 10; + + //**** Font ForeColor ****// + if ((*sit).second.find("TextFontColor") != (*sit).second.end()) + FontDialogText->Font->Color = TColor(atoi ((*(*sit).second.find("TextFontColor")).second.c_str())); + else + FontDialogText->Font->Color = clBlack; + + if ((*sit).second.find("CommentFontColor") != (*sit).second.end()) + FontDialogComment->Font->Color = TColor(atoi ((*(*sit).second.find("CommentFontColor")).second.c_str())); + else + FontDialogComment->Font->Color = clBlack; + + if ((*sit).second.find("LDFontColor") != (*sit).second.end()) + FontDialogLD->Font->Color = TColor(atoi ((*(*sit).second.find("LDFontColor")).second.c_str())); + else + FontDialogLD->Font->Color = clBlack; + if ((*sit).second.find("PopupFontColor") != (*sit).second.end()) + FontDialogPopup->Font->Color = TColor(atoi ((*(*sit).second.find("PopupFontColor")).second.c_str())); + else + FontDialogPopup->Font->Color = clBlack; + } +} + + +void __fastcall TOptionsfrm::shpNumClrMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ + btnNumClrClick(Sender); +} +//--------------------------------------------------------------------------- + + diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm new file mode 100644 index 0000000..3e5a86e --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.dfm @@ -0,0 +1,681 @@ +object Optionsfrm: TOptionsfrm
+ Left = 272
+ Top = 126
+ BorderStyle = bsDialog
+ Caption = 'Preferences'
+ ClientHeight = 325
+ ClientWidth = 531
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnCreate = FormCreate
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object Panel2: TPanel
+ Left = 0
+ Top = 284
+ Width = 531
+ Height = 41
+ Align = alBottom
+ BevelOuter = bvNone
+ TabOrder = 0
+ object OkBtn: TBitBtn
+ Left = 338
+ Top = 9
+ Width = 89
+ Height = 25
+ Anchors = [akTop, akRight]
+ TabOrder = 0
+ Kind = bkOK
+ end
+ object CancelBtn: TBitBtn
+ Left = 436
+ Top = 9
+ Width = 89
+ Height = 25
+ Anchors = [akTop, akRight]
+ TabOrder = 1
+ Kind = bkCancel
+ end
+ end
+ object PageControl1: TPageControl
+ Left = 0
+ Top = 0
+ Width = 531
+ Height = 284
+ ActivePage = TabSheet3
+ Align = alClient
+ TabOrder = 1
+ object TabSheet1: TTabSheet
+ Caption = 'General'
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 163
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object gbPersonalize: TGroupBox
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 163
+ Align = alClient
+ Caption = 'Personalize'
+ TabOrder = 0
+ object Label4: TLabel
+ Left = 7
+ Top = 79
+ Width = 48
+ Height = 13
+ Caption = 'Language'
+ end
+ object AutoBMPersonal: TCheckBox
+ Left = 7
+ Top = 17
+ Width = 210
+ Height = 14
+ Hint =
+ 'Saves your personal bookmarks when you exit'#13#10'so that you can hav' +
+ 'e them next time you run '#13#10'The Sword Project'
+ Caption = 'Autosave Personal Bookmarks'
+ TabOrder = 0
+ end
+ object AutoBMOther: TCheckBox
+ Left = 7
+ Top = 36
+ Width = 210
+ Height = 14
+ Caption = 'Autosave Other Bookmarks'
+ TabOrder = 1
+ end
+ object HintPopups: TCheckBox
+ Left = 248
+ Top = 36
+ Width = 245
+ Height = 13
+ Hint =
+ 'Shows the hint boxes when you mouseover a'#13#10'panel giving a brief ' +
+ 'description of the current '#13#10'module.'
+ Caption = 'Show Hint Pop-ups'
+ TabOrder = 2
+ OnClick = HintPopupsClick
+ end
+ object localeCB: TComboBox
+ Left = 94
+ Top = 76
+ Width = 207
+ Height = 21
+ Hint =
+ 'Select your localized language'#13#10'This only localizes the book nam' +
+ 'es'#13#10'of the bible not the interface.'
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 3
+ end
+ object AutoLayout: TCheckBox
+ Left = 7
+ Top = 55
+ Width = 210
+ Height = 17
+ Hint = 'Saves the screen layout when the program exits'
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Autosave Screen Layout'
+ TabOrder = 4
+ end
+ object HintStrongs: TCheckBox
+ Left = 248
+ Top = 17
+ Width = 245
+ Height = 17
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Show Hint Over Strongs Numbers'
+ TabOrder = 5
+ OnClick = HintStrongsClick
+ end
+ end
+ end
+ end
+ object TabSheet2: TTabSheet
+ Caption = 'Special Modules'
+ ImageIndex = 1
+ object gbDefModules: TGroupBox
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 105
+ Align = alTop
+ Caption = 'Original Language Support - Default Modules'
+ TabOrder = 0
+ object Label5: TLabel
+ Left = 7
+ Top = 36
+ Width = 29
+ Height = 13
+ Caption = 'Greek'
+ end
+ object Label6: TLabel
+ Left = 7
+ Top = 59
+ Width = 37
+ Height = 13
+ Caption = 'Hebrew'
+ end
+ object Label7: TLabel
+ Left = 75
+ Top = 16
+ Width = 49
+ Height = 13
+ Caption = 'Definitions'
+ end
+ object Label8: TLabel
+ Left = 271
+ Top = 16
+ Width = 35
+ Height = 13
+ Caption = 'Parsing'
+ end
+ object Label10: TLabel
+ Left = 7
+ Top = 81
+ Width = 114
+ Height = 13
+ Caption = 'Strong'#39's Numbered Text'
+ end
+ object hebrewDefCB: TComboBox
+ Left = 75
+ Top = 55
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ object greekDefCB: TComboBox
+ Left = 75
+ Top = 33
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 1
+ end
+ object greekParseCB: TComboBox
+ Left = 271
+ Top = 33
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 2
+ end
+ object hebrewParseCB: TComboBox
+ Left = 271
+ Top = 55
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 3
+ end
+ object strongsNumsCB: TComboBox
+ Left = 154
+ Top = 78
+ Width = 190
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 4
+ end
+ end
+ object gbDevos: TGroupBox
+ Left = 0
+ Top = 105
+ Width = 301
+ Height = 151
+ Align = alLeft
+ Anchors = [akLeft, akTop, akRight, akBottom]
+ Caption = 'Daily Devotionals'
+ TabOrder = 1
+ object Label9: TLabel
+ Left = 8
+ Top = 24
+ Width = 107
+ Height = 21
+ AutoSize = False
+ Caption = 'Default Devotional'
+ end
+ object dailyDefaultCB: TComboBox
+ Left = 115
+ Top = 18
+ Width = 166
+ Height = 21
+ Style = csDropDownList
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ object devSplashCB: TCheckBox
+ Left = 8
+ Top = 48
+ Width = 283
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Show Devotional Splash Screen on Startup'
+ TabOrder = 1
+ end
+ object devsAsDictsCB: TCheckBox
+ Left = 8
+ Top = 64
+ Width = 283
+ Height = 22
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Show Devotionals as Dictionaries'
+ TabOrder = 2
+ end
+ end
+ object gbGloss: TGroupBox
+ Left = 305
+ Top = 105
+ Width = 218
+ Height = 151
+ Align = alRight
+ Caption = 'Glossaries'
+ TabOrder = 2
+ object glosAsDictsCB: TCheckBox
+ Left = 9
+ Top = 19
+ Width = 186
+ Height = 13
+ Caption = 'Show Glossaries as Dictionaries'
+ TabOrder = 0
+ end
+ end
+ end
+ object TabSheet3: TTabSheet
+ Caption = 'Display'
+ ImageIndex = 2
+ object Panel3: TPanel
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 256
+ Align = alClient
+ Anchors = [akLeft, akTop, akRight]
+ BevelOuter = bvNone
+ Caption = 'Panel3'
+ TabOrder = 0
+ object gbColors: TGroupBox
+ Left = 0
+ Top = 0
+ Width = 523
+ Height = 256
+ Align = alClient
+ Caption = 'Display Colors'
+ TabOrder = 0
+ object Label2: TLabel
+ Left = 7
+ Top = 17
+ Width = 38
+ Height = 13
+ Caption = 'Preview'
+ end
+ object Label3: TLabel
+ Left = 228
+ Top = 10
+ Width = 66
+ Height = 13
+ Caption = 'Window Type'
+ end
+ object Label11: TLabel
+ Left = 228
+ Top = 59
+ Width = 105
+ Height = 13
+ Caption = 'Text Styles and Colors'
+ end
+ object Label13: TLabel
+ Left = 228
+ Top = 87
+ Width = 91
+ Height = 13
+ Caption = 'Entry Number Color'
+ end
+ object shpCurrVSClr: TShape
+ Left = 391
+ Top = 114
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpCurrVSClrMouseDown
+ end
+ object Label14: TLabel
+ Left = 356
+ Top = 10
+ Width = 39
+ Height = 13
+ Caption = 'Scheme'
+ end
+ object Label15: TLabel
+ Left = 228
+ Top = 145
+ Width = 86
+ Height = 13
+ Caption = 'Combo/Edit Fields'
+ end
+ object btnSave: TSpeedButton
+ Left = 491
+ Top = 27
+ Width = 22
+ Height = 22
+ Anchors = [akTop, akRight]
+ Glyph.Data = {
+ 4E010000424D4E01000000000000760000002800000012000000120000000100
+ 040000000000D800000000000000000000001000000000000000000000000000
+ 8000008000000080800080000000800080008080000080808000C0C0C0000000
+ FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00FFFFFFFFFFFF
+ FFFFFF000000FFFFFFFFFFFFFFFFFF000000FFD0000000000000FF000000FF03
+ 300000088030FF000000FF03300000088030FF000000FF03300000088030FF00
+ 0000FF03300000000030FF000000FF03333333333330FF000000FF0330000000
+ 0330FF000000FF03088888888030FF000000FF03088888888030FF000000FF03
+ 088888888030FF000000FF03088888888030FF000000FF03088888888000FF00
+ 0000FF03088888888080FF000000FF00000000000000FF000000FFFFFFFFFFFF
+ FFFFFF000000FFFFFFFFFFFFFFFFFF000000}
+ OnClick = btnSaveScheme
+ end
+ object Label1: TLabel
+ Left = 228
+ Top = 232
+ Width = 142
+ Height = 13
+ Caption = 'Individual Modules (Font Only)'
+ end
+ object Label12: TLabel
+ Left = 228
+ Top = 174
+ Width = 107
+ Height = 13
+ Caption = 'Strong'#39's Numbers <...>'
+ end
+ object Label16: TLabel
+ Left = 228
+ Top = 203
+ Width = 89
+ Height = 13
+ Caption = 'Strong'#39's Tense (...)'
+ end
+ object shpStrongClr: TShape
+ Left = 391
+ Top = 172
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpStrongClrMouseDown
+ end
+ object shpMorphClr: TShape
+ Left = 391
+ Top = 201
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpMorphClrMouseDown
+ end
+ object shpFieldClr: TShape
+ Left = 391
+ Top = 143
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpFieldClrMouseDown
+ end
+ object shpNumClr: TShape
+ Left = 391
+ Top = 85
+ Width = 20
+ Height = 16
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ OnMouseDown = shpNumClrMouseDown
+ end
+ object btnCurrVerse: TButton
+ Left = 421
+ Top = 111
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 4
+ OnClick = btnCurrVerseClick
+ end
+ object RTFPreview: TRichEdit
+ Left = 7
+ Top = 38
+ Width = 208
+ Height = 211
+ Anchors = [akLeft, akTop, akBottom]
+ ScrollBars = ssVertical
+ TabOrder = 0
+ WantReturns = False
+ end
+ object cmbTextSelect: TComboBox
+ Left = 228
+ Top = 27
+ Width = 125
+ Height = 21
+ ItemHeight = 13
+ TabOrder = 1
+ OnChange = cmbTextSelectChange
+ Items.Strings = (
+ 'All Windows'
+ 'Bible Window'
+ 'Commentary Window'
+ 'Lexicon/Dictionary Window'
+ 'Pop-Up Windows')
+ end
+ object btnFont: TButton
+ Left = 421
+ Top = 54
+ Width = 96
+ Height = 25
+ Hint =
+ 'Selects the font, the background color, and text color for your ' +
+ 'panels'
+ Anchors = [akTop, akRight]
+ Caption = 'Customize...'
+ TabOrder = 2
+ OnClick = btnFontClick
+ end
+ object AutoVSColor: TCheckBox
+ Left = 228
+ Top = 113
+ Width = 149
+ Height = 18
+ Caption = 'Current Verse Color'
+ TabOrder = 3
+ end
+ object btnNumClr: TButton
+ Left = 421
+ Top = 82
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of verse numbers'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 5
+ OnClick = btnNumClrClick
+ end
+ object cmbSchemeSelect: TComboBox
+ Left = 356
+ Top = 27
+ Width = 121
+ Height = 21
+ ItemHeight = 13
+ TabOrder = 6
+ OnChange = cmbSchemeSelectChange
+ Items.Strings = (
+ 'Default'
+ 'Parchment'
+ 'Midnight')
+ end
+ object btnFieldClr: TButton
+ Left = 421
+ Top = 140
+ Width = 96
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 7
+ OnClick = btnFieldClrClick
+ end
+ object btnModFonts: TButton
+ Left = 421
+ Top = 227
+ Width = 96
+ Height = 25
+ Anchors = [akTop, akRight]
+ Caption = 'Select Font...'
+ TabOrder = 8
+ OnClick = btnModFontsClick
+ end
+ object btnStrongClr: TButton
+ Left = 421
+ Top = 169
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 9
+ OnClick = btnStrongClrClick
+ end
+ object btnMorphClr: TButton
+ Left = 421
+ Top = 198
+ Width = 96
+ Height = 25
+ Hint = 'Selects the color of the current verse'
+ Anchors = [akTop, akRight]
+ Caption = 'Select Color...'
+ TabOrder = 10
+ OnClick = btnMorphClrClick
+ end
+ end
+ end
+ end
+ end
+ object ColorDialogVS: TColorDialog
+ Ctl3D = True
+ Color = 3328000
+ Left = 295
+ Top = 65528
+ end
+ object ColorDialogField: TColorDialog
+ Ctl3D = True
+ Left = 323
+ Top = 65528
+ end
+ object ColorDialogVerseNum: TColorDialog
+ Ctl3D = True
+ Left = 348
+ Top = 65528
+ end
+ object SavePopup: TPopupMenu
+ Left = 268
+ Top = 65528
+ object SaveScheme: TMenuItem
+ Caption = '&Save Scheme'
+ OnClick = SaveSchemeClick
+ end
+ object DeleteScheme1: TMenuItem
+ Caption = '&Delete Scheme'
+ OnClick = DeleteClick
+ end
+ object Import: TMenuItem
+ Caption = 'Import Scheme...'
+ OnClick = ImportClick
+ end
+ object Export: TMenuItem
+ Caption = 'E&xport Scheme...'
+ OnClick = ExportClick
+ end
+ end
+ object OpenSchDlg: TOpenDialog
+ DefaultExt = '*.sch'
+ Filter = 'Sword Scheme File (*.sch)|*.sch'
+ Options = [ofHideReadOnly, ofPathMustExist, ofFileMustExist, ofEnableSizing]
+ Title = 'Select Scheme File'
+ Left = 220
+ Top = 65528
+ end
+ object SaveSchDlg: TSaveDialog
+ DefaultExt = '.sch'
+ Filter = 'Sword Scheme File (*.sch)|*.sch'
+ Left = 244
+ Top = 65528
+ end
+ object ColorDialogStrongs: TColorDialog
+ Ctl3D = True
+ Left = 376
+ Top = 65528
+ end
+ object ColorDialogMorph: TColorDialog
+ Ctl3D = True
+ Color = clFuchsia
+ CustomColors.Strings = (
+ 'ColorA=FFFFFFFF'
+ 'ColorB=FFFFFFFF'
+ 'ColorC=FFFFFFFF'
+ 'ColorD=FFFFFFFF'
+ 'ColorE=FFFFFFFF'
+ 'ColorF=FFFFFFFF'
+ 'ColorG=FFFFFFFF'
+ 'ColorH=FFFFFFFF'
+ 'ColorI=FFFFFFFF'
+ 'ColorJ=FFFFFFFF'
+ 'ColorK=FFFFFFFF'
+ 'ColorL=FFFFFFFF'
+ 'ColorM=FFFFFFFF'
+ 'ColorN=FFFFFFFF'
+ 'ColorO=FFFFFFFF'
+ 'ColorP=FFFFFFFF')
+ Left = 408
+ Top = 65528
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/optionfrm.h b/apps/windoze/CBuilder5/BibleCS/optionfrm.h new file mode 100644 index 0000000..5ff30c9 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/optionfrm.h @@ -0,0 +1,146 @@ +//--------------------------------------------------------------------------- +#ifndef optionfrmH +#define optionfrmH +//--------------------------------------------------------------------------- +#include <vcl\Classes.hpp> +#include <vcl\Controls.hpp> +#include <vcl\StdCtrls.hpp> +#include <vcl\Forms.hpp> +#include <vcl\ExtCtrls.hpp> +#include <vcl\Dialogs.hpp> +#include <ComCtrls.hpp> + +#include "FontSel.h" +#include <Buttons.hpp> +#include <Menus.hpp> + +const AnsiString COLOR_DIR = "colors\\"; +const AnsiString COLOR_EXT = ".sch"; + +//--------------------------------------------------------------------------- +class TOptionsfrm : public TForm +{ +__published: // IDE-managed Components + TColorDialog *ColorDialogVS; + TPanel *Panel2; + TPageControl *PageControl1; + TTabSheet *TabSheet1; + TTabSheet *TabSheet2; + TPanel *Panel1; + TGroupBox *gbPersonalize; + TCheckBox *AutoBMPersonal; + TCheckBox *AutoBMOther; + TGroupBox *gbDefModules; + TComboBox *hebrewDefCB; + TComboBox *greekDefCB; + TComboBox *greekParseCB; + TComboBox *hebrewParseCB; + TLabel *Label5; + TLabel *Label6; + TLabel *Label7; + TLabel *Label8; + TGroupBox *gbDevos; + TLabel *Label9; + TComboBox *dailyDefaultCB; + TCheckBox *devSplashCB; + TCheckBox *devsAsDictsCB; + TLabel *Label10; + TComboBox *strongsNumsCB; + TTabSheet *TabSheet3; + TCheckBox *HintPopups; + TLabel *Label4; + TComboBox *localeCB; + TPanel *Panel3; + TGroupBox *gbColors; + TLabel *Label2; + TLabel *Label3; + TRichEdit *RTFPreview; + TComboBox *cmbTextSelect; + TButton *btnFont; + TCheckBox *AutoVSColor; + TButton *btnCurrVerse; + TButton *btnNumClr; + TLabel *Label11; + TLabel *Label13; + TShape *shpCurrVSClr; + TLabel *Label14; + TComboBox *cmbSchemeSelect; + TButton *btnFieldClr; + TLabel *Label15; + TColorDialog *ColorDialogField; + TColorDialog *ColorDialogVerseNum; + TPopupMenu *SavePopup; + TMenuItem *SaveScheme; + TMenuItem *Export; + TMenuItem *Import; + TSpeedButton *btnSave; + TOpenDialog *OpenSchDlg; + TSaveDialog *SaveSchDlg; + TMenuItem *DeleteScheme1; + TCheckBox *AutoLayout; + TGroupBox *gbGloss; + TCheckBox *glosAsDictsCB; + TButton *btnModFonts; + TLabel *Label1; + TBitBtn *OkBtn; + TBitBtn *CancelBtn; + TCheckBox *HintStrongs; + TLabel *Label12; + TLabel *Label16; + TShape *shpStrongClr; + TButton *btnStrongClr; + TShape *shpMorphClr; + TButton *btnMorphClr; + TShape *shpFieldClr; + TColorDialog *ColorDialogStrongs; + TColorDialog *ColorDialogMorph; + TShape *shpNumClr; + void __fastcall btnCurrVerseClick(TObject *Sender); + void __fastcall FormCreate(TObject *Sender); + void __fastcall FormShow(TObject *Sender); + void __fastcall btnFontClick(TObject *Sender); + void __fastcall shpCurrVSClrMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y); + void __fastcall btnNumClrClick(TObject *Sender); + void __fastcall btnFieldClrClick(TObject *Sender); + void __fastcall cmbTextSelectChange(TObject *Sender); + void __fastcall cmbSchemeSelectChange(TObject *Sender); + void __fastcall btnSaveScheme(TObject *Sender); + void __fastcall SaveSchemeClick(TObject *Sender); + void __fastcall ExportClick(TObject *Sender); + void __fastcall ImportClick(TObject *Sender); + void __fastcall DeleteClick(TObject *Sender); + void __fastcall btnModFontsClick(TObject *Sender); + void __fastcall HintStrongsClick(TObject *Sender); + void __fastcall HintPopupsClick(TObject *Sender); + void __fastcall btnStrongClrClick(TObject *Sender); + void __fastcall btnMorphClrClick(TObject *Sender); + void __fastcall shpFieldClrMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall shpStrongClrMouseDown(TObject *Sender, + TMouseButton Button, TShiftState Shift, int X, int Y); + void __fastcall shpMorphClrMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + void __fastcall shpNumClrMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y); + +private: // User declarations + static const char *defaultLocaleName; + static const char *defaultLocaleDescription; + CopyFontDlg(TFontSelFrm* lhs, const TFontSelFrm* rhs); + void FindSchemeNames(); + void GetCurrentScheme(); +public: + TFontSelFrm* FontDialogText; + TFontSelFrm* FontDialogComment; + TFontSelFrm* FontDialogLD; + TFontSelFrm* FontDialogPopup; + void LoadDispSettings(SWConfig* config); + void UpdatePreview(); +public: // User declarations + __fastcall TOptionsfrm(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern TOptionsfrm *Optionsfrm; +//--------------------------------------------------------------------------- +#endif + diff --git a/apps/windoze/CBuilder5/BibleCS/rtfhintfrm.cpp b/apps/windoze/CBuilder5/BibleCS/rtfhintfrm.cpp new file mode 100644 index 0000000..0fbe311 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/rtfhintfrm.cpp @@ -0,0 +1,48 @@ +//--------------------------------------------------------------------------- + +#include <vcl.h> +#pragma hdrstop + +#include "rtfhintfrm.h" +#include <clipbrd.hpp> +#include <swdisprtf.h> +#include <swdisprtfchap.h> +#include "mainfrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" + +TRTFHintForm *RTFHintForm; + + +__fastcall TRTFHintForm::TRTFHintForm(TComponent* Owner) + : TForm(Owner) +{ + rtfDrawer = new TRxRichEditX(Panel1); + rtfDrawer->Parent = Panel1; + rtfDrawer->Align = alTop; + // I changed this to white because our defual now needs to be white so you can use it for controls like the search window with little extra formatting info. + rtfDrawer->Color = 14680063; //TColor(0xB4CDBB); + rtfDrawer->BorderStyle = bsNone; + rtfDrawer->Text = "yoyo"; + rtfDrawer->Name = "rtfDrawer"; + rtfDrawer->Enabled = true; + rtfDrawer->Visible = true; + rtfDrawer->DoubleBuffered = false; + searchListDrawer = new TRxRichEditX(Panel1); + searchListDrawer->Parent = Panel1; + searchListDrawer->Align = alBottom; + searchListDrawer->Color = clWindow; //TColor(0xB4CDBB); + searchListDrawer->BorderStyle = bsNone; + searchListDrawer->Text = "yoyo"; + searchListDrawer->Name = "searchListDrawer"; + searchListDrawer->Enabled = true; + searchListDrawer->Visible = true; + searchListDrawer->DoubleBuffered = false; +} +//--------------------------------------------------------------------------- +void __fastcall TRTFHintForm::Button1Click(TObject *Sender) +{ + Clipboard()->Assign(this->GetFormImage()); +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp new file mode 100644 index 0000000..f661f7f --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.cpp @@ -0,0 +1,414 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include "searchfrm.h" +#include <listkey.h> +#include "mainfrm.h" +#include <regex.h> +#include "RangeMaintFrm.h" +#include <unicode.hpp> +#include <unicodertf.h> +#include "rtfhintfrm.h" +#include <localemgr.h> + +//--------------------------------------------------------------------------- +#pragma resource "*.dfm" +TsearchForm *searchForm; +//--------------------------------------------------------------------------- +__fastcall TsearchForm::TsearchForm(TComponent* Owner) + : TForm(Owner) { + pvrtf = new TRxRichEditX(this); + + pvrtf->Parent = plPreview; + pvrtf->Align = alClient; + pvrtf->ScrollBars = ssVertical; + pvrtf->ReadOnly = true; +// pvrtf->PopupMenu = PopupMenu2; +// SearchText = 0; +// if (!SearchText) { + SearchTextOld->Visible = false; + SearchText = new TTntComboBox(this); + SearchText->Parent = Panel3; + SearchText->Align = alClient; + SearchText->ParentFont = false; + SearchText->Font->Size = 12; +// } + +// mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf))); +// mod->SetKey(DefaultVSKey); +// return 0; + target = 0; +} +//--------------------------------------------------------------------------- +void __fastcall TsearchForm::searchBtnClick(TObject *Sender) +{ +// ModMap::iterator target; + class TWaitCursor { + public: + TWaitCursor() : oldc(Screen->Cursor) { Screen->Cursor = crHourGlass; } + ~TWaitCursor() { Screen->Cursor = oldc; } + private: + TCursor oldc; + } wait; // show hourglass + + if (!SearchText->Text.Length()) + return; + + + int index = SearchText->Items->IndexOf(SearchText->Text); + SearchText->Items->Insert(0, SearchText->Text); + + if (index >= 0) + SearchText->Items->Delete(index+1); + + SearchText->ItemIndex = 0; + + Caption = ""; + + if (target) { + Caption = _tr("Searching"); + Caption += (AnsiString)" [ " + (AnsiString)target->Description() + (AnsiString)" (" + (AnsiString)target->Name() + (AnsiString)") ]..."; + resultsLV->Items->Clear(); + int searchType; + switch (searchTypeGroup->ItemIndex) { + case 0: searchType = -2; break; + case 1: searchType = -1; break; + case 2: searchType = 0; break; + } + int searchOptions = (caseSensitiveCkBx->Checked) ? 0 : REG_ICASE; + SWKey *scope = 0; + switch (scopeGroup->ItemIndex) { + case 2: + if (ComboBox1->ItemIndex < 0) + results = VerseKey().ParseVerseList(ComboBox1->Text.c_str(), "", true); + else { + TCustomRange *rs = (TCustomRange *)ComboBox1->Items->Objects[ComboBox1->ItemIndex]; + results = VerseKey().ParseVerseList(rs->text.c_str(), "", true); + } + case 1: + if (!results.Count()) + return; + scope = &results; break; + } + + searchBtn->Caption = _tr("Halt"); + searchBtn->OnClick = TerminateSearch; + searchThread = new TSearchThread(this, WideStringToUTF8(SearchText->Text).c_str(), searchType, searchOptions, scope); + } + else Caption = "Error finding target module"; +} + + +void __fastcall TsearchForm::TerminateSearch(TObject *Sender) +{ + target->terminateSearch = true; +} + +//--------------------------------------------------------------------------- +void __fastcall TsearchForm::ListBox1DblClick(TObject *Sender) +{ + if (!resultsLV->Items->Count) return; // assert items in list view + + TListItem *focused = resultsLV->ItemFocused; + if (focused) { + int row = focused->Index; + if (targetpc == Form1->LexDictPageControl) { + Form1->DictKeyEdit->Text = resultsLV->Items->Item[row]->Caption.c_str(); + } + else { + *(Form1->DefaultVSKey) = resultsLV->Items->Item[row]->Caption.c_str(); + Form1->TextKeyChanged(); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TsearchForm::ListBox1Click(TObject *Sender) +{ + if (!resultsLV->Items->Count) return; // assert items in list view + + if (target) { + TListItem *focused = resultsLV->ItemFocused; + if (focused) { + int row = focused->Index; + ListKey verse; + verse << resultsLV->Items->Item[row]->Caption.c_str(); + pvrtf->fillWithVerses(target, &verse, true, false); + } + } +} + +//--------------------------------------------------------------------------- + +__fastcall TsearchForm::TSearchThread::TSearchThread(TsearchForm *parent, string searchText, int searchType, int searchOptions, SWKey *scope, bool CreateSuspended) + : TThread(CreateSuspended) +{ + this->parent = parent; + this->searchText = searchText; + this->searchType = searchType; + this->searchOptions = searchOptions; + this->scope = scope; + Priority = tpNormal; + FreeOnTerminate = true; +} + + +void __fastcall TsearchForm::TSearchThread::updateProgressBar(void) { + parent->progressBar->Position = parent->status; + parent->progressBar->Repaint(); +} + + +void __fastcall TsearchForm::TSearchThread::updateStatus(void) { + Synchronize((TThreadMethod)&updateProgressBar); +} + + +void TsearchForm::TSearchThread::searchProgressCallback(char status, void *searchThread) { + TsearchForm::TSearchThread *thread = (TsearchForm::TSearchThread *)searchThread; + thread->parent->status = status; + thread->updateStatus(); +} + + +void __fastcall TsearchForm::TSearchThread::FillListBox(void) +{ + TListItem *pItem; + + SWKey *savekey = (SWKey *)*(parent->target); + for (results = TOP; !results.Error(); results++) { + parent->target->SetKey(results); + pItem = parent->resultsLV->Items->Add(); + pItem->Caption = (const char *)results; + pItem->SubItems->Add(""); +// pItem->SubItems->Add((*parent->target).second->StripText()); +// pItem = resultsLV->Items->Add( + } + parent->target->SetKey(*savekey); +// ListBox1->Items->Pack(); // so Count is set correctly (per helpfile) + parent->Caption = ((AnsiString)parent->resultsLV->Items->Count + (AnsiString)" " + (AnsiString)((parent->resultsLV->Items->Count == 1) ? _tr("match") : _tr("matches"))) + (AnsiString)" from [ " + (AnsiString)parent->target->Description() + (AnsiString)" (" + (AnsiString)parent->target->Name() + (AnsiString)") ]"; + parent->searchBtn->Caption = _tr("Search"); + parent->searchBtn->OnClick = parent->searchBtnClick; +} + +void __fastcall TsearchForm::TSearchThread::Execute() +{ + results = parent->target->Search(searchText.c_str(), searchType, searchOptions, scope, 0, searchProgressCallback, this); + + Synchronize((TThreadMethod)&FillListBox); + parent->results = results; +} + + + + +void __fastcall TsearchForm::scopeGroupClick(TObject *Sender) { + bool enabled = (scopeGroup->ItemIndex == 2); + + customRangeBtn->Enabled = enabled; + ComboBox1->Enabled = enabled; +} +//--------------------------------------------------------------------------- + +void __fastcall TsearchForm::customRangeBtnClick(TObject *Sender) +{ + RangeMaintForm->ShowModal(); + populateRanges(); +} +//--------------------------------------------------------------------------- + +void TsearchForm::populateRanges() { + ConfigEntMap::iterator loop, end; + SWConfig config("./options.conf"); + ComboBox1->Clear(); + loop = config.Sections["CustomRanges"].begin(); + end = config.Sections["CustomRanges"].end(); + while (loop != end) { + TCustomRange *rs = new TCustomRange(loop->first.c_str(), loop->second.c_str()); + ComboBox1->Items->AddObject(rs->name.c_str(), rs); + loop++; + } +} + + +void __fastcall TsearchForm::FormShow(TObject *Sender) +{ + populateRanges(); + fillList(); +} +//--------------------------------------------------------------------------- + + +void __fastcall TsearchForm::resultsLVChange(TObject *Sender, TListItem *Item, + TItemChange Change) +{ + ListBox1Click(Sender); +} +//--------------------------------------------------------------------------- + +void __fastcall TsearchForm::resultsLVCustomDrawItem(TCustomListView *Sender, TListItem *Item, TCustomDrawState State, bool &DefaultDraw) { + + if (target && !Form1->closing) { + TRect rect = Item->DisplayRect(drSelectBounds); + static UnicodeRTF filter; + char buf[255]; + strcpy(buf, Item->Caption.c_str()); + + SWKey *key = *target; + if (!SWDYNAMIC_CAST(VerseKey, key)) + filter.ProcessText(buf, 253, *target, target); + + RTFHintForm->searchListDrawer->fillWithRTFString(target, ((String)" \\b " + buf + " ").c_str()); + if (resultsLV->Selected == Item) RTFHintForm->searchListDrawer->Color = TColor(0xB4CDBB); + Sender->Canvas->Brush->Color = RTFHintForm->searchListDrawer->Color; + Sender->Canvas->FillRect(rect); + + rect.Right = resultsLV->Column[0]->Width; + RTFHintForm->searchListDrawer->paintTo(Sender->Canvas->Handle, &rect, 0); + + ListKey verse; + verse << Item->Caption.c_str(); + RTFHintForm->searchListDrawer->fillWithVerses(target, &verse, false, false, "Default", true); + //set color back in case it got changed in fill* + if (resultsLV->Selected == Item) RTFHintForm->searchListDrawer->Color = TColor(0xB4CDBB); + + RTFHintForm->searchListDrawer->SelStart = 3; + RTFHintForm->searchListDrawer->SelLength = 1; + double textHeight = RTFHintForm->searchListDrawer->SelAttributes->Height; + double multiplier = 1.2; + textHeight *= multiplier; + int textWithMargin = 3 + textHeight; + if (resultsLV->StateImages->Height != textWithMargin) { + resultsLV->StateImages->Height = textWithMargin; + DefaultDraw = false; + return; + } + RTFHintForm->searchListDrawer->SelLength = 0; + + rect = Item->DisplayRect(drSelectBounds); + rect.Left = rect.Left + resultsLV->Column[0]->Width;// + 5; + RTFHintForm->searchListDrawer->paintTo(Sender->Canvas->Handle, &rect, 0); + } + DefaultDraw = false; +} +//--------------------------------------------------------------------------- + +void __fastcall TsearchForm::resultsLVInfoTip(TObject *Sender, + TListItem *Item, AnsiString &InfoTip) +{ + InfoTip = ""; +} +//--------------------------------------------------------------------------- + +void __fastcall TsearchForm::Button1Click(TObject *Sender) +{ + bool newVisible = !pnlChooseMod->Visible; + ChooseModSplitter->Visible = newVisible; + pnlChooseMod->Visible = newVisible; +} +//--------------------------------------------------------------------------- + +void __fastcall TsearchForm::FormActivate(TObject *Sender) +{ + if (!Form1->closing) { + Mouse->Capture = 0; + if (searchBtn->OnClick != TerminateSearch) { + TPageControl *targetpc = Form1->TextPageControl; + + if ((Form1->ActiveControl == Form1->CommentaryPageControl) || (IsChild(Form1->CommentaryPageControl->Handle, Form1->ActiveControl->Handle))) + targetpc = Form1->CommentaryPageControl; + if ((Form1->ActiveControl == Form1->LexDictPageControl) || (IsChild(Form1->LexDictPageControl->Handle, Form1->ActiveControl->Handle))) + targetpc = Form1->LexDictPageControl; + + + ModMap::iterator it = Form1->mainmgr->Modules.find(targetpc->ActivePage->Caption.c_str()); + if (it != Form1->mainmgr->Modules.end()) { + setTarget(it->second); + } + SearchText->SetFocus(); + } + } +} + +void TsearchForm::setTarget(SWModule *itarget) { + target = itarget; + moduleName->Caption = target->Description() + (AnsiString) " (" + target->Name() + ")"; + RTFHintForm->searchListDrawer->fillWithRTFString(target, "yoyo"); + SearchText->Font->Name = RTFHintForm->searchListDrawer->dispAttribs.fontName; +// SearchText->Font->Size = RTFHintForm->searchListDrawer->dispAttribs.fontSize; +} +//--------------------------------------------------------------------------- + +void TsearchForm::fillList() +{ + BibleCSMGR *manager; + ModMap::iterator mods; + TTreeNode *node; + string nodeName; + manager = Form1->mainmgr; + + modTreeView->Items->Clear(); + + if (!manager->configPath) + return; + + for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) { + for (node = modTreeView->Items->GetFirstNode(); node; node = node->getNextSibling()) { + if (!strcmp(node->Text.c_str(), mods->second->Type())) { + break; + } + } + if (!node) { // Add Section + if (!strncmp(mods->second->Type(), "Bibl", 4)) // If Bibles, put first in list + node = modTreeView->Items->AddChildFirst(0, mods->second->Type()); + else node = modTreeView->Items->AddChild(0, mods->second->Type()); + } + nodeName = "["; + nodeName += mods->second->Name(); + nodeName += "] "; + nodeName += mods->second->Description(); + node = modTreeView->Items->AddChildObject(node, nodeName.c_str(), mods->second->Name()); + + } + //for (node = modTreeView->Items->GetFirstNode(); node; node = node->getNextSibling()) + // node->Expand(true); + node = modTreeView->Items->GetFirstNode(); + if (node) + node->MakeVisible(); +} + +void __fastcall TsearchForm::modTreeViewChange(TObject *Sender, TTreeNode *Node) { + BibleCSMGR *manager; + ModMap::iterator mods; + TTreeNode *node; + string nodeName; + manager = Form1->mainmgr; + TTreeNode* currNode = modTreeView->Selected; + AnsiString nodeSubString; + AnsiString modName; + + for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) { + if (currNode->Text.SubString(2, currNode->Text.Pos("]") - 2) == mods->second->Name()) { // Add Section + setTarget(mods->second); + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TsearchForm::Button2Click(TObject *Sender) +{ + string helpDir; + ConfigEntMap::iterator it = Form1->optionsconf->Sections["Help"].find("Directory"); + if (it != Form1->optionsconf->Sections["Help"].end()) + helpDir = (*it).second; + else helpDir = ".\\help"; + + string helpExe = helpDir + "\\Sword.chm::searchh.html"; + if ((int)ShellExecute(this->Handle, "open", "hh", helpExe.c_str(), NULL, SW_SHOWNORMAL) < 33) { + helpExe = helpDir + "\\searchh.html"; + ShellExecute(this->Handle, "open", helpExe.c_str(), NULL, NULL, SW_SHOWNORMAL); + } + +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm b/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm new file mode 100644 index 0000000..c3b607f --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.dfm @@ -0,0 +1,393 @@ +object searchForm: TsearchForm
+ Left = 332
+ Top = 103
+ Width = 494
+ Height = 474
+ Caption = 'Search...'
+ Color = clBtnFace
+ Constraints.MinHeight = 360
+ Constraints.MinWidth = 360
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ Icon.Data = {
+ 0000010001002020100000000000E80200001600000028000000200000004000
+ 0000010004000000000080020000000000000000000000000000000000000000
+ 000000008000008000000080800080000000800080008080000080808000C0C0
+ C0000000FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF006666
+ 6666666666666666666666666666688888888888888888088888888888866888
+ 8888888888888880888888888886688888888888888888808888888888866888
+ 8008888088008880800080008800688888088880880808808080808088006888
+ 8808888088080880800880888806688888008880080808880080808088066888
+ 8808080080800800080088008000688888080888888888888888888888066888
+ 8000088888888888888888888806688888888888888888880888888888866008
+ 8808880888877777777878888F86088088088808887888877788888888F60880
+ 800888078788888878878888888F6800808080878788888878878888888F6088
+ 808087878788888877788888888F0888088087887788888878888888888F0808
+ 0888788878788887788888F888F600000087778777877777777888FFFF866888
+ 8880888888888888888888888886688888880888888888888888888888866800
+ 8880808800088888888888888886688088808808080888888888888888866880
+ 8880080800888888888888888886688088800008080888888888888888866880
+ 8880880880088888888888888886088080808888888888888888888888860000
+ 0080888888888888888888888886688888808888888888888888888888866888
+ 8888088888888888888888888886666666660666666666666666666666660000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 0000000000000000000000000000000000000000000000000000000000000000
+ 000000000000000000000000000000000000000000000000000000000000}
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnActivate = FormActivate
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object ChooseModSplitter: TSplitter
+ Left = 101
+ Top = 0
+ Width = 5
+ Height = 431
+ Cursor = crHSplit
+ Visible = False
+ end
+ object pnlChooseMod: TPanel
+ Left = 0
+ Top = 0
+ Width = 101
+ Height = 431
+ Align = alLeft
+ TabOrder = 0
+ Visible = False
+ object Panel9: TPanel
+ Left = 1
+ Top = 1
+ Width = 99
+ Height = 24
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 0
+ object lblChooseModule: TLabel
+ Left = 4
+ Top = 6
+ Width = 74
+ Height = 13
+ Caption = 'Choose Module'
+ end
+ end
+ object modTreeView: TTreeView
+ Left = 1
+ Top = 25
+ Width = 99
+ Height = 405
+ Align = alClient
+ Indent = 19
+ TabOrder = 1
+ OnChange = modTreeViewChange
+ end
+ end
+ object Panel7: TPanel
+ Left = 106
+ Top = 0
+ Width = 380
+ Height = 431
+ Align = alClient
+ BevelOuter = bvNone
+ Caption = 'Panel7'
+ TabOrder = 1
+ object pnlResult: TPanel
+ Left = 0
+ Top = 204
+ Width = 380
+ Height = 227
+ Align = alClient
+ TabOrder = 0
+ object Splitter1: TSplitter
+ Left = 1
+ Top = 108
+ Width = 378
+ Height = 5
+ Cursor = crVSplit
+ Align = alBottom
+ ResizeStyle = rsUpdate
+ end
+ object plPreview: TPanel
+ Left = 1
+ Top = 113
+ Width = 378
+ Height = 113
+ Align = alBottom
+ TabOrder = 0
+ end
+ object resultsLV: TListView
+ Left = 1
+ Top = 1
+ Width = 378
+ Height = 107
+ Hint = 'false'
+ Align = alClient
+ Columns = <
+ item
+ Caption = 'Reference'
+ MinWidth = 175
+ Width = 175
+ end
+ item
+ AutoSize = True
+ Caption = 'Preview...'
+ end>
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ HideSelection = False
+ ReadOnly = True
+ RowSelect = True
+ ParentFont = False
+ ParentShowHint = False
+ ShowHint = True
+ StateImages = searchImageList
+ TabOrder = 1
+ ViewStyle = vsReport
+ OnChange = resultsLVChange
+ OnClick = ListBox1Click
+ OnCustomDrawItem = resultsLVCustomDrawItem
+ OnDblClick = ListBox1DblClick
+ OnInfoTip = resultsLVInfoTip
+ end
+ end
+ object Panel1: TPanel
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 132
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 1
+ object Panel3: TPanel
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 33
+ Align = alTop
+ BevelOuter = bvNone
+ Caption = 'Panel3'
+ TabOrder = 0
+ object SearchTextOld: TComboBox
+ Left = 0
+ Top = 2
+ Width = 378
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ end
+ object Panel8: TPanel
+ Left = 0
+ Top = 33
+ Width = 380
+ Height = 29
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 1
+ object moduleName: TLabel
+ Left = 28
+ Top = 0
+ Width = 352
+ Height = 29
+ Align = alClient
+ AutoSize = False
+ Caption = 'moduleName'
+ Layout = tlCenter
+ end
+ object Panel6: TPanel
+ Left = 0
+ Top = 0
+ Width = 28
+ Height = 29
+ Align = alLeft
+ BevelOuter = bvNone
+ TabOrder = 0
+ object Button1: TButton
+ Left = 3
+ Top = 3
+ Width = 22
+ Height = 21
+ Caption = '...'
+ TabOrder = 0
+ OnClick = Button1Click
+ end
+ end
+ end
+ object Panel10: TPanel
+ Left = 0
+ Top = 62
+ Width = 380
+ Height = 70
+ Align = alClient
+ BevelOuter = bvNone
+ TabOrder = 2
+ object searchTypeGroup: TRadioGroup
+ Left = 0
+ Top = 0
+ Width = 164
+ Height = 70
+ Align = alLeft
+ Caption = 'Search Type'
+ ItemIndex = 0
+ Items.Strings = (
+ 'Mult Word'
+ 'Phrase'
+ 'Regular Expression')
+ TabOrder = 0
+ end
+ object searchOptionsGroup: TGroupBox
+ Left = 164
+ Top = 0
+ Width = 132
+ Height = 70
+ Align = alLeft
+ Caption = 'Search Options'
+ TabOrder = 1
+ object caseSensitiveCkBx: TCheckBox
+ Left = 8
+ Top = 16
+ Width = 117
+ Height = 17
+ Anchors = [akLeft, akTop, akRight]
+ Caption = 'Case Sensitive'
+ TabOrder = 0
+ end
+ end
+ object Panel4: TPanel
+ Left = 298
+ Top = 0
+ Width = 82
+ Height = 70
+ Align = alRight
+ BevelOuter = bvNone
+ TabOrder = 2
+ object searchBtn: TButton
+ Left = 3
+ Top = 5
+ Width = 75
+ Height = 25
+ Caption = 'Search'
+ Default = True
+ TabOrder = 0
+ OnClick = searchBtnClick
+ end
+ object Button2: TButton
+ Left = 3
+ Top = 33
+ Width = 75
+ Height = 25
+ Caption = '&Help'
+ Default = True
+ TabOrder = 1
+ OnClick = Button2Click
+ end
+ end
+ end
+ end
+ object pnlScope: TPanel
+ Left = 0
+ Top = 132
+ Width = 380
+ Height = 72
+ Align = alTop
+ BevelOuter = bvNone
+ TabOrder = 2
+ object Panel2: TPanel
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 43
+ Align = alClient
+ BevelOuter = bvNone
+ TabOrder = 0
+ object scopeGroup: TRadioGroup
+ Left = 0
+ Top = 0
+ Width = 380
+ Height = 43
+ Align = alClient
+ Caption = 'Scope'
+ Columns = 3
+ ItemIndex = 0
+ Items.Strings = (
+ 'Entire Module'
+ 'Current Results'
+ 'Custom Range')
+ TabOrder = 0
+ OnClick = scopeGroupClick
+ end
+ end
+ object Panel5: TPanel
+ Left = 0
+ Top = 43
+ Width = 380
+ Height = 29
+ Align = alBottom
+ TabOrder = 1
+ object Panel11: TPanel
+ Left = 165
+ Top = 1
+ Width = 214
+ Height = 27
+ Align = alClient
+ BevelOuter = bvNone
+ Caption = 'Panel11'
+ TabOrder = 0
+ object ComboBox1: TComboBox
+ Left = 4
+ Top = 4
+ Width = 206
+ Height = 21
+ Anchors = [akLeft, akTop, akRight]
+ Enabled = False
+ ItemHeight = 13
+ TabOrder = 0
+ end
+ end
+ object Panel12: TPanel
+ Left = 1
+ Top = 1
+ Width = 164
+ Height = 27
+ Align = alLeft
+ BevelOuter = bvNone
+ TabOrder = 1
+ object customRangeBtn: TButton
+ Left = 4
+ Top = 4
+ Width = 153
+ Height = 21
+ Caption = 'Define Custom Range'
+ Enabled = False
+ TabOrder = 0
+ OnClick = customRangeBtnClick
+ end
+ end
+ end
+ end
+ end
+ object progressBar: TProgressBar
+ Left = 0
+ Top = 431
+ Width = 486
+ Height = 16
+ Align = alBottom
+ Min = 0
+ Max = 100
+ Step = 1
+ TabOrder = 2
+ end
+ object searchImageList: TImageList
+ Left = 300
+ Top = 601
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/searchfrm.h b/apps/windoze/CBuilder5/BibleCS/searchfrm.h new file mode 100644 index 0000000..2b9a8ca --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/searchfrm.h @@ -0,0 +1,107 @@ +//--------------------------------------------------------------------------- +#ifndef searchH +#define searchH +//--------------------------------------------------------------------------- +#include <vcl\Classes.hpp> +#include <vcl\Controls.hpp> +#include <vcl\StdCtrls.hpp> +#include <vcl\Forms.hpp> +#include <vcl\ExtCtrls.hpp> +#include "mainfrm.h" +#include <swmgr.h> +#include <ComCtrls.hpp> +#include <TntStdCtrls.hpp> +#include "rxricheditx.h" +#include <ImgList.hpp> +//--------------------------------------------------------------------------- +class TsearchForm : public TForm { + class TSearchThread; + friend class TSearchThread; +__published: // IDE-managed Components + TImageList *searchImageList; + TPanel *pnlChooseMod; + TPanel *Panel7; + TProgressBar *progressBar; + TPanel *pnlResult; + TSplitter *Splitter1; + TPanel *plPreview; + TListView *resultsLV; + TPanel *Panel1; + TPanel *Panel3; + TComboBox *SearchTextOld; + TPanel *pnlScope; + TPanel *Panel2; + TRadioGroup *scopeGroup; + TPanel *Panel5; + TPanel *Panel8; + TLabel *moduleName; + TSplitter *ChooseModSplitter; + TPanel *Panel9; + TTreeView *modTreeView; + TPanel *Panel6; + TButton *Button1; + TPanel *Panel10; + TRadioGroup *searchTypeGroup; + TGroupBox *searchOptionsGroup; + TCheckBox *caseSensitiveCkBx; + TPanel *Panel4; + TButton *searchBtn; + TPanel *Panel11; + TPanel *Panel12; + TButton *customRangeBtn; + TComboBox *ComboBox1; + TLabel *lblChooseModule; + TButton *Button2; + void __fastcall searchBtnClick(TObject *Sender); + void __fastcall TerminateSearch(TObject *Sender); + void __fastcall ListBox1DblClick(TObject *Sender); + void __fastcall ListBox1Click(TObject *Sender); + void __fastcall scopeGroupClick(TObject *Sender); + void __fastcall customRangeBtnClick(TObject *Sender); + void __fastcall FormShow(TObject *Sender); + void __fastcall resultsLVChange(TObject *Sender, TListItem *Item, + TItemChange Change); + void __fastcall resultsLVCustomDrawItem(TCustomListView *Sender, + TListItem *Item, TCustomDrawState State, bool &DefaultDraw); + void __fastcall resultsLVInfoTip(TObject *Sender, TListItem *Item, + AnsiString &InfoTip); + void __fastcall Button1Click(TObject *Sender); + void __fastcall FormActivate(TObject *Sender); + void __fastcall modTreeViewChange(TObject *Sender, TTreeNode *Node); + void __fastcall Button2Click(TObject *Sender); +private: // User declarations + class TSearchThread : public TThread { + ListKey results; + string searchText; + int searchType; + int searchOptions; + SWKey *scope; + TsearchForm *parent; + protected: + void __fastcall Execute(); + public: + __fastcall TSearchThread(TsearchForm *parent, string searchText, int searchType, int searchOptions, SWKey *scope = 0, bool CreateSuspended = false); + void __fastcall FillListBox(void); + static void searchProgressCallback(char status, void *searchFrm); + void __fastcall updateStatus(void); + void __fastcall updateProgressBar(void); + } *searchThread; + TRxRichEditX *pvrtf; + ListKey results; + void populateRanges(); +public: // User declarations + void setTarget(SWModule *target); + char status; + SWModule *target; + TPageControl *targetpc; + TTntComboBox *SearchText; +// AnsiString CapText; + + __fastcall TsearchForm(TComponent* Owner); + void fillList(); +}; +//--------------------------------------------------------------------------- +extern TsearchForm *searchForm; +//--------------------------------------------------------------------------- +#endif + diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Default.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Default.sch new file mode 100644 index 0000000..3fe1ff9 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Default.sch @@ -0,0 +1,20 @@ +[Appearance] +CommentBackColor=16777215 +CommentFontColor=0 +CommentFontName=Times New Roman +CommentFontSize=12 +CurrentVSColor=16711680 +FieldColor=16776960 +LDBackColor=16777215 +LDFontColor=0 +LDFontName=Times New Roman +LDFontSize=12 +TextBackColor=16777215 +TextFontColor=0 +TextFontName=Times New Roman +TextFontSize=12 +VSNumberColor=16711680 +PopupBackColor=14680063 +PopupFontColor=0 +PopupFontName=Times New Roman +PopupFontSize=9 diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Light Blues.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Light Blues.sch new file mode 100644 index 0000000..bf26d58 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Light Blues.sch @@ -0,0 +1,24 @@ + +[Appearance] +CommentBackColor=16771797 +CommentFontColor=8388608 +CommentFontName=MS Sans Serif +CommentFontSize=12 +CurrentVSColor=8388863 +FieldColor=16771797 +LDBackColor=16771797 +LDFontColor=8388608 +LDFontName=MS Sans Serif +LDFontSize=12 +MorphColor=4227072 +PopupBackColor=16773087 +PopupFontColor=8388608 +PopupFontName=MS Sans Serif +PopupFontSize=10 +StrongsColor=8388736 +TextBackColor=16771797 +TextFontColor=8388608 +TextFontName=MS Sans Serif +TextFontSize=12 +VSNumberColor=255 + diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Lighten Up.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Lighten Up.sch new file mode 100644 index 0000000..657beba --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Lighten Up.sch @@ -0,0 +1,24 @@ + +[Appearance] +CommentBackColor=16777215 +CommentFontColor=8421504 +CommentFontName=MS Serif +CommentFontSize=12 +CurrentVSColor=0 +FieldColor=12632256 +LDBackColor=16777215 +LDFontColor=8421504 +LDFontName=MS Serif +LDFontSize=12 +MorphColor=5329233 +PopupBackColor=15461355 +PopupFontColor=6908265 +PopupFontName=Times New Roman +PopupFontSize=11 +StrongsColor=5329233 +TextBackColor=16777215 +TextFontColor=8421504 +TextFontName=MS Serif +TextFontSize=12 +VSNumberColor=12632256 + diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Midnight.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Midnight.sch new file mode 100644 index 0000000..e73c6fb --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Midnight.sch @@ -0,0 +1,24 @@ + +[Appearance] +CommentBackColor=0 +CommentFontColor=65280 +CommentFontName=Arial +CommentFontSize=14 +CurrentVSColor=65535 +FieldColor=12632256 +LDBackColor=0 +LDFontColor=65280 +LDFontName=Arial +LDFontSize=14 +MorphColor=16711808 +PopupBackColor=0 +PopupFontColor=65535 +PopupFontName=Arial +PopupFontSize=10 +StrongsColor=16711935 +TextBackColor=0 +TextFontColor=65280 +TextFontName=Arial +TextFontSize=14 +VSNumberColor=8454143 + diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Navy Blues.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Navy Blues.sch new file mode 100644 index 0000000..f8cacbe --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Navy Blues.sch @@ -0,0 +1,24 @@ + +[Appearance] +CommentBackColor=8404992 +CommentFontColor=14408667 +CommentFontName=Tahoma +CommentFontSize=13 +CurrentVSColor=65535 +FieldColor=12632256 +LDBackColor=8404992 +LDFontColor=14408667 +LDFontName=Tahoma +LDFontSize=13 +MorphColor=16777215 +PopupBackColor=12632256 +PopupFontColor=8388608 +PopupFontName=Tahoma +PopupFontSize=11 +StrongsColor=16777215 +TextBackColor=8404992 +TextFontColor=14408667 +TextFontName=Tahoma +TextFontSize=13 +VSNumberColor=8454143 + diff --git a/apps/windoze/CBuilder5/BibleCS/stage/colors/Parchment.sch b/apps/windoze/CBuilder5/BibleCS/stage/colors/Parchment.sch new file mode 100644 index 0000000..88b69be --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/colors/Parchment.sch @@ -0,0 +1,24 @@ + +[Appearance] +CommentBackColor=13434879 +CommentFontColor=0 +CommentFontName=Arial +CommentFontSize=10 +CurrentVSColor=4227327 +FieldColor=16777215 +LDBackColor=13434879 +LDFontColor=0 +LDFontName=Arial +LDFontSize=10 +MorphColor=25025 +PopupBackColor=14680063 +PopupFontColor=0 +PopupFontName=Arial +PopupFontSize=9 +StrongsColor=16512 +TextBackColor=13434879 +TextFontColor=0 +TextFontName=Arial +TextFontSize=10 +VSNumberColor=4227327 + diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/de.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/de.conf new file mode 100644 index 0000000..722e88d --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/de.conf @@ -0,0 +1,180 @@ +[Meta] +Name=de +Description=German +Translator=Christian Renz <crenz@web42.com> + +[Text] +BackBtnImage=uilocales.d/de_back.bmp +SearchBtnImage=uilocales.d/de_search.bmp +&About=&Über SWORD... +About The SWORD Project=Über das SWORD Projekt +&Add=&Hinzufügen +&Add Bookmark=Lesezeichen &hinzufügen +Add New Bookmark File=Neue Lesezeichendatei hinzufügen +Bookmark Section Title:=Name für diese Gruppe von Lesezeichen: +Bookmark=Lesezeichen +Bookmarks=Lesezeichen +Cancel=Abbrechen +Case Sensitive=Groß-/Kleinschreibung +Chapter=Kapitel +Check Modules To Show As Tabs=Anzuzeigende Module ankreuzen +Combo/Edit Fields=Kombo-/Eingabefelder +Contents=&Inhalt +&Copy=&Kopieren +Copy as &B-Greek Transliteration=Als &B-Greek-Umschrift kopieren +&Close=&Schließen +Create a New Verse List Window=Neues Verslistenfenster &öffnen +Create Verse List=Neue Versliste erstellen +Current Verse Color=Aktuelle Versfarbe +Daily Devotionals=Tageslese +Default Devotional=Standard-Tagelese +Define Custom Range=Eigenen Bereich festlegen +Definitions=Definitionen +&Delete Entry=Eintrag l&öschen +Description=Beschreibung +Devotion for Today=Tageslese für heute +Devotional of the Day=&Tageslese +Dictionary Lookup=Im Wörterbuch nachschlagen +Display Colors=Anzeigefarben +Display=Anzeige +&Edit=&Bearbeiten +&Edit Bookmarks / Tree View...=Lesezeichen &bearbeiten / Baumdarstellung... +Edit Entry=Eintrag bearbeiten +&Edit Entry=Eintrag &bearbeiten +"Entire Module","Current Results","Custom Range"="Ganzes Module","Aktuelle Ergebnisse","Eigener Bereich" +E&xit=&Beenden +eg. mat-jo;rev4=z.B. mat-jo;rev4 +&File=&Datei +File Name (without extension):=Dateiname (ohne Endung) +Font Size:=Schriftgröße +Found New Module...=Neues Modul gefunden... +General=Allgemein +Greek=Griechisch +Hebrew=Hebräisch +&Help=&Hilfe +Hide / Show Modules=Module anzeigen/verstecken +Individual Modules (Font Only)=Einzelne Module (nur Schriftart) +Install Manager=&Installationsprogramm +Language=Sprache +Link to Comment for Verse...=Mit anderem Vers &verknüpfen +Maintain Custom Ranges=Eigene Bereiche verwalten +Module Type=Modulart +Module=Modul +"Mult Word","Phrase","Regular Expression"="Mehrere Worte","Ausdruck","Regulärer Ausdruck" +&New Search Window=&Neues Suchfenster... +OK=OK +OkBtn=OK +Options=&Optionen +Original Language Support - Default Modules=Standardmodule für Ursprachenunterstützung +Parsing=Syntaxanalyse +Personalize=Personalisieren +Preferences=Voreinstellungen +&Preferences...=&Voreinstellungen... +Preview...=Vorschau... +Preview=Vorschau +Range Name=Name für diesen Bereich +Range Text=Bibeltext +Reference=Bibelstelle +&Remove=&Entfernen +&Save=&Speichern +S&ave Layout=Anordnung s&peichern +Save Other Bookmarks=Andere Lesezeichen speichern +Save Personal Bookmarks=Eigene Lesezeichen speichern +Save Screen Layout=Bildschirmanordnung speichern +Scheme=Schema +Scope=Bereich +&Search=&Suche +Search Options=Sucheinstellungen +Search Type=Suchart +Search...=Suche... +Search=Suche +Select Color...=Farbe... +Select Font...=Schriftart... +Show Devotional at Startup=Tageslese beim Programmstart anzeigen +Show Devotional Splash Screen on Startup=Tageslese beim Programmstart anzeigen +Show Devotionals as Dictionaries=Tageslese als Wörterbucher anzeigen +Show Hint Over Strongs Numbers=Erklärung über Strongs-Nummern anzeigen +Show Hint Pop-ups=Tipps anzeigen +Special Modules=Besondere Module +Strong's Numbered Text=Text mit Strongs-Nummern +Text Font=Schriftart für den Text +&Tools=&Tools +Type Verse=Vers eintippen +User Verse List=Eigene Versliste +Verse List=Versliste +Verse Number Color=Farbe für Versnummern +&New Bookmark File=&Neue Lesezeichendatei +P&rint...=&Drucken... +The SWORD Project=Das SWORD Projekt +&Footnotes=&Fußnoten +&On=&An +O&ff=A&us +&Hebrew Cantillation=Hebräische Kantillation +H&ebrew Vowel Points=Hebräische Vokalmarkierungen +&Strong's Numbers=Strongs-Nummern +&Morphological Tags=Wortformenanzeige +He&adings=Ü&berschriften +&Transliteration=&Umschrift +&Latin=Lateinische Buchstaben +&Basic Latin=Lateinische Buchstaben ohne Akzente +B&eta=B&eta +B&Greek=B&Greek +Print Selection=Druckauswahl +Print Source=Quelle +Bible Text=Bibeltext +Commentary Text=Kommentartext +Lexicon/Dictionary Text=Lexikon-/Wörterbuchtext +Module Name=Modulname +Print Range=Druckbereich +Versbereich oder -liste: +&Print=&Drucken +Print=Drucken +Print...=Drucken... +&Print...=&Drucken... +P&review=&Vorschau +P&review...=&Vorschau... +Printer&s...=D&rucker... +Margins (Inches)=Ränder (Zoll) +Top:=Oben: +Left:=Links: +Right:=Rechts: +Bottom:=Unten: +Header/Footer=Kopf-/Fußzeile +Print Header=Kopfzeile drucken +Header Text:=Kopfzeilentext: +Print Footer=Fußzeile drucken +Footer Text:=Fußzeilentext: +Formatting Options=Formatierung +Font and Size=Schriftart und -größe +Chapter Heading:=Kapitelüberschrift: +Body Text:=Text: +Verse Numbers:=Versnummern: +Font:=Schriftart: +Book Name=Buchname +Chapter Headings=Kapitelüberschriften +Paragraph Format=Absatzformat +Verse Numbers=Versnummern +Superscripted=Hochgestellt +Prefixed (John 1:1 KJV)...=Vorne (Johannes 1,1 KJV)... +Postfixed ...(John 1:1 KJV)=Hinten ...(Johannes 1,1 KJV) +"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak"="Englisch (USA)","Tschechisch","Dänisch","Deutsch","Französisch","Norwegisch","Polnisch","Portugiesisch","Slovakisch" +Glossaries=Glossare +Show Glossaries as Dictionaries=Glossare als Wörterbücher anzeigen +Default=Standard +"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Alle Module","Bibelmodule","Kommentarmodule","Lexikon-/Wörterbuchmodule" +&Save Scheme=Schema &speichern +&Delete Scheme=Schema &löschen +&Import Scheme=Schema &importieren +&Export Scheme=Schema &exportieren +Personal Bookmarks=Eigene Lesezeichen +Words To Live By...Worte zum Leben... +Go Back To Previous Location=Zurück +Bring Up Search Window=Suchfenster anzeigen +Biblical Texts=Biblische Texte +Commentaries=Kommentare +Lexicons / Dictionaries=Lexika / Wörterbücher +Lookup Entry=Nach Eintrag suchen +Verse Range or List=Versbereich oder -liste +Page Setup=Seite einrichten +Strong's Numbers <...>=Strongs Nummer <...> +Strong's Tense (...)=Strongs Zeitform (...)
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/hu.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/hu.conf new file mode 100644 index 0000000..946759d --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/hu.conf @@ -0,0 +1,172 @@ +[Meta]
+Name=hu
+Description=Magyar
+Translator=Mentler Gyula <mentler@sbgk.hu>
+
+[Text]
+BackBtnImage=uilocales.d/en_back.bmp
+SearchBtnImage=uilocales.d/en_search.bmp
+&About=SWORD &névjegye
+About The SWORD Project=SWORD Projektrõl
+&Add=&Hozzáadás
+&Add Bookmark=&Könyvjelzõ elhelyezése
+Add New Bookmark File=Új könyvjelzõfile létrehozása
+Bookmark Section Title:=Könyvjelzõ csoport címe:
+Bookmark=Könyvjelzõ
+Bookmarks=Könyvjelzõk
+Cancel=Mégsem
+Case Sensitive=Kis-/Nagybetû érzékeny
+Chapter=Fejezet
+Check Modules To Show As Tabs=Fülként megjelenõ modulok kijelölése
+Combo/Edit Fields=Combo/Edit Fields
+Contents=&Tartalom
+&Copy=&Másolás
+Copy as &B-Greek Transliteration=Másolás &B-Görög átírásban
+&Close=Be&zárás
+Create a New Verse List Window=Új verslista ablak létrehozása
+Create Verse List=Verslista létrehozása
+Current Verse Color=Aktuális vers színe
+Daily Devotionals=Napi csendesség
+Default Devotional=Alapértelmezett napi csendesség
+Define Custom Range=Tartomány megadása
+Definitions=Definíciók
+&Delete Entry=Bejegyzés törlése
+Description=Leírás
+Devotion for Today=Mai csendesség
+Devotional of the Day=&Csendesség
+Dictionary Lookup=Keresés a szótárban
+Display Colors=Képernyõ színei
+Display=Képernyõ
+&Edit=S&zerkesztés
+&Edit Bookmarks / Tree View...=Könyvjelzõk s&zerkesztése / Fa nézet
+Edit Entry=Bejegyzés szerkesztése
+&Edit Entry=Bejegyzés s&zerkesztése
+"Entire Module","Current Results","Custom Range"="Egész modul","Aktuális eredmények","Beállított tartomány"
+E&xit=&Kilépés
+eg. mat-jo;rev4=eg. mat-jo;rev4
+&File=&File
+File Name (without extension):=File neve (kiterjesztés nélkül):
+Font Size:=Betûtípus mérete:
+Found New Module...=Új modultok...
+General=Álltalános
+Greek=Görög
+Hebrew=Héber
+&Help=&Súgó
+Hide / Show Modules=Modulok elrejtése/megjelenítése
+Individual Modules (Font Only)=Egyedi modulok (csak betûtípus)
+Install Manager=&Install manager program
+Language=Nyelv
+Link to Comment for Verse...=Mutató a vershez tartozó kommentárra
+Maintain Custom Ranges=Tartományok beállítása
+Module Type=Modul típus
+Module=Modul
+"Mult Word","Phrase","Regular Expression"="Több szó","Kifejezés","Reguláris kifejezés"
+&New Search Window=Új keresõablak
+OK=OK
+OkBtn=OK
+Options=&Beállítások
+Original Language Support - Default Modules=Eredeti nyelv támogatás - Alapértelmezett modulok
+Parsing=Szintaktikai feldolgozás
+Personalize=Personalize
+Preferences=Testreszabás
+&Preferences...=&Testreszabás...
+Preview...=Preview...
+Preview=Preview
+Range Name=Tartomány neve
+Range Text=Tartomány szövege
+Reference=Hivatkozás
+&Remove=&Eltávolítás
+&Save=&Mentés
+S&ave Layout=Elrendezés &mentése
+Save Other Bookmarks=Egyéb könyvjelzõk mentése
+Save Personal Bookmarks=Személyes könyvjelzõk mentése
+Save Screen Layout=Képernyõelrendezés mentése
+Scheme=Séma
+Scope=Környezet(Scope)
+&Search=&Keresés
+Search Options=Keresési opciók
+Search Type=Kereséstípus
+Search...=Keresés...
+Search=Keresés
+Select Color...=Szín...
+Select Font...=Betûtípus...
+Show Devotional at Startup=Show Devotional at Startup
+Show Devotional Splash Screen on Startup=Show Devotional Splash Screen on Startup
+Show Devotionals as Dictionaries=Show Devotionals as Dictionaries
+Show Hint Over Strongs Numbers=Magyarázatok megmutatása a Strong számok felett
+Show Hint Pop-ups=Tipp ablalok megmutatása
+Special Modules=Speciális modulok
+Strong's Numbered Text=Strong számokkal ellátott szöveg
+Text Font=Betûtípus a szöveghez
+&Tools=&Eszközök
+Type Verse=Type Verse
+User Verse List=Felhasználói verslista
+Verse List=Verslista
+Verse Number Color=Vers sorszámok színe
+&New Bookmark File=&Új könyvjelzõfile
+P&rint...=&Nyomtatás...
+The SWORD Project=A SWORD Projekt
+&Footnotes=&Lábjegyzetek
+&On=&Be
+O&ff=@Ki
+&Hebrew Cantillation=Héber recitálás
+H&ebrew Vowel Points=Héber magánhangzók pontozása
+&Strong's Numbers=Strong számok
+&Morphological Tags=Morfológiai jelzések
+He&adings=Fejlécek
+&Transliteration=Átírás
+&Latin=Latin betûk
+&Basic Latin=Latin betûk ékezet nélkül
+B&eta=B&eta
+B&Greek=B&Görög
+Print Selection=Kiválasztott rész kinyomtatása
+Print Source=Forrás nyomtatása
+Bible Text=Bibliai szöveg
+Commentary Text=Kommentár szövege
+Lexicon/Dictionary Text=Lexikon/Szótár
+Module Name=Modulnév
+Print Range=Tartomány nyomtatása
+&Print=&Nyomtatás
+P&review=Bemutatás
+Printer&s...=Nyomtatók...
+Margins (Inches)=Margók (inch)
+Top=Fent
+Left=Bal
+Right=Jobb
+Bottom=Lent
+Header/Footer=Fej-/Lábléc
+Print Header=Fejléc nyomtatás
+Header Text=Fejléc szövege
+Print Footer=Lábléc nyomtatása
+Footer Text=Lábléc szövege
+Formatting Options=Formázási opciók
+Font and Size=Metûtípus és méret
+Chapter Heading=Fejezet fejléce
+Body Text=Kenyérszöveg
+Verse Numbers=Versszámozás
+Font=Betûtípus
+Book Name=Könyv neve
+Chapter Headigns=Fejezetek fejlécei
+Paragraph Format=Bekezdés formázás
+Verse Numbers=Versszámozás
+Superscripted=Felsõ indexbe
+Prefixed (John 1:1 KJV)...=Elé írva (János 1,1 KJV)...
+Postfixed ...(John 1:1 KJV)=Utána írva ...(János 1,1 KJV)
+"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak"="Angol (USA)","Cseh","Dán","Német","Francia","Norvég","Lengyel","Portugál","Szlovák"
+Glossaries=Szójegyzékek
+Show Glossaries as Dictionaries=Szójegyzékek és szótárak megmutatása
+Default=Alapértelmezett
+"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Minden modul","Biblia modulok","Kommentár modulok","Lexikon/szótár modulok"
+&Save Scheme=Séma &mentés
+&Delete Scheme=Séma &törlés
+&Import Scheme=Séma &importálás
+&Export Scheme=Séma &exportálás
+Words To Live By...=Words To Live By...
+Go Back To Previous Location=Vissza az elõzõ helyre
+Bring Up Search Window=Keresõablak megjelenítése
+Biblical Texts=Bibliai szövegek
+Commentaries=Kommentárok
+Lexicons / Dictionaries=Lexikonok/Szótárak
+
+
+
diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/id.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/id.conf new file mode 100644 index 0000000..a0802ef --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/id.conf @@ -0,0 +1,179 @@ +[Meta] +Name=id +Description=Indonesia +Translator=SABDA/YLSA <SABDA@xc.org> + +[Text] +#BackBtnImage=uilocales.d/id_back.bmp +#SearchBtnImage=uilocales.d/id_search.bmp +&About=&Tentang SWORD/PEDANG... +About The SWORD Project=Tentang Proyek SWORD/PEDANG +&Add=&Tambah +&Add Bookmark=Tambah Bookmark +Add New Bookmark File=Tambah File Bookmark Baru +Bookmark Section Title:=Judul Bagian Bookmark: +Bookmark=Bookmark +Bookmarks=Bookmark +Cancel=Batal +Case Sensitive=Huruf Besar/Kecil Berbeda +Chapter=Pasal/Bab +Check Modules To Show As Tabs=Cek Modul yang Ditampilkan dalam Tab +Combo/Edit Fields=Field Multi/Edit +Contents=Isi +&Copy=Copy +Copy as &B-Greek Transliteration=Copy Ke Transliterasi Yunani +&Close=Tutup +Create a New Verse List Window=Membuat Jendela Daftar Ayat Baru +Create Verse List=Membuat Daftar Ayat +Current Verse Color=Warna Ayat Aktif +Daily Devotionals=Renungan Harian +Default Devotional=Renungan Standar/Default +Define Custom Range=Definisikan Batasan Khusus/Custom +Definitions=Definisi +&Delete Entry=Hapus Data +Description=Deskripsi +Devotion for Today=Renungan untuk Hari Ini +Devotional of the Day=Renungan Hari Ini +Dictionary Lookup=Cari dalam Kamus +Display Colors=Warna Tampilan +Display=Tampilkan +&Edit=&Edit +&Edit Bookmarks / Tree View...=Edit Bookmark / Sub-Bagian... +Edit Entry=Edit Tulisan/Data +&Edit Entry=Edit Tulisan/Data +"Entire Module","Current Results","Custom Range"="Dalam Satu Modul","Dalam Hasil Pencarian","Dalam Batasan Khusus" +E&xit=Keluar +eg. mat-jo;rev4=mis. mat-yoh;wah4 +&File=File +File Name (without extension):=Nama File (tanpa ekstensi/jenis): +Font Size:=Ukuran Font: +Found New Module...=Modul Baru Ditemukan... +General=Umum +Greek=Yunani +Hebrew=Ibrani +&Help=Help -- Bantuan/Info +Hide / Show Modules=Sembunyikan/Tampilkan Modul +Individual Modules (Font Only)=Modul Tersendiri (Hanya Font) +Install Manager=Program Install Manager +Language=Bahasa +Link to Comment for Verse...=Link Ke Catatan/Komentar untuk Ayat... +Maintain Custom Ranges=Mengolah Batasan Khusus +Module Type=Jenis Modul +Module=Modul +"Mult Word","Phrase","Regular Expression"="Multi-Kata","Frasa","Ekspresi/Rumus" +&New Search Window=Jendela Pencarian Baru +OK=OK +OkBtn=OkBtn +Options=Pilihan +Original Language Support - Default Modules=Dukungan untuk Bahasa Asli - Modul Standar/Default +Parsing=Uraian Kalimat/Parsing +Personalize=Kustomisasi Pribadi +Preferences=Preferensi +&Preferences...=Preferensi... +Preview=Lihat Dahulu +Preview...=Lihat Dahulu... +Range Name=Batasan Nama +Range Text=Batasan Teks +Reference=Referensi +&Remove=Hapus +&Save=Simpan +S&ave Layout=Simpan Susunan/Layout +Save Other Bookmarks=Simpan Bookmark Lain +Save Personal Bookmarks=Simpan Bookmark Pribadi +Save Screen Layout=Simpan Susunan/Layout Layar +Scheme=Skema +Scope=Ruang Lingkup +&Search=Cari +Search Options=Pilihan Pencarian +Search Type=Jenis Pencarian +Search...=Cari... +Search=Cari +Select Color...=Pilih Warna... +Select Font...=Pilih Font... +Show Devotional at Startup=Tampilkan Renungan di Start-up +Show Devotional Splash Screen on Startup=Tampilkan Layar Renungan Saat Start-up +Show Devotionals as Dictionaries=Tampilkan Renungan Seperti Kamus +Show Hint Over Strongs Numbers=Tampilkan Tip Nomor Strong +Show Hint Pop-ups=Tampilkan Tip Pop-up +Special Modules=Modul Khusus +Strong's Numbered Text=Teks dengan Nomor Strong +Text Font=Font Teks +&Tools=Alat-alat +Type Verse=Ketik Ayat +User Verse List=Daftar Ayat Pengguna +Verse List=Daftar Ayat +Verse Number Color=Warna Nomor Ayat +&New Bookmark File=File Bookmark Baru +P&rint...=Cetak... +The SWORD Project=Proyek SWORD/PEDANG +&Footnotes=Catatan Kaki +&On=Hidup/On +O&ff=Mati/Off +&Hebrew Cantillation=Kantilasi/Kanonis Ibrani +H&ebrew Vowel Points=Titik/Poin Vokal Ibrani +&Strong's Numbers=Nomor Strong +&Morphological Tags= Tag Morfologi +He&adings=Bagian Kepala +&Transliteration=Transliterasi +&Latin=Bahasa Latin +&Basic Latin=Bahasa Latin (Basic/Dasar) +B&eta=Beta +B&Greek=Yunani +Print Selection=Pilihan Cetak +Print Source=Sumber Cetak +Bible Text=Teks Alkitab +Commentary Text=Teks Tafsiran/Komentar +Lexicon/Dictionary Text=Teks Leksikon/Kamus +Module Name=Nama Modul +Print Range=Batasan Cetak +Versbereich oder -liste: ********** +&Print=Cetak +&Print...=Cetak... +Print=Cetak +Print...=Cetak... +P&review=Lihat Dahulu Cetakan +P&review...=Lihat Dahulu Cetakan... +Printer&s...=Printer... +Margins (Inches)=Margin (Inci) +Top:=Atas: +Left:=Kiri: +Right:=Kanan: +Bottom:=Bawah: +Header/Footer=Kepala/Kaki +Print Header=Kepala/Header Halaman Cetak +Header Text:=Teks Kepala/Header: +Print Footer= Kaki/Footer Halaman Cetak +Footer Text:=Teks Kaki/Footer: +Formatting Options=Pilihan Format +Font and Size=Font dan Ukuran +Chapter Heading:=Judul Bab/Pasal: +Body Text:=Teks Utama: +Verse Numbers:=Nomor Ayat: +Font:=Font: +Book Name=Nama Kitab/Buku +Chapter Headings=Judul Bab/Pasal +Paragraph Format=Format Paragraf +Verse Numbers=Nomor Ayat +Superscripted=Tulisan Superskrip +Prefixed (John 1:1 KJV)...=Alamat Ayat Sebelum (Yohanes 1:1 TB)... +Postfixed ...(John 1:1 KJV)=Alamat Ayat Setelah ...(Yohanes 1:1 TB) +"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak"="Inggris","Cekoslovakia","Denmark","Jerman","Prancis","Norwegia","Polandia","Portugis","Slovia" +Glossaries=Daftar Kata - Glossary +Show Glossaries as Dictionaries=Tampil Daftar Kata/Glossary Seperti Kamus +Default=Standar/Default +"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Semua Modul","Modul Alkitab","Modul Tafsiran/Komentar","Modul Leksikon/Kamus" +&Save Scheme=Simpan Skema +&Delete Scheme=Hapus Skema +&Import Scheme=Impor Skema +&Export Scheme=Ekspor Skema +Words To Live By...=Kata-kata untuk Kehidupan... +Go Back To Previous Location=Kembali ke Lokasi Sebelumnya +Bring Up Search Window=Dapat Jendala Pencarian +Biblical Texts=Teks Alkitabiah +Commentaries=Tafsiran/Komentar +Lexicons / Dictionaries= Leksikon / Kamus +Lookup Entry=Lookup Entry +Verse Range or List=Verse Range or List +Page Setup=Page Setup +Strong's Numbers <...>=Strong's Numbers <...> +Strong's Tense (...)=Strong's Tense (...)
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/sl.conf b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/sl.conf new file mode 100644 index 0000000..286d8ff --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/stage/uilocales.d/sl.conf @@ -0,0 +1,178 @@ +[Meta] +Name=sl +Description=Slovenian +Translator=Gregor Anzelj <gre_gor@hotmail.com> + +[Text] +BackBtnImage=uilocales.d/sl_back.bmp +SearchBtnImage=uilocales.d/sl_search.bmp +&About=Vi&zitka +About The SWORD Project=Predstavitev projekta SWORD +&Add=&Dodaj +&Add Bookmark=&Dodaj zaznamek +Add New Bookmark File=Dodaj novo datoteko zaznamkov +Bookmark Section Title:=Ime skupine zaznamkov: +Bookmark=Zaznamek +Bookmarks=Zaznamki +Cancel=Preklici +Case Sensitive=Razlikovanje crk +Chapter=Poglavje +Check Modules To Show As Tabs=Oznaci module, ki bodo vidni +Combo/Edit Fields=Kombo/Vnosna polja +Contents=Vsebina +&Copy=&Kopiraj +Copy as &B-Greek Transliteration=Kopiraj kot &B-Grski prepis +&Close=&Zapri +Create a New Verse List Window=Ustvari okno z novim seznamom vrstic +Create Verse List=Ustvari seznam vrstic +Current Verse Color=Barva trenutne vrstice +Daily Devotionals=Dnevno branje +Default Devotional=Privzeto branje +Define Custom Range=Definiraj lasten obseg +Definitions=Definicije +&Delete Entry=&Izbrisi vnos +Description=Opis +Devotion for Today=Danasnje dnevno branje +Devotional of the Day=Dnevno branje +Dictionary Lookup=Poglej v slovarju +Display Colors=Barve zaslona +Display=Zaslon +&Edit=&Urejanje +&Edit Bookmarks / Tree View...=&Urejanje zaznamkov / Drevo... +Edit Entry=Urejanje vnosa +&Edit Entry=&Urejanje vnosa +"Entire Module","Current Results","Custom Range"="Celoten modul","Trenutni rezultati","Lasten obseg" +E&xit=Iz&hod +eg. mat-jo;rev4=npr. mt-jn;raz4 +&File=&Datoteka +File Name (without extension):=Ime datoteke (brez koncnice): +Font Size:=Velikost pisave: +Found New Module...=Najden je nov modul... +General=Splosno +Greek=Grsko +Hebrew=Hebrejsko +&Help=&Pomoc +Hide / Show Modules=Pokazi / Skrij module +Individual Modules (Font Only)=Posamezni moduli (samo pisava) +Install Manager=Namestitveni program +Language=Jezik +Link to Comment for Verse...=Povezava s komentarjem vrstice +Maintain Custom Ranges=Vzdrzuj lastne obsege +Module Type=Tip modula +Module=Modul +"Mult Word","Phrase","Regular Expression"="Vec besed","Fraza","Pravilen izraz" +&New Search Window=&Novo iskalno okno +OK=V redu +OkBtn=&V redu +Options=&Moznosti +Original Language Support - Default Modules=Podpora za izvirne jezike - Privzeti moduli +Parsing=Razclemba +Personalize=Po meri +Preferences=Nastavitve +&Preferences...=&Nastavitve... +Preview...=Predogled... +Preview=Predogled +Range Name=Ime obsega +Range Text=Obseg besedila +Reference=Referenca +&Remove=&Odstrani +&Save=&Shrani +S&ave Layout=S&hrani izgled +Save Other Bookmarks=Shrani druge zaznamke +Save Personal Bookmarks=Shrani osebne zaznamke +Save Screen Layout=Shrani izgled zaslona +Scheme=Shema +Scope=Obseg +&Search=&Iskanje +Search Options=Moznosti iskanja +Search Type=Tip iskanja +Search...=Iskanje... +Search=Iskanje +Select Color...=Izberi barvo... +Select Font...=Izberi pisavo... +Show Devotional at Startup=Pokazi branje ob zacetku +Show Devotional Splash Screen on Startup=Pokazi dnevno branje ob zacetku +Show Devotionals as Dictionaries=Pokazi dnevna branja kot slovarje +Show Hint Over Strongs Numbers=Pokazi namige pri Strong stevilih +Show Hint Pop-ups=Pokazi namige +Special Modules=Posebni moduli +Strong's Numbered Text=Besedilo s Strong stevili +Text Font=Pisava besedila +&Tools=&Orodja +Type Verse=Tip vrstice +User Verse List=Uporabnikov seznam vrstic +Verse List=Seznam vrstic +Verse Number Color=Barva stevilke vrstice +&New Bookmark File=&Nova datoteka zaznamkov +P&rint...=Na&tisni... +The SWORD Project=Projekt SWORD +&Footnotes=&Opombe +&On=&Pokazi +O&ff=&Skrij +&Hebrew Cantillation=Hebrejska kantilacija? +H&ebrew Vowel Points=Hebrejske pike? +&Strong's Numbers=&Strong stevila +&Morphological Tags=&Morfoloske oznake +He&adings=&Naslovi +&Transliteration=&Prepis +&Latin=&Latinica +&Basic Latin=Latinica &brez naglasov +B&eta=B&eta +B&Greek=B-&Grsko +Print Selection=Izbor tiskanja +Print Source=Vir tiskanja +Bible Text=Biblicno besedilo +Commentary Text=Besedilo komentarja +Lexicon/Dictionary Text=Besedilo leksikona/slovarja +Module Name=Ime modula +Print Range=Obseg tiskanja +&Print=Na&tisni +&Print...=Na&tisni... +Print=Natisni +Print...=Natisni... +P&review=P&redogled +P&review...=P&redogled... +Printer&s...=T&iskalniki... +Margins (Inches)=Robovi (v palcih) +Top:=Zgoraj: +Left:=Levo: +Right:=Desno: +Bottom:=Spodaj: +Header/Footer=Glava/Noga +Print Header=Natisni glavo +Header Text:=Besedilo glave: +Print Footer=Natisni nogo +Footer Text:=Besedilo noge: +Formatting Options=Moznosti oblikovanja +Font and Size=Pisava in velikost +Chapter Heading:=Naslov poglavja: +Body Text:=Besedilo: +Verse Numbers:=Stevilke vrstic: +Font:=Pisava: +Book Name=Ime knjige +Chapter Headings=Naslovi poglavij +Paragraph Format=Oblika odstavka +Verse Numbers=Stevilke vrstic +Superscripted=Nadpisano +Prefixed (John 1:1 KJV)...=Predpona (Janez 1,1 KJV)... +Postfixed ...(John 1:1 KJV)=Pripona ...(Janez 1,1 KJV) +"English (US)","Czech","Danish","German","French","Norwegian","Polish","Portuguese","Slovak","Slovenian"="anglesko","cesko","dansko","nemsko","francosko","norvesko","poljsko","portugalsko","slovasko","slovensko" +Glossaries=Besednjaki +Show Glossaries as Dictionaries=Pokazi besednjake kot slovarje +Default=Privzeto +"All Modules","Bible Modules","Commentary Modules","Lexicon/Dictionary Modules"="Vsi moduli","Biblicni moduli","Moduli komentarjev","Moduli leksikonov/slovarjev" +&Save Scheme=&Shrani shemo +&Delete Scheme=&Izbrisi shemo +&Import Scheme=&Uvozi shemo +&Export Scheme=I&zvozi shemo +Words To Live By...=Besede za zivljenje... +Go Back To Previous Location=Pojdi na prejsnje mesto +Bring Up Search Window=Pokazi iskalno okno +Biblical Texts=Biblicna besedila +Commentaries=Komentarji +Lexicons / Dictionaries=Leksikoni / Slovarji +Lookup Entry=Lookup Entry +Verse Range or List=Verse Range or List +Page Setup=Page Setup +Strong's Numbers <...>=Strong's Numbers <...> +Strong's Tense (...)=Strong's Tense (...) diff --git a/apps/windoze/CBuilder5/BibleCS/sword.bpr b/apps/windoze/CBuilder5/BibleCS/sword.bpr new file mode 100644 index 0000000..8d99df8 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/sword.bpr @@ -0,0 +1,166 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.05.03"/> + <PROJECT value="stage\sword.exe"/> + <OBJFILES value="obj\sword.obj obj\mainfrm.obj obj\AboutBoxfrm.obj obj\bookmarkfrm.obj + obj\newbmfilefrm.obj obj\optionfrm.obj obj\searchfrm.obj + obj\biblecsmgr.obj obj\ModInstForm.obj obj\vrslstfrm.obj + obj\editentryfrm.obj obj\versesel.obj obj\RangeMaintFrm.obj + obj\ModVisFrm.obj obj\swdisprtfchap.obj obj\swdisprtf.obj + obj\DevOfTheDay.obj obj\SplashPage.obj obj\FontSel.obj rxlib\Rxcombos.obj + rxlib\Vclutils.obj rxlib\Rxcconst.obj rxlib\Rxconst.obj + obj\StudyProfessor.obj rxlib\RxRichEd.obj rxlib\Maxmin.obj + obj\TModuleFonts.obj obj\rtfhintfrm.obj obj\RxRichEditX.obj + obj\PreviewForm.obj obj\PrintFrm.obj TntUnicodeControls\Unicode.obj + TntUnicodeControls\TntControls.obj TntUnicodeControls\TntForms.obj + TntUnicodeControls\TntStdCtrls.obj TntUnicodeControls\TntClasses.obj"/> + <RESFILES value="sword.res"/> + <IDLFILES value=""/> + <IDLGENFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES) mainfrm.dfm AboutBoxfrm.dfm bookmarkfrm.dfm newbmfilefrm.dfm + optionfrm.dfm searchfrm.dfm ModInstForm.dfm vrslstfrm.dfm editentryfrm.dfm + versesel.dfm RangeMaintFrm.dfm ModVisFrm.dfm DevOfTheDay.dfm + SplashPage.dfm FontSel.dfm StudyProfessor.dfm rtfhintfrm.dfm + PreviewForm.dfm PrintFrm.dfm"/> + <LIBFILES value="swordlib.lib ..\..\..\..\..\icu-sword\as_is\borland\icucommon.lib + ..\..\..\..\..\icu-sword\as_is\borland\icudatab.lib + ..\..\..\..\..\icu-sword\as_is\borland\icui18n.lib"/> + <LIBRARIES value="bcbie50.lib vcljpg50.lib nmfast50.lib vclbde50.lib vcldb50.lib vclx50.lib + vcl50.lib"/> + <SPARELIBS value="vcl50.lib vclx50.lib vcldb50.lib vclbde50.lib nmfast50.lib vcljpg50.lib + bcbie50.lib"/> + <PACKAGES value="Vcl50.bpi Vclx50.bpi bcbsmp50.bpi Qrpt50.bpi Vcldb50.bpi Vclbde50.bpi + ibsmp50.bpi vcldbx50.bpi TeeUI50.bpi TeeDB50.bpi Tee50.bpi TeeQR50.bpi + VCLIB50.bpi bcbie50.bpi vclie50.bpi Inetdb50.bpi Inet50.bpi NMFast50.bpi + dclocx50.bpi bcb2kaxserver50.bpi"/> + <PATHCPP value=".;..\..;rxlib;TntUnicodeControls"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value="$(BCB)\lib\debug"/> + <RELEASELIBPATH value="$(BCB)\lib\release"/> + <LINKER value="ilink32"/> + <USERDEFINES value="_ICU_;_ICUSWORD_"/> + <SYSDEFINES value="NO_STRICT"/> + <MAINSOURCE value="sword.cpp"/> + <INCLUDEPATH value="TntUnicodeControls;..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib"/> + <LIBPATH value="TntUnicodeControls;..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\lib;"C:\Program Files\Borland\CBuilder5\RX\Units\";$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;"C:\program files\borland\cbuilder3\projects\";C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + </MACROS> + <OPTIONS> + <IDLCFLAGS value="-I..\.. -I..\..\..\..\..\icu-sword\source\common + -I..\..\..\..\..\icu-sword\source\i18n -I..\..\..\..\include + -I$(BCB)\include -I$(BCB)\include\vcl -Irxlib -src_suffix cpp -D_ICU_"/> + <CFLAG1 value="-O2 -Vx -Ve -RT- -X- -a8 -4 -b- -k- -vi -c -tW -tWM"/> + <PFLAGS value="-N2obj -N0obj -$Y- -$L- -$D- -v -M -JPHNE"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zn"/> + <LFLAGS value="-Iobj -D"" -aa -Tpe -GD -s -Gn"/> + </OPTIONS> + <LINKER> + <ALLOBJ value="c0w32.obj $(OBJFILES)"/> + <ALLRES value="$(RESFILES)"/> + <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/> + </LINKER> + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=1 +MajorVer=1 +MinorVer=5 +Release=3 +Build=103 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName=CrossWire Software & Bible Society +FileDescription=Windows 32bit User Interface to The SWORD Project +FileVersion=1.5.3.103 +InternalName=biblecs +LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License +LegalTrademarks= +OriginalFilename= +ProductName=The SWORD Project +ProductVersion=1.5.4betaX +Comments=Seek Him and you will find Him + +[HistoryLists\hlIncludePath] +Count=11 +Item0=TntUnicodeControls;..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item1=TntUnicodeControls;..\..\..\WINDOZE;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item2=..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item3=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item4=..\..\..\windoze;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item5=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item6=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item7=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item8=..\..\..\..\..\icu-sword\source\common\;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item9=C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item10=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib + +[HistoryLists\hlLibraryPath] +Count=8 +Item0=TntUnicodeControls;..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item1=TntUnicodeControls;..\..\..\..\..\TntUnicodeControls;..\..\..\WINDOZE;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item2=..\..\..\..\..\TntUnicodeControls;..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item3=..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item4=..\..\..\windoze;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item5=..\..;..\..\..\windoze;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item6=..\..;..\..\..\..\lib\;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item7=..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=5 +Item0=_ICU_;_ICUSWORD_ +Item1=_ICU_;_ICUSWORD_;_DEBUG +Item2=_ICU_ +Item3=_ICU_;_DEBUG +Item4=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=2 +Item0=obj +Item1=C:\sword\apps\windoze\CBuilder5\BibleCS\obj + +[HistoryLists\hlFinalOutputDir] +Count=4 +Item0=stage\ +Item1=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword\ +Item2=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword +Item3=C:\sword\apps\windoze\CBuilder5\BibleCS\stage + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/BibleCS/sword.cpp b/apps/windoze/CBuilder5/BibleCS/sword.cpp new file mode 100644 index 0000000..3686c59 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/sword.cpp @@ -0,0 +1,160 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop +#include "SplashPage.h" +#include <winreg.h> +#include <dir.h> +#include "sword.h" + +USERES("sword.res"); +USEFORM("mainfrm.cpp", Form1); +USEFORM("AboutBoxfrm.cpp", AboutBox); +USEFORM("bookmarkfrm.cpp", bookmarkForm); +USEFORM("newbmfilefrm.cpp", NewBMfrm); +USEFORM("optionfrm.cpp", Optionsfrm); +USEFORM("searchfrm.cpp", searchForm); +USEUNIT("biblecsmgr.cpp"); +USEFORM("ModInstForm.cpp", ModInstFrm); +USEFORM("vrslstfrm.cpp", VerseListFrm); +USEFORM("editentryfrm.cpp", EditEntryForm); +USEFORM("versesel.cpp", VerseSelFrm); +USELIB("swordlib.lib"); +USEFORM("RangeMaintFrm.cpp", RangeMaintForm); +USEFORM("ModVisFrm.cpp", ModVisForm); +USEUNIT("..\..\swdisprtfchap.cpp"); +USEUNIT("..\..\swdisprtf.cpp"); +USEFORM("DevOfTheDay.cpp", DevOfTheDay2); +USEFORM("SplashPage.cpp", SplashPg); +USEFORM("FontSel.cpp", FontSelFrm); +USEOBJ("rxlib\Rxcombos.obj"); +USEOBJ("rxlib\Vclutils.obj"); +USEOBJ("rxlib\Rxcconst.obj"); +USEOBJ("rxlib\Rxconst.obj"); +USEFORM("StudyProfessor.cpp", Form3); +USELIB("..\..\..\..\..\icu-sword\as_is\borland\icucommon.lib"); +USELIB("..\..\..\..\..\icu-sword\as_is\borland\icudatab.lib"); +USELIB("..\..\..\..\..\icu-sword\as_is\borland\icui18n.lib"); +USEOBJ("rxlib\RxRichEd.obj"); +USEOBJ("rxlib\Maxmin.obj"); +USEUNIT("TModuleFonts.cpp"); +USEFORM("rtfhintfrm.cpp", RTFHintForm); +USEUNIT("RxRichEditX.cpp"); +USEFORM("PreviewForm.cpp", PreviewForm); +USEFORM("PrintFrm.cpp", PrintForm); +USEOBJ("TntUnicodeControls\Unicode.obj"); +USEOBJ("TntUnicodeControls\TntControls.obj"); +USEOBJ("TntUnicodeControls\TntForms.obj"); +USEOBJ("TntUnicodeControls\TntStdCtrls.obj"); +USEOBJ("TntUnicodeControls\TntClasses.obj"); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { + + LONG result; + + try { + HKEY hkey; + HWND otherInst; + + // see if there's a previous instance running + otherInst = ::FindWindow(NULL, "The SWORD Project for Windows"); + // if so, and we have an argument, send the argument to the other instance + if (*lpCmdLine) { + if (otherInst && *lpCmdLine) { + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\OpenVerse", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, lpCmdLine, strlen(lpCmdLine) + 1); + result = RegCloseKey(hkey); + + PostMessage(otherInst, WM_VERSE, NULL, NULL); + return 0; + } + + // TODO 5: if we have a cmdline argument, figure we have to change directories. BAD, FIX. + result = Application->ExeName.Length(); + char * dir = new char[result + 1]; + strcpy (dir, Application->ExeName.c_str()); + for (;result > 0 && dir[result] != '\\'; result--) { + dir[result] = 0; + } + chdir(dir); + delete [] dir; + } + + // adjust the registry for our private protocol using the current path + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1); + result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1); + result = RegCloseKey(hkey); + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1); + result = RegCloseKey(hkey); + AnsiString opencommand = Application->ExeName + " \"%1\""; + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1); + result = RegCloseKey(hkey); + + + /* + // don't override Logos' setting if it exists + result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "libronixdls", 0, KEY_READ | KEY_WRITE, &hkey); + if (!result) { + char* libStr = new char[32]; + unsigned long libSize = 32; + result = RegQueryValueEx(hkey, NULL, NULL, NULL, libStr, &libSize); + if (!result) { + if (strstr(libStr, "SWORD")) { + result = 1; + } + } + } + if (result) { + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1); + result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1); + result = RegCloseKey(hkey); + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1); + result = RegCloseKey(hkey); + AnsiString opencommand = Application->ExeName + " \"%1\""; + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1); + result = RegCloseKey(hkey); + } + */ + } + catch (Exception &exception) { + Application->ShowException(&exception); + } + + try { + Application->Initialize(); + Application->Title = "The SWORD Project"; + SplashPg = new TSplashPg(static_cast<void*>(NULL)); + SplashPg->Show(); + Application->ProcessMessages(); + Application->CreateForm(__classid(TForm1), &Form1); + Application->CreateForm(__classid(TAboutBox), &AboutBox); + Application->CreateForm(__classid(TbookmarkForm), &bookmarkForm); + Application->CreateForm(__classid(TNewBMfrm), &NewBMfrm); + Application->CreateForm(__classid(TOptionsfrm), &Optionsfrm); + Application->CreateForm(__classid(TsearchForm), &searchForm); + Application->CreateForm(__classid(TModInstFrm), &ModInstFrm); + Application->CreateForm(__classid(TVerseListFrm), &VerseListFrm); + Application->CreateForm(__classid(TEditEntryForm), &EditEntryForm); + Application->CreateForm(__classid(TVerseSelFrm), &VerseSelFrm); + Application->CreateForm(__classid(TRangeMaintForm), &RangeMaintForm); + Application->CreateForm(__classid(TModVisForm), &ModVisForm); + Application->CreateForm(__classid(TDevOfTheDay2), &DevOfTheDay2); + Application->CreateForm(__classid(TForm3), &Form3); + Application->CreateForm(__classid(TRTFHintForm), &RTFHintForm); + Application->CreateForm(__classid(TPreviewForm), &PreviewForm); + Application->CreateForm(__classid(TPrintForm), &PrintForm); + Application->Run(); + delete SplashPg; + } + catch (Exception &exception) { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/BibleCS/sword.h b/apps/windoze/CBuilder5/BibleCS/sword.h new file mode 100644 index 0000000..5bfa702 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/sword.h @@ -0,0 +1 @@ +#define WM_VERSE (WM_APP + 1995) diff --git a/apps/windoze/CBuilder5/BibleCS/sword.res b/apps/windoze/CBuilder5/BibleCS/sword.res Binary files differnew file mode 100644 index 0000000..8aa7e8d --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/sword.res diff --git a/apps/windoze/CBuilder5/BibleCS/swordlib.bpr b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr new file mode 100644 index 0000000..52ae339 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/swordlib.bpr @@ -0,0 +1,203 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.05.03"/> + <PROJECT value="..\..\..\..\lib\swordlib.lib"/> + <OBJFILES value="..\..\..\..\obj\swordlib.obj ..\..\..\..\obj\versekey.obj + ..\..\..\..\obj\swkey.obj ..\..\..\..\obj\listkey.obj + ..\..\..\..\obj\strkey.obj ..\..\..\..\obj\swmgr.obj + ..\..\..\..\obj\swconfig.obj ..\..\..\..\obj\rawcom.obj + ..\..\..\..\obj\swcom.obj ..\..\..\..\obj\rawverse.obj + ..\..\..\..\obj\rawstr.obj ..\..\..\..\obj\gbfrtf.obj + ..\..\..\..\obj\gbfplain.obj ..\..\..\..\obj\rawld.obj + ..\..\..\..\obj\swld.obj ..\..\..\..\obj\rawtext.obj + ..\..\..\..\obj\swtext.obj ..\..\..\..\obj\swmodule.obj + ..\..\..\..\obj\tbdisp.obj ..\..\..\..\obj\swwinlog.obj + ..\..\..\..\obj\hrefcom.obj ..\..\..\..\obj\filemgr.obj + ..\..\..\..\obj\rawfiles.obj ..\..\..\..\obj\utilstr.obj + ..\..\..\..\obj\utilconf.obj ..\..\..\..\obj\Greek2Greek.obj + ..\..\..\..\obj\regex.obj ..\..\..\..\obj\swlog.obj + ..\..\..\..\obj\swdisp.obj ..\..\..\..\obj\gbfstrongs.obj + ..\..\..\..\obj\gbffootnotes.obj ..\..\..\..\obj\cipherfil.obj + ..\..\..\..\obj\sapphire.obj ..\..\..\..\obj\swcipher.obj + ..\..\..\..\obj\swlocale.obj ..\..\..\..\obj\localemgr.obj + ..\..\..\..\obj\lzsscomprs.obj ..\..\..\..\obj\zverse.obj + ..\..\..\..\obj\swcomprs.obj ..\..\..\..\obj\ztext.obj + ..\..\..\..\obj\thmlrtf.obj ..\..\..\..\obj\gbfhtml.obj + ..\..\..\..\obj\gbfthml.obj ..\..\..\..\obj\plainfootnotes.obj + ..\..\..\..\obj\plainhtml.obj ..\..\..\..\obj\rtfhtml.obj + ..\..\..\..\obj\thmlgbf.obj ..\..\..\..\obj\thmlhtml.obj + ..\..\..\..\obj\thmlplain.obj ..\..\..\..\obj\zcom.obj + ..\..\..\..\obj\gbfheadings.obj ..\..\..\..\obj\rawstr4.obj + ..\..\..\..\obj\rawld4.obj ..\..\..\..\obj\zipcomprs.obj + ..\..\..\..\obj\uncompr.obj ..\..\..\..\obj\compress.obj + ..\..\..\..\obj\inflate.obj ..\..\..\..\obj\deflate.obj + ..\..\..\..\obj\zutil.obj ..\..\..\..\obj\trees.obj + ..\..\..\..\obj\maketree.obj ..\..\..\..\obj\infutil.obj + ..\..\..\..\obj\inftrees.obj ..\..\..\..\obj\inffast.obj + ..\..\..\..\obj\infcodes.obj ..\..\..\..\obj\infblock.obj + ..\..\..\..\obj\crc32.obj ..\..\..\..\obj\adler32.obj + ..\..\..\..\obj\gzio.obj ..\..\..\..\obj\untgz.obj + ..\..\..\..\obj\unicodertf.obj ..\..\..\..\obj\gbfmorph.obj + ..\..\..\..\obj\thmlolb.obj ..\..\..\..\obj\roman.obj + ..\..\..\..\obj\gbfhtmlhref.obj ..\..\..\..\obj\latin1utf8.obj + ..\..\..\..\obj\latin1utf16.obj ..\..\..\..\obj\scsuutf8.obj + ..\..\..\..\obj\swbasicfilter.obj ..\..\..\..\obj\thmlhtmlhref.obj + ..\..\..\..\obj\utf8cantillation.obj ..\..\..\..\obj\utf8greekaccents.obj + ..\..\..\..\obj\utf8hebrewpoints.obj + ..\..\..\..\obj\utf8transliterator.obj ..\..\..\..\obj\utf8utf16.obj + ..\..\..\..\obj\utf16utf8.obj ..\..\..\..\obj\utf8latin1.obj + ..\..\..\..\obj\utf8html.obj ..\..\..\..\obj\thmlscripref.obj + ..\..\..\..\obj\thmlheadings.obj ..\..\..\..\obj\thmllemma.obj + ..\..\..\..\obj\thmlmorph.obj ..\..\..\..\obj\thmlfootnotes.obj + ..\..\..\..\obj\thmlstrongs.obj ..\..\..\..\obj\utf8nfkd.obj + ..\..\..\..\obj\utf8nfc.obj ..\..\..\..\obj\utf8bidireorder.obj + ..\..\..\..\obj\utf8arshaping.obj ..\..\..\..\obj\markupfiltmgr.obj + ..\..\..\..\obj\encfiltmgr.obj ..\..\..\..\obj\swfiltermgr.obj + ..\..\..\..\obj\swversion.obj ..\..\..\..\obj\zld.obj + ..\..\..\..\obj\zstr.obj ..\..\..\..\obj\entriesblk.obj + ..\..\..\..\obj\swgenbook.obj ..\..\..\..\obj\rawgenbook.obj + ..\..\..\..\obj\treekey.obj ..\..\..\..\obj\treekeyidx.obj + ..\..\..\..\obj\thmlvariants.obj ..\..\..\..\obj\swcacher.obj + ..\..\..\..\obj\greeklexattribs.obj ..\..\..\..\obj\gbfosis.obj + ..\..\..\..\obj\thmlosis.obj"/> + <RESFILES value=""/> + <IDLFILES value=""/> + <IDLGENFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES)"/> + <LIBFILES value=""/> + <LIBRARIES value="nmfast50.lib vclx50.lib vcl50.lib"/> + <SPARELIBS value="vcl50.lib vclx50.lib nmfast50.lib"/> + <PACKAGES value=""/> + <PATHCPP value=".;..\..\..\..\src\keys;..\..\..\..\src\mgr;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\common;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts;..\..\..\..\src\modules;..\..;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\utilfuns;..\..\..\..\src\frontend;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\genbook\rawgenbook"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value=""/> + <RELEASELIBPATH value=""/> + <LINKER value="TLib"/> + <USERDEFINES value="_ICU_;_ICUSWORD_"/> + <SYSDEFINES value="NO_STRICT;_NO_VCL"/> + <MAINSOURCE value="swordlib.cpp"/> + <INCLUDEPATH value="..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl"/> + <LIBPATH value="..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + <LISTFILE value=""/> + </MACROS> + <OPTIONS> + <IDLCFLAGS value="-I..\.. -I..\..\..\..\src\modules\genbook\rawgenbook + -I..\..\..\..\src\modules\genbook -I..\..\..\..\src\modules\lexdict\zld + -I..\..\..\..\..\icu-sword\source\common + -I..\..\..\..\..\icu-sword\source\i18n -I..\..\..\..\src\utilfuns\zlib + -I..\..\..\..\src\modules\lexdict\rawld4 + -I..\..\..\..\src\modules\comments\zcom + -I..\..\..\..\src\modules\texts\ztext -I..\..\..\..\src\frontend + -I..\..\.. -I..\..\..\..\utilfuns -I..\..\..\framework + -I..\..\..\..\src\modules\comments\rawfiles + -I..\..\..\..\src\modules\comments\hrefcom -I..\..\..\..\include + -I..\..\..\..\frontend -I..\..\..\..\src\utilfuns + -I..\..\..\..\src\modules -I..\..\..\..\src\modules\texts + -I..\..\..\..\src\modules\texts\rawtext + -I..\..\..\..\src\modules\texts\rawgbf -I..\..\..\..\src\modules\lexdict + -I..\..\..\..\src\modules\lexdict\rawld -I..\..\..\..\src\modules\filters + -I..\..\..\..\src\modules\common -I..\..\..\..\src\modules\comments + -I..\..\..\..\src\modules\comments\rawcom -I..\..\..\..\src\mgr + -I..\..\..\..\src\keys -I$(BCB)\include -I$(BCB)\include\vcl -src_suffix + cpp -D_ICU_ -D_DEBUG"/> + <CFLAG1 value="-O2 -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -RT- -X- -a8 + -4 -b- -k- -vi -c -g0 -tWM"/> + <PFLAGS value="-N2..\..\..\..\obj -N0..\..\..\..\obj -$Y- -$L- -$D- -v -M -JPHNE"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zn"/> + <LFLAGS value="/P512"/> + </OPTIONS> + <LINKER> + <ALLOBJ value="$(OBJFILES)"/> + <ALLRES value=""/> + <ALLLIB value="cg32.lib"/> + </LINKER> + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[HistoryLists\hlIncludePath] +Count=10 +Item0=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item1=..\..;..\..\..\WINDOZE;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\APPS;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item2=..\..\..\windoze;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item3=..\..;..\..\..\windoze;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item4=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item5=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item6=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item7=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item8=..\..\..\..\src\modules\lexdict\zld;C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item9=..\..\..\..\src\modules\lexdict\zld;..\..\..\..\..\icu-sword\source\common\;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=6 +Item0=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys +Item1=..\..;..\..\..\WINDOZE;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys +Item2=..\..\..\windoze;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys +Item3=..\..;..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..\..\windoze;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys +Item4=..\..\..\..\src\modules\genbook\rawgenbook;..\..\..\..\src\modules\genbook;..\..\..\..\src\modules\lexdict\zld;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys +Item5=..\..\..\..\src\modules\lexdict\zld;..\..;..\..\..\..\src\utilfuns\zlib;..\..\..\..\src\modules\lexdict\rawld4;..\..\..\..\src\modules\comments\zcom;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys + +[HistoryLists\hlConditionals] +Count=5 +Item0=_ICU_;_ICUSWORD_ +Item1=_ICU_;_ICUSWORD_;_DEBUG +Item2=_ICU_ +Item3=_ICU_;_DEBUG +Item4=_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=2 +Item0=..\..\..\..\obj +Item1=C:\sword\obj + +[HistoryLists\hlFinalOutputDir] +Count=2 +Item0=..\..\..\..\lib\ +Item1=C:\sword\lib + +[HistoryLists\hlTlibPageSize] +Count=2 +Item0=0x0200 +Item1=0x0100 + +[Debugging] +DebugSourceDirs= + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/BibleCS/swordlib.cpp b/apps/windoze/CBuilder5/BibleCS/swordlib.cpp new file mode 100644 index 0000000..80f7b7e --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/swordlib.cpp @@ -0,0 +1,121 @@ +//--------------------------------------------------------------------------- +#include <condefs.h> +#pragma hdrstop +USEUNIT("..\..\..\..\src\keys\versekey.cpp"); +USEUNIT("..\..\..\..\src\keys\swkey.cpp"); +USEUNIT("..\..\..\..\src\keys\listkey.cpp"); +USEUNIT("..\..\..\..\src\keys\strkey.cpp"); +USEUNIT("..\..\..\..\src\mgr\swmgr.cpp"); +USEUNIT("..\..\..\..\src\mgr\swconfig.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\rawcom\rawcom.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\swcom.cpp"); +USEUNIT("..\..\..\..\src\modules\common\rawverse.cpp"); +USEUNIT("..\..\..\..\src\modules\common\rawstr.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfrtf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfplain.cpp"); +USEUNIT("..\..\..\..\src\modules\lexdict\rawld\rawld.cpp"); +USEUNIT("..\..\..\..\src\modules\lexdict\swld.cpp"); +USEUNIT("..\..\..\..\src\modules\texts\rawtext\rawtext.cpp"); +USEUNIT("..\..\..\..\src\modules\texts\swtext.cpp"); +USEUNIT("..\..\..\..\src\modules\swmodule.cpp"); +USEUNIT("..\..\tbdisp.cpp"); +USEUNIT("..\..\swwinlog.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\hrefcom\hrefcom.cpp"); +USEUNIT("..\..\..\..\src\mgr\filemgr.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\rawfiles\rawfiles.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\utilstr.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\utilconf.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\Greek2Greek.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\regex.c"); +USEUNIT("..\..\..\..\src\frontend\swlog.cpp"); +USEUNIT("..\..\..\..\src\frontend\swdisp.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfstrongs.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbffootnotes.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\cipherfil.cpp"); +USEUNIT("..\..\..\..\src\modules\common\sapphire.cpp"); +USEUNIT("..\..\..\..\src\modules\common\swcipher.cpp"); +USEUNIT("..\..\..\..\src\mgr\swlocale.cpp"); +USEUNIT("..\..\..\..\src\mgr\localemgr.cpp"); +USEUNIT("..\..\..\..\src\modules\common\lzsscomprs.cpp"); +USEUNIT("..\..\..\..\src\modules\common\zverse.cpp"); +USEUNIT("..\..\..\..\src\modules\common\swcomprs.cpp"); +USEUNIT("..\..\..\..\src\modules\texts\ztext\ztext.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlrtf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfthml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\plainfootnotes.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\plainhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\rtfhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlgbf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlplain.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\zcom\zcom.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfheadings.cpp"); +USEUNIT("..\..\..\..\src\modules\common\rawstr4.cpp"); +USEUNIT("..\..\..\..\src\modules\lexdict\rawld4\rawld4.cpp"); +USEUNIT("..\..\..\..\src\modules\common\zipcomprs.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\uncompr.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\compress.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\inflate.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\deflate.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\zutil.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\trees.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\maketree.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\infutil.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\inftrees.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\inffast.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\infcodes.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\infblock.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\crc32.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\adler32.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\gzio.c"); +USEUNIT("..\..\..\..\src\utilfuns\zlib\untgz.c"); +USEUNIT("..\..\..\..\src\modules\filters\unicodertf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfmorph.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlolb.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\roman.c"); +USEUNIT("..\..\..\..\src\modules\filters\gbfhtmlhref.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\latin1utf8.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\latin1utf16.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\scsuutf8.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\swbasicfilter.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlhtmlhref.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8cantillation.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8greekaccents.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8hebrewpoints.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8transliterator.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8utf16.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf16utf8.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8latin1.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8html.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlscripref.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlheadings.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmllemma.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlmorph.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlfootnotes.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlstrongs.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8nfkd.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8nfc.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8bidireorder.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\utf8arshaping.cpp"); +USEUNIT("..\..\..\..\src\mgr\markupfiltmgr.cpp"); +USEUNIT("..\..\..\..\src\mgr\encfiltmgr.cpp"); +USEUNIT("..\..\..\..\src\mgr\swfiltermgr.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\swversion.cpp"); +USEUNIT("..\..\..\..\src\modules\lexdict\zld\zld.cpp"); +USEUNIT("..\..\..\..\src\modules\common\zstr.cpp"); +USEUNIT("..\..\..\..\src\modules\common\entriesblk.cpp"); +USEUNIT("..\..\..\..\src\modules\genbook\swgenbook.cpp"); +USEUNIT("..\..\..\..\src\modules\genbook\rawgenbook\rawgenbook.cpp"); +USEUNIT("..\..\..\..\src\keys\treekey.cpp"); +USEUNIT("..\..\..\..\src\keys\treekeyidx.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlvariants.cpp"); +USEUNIT("..\..\..\..\src\mgr\swcacher.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\greeklexattribs.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfosis.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlosis.cpp"); +//--------------------------------------------------------------------------- +#define Library + +// To add a file to the library use the Project menu 'Add to Project'. + diff --git a/apps/windoze/CBuilder5/BibleCS/swordprj.bpg b/apps/windoze/CBuilder5/BibleCS/swordprj.bpg new file mode 100644 index 0000000..c5e4dab --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/swordprj.bpg @@ -0,0 +1,32 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = icucommon.lib icui18n.lib swordlib.lib sword.exe +#------------------------------------------------------------------------------ +default: sword +#------------------------------------------------------------------------------ + + +swordlib.lib: swordlib.bpr + $(MAKE) + +sword.exe: sword.bpr + $(MAKE) + +icui18n.lib: ..\..\..\..\..\icu-sword\as_is\borland\i18n.bpr + $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + +icucommon.lib: ..\..\..\..\..\icu-sword\as_is\borland\common.bpr + $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + + diff --git a/apps/windoze/CBuilder5/BibleCS/versesel.cpp b/apps/windoze/CBuilder5/BibleCS/versesel.cpp new file mode 100644 index 0000000..8788580 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/versesel.cpp @@ -0,0 +1,22 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "versesel.h" +#include <versekey.h> +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TVerseSelFrm *VerseSelFrm; +//--------------------------------------------------------------------------- +__fastcall TVerseSelFrm::TVerseSelFrm(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void __fastcall TVerseSelFrm::Edit1Change(TObject *Sender) +{ + VerseKey trykey = Edit1->Text.c_str(); + Panel2->Caption = (const char *)trykey; +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp new file mode 100644 index 0000000..ac0f3b9 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.cpp @@ -0,0 +1,49 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "vrslstfrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TVerseListFrm *VerseListFrm; +//--------------------------------------------------------------------------- +__fastcall TVerseListFrm::TVerseListFrm(TComponent* Owner, ListKey &iVerseList) + : TForm(Owner), verseList(iVerseList) { + pvrtf = new SWDispRTF(this); + + pvrtf->Parent = plPreview; + pvrtf->Align = alClient; + pvrtf->ScrollBars = ssVertical; + pvrtf->ReadOnly = true; +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListFrm::ListBox1Click(TObject *Sender) { + ModMap::iterator target; + target = Form1->mainmgr->Modules.find(Form1->TextPageControl->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + SWKey *savekey = *(*target).second; + (*target).second->SetKey(ListBox1->Items->Strings[ListBox1->ItemIndex].c_str()); + pvrtf->Display(*(*target).second); + (*target).second->SetKey(*savekey); + } +} +//--------------------------------------------------------------------------- + +void __fastcall TVerseListFrm::ListBox1DblClick(TObject *Sender) +{ + *(Form1->DefaultVSKey) = ListBox1->Items->Strings[ListBox1->ItemIndex].c_str(); + Form1->TextKeyChanged(); +} +//--------------------------------------------------------------------------- +void __fastcall TVerseListFrm::FormShow(TObject *Sender) +{ + for (verseList = TOP; (!verseList.Error()); verseList++) + ListBox1->Items->Add((const char *)verseList); +} +//--------------------------------------------------------------------------- + + + + diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm new file mode 100644 index 0000000..ed8fd45 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.dfm @@ -0,0 +1,40 @@ +object VerseListFrm: TVerseListFrm
+ Left = 457
+ Top = 100
+ Width = 256
+ Height = 315
+ Caption = 'Verse List'
+ Color = clBtnFace
+ Font.Charset = DEFAULT_CHARSET
+ Font.Color = clWindowText
+ Font.Height = -11
+ Font.Name = 'MS Sans Serif'
+ Font.Style = []
+ FormStyle = fsStayOnTop
+ OldCreateOrder = True
+ Position = poScreenCenter
+ Scaled = False
+ OnShow = FormShow
+ PixelsPerInch = 96
+ TextHeight = 13
+ object plPreview: TPanel
+ Left = 0
+ Top = 143
+ Width = 248
+ Height = 145
+ Align = alBottom
+ Caption = 'plPreview'
+ TabOrder = 0
+ end
+ object ListBox1: TListBox
+ Left = 0
+ Top = 0
+ Width = 248
+ Height = 143
+ Align = alClient
+ ItemHeight = 13
+ TabOrder = 1
+ OnClick = ListBox1Click
+ OnDblClick = ListBox1DblClick
+ end
+end
diff --git a/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h new file mode 100644 index 0000000..7af64b9 --- /dev/null +++ b/apps/windoze/CBuilder5/BibleCS/vrslstfrm.h @@ -0,0 +1,29 @@ +//--------------------------------------------------------------------------- +#ifndef vrslstfrmH +#define vrslstfrmH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <ExtCtrls.hpp> +#include "mainfrm.h" +//--------------------------------------------------------------------------- +class TVerseListFrm : public TForm +{ +__published: // IDE-managed Components + TPanel *plPreview; + TListBox *ListBox1; + void __fastcall ListBox1Click(TObject *Sender); + void __fastcall ListBox1DblClick(TObject *Sender); + void __fastcall FormShow(TObject *Sender); +private: // User declarations + SWDispRTF *pvrtf; + ListKey &verseList; +public: // User declarations + __fastcall TVerseListFrm(TComponent* Owner, ListKey &iVerseList); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TVerseListFrm *VerseListFrm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg new file mode 100644 index 0000000..792eb7c --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpg @@ -0,0 +1,31 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = swordlib.lib zlib.lib libcurl.lib InstallMgr.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +InstallMgr.exe: InstallMgr.bpr + $(MAKE) + +swordlib.lib: ..\BibleCS\swordlib.bpr + $(MAKE) + +zlib.lib: zlib.bpr + $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + +libcurl.lib: libcurl.bpr + $(ROOT)\bin\bpr2mak -t$(ROOT)\bin\deflib.bmk $** + $(ROOT)\bin\make -$(MAKEFLAGS) -f$*.mak + + diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr new file mode 100644 index 0000000..1b2a792 --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.bpr @@ -0,0 +1,136 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.05.03"/> + <PROJECT value="InstallMgr.exe"/> + <OBJFILES value="InstallMgr.obj MainFrm.obj StatusFrm.obj RemoteMntFrm.obj InfoFrm.obj + cipherfrm.obj UninstallFrm.obj"/> + <RESFILES value="InstallMgr.res"/> + <IDLFILES value=""/> + <IDLGENFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES) MainFrm.dfm StatusFrm.dfm RemoteMntFrm.dfm InfoFrm.dfm + cipherfrm.dfm UninstallFrm.dfm"/> + <LIBFILES value="zlib.lib ..\..\..\..\lib\swordlib.lib libcurl.lib curl\lib\ws2_32.lib"/> + <LIBRARIES value="vclx50.lib vcl50.lib"/> + <SPARELIBS value="vcl50.lib vclx50.lib"/> + <PACKAGES value="vcl50.bpi vclx50.bpi vcljpg50.bpi bcbsmp50.bpi qrpt50.bpi vcldb50.bpi + vclbde50.bpi ibsmp50.bpi vcldbx50.bpi teeui50.bpi teedb50.bpi tee50.bpi + nmfast50.bpi dclocx50.bpi"/> + <PATHCPP value=".;"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value="$(BCB)\lib\debug"/> + <RELEASELIBPATH value="$(BCB)\lib\release"/> + <LINKER value="ilink32"/> + <USERDEFINES value="VCL"/> + <SYSDEFINES value="NO_STRICT"/> + <MAINSOURCE value="InstallMgr.cpp"/> + <INCLUDEPATH value="curl\include;..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include"/> + <LIBPATH value="..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + </MACROS> + <OPTIONS> + <IDLCFLAGS value="-I..\BibleCS -I..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr + -I$(BCB)\include -I$(BCB)\include\vcl -I..\..\..\..\include -src_suffix + cpp -DVCL -boa"/> + <CFLAG1 value="-O2 -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -RT- -X- -a8 + -b- -k- -vi -c -tW -tWM"/> + <PFLAGS value="-$Y- -$L- -$D- -v -JPHNE -M"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zn"/> + <LFLAGS value="-D"" -aa -Tpe -x -Gn"/> + </OPTIONS> + <LINKER> + <ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/> + <ALLRES value="$(RESFILES)"/> + <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/> + </LINKER> + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=0 +MajorVer=1 +MinorVer=5 +Release=3 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName=CrossWire Bible Society +FileDescription=SWORD Installation Manager +FileVersion=1.5.3.0 +InternalName=InstallMgr +LegalCopyright=Copyright 2002 by CrossWire Bible Society +LegalTrademarks= +OriginalFilename= +ProductName=The SWORD Project +ProductVersion=1.5.3 +Comments=Seek Jesus who exchanges temporary for eternal + +[HistoryLists\hlIncludePath] +Count=6 +Item0=curl\include;..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item1=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item2=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item3=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item4=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item5=..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include + +[HistoryLists\hlLibraryPath] +Count=5 +Item0=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib +Item1=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib +Item2=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib +Item3=..\BibleCS;..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib +Item4=..\..\..\..\usr\src\sword\apps\windoze\CBuilder4\InstallMgr;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=8 +Item0=VCL +Item1=VCL;__STDC__ true +Item2=VCL;__STDC__ +Item3=VCL;_MSC_VER +Item4=VCL __STDC__ +Item5=VCL;_DEBUG +Item6=_DEBUG;VCL +Item7=_DEBUG + +[HistoryLists\hlRunParameters] +Count=1 +Item0=-uninstall + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp new file mode 100644 index 0000000..a269603 --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.cpp @@ -0,0 +1,36 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop +USERES("InstallMgr.res"); +USEFORM("MainFrm.cpp", MainForm); +USEFORM("StatusFrm.cpp", StatusForm); +USEFORM("RemoteMntFrm.cpp", RemoteMntForm); +USEFORM("InfoFrm.cpp", InfoForm); +USEFORM("cipherfrm.cpp", CipherForm); +USEFORM("UninstallFrm.cpp", UninstallForm); +USELIB("zlib.lib"); +USELIB("..\..\..\..\lib\swordlib.lib"); +USELIB("libcurl.lib"); +USELIB("curl\lib\ws2_32.lib"); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->Title = "Install Manager"; + Application->CreateForm(__classid(TMainForm), &MainForm); + Application->CreateForm(__classid(TStatusForm), &StatusForm); + Application->CreateForm(__classid(TRemoteMntForm), &RemoteMntForm); + Application->CreateForm(__classid(TInfoForm), &InfoForm); + Application->CreateForm(__classid(TCipherForm), &CipherForm); + Application->CreateForm(__classid(TUninstallForm), &UninstallForm); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res Binary files differnew file mode 100644 index 0000000..67f5484 --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/InstallMgr.res diff --git a/apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp b/apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp new file mode 100644 index 0000000..42e0500 --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/MainFrm.cpp @@ -0,0 +1,1110 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +extern "C" { +#include <untgz.h> +} + +#include "MainFrm.h" +#include "StatusFrm.h" +#include "RemoteMntFrm.h" +#include "InfoFrm.h" +#include "cipherfrm.h" +#include "UninstallFrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" + +#include <swwinlog.h> +#include <shellapi.h> +#include <dirent.h> +#include <fcntl.h> +#include <io.h> +#include <sys/stat.h> +#include <dir.h> +#include <FileCtrl.hpp> + +TMainForm *MainForm; + + +VersionInfo::VersionInfo(const char *version) { + char *buf = new char[ strlen(version) + 1 ]; + char *tok; + major = minor = minor2 = minor3 = 0; + + strcpy(buf, version); + tok = strtok(buf, "."); + if (tok) + major = atoi(tok); + tok = strtok(0, "."); + if (tok) + minor = atoi(tok); + tok = strtok(0, "."); + if (tok) + minor2 = atoi(tok); + tok = strtok(0, "."); + if (tok) + minor3 = atoi(tok); + delete [] buf; +} + + +int VersionInfo::compare(const VersionInfo &vi) const { + if (major == vi.major) + if (minor == vi.minor) + if (minor2 == vi.minor2) + if (minor3 == vi.minor3) + return 0; + else return minor3 - vi.minor3; + else return minor2 - vi.minor2; + else return minor - vi.minor; + else return major - vi.major; +} + + +__fastcall InstallSourceTab::InstallSourceTab(TComponent *Owner, const char *confEnt, const char *type) : TControl(Owner) { + char *buf = new char [ strlen(confEnt) + 1 ]; + + strcpy(buf, confEnt); + + Caption = strtok(buf, "|"); + Source = strtok(0, "|"); + Directory = strtok(0, "|"); + delete [] buf; + Type = type; + mgr = 0; +} + +__fastcall InstallSourceTab::~InstallSourceTab() { + if (mgr) + delete mgr; +} + +__fastcall TMainForm::TMainForm(TComponent* Owner) + : TForm(Owner) +{ + try { + manager = new SWMgr(); + } + catch (...) { + createPathAndFile("./mods.d/globals.conf"); + manager = new SWMgr(); + } + installConf = new SWConfig("./InstallMgr.conf"); + localMgr = 0; +} + + +__fastcall TMainForm::~TMainForm() +{ + delete manager; + delete installConf; + if (localMgr) + delete localMgr; +} + + +void __fastcall TMainForm::FormCreate(TObject *Sender) { + + refreshPageControl(); + + if (SWLog::systemlog) + delete SWLog::systemlog; + SWLog::systemlog = new SWWinLog(this->Handle); // set the system logger to our MSWindows specific SWLog class + + fillInstallTree(); + fillSourceTree(getLocalDir(), localTree); +} + + +void TMainForm::refreshPageControl() { + SectionMap::iterator sources; + ConfigEntMap::iterator sourceBegin; + ConfigEntMap::iterator sourceEnd; + + while (PageControl1->PageCount > 1) { + delete PageControl1->Pages[1]; + } + + sources = installConf->Sections.find("Sources"); + passive = (!stricmp((*installConf)["General"]["PassiveFTP"].c_str(), "true")); + + if (sources != installConf->Sections.end()) { + sourceBegin = sources->second.lower_bound("FTPSource"); + sourceEnd = sources->second.upper_bound("FTPSource"); + + if (sourceBegin != sourceEnd) { + while (sourceBegin != sourceEnd) { + InstallSourceTab *ist = new InstallSourceTab(this, sourceBegin->second.c_str(), "FTP"); + addSource(ist); + sourceBegin++; + } + } + } +} + + +void TMainForm::addSource(InstallSourceTab *ist) +{ + TTabSheet *newtab = new TTabSheet(this); + TTreeView *newtree = new TTreeView(this); + TSpeedButton *newbutton = new TSpeedButton(this); + TPanel *newpanel = new TPanel(this); + char buf[512]; + SectionMap::iterator sit; + + newtab->Caption = ist->Caption.c_str(); + newtab->Hint = ist->Source.c_str(); + newtab->ShowHint = true; + newtab->PageControl = PageControl1; + ist->Parent = newtab; + ist->tree = newtree; + newpanel->Parent = newtab; + newpanel->Align = alTop; + newpanel->BevelOuter = bvNone; + newpanel->BevelInner = bvNone; + newpanel->Height = 25; + newbutton->Parent = newpanel; + newbutton->Caption = "Refresh from Remote Source"; + newbutton->Width = 210; + newbutton->OnClick = RefreshRemoteSource; + newbutton->Flat = true; + newbutton->Glyph = SpeedButton2->Glyph; + newtree->Parent = newtab; + newtree->Align = alClient; + newtree->ReadOnly = true; + newtree->OnDblClick = localTreeDblClick; + newtree->Images = ImageList1; + newtree->StateImages = ImageList2; + string parent = "./sources/" + ist->Source + "/file"; + createParent(parent.c_str()); + parent = "./sources/" + ist->Source; + fillSourceTree(parent.c_str(), newtree); +} + + +const char *TMainForm::getLocalDir() +{ + ConfigEntMap::iterator entry; + + entry = installConf->Sections["Sources"].find("LocalPath"); + if (entry == installConf->Sections["Sources"].end()) { + installConf->Sections["Sources"].insert(ConfigEntMap::value_type("LocalPath", "d:/sword")); + entry = installConf->Sections["Sources"].find("LocalPath"); + } + return entry->second.c_str(); + +} + + +void TMainForm::setLocalDir(const char *idir) +{ + installConf->Sections["Sources"].erase("LocalPath"); installConf->Sections["Sources"].insert(ConfigEntMap::value_type("LocalPath", idir)); +} + + +//--------------------------------------------------------------------------- +void __fastcall TMainForm::LocalPath1Click(TObject *Sender) +{ + AnsiString Dir = "C:"; + WideString Root = getLocalDir(); + SelectDirectory("Select Local Path", Root , Dir); + +/* + localPathDlg->Title = "Select a file in the directory to choose"; + localPathDlg->InitialDir = getLocalDir(); + if (localPathDlg->Execute()) { + char *buf = new char [ strlen(localPathDlg->FileName.c_str()) + 1 ]; + + strcpy(buf, localPathDlg->FileName.c_str()); + int end = strlen(buf) - 1; + while (end) { + if ((buf[end] == '/') || (buf[end] == '\\')) + break; + end--; + } + buf[end+1] = 0; + setLocalDir(buf); + delete [] buf; + } +*/ + + setLocalDir(Dir.c_str()); + + installConf->Save(); + fillSourceTree(getLocalDir(), localTree); +} +//--------------------------------------------------------------------------- + +void TMainForm::fillInstallTree() +{ + ModMap::iterator mods; + TTreeNode *node; + string nodeName; + + installTree->Items->Clear(); + + if (!manager->configPath) + return; + + for (mods = manager->Modules.begin(); mods != manager->Modules.end(); mods++) { + for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling()) { + if (!strcmp(node->Text.c_str(), mods->second->Type())) { + break; + } + } + if (!node) { // Add Section + if (!strncmp(mods->second->Type(), "Bibl", 4)) // If Bibles, put first in list + node = installTree->Items->AddChildFirst(0, mods->second->Type()); + else node = installTree->Items->AddChild(0, mods->second->Type()); + } + nodeName = "["; + nodeName += mods->second->Name(); + nodeName += "] "; + nodeName += mods->second->Description(); + node = installTree->Items->AddChildObject(node, nodeName.c_str(), mods->second->Name()); + } + for (node = installTree->Items->GetFirstNode(); node; node = node->getNextSibling()) + node->Expand(true); + node = installTree->Items->GetFirstNode(); + if (node) + node->MakeVisible(); +} + + +void TMainForm::fillSourceTree(const char *sourceConf, TTreeView *tree) +{ + ModMap::iterator mods; + TTreeNode *node; + SectionMap::iterator sections, targetSection; + ConfigEntMap::iterator entry; + string secName; + const char * modDesc; + string nodeName; + string targetVersion; + string sourceVersion; + bool cipher; + bool showLocked = LockedModules1->Checked; + + SWMgr *mgr; + + if (tree == localTree) { + if (localMgr) + delete localMgr; + mgr = localMgr = new SWMgr(sourceConf); + } + else { + + InstallSourceTab *ist = (InstallSourceTab *) tree->Parent->Controls[0]; + if (ist->mgr) + delete ist->mgr; + mgr = ist->mgr = new SWMgr(sourceConf); + } + + tree->Items->Clear(); + + if (!mgr->configPath) + return; + + for (sections = mgr->config->Sections.begin(); sections != mgr->config->Sections.end(); sections++) { + + cipher = false; + + if (!strcmp(sections->first.c_str(), "Globals")) // skip [Globals] + continue; + + entry = sections->second.find("CipherKey"); + if (entry != sections->second.end()) { + if (showLocked) + cipher = true; + else continue; + } + + mods = mgr->Modules.find(sections->first.c_str()); + if (mods != mgr->Modules.end()) + secName = mods->second->Type(); + else { + secName = "Other"; + } + + string misc1 = ((entry = sections->second.find("Category")) != sections->second.end()) ? (*entry).second : (string)""; + if (misc1.length() > 0) + secName = misc1; + + entry = sections->second.find("Description"); + if (entry != sections->second.end()) + modDesc = entry->second.c_str(); + else modDesc = ""; + + + targetVersion = "0.0"; + sourceVersion = "1.0"; + + entry = sections->second.find("Version"); + if (entry != sections->second.end()) + sourceVersion = entry->second.c_str(); + + targetSection = manager->config->Sections.find(sections->first); + if (targetSection != manager->config->Sections.end()) { + targetVersion = "1.0"; + entry = targetSection->second.find("Version"); + if (entry != targetSection->second.end()) + targetVersion = entry->second; + } + + if (VersionInfo(sourceVersion.c_str()) > VersionInfo(targetVersion.c_str())) { + for (node = tree->Items->GetFirstNode(); node; node = node->getNextSibling()) { + if (!strcmp(node->Text.c_str(), secName.c_str())) { + break; + } + } + + if (!node) { // Add Section + if (!strncmp(secName.c_str(), "Bibl", 4)) // If Bibles, put first in list + node = tree->Items->AddChildFirst(0, secName.c_str()); + else node = tree->Items->AddChild(0, secName.c_str()); + node->ImageIndex = 0; + } + nodeName = "[" + sections->first + "] " + modDesc; + node = tree->Items->AddChildObject(node, nodeName.c_str(), (void *) sections->first.c_str()); + if (VersionInfo(targetVersion.c_str()) < VersionInfo("1.0")) { + node->ImageIndex = 1; + node->SelectedIndex = 1; + } + else { + node->ImageIndex = 2; + node->SelectedIndex = 2; + } + if (cipher) { + node->ImageIndex += 2; + node->SelectedIndex += 2; + } + node->StateIndex = 0; + } + } + for (node = tree->Items->GetFirstNode(); node; node = node->getNextSibling()) + node->Expand(true); + node = tree->Items->GetFirstNode(); + if (node) + node->MakeVisible(); +} + + +void __fastcall TMainForm::Button5Click(TObject *Sender) +{ + TTreeView *tree; + for (int i = 0; i < PageControl1->ActivePage->ControlCount; i++) { + if (PageControl1->ActivePage->Controls[i]->ClassNameIs("TTreeView")) { + tree = (TTreeView*)(PageControl1->ActivePage->Controls[i]); + break; + } + } + TTreeNode *node = tree->Selected; + if (node) { + if (node->Parent) { + if (node->StateIndex == 1) + node->StateIndex = 0; //node->StateIndex; + else node->StateIndex = 1; + tree->Repaint(); + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TMainForm::localTreeDblClick(TObject *Sender) +{ + Button5Click(Sender); +} +//--------------------------------------------------------------------------- + +int TMainForm::selectAll(TTreeView *tree, bool sel) +{ + TTreeNode *node; + TTreeNode *node2; + int retCount = 0; + + for (node = tree->Items->GetFirstNode(); node; node = node->getNextSibling()) { + for (node2 = node->getFirstChild(); node2; node2 = node2->getNextSibling()) { + if (node2->StateIndex == 1) { + if (!sel) { + node2->StateIndex = 0; //node2->StateIndex; + retCount++; + } + } + else { + if (sel) { + node2->StateIndex = 1; + retCount++; + } + } + } + } + return retCount; +} + + +void __fastcall TMainForm::Button6Click(TObject *Sender) // SELECT ALL +{ + TTreeView *tree; + for (int i = 0; i < PageControl1->ActivePage->ControlCount; i++) { + if (PageControl1->ActivePage->Controls[i]->ClassNameIs("TTreeView")) { + tree = (TTreeView*)(PageControl1->ActivePage->Controls[i]); + break; + } + } + if (!selectAll(tree, true)) + selectAll(tree, false); + tree->Repaint(); +} +//--------------------------------------------------------------------------- + +void __fastcall TMainForm::Image1Click(TObject *Sender) +{ + ShellExecute(this->Handle, "open", "http://www.crosswire.org", NULL, NULL, SW_SHOWNORMAL); + +} +//--------------------------------------------------------------------------- + +int TMainForm::removeModule(const char *modName) +{ + SectionMap::iterator module; + ConfigEntMap::iterator fileBegin; + ConfigEntMap::iterator fileEnd, entry; + + module = manager->config->Sections.find(modName); + + if (module != manager->config->Sections.end()) { + entry = module->second.find("CipherKey"); + if (entry != module->second.end()) + CipherForm->cipherEdit->Text = entry->second.c_str(); + + fileBegin = module->second.lower_bound("File"); + fileEnd = module->second.upper_bound("File"); + + if (fileBegin != fileEnd) { // remove each file + while (fileBegin != fileEnd) { + //remove file + remove(fileBegin->second.c_str()); + fileBegin++; + } + } + else { //remove all files in DataPath directory + + DIR *dir; + struct dirent *ent; + ConfigEntMap::iterator entry; + string modDir; + string modFile; + + entry = module->second.find("DataPath"); + if (entry != module->second.end()) { + modDir = entry->second.c_str(); + entry = module->second.find("ModDrv"); + if (entry != module->second.end()) { + if (!strcmp(entry->second.c_str(), "RawLD") || !strcmp(entry->second.c_str(), "RawLD4") || !strcmp(entry->second.c_str(), "zLD") || !strcmp(entry->second.c_str(), "RawGenBook") || !strcmp(entry->second.c_str(), "zGenBook")) { + char *buf = new char [ strlen(modDir.c_str()) + 1 ]; + + strcpy(buf, modDir.c_str()); + int end = strlen(buf) - 1; + while (end) { + if (buf[end] == '/') + break; + end--; + } + buf[end] = 0; + modDir = buf; + delete [] buf; + } + } + + if (dir = opendir(modDir.c_str())) { + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) { + modFile = modDir; + modFile += "/"; + modFile += ent->d_name; + remove(modFile.c_str()); + } + } + closedir(dir); + } + if (dir = opendir(manager->configPath)) { // find and remove .conf file + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) { + modFile = manager->configPath; + modFile += "/"; + modFile += ent->d_name; + SWConfig *config = new SWConfig(modFile.c_str()); + if (config->Sections.find(modName) != config->Sections.end()) { + delete config; + remove(modFile.c_str()); + } + else delete config; + } + } + closedir(dir); + } + } + } + return 0; + } + return 1; +} + + +int TMainForm::createParent(const char *pName) +{ + char *buf = new char [ strlen(pName) + 1 ]; + int retCode = 0; + + strcpy(buf, pName); + int end = strlen(buf) - 1; + while (end) { + if (buf[end] == '/') + break; + end--; + } + buf[end] = 0; + if (strlen(buf)>0) { + if (access(buf, 02)) { // not exists with write access? + if ((retCode = mkdir(buf))) { + createParent(buf); + retCode = mkdir(buf); + } + } + } + else retCode = -1; + delete [] buf; + return retCode; +} + + +int TMainForm::createPathAndFile(const char *fName) +{ + int fd; + + fd = open(fName, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE); + if (fd < 1) { + createParent(fName); + fd = open(fName, O_CREAT|O_WRONLY|O_BINARY, S_IREAD|S_IWRITE); + } + return fd; +} + + +int TMainForm::copyFileToCWD(const char *sourceDir, const char *fName) +{ + string sourcePath = sourceDir; + sourcePath += fName; + + string dest; + dest = manager->prefixPath; + if ((manager->prefixPath[strlen(manager->prefixPath)-1] != '\\') && ( manager->prefixPath[strlen(manager->prefixPath)-1] != '/')) + dest += "/"; + dest += fName; + + return copyFile(sourcePath.c_str(), dest.c_str()); +} + + +int TMainForm::copyFile(const char *sourceFile, const char *targetFile) +{ + int sfd, dfd, len; + char buf[4096]; + + if ((sfd = open(sourceFile, O_RDONLY|O_BINARY)) < 1) + return -1; + if ((dfd = createPathAndFile(targetFile)) < 1) + return -1; + + do { + len = read(sfd, buf, 4096); + write(dfd, buf, len); + } + while(len == 4096); + close(dfd); + close(sfd); + + return 0; +} + + +int TMainForm::installModule(const char *modName, InstallSourceTab *ist) +{ + SectionMap::iterator module, section; + ConfigEntMap::iterator fileBegin; + ConfigEntMap::iterator fileEnd; + ConfigEntMap::iterator entry; + string sourceDir; + string buffer; + bool aborted = false; + bool cipher = false; + + if (ist) + sourceDir = "./sources/" + ist->Source; + else sourceDir = getLocalDir(); + + SWMgr mgr(sourceDir.c_str()); + + module = mgr.config->Sections.find(modName); + + if (module != mgr.config->Sections.end()) { + + entry = module->second.find("CipherKey"); + if (entry != module->second.end()) + cipher = true; + + fileEnd = module->second.upper_bound("File"); + fileBegin = module->second.lower_bound("File"); + + if (fileBegin != fileEnd) { // copy each file + if (ist) { + while (fileBegin != fileEnd) { // ftp each file first + buffer = sourceDir + "/" + fileBegin->second; + if (FTPCopy(ist, fileBegin->second.c_str(), buffer.c_str())) { + aborted = true; + break; // user aborted + } + fileBegin++; + } + fileBegin = module->second.lower_bound("File"); + } + + if (!aborted) { + // DO THE INSTALL + while (fileBegin != fileEnd) { + copyFileToCWD(sourceDir.c_str(), fileBegin->second.c_str()); + fileBegin++; + } + } + //--------------- + + if (ist) { + fileBegin = module->second.lower_bound("File"); + while (fileBegin != fileEnd) { // delete each tmp ftp file + buffer = sourceDir + "/" + fileBegin->second; + remove(buffer.c_str()); + fileBegin++; + } + } + } + else { //copy all files in DataPath directory + DIR *dir; + struct dirent *ent; + ConfigEntMap::iterator entry; + string modDir; + string modFile; + string sourceOrig = sourceDir; + + entry = module->second.find("DataPath"); + if (entry != module->second.end()) { + modDir = entry->second.c_str(); + entry = module->second.find("ModDrv"); + if (entry != module->second.end()) { + if (!strcmp(entry->second.c_str(), "RawLD") || !strcmp(entry->second.c_str(), "RawLD4") || !strcmp(entry->second.c_str(), "zLD") || !strcmp(entry->second.c_str(), "RawGenBook") || !strcmp(entry->second.c_str(), "zGenBook")) { + char *buf = new char [ strlen(modDir.c_str()) + 1 ]; + + strcpy(buf, modDir.c_str()); + int end = strlen(buf) - 1; + while (end) { + if (buf[end] == '/') + break; + end--; + } + buf[end] = 0; + modDir = buf; + delete [] buf; + } + } + + if (ist) { + buffer = sourceDir + "/" + modDir; + if (FTPCopy(ist, modDir.c_str(), buffer.c_str(), true)) { + aborted = true; // user aborted + } + } + sourceDir += "/"; + sourceDir += modDir; + if (!aborted) { + if (dir = opendir(sourceDir.c_str())) { + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) { + modFile = modDir; + modFile += "/"; + modFile += ent->d_name; + copyFileToCWD(sourceOrig.c_str(), modFile.c_str()); + } + } + closedir(dir); + } + } + if (ist) { // delete tmp ftp files + if (dir = opendir(sourceDir.c_str())) { + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) { + modFile = sourceOrig + "/" + modDir; + modFile += "/"; + modFile += ent->d_name; + remove(modFile.c_str()); + } + } + closedir(dir); + } + } + sourceDir = sourceOrig; + sourceDir += "/mods.d/"; + if (!aborted) { + if (dir = opendir(sourceDir.c_str())) { // find and copy .conf file + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) { + modFile = sourceDir; + modFile += ent->d_name; + SWConfig *config = new SWConfig(modFile.c_str()); + if (config->Sections.find(modName) != config->Sections.end()) { + delete config; + string targetFile = manager->configPath; //"./mods.d/"; + targetFile += "/"; + targetFile += ent->d_name; + copyFile(modFile.c_str(), targetFile.c_str()); + if (cipher) { + CipherForm->modName = modName; + CipherForm->confFile = targetFile; + if (CipherForm->ShowModal() == mrCancel) { + removeModule(modName); + aborted = true; + } + } + } + else delete config; + } + } + closedir(dir); + } + } + } + } + return (aborted) ? -1 : 0; + } + return 1; +} + + +void TMainForm::fillAllSourceTrees() +{ + fillSourceTree(getLocalDir(), localTree); + for (int i = 1; i < PageControl1->PageCount; i++) { + InstallSourceTab *ist = (InstallSourceTab *) MainForm->PageControl1->Pages[i]->Controls[0]; + string parent = "./sources/" + ist->Source; + fillSourceTree(parent.c_str(), ist->tree); + } +} + + +void __fastcall TMainForm::Button4Click(TObject *Sender) // REMOVE MODULE +{ + TTreeNode *node = installTree->Selected; + if (node) { + if (node->Parent) { + removeModule((const char *)node->Data); + delete manager; + manager = new SWMgr(); + fillInstallTree(); + fillAllSourceTrees(); + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TMainForm::Button2Click(TObject *Sender) // INSTALL +{ + TTreeNode *node; + int count = 0; + int abort = 0; + + class TWaitCursor { + public: + TWaitCursor() : oldc(Screen->Cursor) { Screen->Cursor = crHourGlass; } + ~TWaitCursor() { Screen->Cursor = oldc; } + private: + TCursor oldc; + } wait; // show hourglass + + TTreeView *tree; + for (int i = 0; i < PageControl1->ActivePage->ControlCount; i++) { + if (PageControl1->ActivePage->Controls[i]->ClassNameIs("TTreeView")) { + tree = (TTreeView*)(PageControl1->ActivePage->Controls[i]); + break; + } + } + + for (node = tree->Items->GetFirstNode(); node; node = node->GetNext()) { + if (node->StateIndex == 1) + count++; + } // do true progress bar + + if (!count) { + MessageBox(this->WindowHandle, "Please first choose which modules you would like to install by double-clicking a module in the 'Available' tree.", "Please select modules first.", MB_OK); + return; // if nothing is selected, do nothing + } + + progressBar->Max = count; + progressBar->Position = 0; + + for (node = tree->Items->GetFirstNode(); node; node = node->GetNext()) { + if (node->StateIndex == 1) { // if selected for install + CipherForm->cipherEdit->Text = ""; + if ((node->ImageIndex == 2) || (node->ImageIndex == 4)) { // if this is an upgrade + removeModule((const char *)node->Data); + } + // install module + statusBar->Caption = "Installing: " + node->Text + "..."; + statusBar->Repaint(); + if (tree == localTree) + abort = installModule((const char *)node->Data); + else abort = installModule((const char *)node->Data, (InstallSourceTab *) PageControl1->ActivePage->Controls[0]); + if (abort) + break; + progressBar->Position++; + } + } + delete manager; + manager = new SWMgr(); + fillInstallTree(); + fillAllSourceTrees(); + statusBar->Caption = ""; + progressBar->Position = 0; +} + + +int TMainForm::FTPCopy(InstallSourceTab *ist, const char *src, const char *dest, bool dirTransfer, const char *suffix) +{ + StatusForm->ist = ist; + StatusForm->src = src; + StatusForm->dest = dest; + StatusForm->suffix = suffix; + StatusForm->dirTransfer = dirTransfer; + StatusForm->passive = passive; + Application->ProcessMessages(); + if (StatusForm->ShowModal() == mrCancel) + return -1; + else return 0; +} + + +void __fastcall TMainForm::RefreshRemoteSource(TObject *Sender) +{ + InstallSourceTab *ist = (InstallSourceTab *) MainForm->PageControl1->ActivePage->Controls[0]; + DIR *dir; + struct dirent *ent; + ConfigEntMap::iterator entry; + string modDir; + string modFile; + string root = "./sources/"; + root += ist->Source.c_str(); + string target = root + "/mods.d"; + + if (dir = opendir(target.c_str())) { + rewinddir(dir); + while ((ent = readdir(dir))) { + if ((strcmp(ent->d_name, ".")) && (strcmp(ent->d_name, ".."))) { + modFile = target; + modFile += "/"; + modFile += ent->d_name; + remove(modFile.c_str()); + } + } + closedir(dir); + } + + + string archive = root + "/mods.d.tar.gz"; + if (!FTPCopy(ist, "mods.d.tar.gz", archive.c_str(), false)) { + int fd = open(archive.c_str(), O_RDONLY|O_BINARY); + untargz(fd, root.c_str()); + close(fd); + } + else FTPCopy(ist, "mods.d", target.c_str(), true, ".conf"); + + target = "./sources/"; + target += ist->Source.c_str(); + + fillSourceTree(target.c_str(), ist->tree); +} + + + +void __fastcall TMainForm::SpeedButton1Click(TObject *Sender) +{ + InfoForm->Caption = "W A R N I N G"; + InfoForm->info = "\\qc {\\b \\fs20 -=+* WARNING *+=- -=+* WARNING *+=-}\\par\\par\\pard "; + InfoForm->info += "Although Install Manager provides a convenient way for installing and upgrading SWORD components, it also uses a systematic method for accessing sites which gives packet sniffers a target to lock into for singling out users. \\par\\par "; + InfoForm->info += "\\b\\qc IF YOU LIVE IN A PERSECUTED COUNTRY AND DO NOT WISH TO RISK DETECTION, YOU SHOULD *NOT* USE INSTALL MANAGER'S REMOTE SOURCE FEATURES."; + InfoForm->ShowModal(); + if (RemoteMntForm->ShowModal() == mrOk) { + delete installConf; + installConf = new SWConfig("./InstallMgr.conf"); + + refreshPageControl(); + } +} + +void __fastcall TMainForm::SpeedButton5Click(TObject *Sender) +{ + TTreeView *tree; + InstallSourceTab *ist = 0; + SectionMap::iterator module; + ConfigEntMap::iterator entry, entryEnd; + string sourceDir; + + if (PageControl1->ActivePage != PageControl1->Pages[0]) { + ist = (InstallSourceTab *) PageControl1->ActivePage->Controls[0]; + tree = ist->tree; + } + else tree = localTree; + + TTreeNode *node = tree->Selected; + if (node) { + if (node->Parent) { + if (ist) + sourceDir = "./sources/" + ist->Source; + else sourceDir = getLocalDir(); + SWMgr *mgr = new SWMgr(sourceDir.c_str()); + + module = mgr->config->Sections.find((const char *)node->Data); + + if (module != mgr->config->Sections.end()) { + string targetVersion = "0.0"; + string sourceVersion = "1.0"; + SectionMap::iterator targetSection; + + entry = module->second.find("Version"); + if (entry != module->second.end()) + sourceVersion = entry->second.c_str(); + + targetSection = manager->config->Sections.find(module->first); + if (targetSection != manager->config->Sections.end()) { + targetVersion = "1.0"; + entry = targetSection->second.find("Version"); + if (entry != targetSection->second.end()) + targetVersion = entry->second; + } + if (VersionInfo(targetVersion.c_str()) < VersionInfo("1.0")) { + InfoForm->info = "\\pard{\\b * Additional Module Available for Install. } \\par "; + } + else { + InfoForm->info = "\\pard{\\b + Upgraded Module Available for Install.}\\par\\tab Current Version: \\tab " + targetVersion + " \\par\\tab Upgrade Version:\\tab " + sourceVersion + " \\par "; + bool changes = false; + for (entry = module->second.begin(); entry != module->second.end(); entry++) { + if (!strncmp(entry->first.c_str(), "History_", 8)) { + if (VersionInfo(&entry->first.c_str()[8]) > VersionInfo(targetVersion.c_str())) { + if (!changes) { + changes = true; + InfoForm->info += "\\par{\\b Changes: }\\par "; + } + InfoForm->info += "\\tab "; + InfoForm->info += entry->second.c_str(); + InfoForm->info += "\\par "; + } + } + } + } + + entry = module->second.find("About"); + if (entry != module->second.end()) { + InfoForm->info += "\\par{\\b About: } \\par\\par "; + InfoForm->info += entry->second.c_str(); + } + InfoForm->Caption = "Module Information"; + InfoForm->ShowModal(); + } + delete mgr; + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TMainForm::Exit1Click(TObject *Sender) +{ + Close(); +} +//--------------------------------------------------------------------------- + + +void TMainForm::deleteAllModules() { + + SWMgr *mgr = new SWMgr(); + + + int count = mgr->Modules.size(); + + if (!count) + return; + + UninstallForm->Show(); + UninstallForm->ProgressBar1->Max = count; + UninstallForm->ProgressBar1->Position = 0; + + ModMap::iterator it; + for (it = mgr->Modules.begin(); it != mgr->Modules.end(); it++) { + string label = "Uninstalling: ["; + label += it->second->Name(); + label += "] "; + label += it->second->Description(); + UninstallForm->Label1->Caption = label.c_str(); + UninstallForm->Label1->Repaint(); + removeModule(it->second->Name()); + UninstallForm->ProgressBar1->Position = UninstallForm->ProgressBar1->Position + 1; + UninstallForm->ProgressBar1->Repaint(); + } + delete mgr; + UninstallForm->Hide(); + return; +} +void __fastcall TMainForm::FormShow(TObject *Sender) +{ + for (int i=0;i<=ParamCount();i++) { + if (LowerCase(ParamStr(i)) == "-uninstall") { + deleteAllModules(); + Application->Terminate(); + } + } + +} +//--------------------------------------------------------------------------- + +void __fastcall TMainForm::LockedModules1Click(TObject *Sender) { + LockedModules1->Checked = !(LockedModules1->Checked); + + if (LockedModules1->Checked) { + InfoForm->Caption = "About Locked Modules"; + InfoForm->info = "\\qc {\\b \\fs20 About Locked Modules}\\par\\par\\pard "; + + InfoForm->info += "Unfortunately, we are unable to legally provide these modules to the general public at this time. We are making attempts to gain permission from the copyright holders, but until such an agreement is arranged, these modules are only available to our developers and testers. We hope to be able to provide some of these to you soon. \\par\\par\\pard "; + InfoForm->info += "If you would like to contribute to the project by contacting a publisher seeking distribution permission for CrossWire, your efforts would be very appreciated-- especially in regard to non-English texts. Please subscribe to our developers' forum per instructions on our website, following the [Mailing Lists] link, and post a message stating how you would like to help. Thank you. \\par\\par\\pard "; + InfoForm->info += "\t-CrossWire Bible Society. "; + InfoForm->ShowModal(); + } + fillAllSourceTrees(); +} +//--------------------------------------------------------------------------- + +void __fastcall TMainForm::Contents1Click(TObject *Sender) +{ + SWConfig optionsconf("options.conf"); + string helpDir; + ConfigEntMap::iterator it = optionsconf.Sections["Help"].find("Directory"); + if (it != optionsconf.Sections["Help"].end()) + helpDir = (*it).second; + else helpDir = ".\\help"; + + string helpExe = helpDir + "\\Sword.chm::modulesh.html#instmgr"; + ShellExecute(this->Handle, "open", "hh", helpExe.c_str(), NULL, SW_SHOWNORMAL); +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/InstallMgr/MainFrm.h b/apps/windoze/CBuilder5/InstallMgr/MainFrm.h new file mode 100644 index 0000000..47fe65c --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/MainFrm.h @@ -0,0 +1,146 @@ +//--------------------------------------------------------------------------- +#ifndef MainFrmH +#define MainFrmH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <Dialogs.hpp> +#include <Menus.hpp> +#include <ExtCtrls.hpp> +#include <MPlayer.hpp> +#include <Graphics.hpp> +#include <ComCtrls.hpp> +#include <swmgr.h> +#include <ImgList.hpp> +#include <Buttons.hpp> +#include <NMFtp.hpp> +#include <NMHttp.hpp> +#include <Psock.hpp> + + +class VersionInfo { + public: + int major, minor, minor2, minor3; + + VersionInfo(const char *version); + int compare(const VersionInfo &vi) const; + bool operator>(const VersionInfo &vi) const {return (compare(vi) > 0);} + bool operator<(const VersionInfo &vi) const {return (compare(vi) < 0);} + bool operator==(const VersionInfo &vi) const {return (compare(vi) == 0);} +}; + + +class InstallSourceTab : public TControl { +public: + __fastcall InstallSourceTab(TComponent *Owner, const char *confEnt, const char *type); + __fastcall ~InstallSourceTab(); + string Type; + string Source; + string Directory; + string Caption; + TTreeView *tree; + SWMgr *mgr; +}; + + +//--------------------------------------------------------------------------- +class TMainForm : public TForm +{ + class TWebThread; + friend class TWebThread; +__published: // IDE-managed Components + TMainMenu *MainMenu1; + TMenuItem *File1; + TMenuItem *Exit1; + TMenuItem *Option1; + TMenuItem *LocalPath1; + TOpenDialog *localPathDlg; + TPanel *Panel1; + TMediaPlayer *MediaPlayer1; + TImage *Image1; + TPanel *pnlAvailable; + TPanel *pnlInstalled; + TSplitter *Splitter1; + TPanel *Panel2; + TPanel *Panel5; + TPageControl *PageControl1; + TTabSheet *TabSheet1; + TTreeView *localTree; + TPanel *Panel8; + TPanel *Panel7; + TPanel *Panel6; + TTreeView *installTree; + TTimer *Timer1; + TLabel *Label1; + TImageList *ImageList1; + TPanel *Panel3; + TImageList *ImageList2; + TPanel *statusBar; + TPanel *Panel4; + TProgressBar *progressBar; + TSpeedButton *SpeedButton2; + TImage *Image2; + TLabel *Label2; + TMenuItem *ManageRemoteSources1; + TSpeedButton *SpeedButton1; + TSpeedButton *SpeedButton3; + TSpeedButton *SpeedButton4; + TSpeedButton *SpeedButton5; + TSpeedButton *SpeedButton6; + TSpeedButton *SpeedButton7; + TMenuItem *View1; + TMenuItem *LockedModules1; + TMenuItem *Help1; + TMenuItem *Contents1; + void __fastcall LocalPath1Click(TObject *Sender); + void __fastcall FormCreate(TObject *Sender); + void __fastcall Button5Click(TObject *Sender); + void __fastcall localTreeDblClick(TObject *Sender); + void __fastcall Button6Click(TObject *Sender); + void __fastcall Image1Click(TObject *Sender); + void __fastcall Button4Click(TObject *Sender); + void __fastcall Button2Click(TObject *Sender); + void __fastcall SpeedButton1Click(TObject *Sender); + void __fastcall SpeedButton5Click(TObject *Sender); + void __fastcall Exit1Click(TObject *Sender); + void __fastcall FormShow(TObject *Sender); + void __fastcall LockedModules1Click(TObject *Sender); + void __fastcall Contents1Click(TObject *Sender); + +private: // User declarations + + SWMgr *manager; + SWConfig *installConf; + const char *getLocalDir(); + void setLocalDir(const char *idir); + void refreshPageControl(); + void addSource(InstallSourceTab *ist); + void fillAllSourceTrees(); + void deleteAllModules(); + +public: // User declarations + __fastcall TMainForm(TComponent* Owner); + __fastcall ~TMainForm(); + void __fastcall RefreshRemoteSource(TObject *Sender); + int selectAll(TTreeView *tree, bool sel); + int removeModule(const char *modName); + int installModule(const char *modName, InstallSourceTab *ist = 0); + static int createParent(const char *pName); + int createPathAndFile(const char *fName); + int copyFile(const char *sourceFile, const char *targetFile); + int copyFileToCWD(const char *sourceDir, const char *fName); + int FTPCopy(InstallSourceTab *ist, const char *src, const char *dest, bool dirTransfer = false, const char *suffix = ""); + SWMgr *localMgr; + bool passive; + +protected: + virtual void fillInstallTree(); + virtual void fillSourceTree(const char *sourceConf, TTreeView *tree); +}; + +//--------------------------------------------------------------------------- +extern PACKAGE TMainForm *MainForm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.cpp b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.cpp new file mode 100644 index 0000000..148a7fd --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.cpp @@ -0,0 +1,160 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "RemoteMntFrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" + +TRemoteMntForm *RemoteMntForm; + + +class TRemoteSource : public TObject { +public: + string name; + string machine; + string dir; + TRemoteSource(const char *confEnt) { + char *buf = new char [ strlen(confEnt) + 1 ]; + + strcpy(buf, confEnt); + + name = strtok(buf, "|"); + machine = strtok(0, "|"); + dir = strtok(0, "|"); + delete [] buf; + } + string getConfEnt() { + return name +"|" + machine + "|" + dir; + } +}; + + +//--------------------------------------------------------------------------- +__fastcall TRemoteMntForm::TRemoteMntForm(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void __fastcall TRemoteMntForm::FormShow(TObject *Sender) +{ + ConfigEntMap::iterator loop, end; + config = new SWConfig("./InstallMgr.conf"); + ListBox1->Clear(); + loop = config->Sections["Sources"].lower_bound("FTPSource"); + end = config->Sections["Sources"].upper_bound("FTPSource"); + while (loop != end) { + TRemoteSource *rs = new TRemoteSource(loop->second.c_str()); + ListBox1->Items->AddObject(rs->name.c_str(), rs); + loop++; + } + ListBox1->ItemIndex = 0; + ListBox1Click(0); + CheckBox1->Checked = (!stricmp((*config)["General"]["PassiveFTP"].c_str(), "true")); + checkDisabled(); +} + + +void TRemoteMntForm::checkDisabled() { + bool enabled = ListBox1->Items->Count; + NameEdit->Enabled = enabled; + MachineEdit->Enabled = enabled; + DirEdit->Enabled = enabled; +} + + +//--------------------------------------------------------------------------- +void __fastcall TRemoteMntForm::FormClose(TObject *Sender, + TCloseAction &Action) +{ + delete config; +} + + +void __fastcall TRemoteMntForm::SpeedButton4Click(TObject *Sender) +{ + ModalResult = mrCancel; +} + + +void __fastcall TRemoteMntForm::ListBox1Click(TObject *Sender) +{ + if (ListBox1->ItemIndex >= 0) { + TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex]; + + NameEdit->Text = rs->name.c_str(); + MachineEdit->Text = rs->machine.c_str(); + DirEdit->Text = rs->dir.c_str(); + } + else { + NameEdit->Text = ""; + MachineEdit->Text = ""; + DirEdit->Text = ""; + } +} + + +void __fastcall TRemoteMntForm::NameEditChange(TObject *Sender) +{ + if (ListBox1->ItemIndex < 0) + return; + TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex]; + rs->name = NameEdit->Text.c_str(); + ListBox1->Items->Strings[ListBox1->ItemIndex] = rs->name.c_str(); +} + + +void __fastcall TRemoteMntForm::MachineEditChange(TObject *Sender) +{ + if (ListBox1->ItemIndex < 0) + return; + TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex]; + rs->machine = MachineEdit->Text.c_str(); +} + + +void __fastcall TRemoteMntForm::DirEditChange(TObject *Sender) +{ + if (ListBox1->ItemIndex < 0) + return; + TRemoteSource *rs = (TRemoteSource *)ListBox1->Items->Objects[ListBox1->ItemIndex]; + rs->dir = DirEdit->Text.c_str(); +} + +void __fastcall TRemoteMntForm::SpeedButton2Click(TObject *Sender) +{ + if (ListBox1->ItemIndex < 0) + return; + int delItem = ListBox1->ItemIndex; + ListBox1->Items->Delete(delItem); + ListBox1->ItemIndex = (delItem < ListBox1->Items->Count) ? delItem : delItem - 1; + checkDisabled(); + ListBox1Click(0); +} +//--------------------------------------------------------------------------- + +void __fastcall TRemoteMntForm::SpeedButton1Click(TObject *Sender) +{ + TRemoteSource *rs = new TRemoteSource("[New Remote Site]|ftp.domain.org|/pub/sword/raw/"); + ListBox1->ItemIndex = ListBox1->Items->AddObject(rs->name.c_str(), rs); + + checkDisabled(); + ListBox1Click(0); +} +//--------------------------------------------------------------------------- + +void __fastcall TRemoteMntForm::SpeedButton3Click(TObject *Sender) +{ + TRemoteSource *rs; + config->Sections["Sources"].erase("FTPSource"); + for (int i = 0; i < ListBox1->Items->Count; i++) { + rs = (TRemoteSource *)ListBox1->Items->Objects[i]; + config->Sections["Sources"].insert(ConfigEntMap::value_type("FTPSource", rs->getConfEnt().c_str())); + } + (*config)["General"]["PassiveFTP"] = (CheckBox1->Checked) ? "true" : "false"; + config->Save(); + ModalResult = mrOk; +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.h b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.h new file mode 100644 index 0000000..67c825d --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/RemoteMntFrm.h @@ -0,0 +1,52 @@ +//--------------------------------------------------------------------------- +#ifndef RemoteMntFrmH +#define RemoteMntFrmH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <Buttons.hpp> +#include <ExtCtrls.hpp> +#include <swconfig.h> +//--------------------------------------------------------------------------- +class TRemoteMntForm : public TForm +{ +__published: // IDE-managed Components + TPanel *Panel1; + TPanel *Panel2; + TPanel *Panel3; + TListBox *ListBox1; + TSpeedButton *SpeedButton1; + TSpeedButton *SpeedButton2; + TEdit *NameEdit; + TEdit *MachineEdit; + TEdit *DirEdit; + TPanel *Panel4; + TSpeedButton *SpeedButton3; + TSpeedButton *SpeedButton4; + TLabel *Label1; + TLabel *Label2; + TLabel *Label3; + TCheckBox *CheckBox1; + void __fastcall FormShow(TObject *Sender); + void __fastcall FormClose(TObject *Sender, TCloseAction &Action); + void __fastcall NameEditChange(TObject *Sender); + void __fastcall SpeedButton4Click(TObject *Sender); + void __fastcall ListBox1Click(TObject *Sender); + void __fastcall MachineEditChange(TObject *Sender); + void __fastcall DirEditChange(TObject *Sender); + void __fastcall SpeedButton2Click(TObject *Sender); + void __fastcall SpeedButton1Click(TObject *Sender); + void __fastcall SpeedButton3Click(TObject *Sender); +private: // User declarations + SWConfig *config; + void checkDisabled(); + +public: // User declarations + __fastcall TRemoteMntForm(TComponent* Owner); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TRemoteMntForm *RemoteMntForm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.cpp b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.cpp new file mode 100644 index 0000000..0abc9da --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.cpp @@ -0,0 +1,273 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "StatusFrm.h" +#include "MainFrm.h" +//--------------------------------------------------------------------------- +#pragma package(smart_init) +//#pragma link "IdBaseComponent" +//#pragma link "IdComponent" +//#pragma link "IdFTP" +//#pragma link "IdTCPClient" +//#pragma link "IdTCPConnection" +#pragma resource "*.dfm" +TStatusForm *StatusForm; + + + + +struct FtpFile { + char *filename; + FILE *stream; +}; + +int my_fwrite(void *buffer, size_t size, size_t nmemb, void *stream) +{ + struct FtpFile *out=(struct FtpFile *)stream; + if(out && !out->stream) { + /* open file for writing */ + out->stream=fopen(out->filename, "wb"); + if(!out->stream) + return -1; /* failure, can't open file to write */ + } + return fwrite(buffer, size, nmemb, out->stream); +} + + + + + +//--------------------------------------------------------------------------- +__fastcall TStatusForm::TStatusForm(TComponent* Owner) + : TForm(Owner) { + suffix = ""; + passive = false; + curl_global_init(CURL_GLOBAL_DEFAULT); +} + + +__fastcall TStatusForm::~TStatusForm() { + curl_global_cleanup(); +} + + +//--------------------------------------------------------------------------- +void __fastcall TStatusForm::FormShow(TObject *Sender) +{ + abort = false; + ftpThread = new TFTPThread(ist, src.c_str(), dest.c_str(), dirTransfer, passive, true, suffix.c_str()); + ftpThread->OnTerminate = Cleanup; + ftpThread->Resume(); +} +//--------------------------------------------------------------------------- +__fastcall TStatusForm::TFTPThread::TFTPThread(InstallSourceTab *iist, const char *isrc, const char *idest, bool idirTransfer, bool CreateSuspended, bool ipassive, const char *isuffix) + : TThread(CreateSuspended) +{ + ist = iist; + src = isrc; + dest = idest; + suffix = isuffix; + dirTransfer = idirTransfer; + Priority = tpNormal; + passive = ipassive; + FreeOnTerminate = true; + Synchronize((TThreadMethod)&CreateFTPObject); +} + +__fastcall TStatusForm::TFTPThread::~TFTPThread() +{ +} + + +void __fastcall TStatusForm::TFTPThread::Execute() +{ + CURL *curl; + CURLcode res; + struct FtpFile ftpfile={ + "curl.tar.gz", /* name to store the file as if succesful */ + NULL + }; + + Synchronize((TThreadMethod)&PreConnect); + StatusForm->ftpCon->Host = ist->Source.c_str(); + StatusForm->ftpCon->Username = "ftp"; + StatusForm->ftpCon->Password = "installmgr@user.com"; + StatusForm->ftpCon->Passive = passive; + + + curl = curl_easy_init(); + + if (curl) { + /* Get curl 7.9.2 from sunet.se's FTP site: */ + curl_easy_setopt(curl, CURLOPT_URL, + "ftp://ftp.sunet.se/pub/www/utilities/curl/curl-7.9.2.tar.gz"); + /* Define our callback to get called when there's data to be written */ + curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, my_fwrite); + /* Set a pointer to our struct to pass to the callback */ + curl_easy_setopt(curl, CURLOPT_FILE, &ftpfile); + + /* Switch on full protocol/debug output */ + curl_easy_setopt(curl, CURLOPT_VERBOSE, TRUE); + + res = curl_easy_perform(curl); + + /* always cleanup */ + curl_easy_cleanup(curl); + + if(CURLE_OK != res) { + /* we failed */ + fprintf(stderr, "curl told us %d\n", res); + } + } + + if(ftpfile.stream) + fclose(ftpfile.stream); /* close the local file */ + +/* + try { + StatusForm->ftpCon->Connect(true, -1); + StatusForm->ftpCon->TransferType = ftBinary; + StatusForm->ftpCon->ChangeDir(ist->Directory.c_str()); + } + catch(...) { + MessageBox(0, "Can't connect. Please check your configuration.", "Connection Error", MB_OK); + StatusForm->Button1Click(0); // abort thread + } + + if (!Terminated) { + if (dirTransfer) { + StatusForm->ftpCon->ChangeDir(src.c_str()); + TStringList *dirText = new TStringList(); + StatusForm->ftpCon->List(dirText, "*", true); + TIdFTPListItems *dirList = StatusForm->ftpCon->DirectoryListing; + for (int i = 0; i < dirList->Count; i++) { + if (dirList->Items[i]->ItemType != ditDirectory) { + buffer = dest + "/" + (dirList->Items[i]->FileName.c_str()); +// files->Strings[i].c_str(); + if (!strcmp(&buffer.c_str()[buffer.length()-suffix.length()], suffix.c_str())) { + buffer2 = "Downloading ("; + buffer2 += IntToStr(i+1).c_str(); + buffer2 += " of "; + buffer2 += IntToStr(dirList->Count).c_str(); + buffer2 += "): "; + buffer2 += (dirList->Items[i]->FileName.c_str()); + // SWLog::systemlog->LogInformation("%s", buffer.c_str()); + TMainForm::createParent(buffer.c_str()); // make sure parent directory exists + Synchronize((TThreadMethod)&PreDownload1); + try { + StatusForm->currentFileSize = dirList->Items[i]->Size; + StatusForm->ftpCon->Get(dirList->Items[i]->FileName.c_str(), buffer.c_str(), true, false); + } + catch(...) { + MessageBox(0, "Can't download file. If you have not done so recently, you might try pressing the Refresh from Remote Source button.", "Download Error", MB_OK); + StatusForm->Button1Click(0); // abort thread + } + if (Terminated) + break; + } + } + } + } + else { + Synchronize((TThreadMethod)&PreDownload2); + try { + StatusForm->ftpCon->Get(src.c_str(), dest.c_str(), true, false); + } + catch(...) {StatusForm->abort = true;} + } + try { + StatusForm->ftpCon->Disconnect(); + } + catch(...){} + } +*/ +} + + +void __fastcall TStatusForm::TFTPThread::FTPLinkPacketRecvd(TObject *Sender) +{ +// Synchronize((TThreadMethod)&UpdateBytes); +} + + +//void __fastcall TStatusForm::TFTPThread::UpdateBytes(void) { +void __fastcall TStatusForm::UpdateBytes(void) { + StatusForm->statusBar->Caption = IntToStr(StatusForm->currentByteCount) + " bytes out of " + IntToStr(StatusForm->currentFileSize) + " transferred (" + IntToStr((int)((float)(StatusForm->currentByteCount + 1) / (float)(StatusForm->currentFileSize + 1) * 100)) + "%)"; + StatusForm->statusBar->Repaint(); +} + + +void __fastcall TStatusForm::TFTPThread::CreateFTPObject(void) +{ +// FTPLink = new TNMFTP(0); +} + + +void __fastcall TStatusForm::TFTPThread::PreConnect(void) +{ + buffer = "Connecting to server at "; + buffer += ist->Source.c_str(); + buffer += "..."; + StatusForm->actionBar->Caption = buffer.c_str(); + StatusForm->statusBar->Caption = ""; + StatusForm->Repaint(); +} + + +void __fastcall TStatusForm::TFTPThread::PreDownload1(void) +{ +// SWLog::systemlog->LogInformation("Creating parent dir: %s", buffer.c_str()); +// SWLog::systemlog->LogInformation("Return: %d", ret); + StatusForm->actionBar->Caption = buffer2.c_str(); + StatusForm->statusBar->Caption = ""; + StatusForm->Repaint(); +} + + +void __fastcall TStatusForm::TFTPThread::PreDownload2(void) +{ + buffer = "Downloading: "; + buffer += src.c_str(); + StatusForm->actionBar->Caption = buffer.c_str(); + StatusForm->statusBar->Caption = ""; + StatusForm->Repaint(); + MainForm->createParent(dest.c_str()); // make sure parent directory exists +} + + +void __fastcall TStatusForm::Cleanup(TObject *Sender) +//void __fastcall TStatusForm::TFTPThread::Cleanup() +{ + if (abort) + StatusForm->ModalResult = mrCancel; + else StatusForm->ModalResult = mrOk; +// StatusForm->Close(); +} + +void __fastcall TStatusForm::FormClose(TObject *Sender, TCloseAction &Action) +{ + suffix = ""; + MainForm->SetFocus(); +} +//--------------------------------------------------------------------------- + +void __fastcall TStatusForm::Button1Click(TObject *Sender) +{ + abort = true; +// ftpCon->Abort(); + ftpThread->Terminate(); +} +//--------------------------------------------------------------------------- + +/* +void __fastcall TStatusForm::ftpConWork(TObject *Sender, + TWorkMode AWorkMode, const int AWorkCount) +{ + currentByteCount = AWorkCount; +// Synchronize((TThreadMethod)&UpdateBytes); + UpdateBytes(); +} +*/ +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm Binary files differnew file mode 100644 index 0000000..bf8609e --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.dfm diff --git a/apps/windoze/CBuilder5/InstallMgr/StatusFrm.h b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.h new file mode 100644 index 0000000..d4b2094 --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/StatusFrm.h @@ -0,0 +1,89 @@ +//--------------------------------------------------------------------------- +#ifndef StatusFrmH +#define StatusFrmH +//--------------------------------------------------------------------------- +#include <Classes.hpp> +#include <Controls.hpp> +#include <StdCtrls.hpp> +#include <Forms.hpp> +#include <ExtCtrls.hpp> +//#include <NMFtp.hpp> +#include "MainFrm.h" +//#include "IdBaseComponent.hpp" +//#include "IdComponent.hpp" +//#include "IdFTP.hpp" +//#include "IdTCPClient.hpp" +//#include "IdTCPConnection.hpp" +#include <curl/curl.h> +#include <curl/types.h> +#include <curl/easy.h> +//--------------------------------------------------------------------------- + +class TFTPCon { +public: + string Host; + string Username; + string Password; + bool Passive; + string cwd; + +}; + +class TStatusForm : public TForm +{ +__published: // IDE-managed Components + TPanel *Panel1; + TPanel *Panel2; + TButton *Button1; + TPanel *statusBar; + TPanel *Panel3; + TPanel *actionBar; + void __fastcall FormShow(TObject *Sender); + void __fastcall Cleanup(TObject *Sender); + void __fastcall FormClose(TObject *Sender, TCloseAction &Action); + void __fastcall Button1Click(TObject *Sender); +// void __fastcall ftpConWork(TObject *Sender, TWorkMode AWorkMode, +// const int AWorkCount); +private: // User declarations + class TFTPThread : public TThread { + bool abort; + InstallSourceTab *ist; + string src; + string dest; + string buffer; + string buffer2; + string suffix; + bool dirTransfer; + bool passive; + protected: + void __fastcall Execute(); + public: +// TNMFTP *FTPLink; + __fastcall TFTPThread(InstallSourceTab *iist, const char *isrc, const char *idest, bool idirTransfer = false, bool CreateSuspended = false, bool ipassive = false, const char *suffix = ""); + __fastcall TFTPThread::~TFTPThread(); + void __fastcall FTPLinkPacketRecvd(TObject *Sender); + void __fastcall CreateFTPObject(void); + void __fastcall PreConnect(void); + void __fastcall PreDownload1(void); + void __fastcall PreDownload2(void); +// void __fastcall Cleanup(void); + } *ftpThread; +public: // User declarations + TFTPCon *ftpCon; + long currentByteCount; + long currentFileSize; + InstallSourceTab *ist; + string src; + string dest; + string suffix; + bool dirTransfer; + bool passive; + bool abort; + void __fastcall UpdateBytes(); + __fastcall TStatusForm(TComponent* Owner); + __fastcall ~TStatusForm(); +}; +//--------------------------------------------------------------------------- +extern PACKAGE TStatusForm *StatusForm; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp b/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp new file mode 100644 index 0000000..5b77797 --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/cipherfrm.cpp @@ -0,0 +1,67 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop + +#include "cipherfrm.h" +#include <swmgr.h> +#include <swconfig.h> +//--------------------------------------------------------------------------- +#pragma package(smart_init) +#pragma resource "*.dfm" +TCipherForm *CipherForm; +//--------------------------------------------------------------------------- +__fastcall TCipherForm::TCipherForm(TComponent* Owner) + : TForm(Owner) +{ +} +//--------------------------------------------------------------------------- +void __fastcall TCipherForm::Button2Click(TObject *Sender) +{ + SectionMap::iterator section; + ConfigEntMap::iterator entry; + SWConfig *modconf = new SWConfig(confFile.c_str()); + string tmpBuf; + + section = modconf->Sections.find(modName); + if (section != modconf->Sections.end()) { + entry = section->second.find("CipherKey"); + if (entry != section->second.end()) { + entry->second = CipherForm->cipherEdit->Text.c_str(); + modconf->Save(); + delete modconf; // close file + modconf = 0; + SWMgr *mgr = new SWMgr(); + SWModule *mod = mgr->Modules[modName]; + mod->SetKey("Ipet 2:12"); + tmpBuf = mod->StripText(); + mod->SetKey("gen 1:10"); + tmpBuf += "\r\n\r\n"; + tmpBuf += mod->StripText(); + Memo1->Text = tmpBuf.c_str(); + delete mgr; + } + } + if (modconf) + delete modconf; + +} +//--------------------------------------------------------------------------- + +void __fastcall TCipherForm::FormShow(TObject *Sender) +{ + string tmpCaption; + tmpCaption = "Cipher Key: ["; + tmpCaption += modName; + tmpCaption += "]"; + Caption = tmpCaption.c_str(); +} +//--------------------------------------------------------------------------- + + +void __fastcall TCipherForm::FormClose(TObject *Sender, + TCloseAction &Action) +{ + Memo1->Text = ""; +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/InstallMgr/installmgr.conf b/apps/windoze/CBuilder5/InstallMgr/installmgr.conf new file mode 100644 index 0000000..04a349b --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/installmgr.conf @@ -0,0 +1,8 @@ + +[General] +PassiveFTP=true + +[Sources] +FTPSource=crosswire|ftp.crosswire.org|/pub/sword/raw/ +LocalPath=C:\tmp + diff --git a/apps/windoze/CBuilder5/InstallMgr/zlib.bpr b/apps/windoze/CBuilder5/InstallMgr/zlib.bpr new file mode 100644 index 0000000..635316b --- /dev/null +++ b/apps/windoze/CBuilder5/InstallMgr/zlib.bpr @@ -0,0 +1,126 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.05.03"/> + <PROJECT value="zlib.lib"/> + <OBJFILES value="..\..\..\..\src\utilfuns\zlib\adler32.obj + ..\..\..\..\src\utilfuns\zlib\compress.obj + ..\..\..\..\src\utilfuns\zlib\crc32.obj + ..\..\..\..\src\utilfuns\zlib\deflate.obj + ..\..\..\..\src\utilfuns\zlib\gzio.obj + ..\..\..\..\src\utilfuns\zlib\infblock.obj + ..\..\..\..\src\utilfuns\zlib\infcodes.obj + ..\..\..\..\src\utilfuns\zlib\inffast.obj + ..\..\..\..\src\utilfuns\zlib\inflate.obj + ..\..\..\..\src\utilfuns\zlib\inftrees.obj + ..\..\..\..\src\utilfuns\zlib\infutil.obj + ..\..\..\..\src\utilfuns\zlib\maketree.obj + ..\..\..\..\src\utilfuns\zlib\trees.obj + ..\..\..\..\src\utilfuns\zlib\uncompr.obj + ..\..\..\..\src\utilfuns\zlib\untgz.obj + ..\..\..\..\src\utilfuns\zlib\zutil.obj"/> + <RESFILES value=""/> + <IDLFILES value=""/> + <IDLGENFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES)"/> + <LIBFILES value=""/> + <LIBRARIES value=""/> + <PACKAGES value=""/> + <PATHCPP value=".;..\..\..\..\src\utilfuns\zlib"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <LINKER value="TLib"/> + <USERDEFINES value=""/> + <SYSDEFINES value="_RTLDLL;NO_STRICT"/> + <MAINSOURCE value="zlib.bpf"/> + <INCLUDEPATH value="..\..\..\..\src\utilfuns\zlib;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include"/> + <LIBPATH value="..\..\..\..\src\utilfuns\zlib;$(BCB)\lib\obj;$(BCB)\lib"/> + <WARNINGS value="-w-par"/> + <LISTFILE value=""/> + </MACROS> + <OPTIONS> + <IDLCFLAGS value="-I..\..\..\..\src\utilfuns\zlib -I$(BCB)\include -I$(BCB)\include\vcl + -I..\..\..\..\include -src_suffix cpp -boa"/> + <CFLAG1 value="-O2 -H=$(BCB)\lib\vcl50.csm -Hc -Vx -Ve -X- -a8 -b- -k- -vi -c -tW -tWM"/> + <PFLAGS value="-$Y- -$L- -$D- -v -JPHNE -M"/> + <AFLAGS value="/mx /w2 /zn"/> + <LFLAGS value=""/> + </OPTIONS> + <LINKER> + <ALLOBJ value="$(OBJFILES)"/> + <ALLLIB value=""/> + </LINKER> + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[HistoryLists\hlIncludePath] +Count=2 +Item0=..\..\..\..\src\utilfuns\zlib;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item1=..\..\..\..\src\utilfuns\zlib;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlLibraryPath] +Count=1 +Item0=..\..\..\..\src\utilfuns\zlib;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=1 +Item0=_DEBUG + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[CORBA] +AddServerUnit=1 +AddClientUnit=1 +PrecompiledHeaders=1 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/prototype/CommentPanel.cpp b/apps/windoze/CBuilder5/prototype/CommentPanel.cpp new file mode 100644 index 0000000..dbf8adf --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/CommentPanel.cpp @@ -0,0 +1,222 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#include <vcl/clipbrd.hpp> +#pragma hdrstop + +#include "CommentPanel.h" +#pragma package(smart_init) +#include "swdisprtfchap.h" +#include <swconfig.h> +#include <swmodule.h> +#include "Greek2Greek.h" +#include <utilfuns.h> +#include <swmgr.h> +#include <shellapi.h> + +class RTFDisp : public SWDisplay { + SWDispRTF *edit; +public: + RTFDisp(SWDispRTF *iedit) { edit = iedit; } + RTFDisp() {} + char Display(SWModule &imodule) { + edit->Display(imodule); + } +}; + +class DispExternal : public SWDisplay { +public: + DispExternal() {} + char Display(SWModule &imodule) { + SHELLEXECUTEINFO info; + info.cbSize = sizeof(SHELLEXECUTEINFO); + info.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_CLASSNAME; + info.hwnd = GetFocus(); + info.lpVerb = "open"; + info.lpFile = (char *)imodule; + info.lpParameters = NULL; + info.lpDirectory = NULL; + info.nShow = 0; +// info.lpClass = ".html"; + ShellExecuteEx(&info); +// ShellExecute(edit->Handle, "open", (char *)imodule, NULL, NULL, SW_SHOWNORMAL); + } +}; + +//--------------------------------------------------------------------------- +// ValidCtrCheck is used to assure that the components created do not have +// any pure virtual functions. +// + +static inline void ValidCtrCheck(TCommentPanel *) +{ + new TCommentPanel(NULL); +} +//--------------------------------------------------------------------------- +__fastcall TCommentPanel::TCommentPanel(TComponent* Owner, SWModule *mod, SWMgr *imgr) + : TPanel(Owner) +{ + module = mod; + mgr = imgr; + this->font = 0; + stdstr(&(this->font), font); + menu = new TPopupMenu(this); + menu->OnPopup = PopupMenuPopup; + + TMenuItem * newitem; + newitem = new TMenuItem(menu); + newitem->Caption = "&Copy"; + newitem->Hint = "Copy text to clipboard"; + newitem->Default = false; + newitem->OnClick = Copy1Click; + menu->Items->Add(newitem); + if (!strcmp(mod->Name(), "N27U4")) { + newitem = new TMenuItem(menu); + newitem->Caption = "Copy as &B-Greek Transliteration"; + newitem->Hint = "Copy text to clipboard as B-Greek Transliteration"; + newitem->Default = false; + newitem->OnClick = CopyasBGreekTransliteration1Click; + menu->Items->Add(newitem); + } + newitem = new TMenuItem(menu); + newitem->Caption = "Dictionary Lookup"; + newitem->Hint = "Send text to dictionary key for lookup"; + newitem->Default = false; + newitem->OnClick = DictionaryLookup1Click; + menu->Items->Add(newitem); +} + + +void __fastcall TCommentPanel::CreateWnd() { + TPanel::CreateWnd(); + + TWinControl *newrtf; + + if (mgr->config->Sections[module->Name()]["ModDrv"] == "HREFCom") { +// if (mainmgr->config->Sections[mod->Name()]["External"] == "1") { + newrtf = new TPanel(this); + ((TPanel *)newrtf)->Caption = "Syncronizing to External Viewer"; + display = new DispExternal(); + module->Disp(display); +/* + } + else { + // newrtf = new THTML(this->Handle); + // newrtf = new SWDispRTF(this); + newrtf = HTML1; + newrtf->Visible = true; + mod->Disp(*displays.insert(displays.begin(), new HREFDisp((THTML *)newrtf))); + // mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf))); + } +*/ + } + else { + newrtf = new SWDispRTF(this); + display = new RTFDisp((SWDispRTF *)newrtf); + module->Disp(display); + ((SWDispRTF *)newrtf)->ScrollBars = ssVertical; + ((SWDispRTF *)newrtf)->ReadOnly = true; + if (mgr->config->Sections[module->Name()]["ModDrv"] == "RawFiles") { +// ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3; + ((SWDispRTF *)newrtf)->ExpandNewLine = false; + } +// else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2; + ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown; + } + + newrtf->Parent = this; + newrtf->Align = alClient; + +// mod->SetKey(DefaultVSKey); +// return 0; + + +} +__fastcall TCommentPanel::~TCommentPanel() { + delete display; + if (font) + delete font; +} +//--------------------------------------------------------------------------- +namespace Commentpanel +{ + void __fastcall PACKAGE Register() + { + TComponentClass classes[1] = {__classid(TCommentPanel)}; + RegisterComponents("Samples", classes, 0); + } +} +//--------------------------------------------------------------------------- +void __fastcall TCommentPanel::PopupMenuPopup(TObject *Sender) +{ +} +void TCommentPanel::BuildRTFHeader(char *buf, char *font, int max) +{ + char buf1[1024], buf2[1024]; + SectionMap::iterator sit; + + sprintf(buf1, "{\\rtf1\\ansi"); + if (font) + sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f2\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f3\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}", font); + else sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}"); + strcat(buf1, buf2); + +// if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) { +// sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red%d\\green%d\\blue%d;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}", +// atoi((*sit).second["CurrentVSColorRed"].c_str()), +// atoi((*sit).second["CurrentVSColorGreen"].c_str()), +// atoi((*sit).second["CurrentVSColorBlue"].c_str())); +// } +// else + sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}"); + strcat(buf1, buf2); + memset(buf, 0, max); + strncpy(buf, buf1, max); +} + + +void __fastcall TCommentPanel::CopyasBGreekTransliteration1Click(TObject *Sender) +{ + char *retbuf; + int len; + TClipboard *clip = new TClipboard(); + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + len = rtf->SelText.Length() * 2; + retbuf = new char [ len ]; + if (!Greek2bGreek(retbuf, rtf->SelText.c_str(), len)) { + clip->SetTextBuf(retbuf); + } + delete clip; +} + +void __fastcall TCommentPanel::Copy1Click(TObject *Sender) +{ + int wordstart; + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + if (!rtf->SelLength) { + for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--); + rtf->SelStart = (wordstart > -1) ? wordstart: 0; + for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++); + rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1; + } + rtf->CopyToClipboard(); +} +void __fastcall TCommentPanel::DictionaryLookup1Click(TObject *Sender) +{ + int wordstart; + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + if (!rtf->SelLength) { + for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--); + rtf->SelStart = (wordstart > -1) ? wordstart: 0; + for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++); + rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1; + } +// DictKeyEdit->Text = Trim(rtf->SelText); +} +void __fastcall TCommentPanel::RTFMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + ((TWinControl *)Sender)->SetFocus(); +} diff --git a/apps/windoze/CBuilder5/prototype/biblecsmgr.cpp b/apps/windoze/CBuilder5/prototype/biblecsmgr.cpp new file mode 100644 index 0000000..5532081 --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/biblecsmgr.cpp @@ -0,0 +1,88 @@ +//--------------------------------------------------------------------------- +#include "BibleCSMGR.h" +#include <swconfig.h> +#include <gbfrtf.h> +#include <rwprtf.h> +#include <rawgbf.h> +#include <thmlrtf.h> +//--------------------------------------------------------------------------- +BibleCSMGR::BibleCSMGR(TModInstFrm *iModInstFrm) : SWMgr(0, 0, false) +{ + gbftortf = new GBFRTF(); + rwptortf = new RWPRTF(); + thmltortf = new ThMLRTF(); + ModInstFrm = iModInstFrm; + Load(); +} + + +BibleCSMGR::~BibleCSMGR() +{ + if (gbftortf) + delete gbftortf; + + if (rwptortf) + delete rwptortf; + + if (thmltortf) + delete thmltortf; +} + + +void BibleCSMGR::AddRenderFilters(SWModule *module, ConfigEntMap §ion) +{ + string sourceformat; + ConfigEntMap::iterator entry; + + sourceformat = ((entry = section.find("SourceType")) != section.end()) ? (*entry).second : (string)""; + // Temporary: To support old module types +// if (sourceformat.empty()) { +// try { +// if (dynamic_cast<RawGBF *>(module)) +// sourceformat = "GBF"; +// } +// catch ( ... ) {} +// } +// + if (!stricmp(sourceformat.c_str(), "GBF")) { + module->AddRenderFilter(gbftortf); + } + + if (!stricmp(module->Name(), "RWP")) + module->AddRenderFilter(rwptortf); + + if (!stricmp(sourceformat.c_str(), "THML")) + module->AddRenderFilter(thmltortf); +} + + +char BibleCSMGR::AddModToConfig(int conffd, const char *fname) +{ + SWConfig modconf(fname); + SectionMap::iterator section; + AnsiString abouttext = ""; + bool logflag; + TMemoryStream *RTFStream = new TMemoryStream(); + char retval; + + section = modconf.Sections.begin(); + + ModInstFrm->ModText->Caption = ""; + ModInstFrm->ModText->Caption = ModInstFrm->ModText->Caption + "Found new module [ " + (*(*section).second.find("Description")).second.c_str() + " ]. Installing..."; + + abouttext = abouttext + "{\\fs20\\cf0 " + (*(*section).second.find("About")).second.c_str() + " }"; + RTFStream->Clear(); + RTFStream->WriteBuffer(abouttext.c_str(), abouttext.Length()); + RTFStream->Position = 0; + ModInstFrm->AboutText->Lines->LoadFromStream(RTFStream); + delete RTFStream; + + ModInstFrm->ShowModal(); + + logflag = SWLog::systemlog->log; + SWLog::systemlog->log = false; + retval = SWMgr::AddModToConfig(conffd, fname); + SWLog::systemlog->log = logflag; + + return retval; +} diff --git a/apps/windoze/CBuilder5/prototype/editentryfrm.cpp b/apps/windoze/CBuilder5/prototype/editentryfrm.cpp new file mode 100644 index 0000000..e9404f8 --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/editentryfrm.cpp @@ -0,0 +1,332 @@ +#include <vcl.h> +#pragma hdrstop +#include <windows.hpp> +#include <stdlib.h> +#include <stdio.h> +#include "editentryfrm.h" +#include <swdisprtf.h> + +const float RulerAdj = 4.0/3.0; +const int GutterWid = 6; +//---------------------------------------------------------------------------- +#pragma resource "*.dfm" +TEditEntry *EditEntry; +//---------------------------------------------------------------------------- +__fastcall TEditEntry::TEditEntry(TComponent *Owner) + : TForm(Owner) +{ + ResultBuf = 0; +} + + +__fastcall TEditEntry::~TEditEntry() +{ + if (ResultBuf) + delete [] ResultBuf; +} + + +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::SelectionChange(TObject */*Sender*/) +{ + char sizebuf[6]; + + try { + FUpdating = True; + FirstInd->Left = int(RichEdit1->Paragraph->FirstIndent*RulerAdj)- + 4+GutterWid; + LeftInd->Left = int((RichEdit1->Paragraph->LeftIndent+ + RichEdit1->Paragraph->FirstIndent)*RulerAdj)- + 4+GutterWid; + RightInd->Left = Ruler->ClientWidth-6-int( + (RichEdit1->Paragraph->RightIndent+GutterWid)*RulerAdj); + + BoldButton->Down = RichEdit1->SelAttributes->Style.Contains(fsBold); + ItalicButton->Down = RichEdit1->SelAttributes->Style.Contains(fsItalic); + UnderlineButton->Down = RichEdit1->SelAttributes->Style.Contains(fsUnderline); + + BulletsButton->Down = bool(RichEdit1->Paragraph->Numbering); + + FontSize->Text = itoa(RichEdit1->SelAttributes->Size, sizebuf, 10); + + switch((int)RichEdit1->Paragraph->Alignment) + { case 0: LeftAlign->Down = True; break; + case 1: RightAlign->Down = True; break; + case 2: CenterAlign->Down = True; break; + } + } + catch (...) { + FUpdating = False; + } + FUpdating = False; +} +//---------------------------------------------------------------------------- +TTextAttributes *__fastcall TEditEntry::CurrText(void) +{ + return RichEdit1->SelAttributes; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::CheckFileSave(void) +{ + if ( RichEdit1->Modified ) { + switch(MessageBox(Handle, "Save Changes?","Modify Comment",MB_YESNOCANCEL | MB_ICONQUESTION)) { + case ID_YES : ExtractRTF(); break; + case ID_CANCEL : Abort(); break; + default: + if (ResultBuf) + delete [] ResultBuf; + ResultBuf = 0; + break; + }; + } +} + + +void __fastcall TEditEntry::SetupRuler(void) +{ int iCtr = 1; + char sTmp[201]; + while (iCtr < 200) { + sTmp[iCtr] = 9; + iCtr++; + sTmp[iCtr] = '|'; + iCtr++; + } + Ruler->Caption = (AnsiString)sTmp; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::SetEditRect(void) +{ TRect Rct = Rect(GutterWid, 0, RichEdit1->ClientWidth-GutterWid, + ClientHeight); + SendMessage(RichEdit1->Handle, EM_SETRECT, 0, long(&Rct)); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::FormCreate(TObject* /*Sender*/) +{ Application->OnHint = &ShowHint; + SetupRuler(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::ShowHint(TObject* /*Sender*/) +{ StatusBar->SimpleText = Application->Hint; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::EditUndoClick(TObject* /*Sender*/) +{ if ( RichEdit1->HandleAllocated() ) + SendMessage(RichEdit1->Handle, EM_UNDO, 0, 0); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::EditCutClick(TObject* /*Sender*/) +{ RichEdit1->CutToClipboard(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::EditCopyClick(TObject* /*Sender*/) +{ RichEdit1->CopyToClipboard(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::EditPasteClick(TObject* /*Sender*/) +{ RichEdit1->PasteFromClipboard(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::RulerResize(TObject* /*Sender*/) +{ RulerLine->Width = (int)Ruler->ClientWidth - (RulerLine->Left*2); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::FormResize(TObject* Sender) +{ SetEditRect(); + SelectionChange(Sender); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::FormPaint(TObject* /*Sender*/) +{ SetEditRect(); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::BoldButtonClick(TObject* /*Sender*/) +{ if ( !FUpdating ) + { if ( BoldButton->Down ) + CurrText()->Style = CurrText()->Style << fsBold; + else + CurrText()->Style = CurrText()->Style >> fsBold; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::ItalicButtonClick(TObject* /*Sender*/) +{ if ( !FUpdating ) + { + if ( ItalicButton->Down ) + CurrText()->Style = CurrText()->Style << fsItalic; + else + CurrText()->Style = CurrText()->Style >> fsItalic; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::UnderlineButtonClick(TObject* /*Sender*/) +{ + if ( !FUpdating ) { + if ( UnderlineButton->Down ) + CurrText()->Style = CurrText()->Style << fsUnderline; + else CurrText()->Style = CurrText()->Style >> fsUnderline; + } +} + + +void __fastcall TEditEntry::FontSizeChange(TObject* /*Sender*/) +{ + int fontsize = atoi(FontSize->Text.c_str()); + + if ((!FUpdating) && (fontsize)) { + if (fontsize < 1) { + ShowMessage("Please Enter a Number betweek 1 and 1638"); + FontSize->Text = 1; + } + else if (fontsize > 1638) { + ShowMessage("Please Enter a Number betweek 1 and 1638"); + FontSize->Text = 1638; + } + CurrText()->Size = atoi(FontSize->Text.c_str()); + } +} + + +void __fastcall TEditEntry::AlignClick(TObject* Sender) +{ + if ( !FUpdating ) { + TControl *oAliBtn = (TControl*)(Sender); + RichEdit1->Paragraph->Alignment = (TAlignment)oAliBtn->Tag; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::BulletsButtonClick(TObject* /*Sender*/) +{ if ( !FUpdating ) + RichEdit1->Paragraph->Numbering = (TNumberingStyle)BulletsButton->Down; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::FormCloseQuery(TObject* /*Sender*/, + bool & CanClose) +{ try { + CheckFileSave(); + } + catch (...) { + CanClose = False; + } +} +//---------------------------------------------------------------------------- + +//*************************** +//***Ruler Indent Dragging*** +//*************************** + +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::RulerItemMouseDown(TObject * Sender, + TMouseButton Button, TShiftState Shift, int X, int Y) +{ TLabel * oTmpLabel = (TLabel *)Sender; + FDragOfs = oTmpLabel->Width / 2; + oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs; + FDragging = True; +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::RulerItemMouseMove(TObject *Sender, TShiftState Shift, int X, int /*Y*/) { + if (FDragging) { + TLabel *oTmpLabel = (TLabel *)Sender; + oTmpLabel->Left = oTmpLabel->Left+X-FDragOfs; + oTmpLabel->Left -= oTmpLabel->Left % 10; + } +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::FirstIndMouseUp(TObject *Sender, TMouseButton + Button, TShiftState Shift, int X, int Y) +{ FDragging = False; + RichEdit1->Paragraph->FirstIndent = int((FirstInd->Left+FDragOfs-GutterWid) / RulerAdj); + LeftIndMouseUp(Sender, Button, Shift, X, Y); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::LeftIndMouseUp(TObject *Sender, TMouseButton + /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/) +{ FDragging = False; + RichEdit1->Paragraph->LeftIndent = int((LeftInd->Left+FDragOfs-GutterWid)/ + RulerAdj)-RichEdit1->Paragraph->FirstIndent; + SelectionChange(Sender); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::RightIndMouseUp(TObject *Sender, TMouseButton + /*Button*/, TShiftState /*Shift*/, int /*X*/, int /*Y*/) +{ FDragging = False; + RichEdit1->Paragraph->RightIndent = + int((Ruler->ClientWidth-RightInd->Left+FDragOfs-2) / + RulerAdj)-2*GutterWid; + SelectionChange(Sender); +} +//---------------------------------------------------------------------------- +void __fastcall TEditEntry::FormActivate(TObject *Sender) +{ + System::AnsiString newtext, tmptext; + + if (Module) { + TMemoryStream *RTFStream = new TMemoryStream(); + newtext = RTFDisplay->RTFHeader; + Module->Error(); // clear error; + newtext = newtext + "\\pard \\nowidctlpar \\cf0 "; + (char *)*Module; // force key to snap to entry before pulling out the text of the key + tmptext = (char *)*Module; + + newtext = newtext + RTFDisplay->RTFVersePre + " " + tmptext + RTFDisplay->RTFVersePost; + newtext = newtext + RTFDisplay->RTFTrailer; + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.Length()); + RTFStream->Position = 0; + RichEdit1->Lines->LoadFromStream(RTFStream); + delete RTFStream; + } + SelectionChange(this); + RichEdit1->SetFocus(); + if (ResultBuf) + delete [] ResultBuf; + ResultBuf = 0; +} +//--------------------------------------------------------------------- + +void TEditEntry::ExtractRTF() +{ + System::AnsiString newtext, tmptext; + TMemoryStream *RTFStream = new TMemoryStream(); + char *tmpbuf, *datastart; + + RTFStream->Clear(); + RichEdit1->Lines->SaveToStream(RTFStream); + RTFStream->Position = 0; + if (ResultBuf) + delete [] ResultBuf; + tmpbuf = new char [ RTFStream->Size + 1]; + RTFStream->ReadBuffer(tmpbuf, RTFStream->Size); + tmpbuf[RTFStream->Size] = 0; + strtok(strstr(tmpbuf, "colortbl"), "}"); + datastart = strtok(NULL, ""); + ResultBuf = new char [ strlen(datastart) + 2 ]; + ResultBuf[0] = '{'; + strcpy(ResultBuf+1, datastart); + delete [] tmpbuf; + delete RTFStream; + //-------- Change all fonts to \f1 + for (int i = 0; i < strlen(ResultBuf)-4; i++) { + if (ResultBuf[i] == '\\') { + if (ResultBuf[i+1] == '\\') { // skip a real '\' character + i += 1; + continue; + } + if (ResultBuf[i+1] == 'f') { + if (isdigit(ResultBuf[i+2])) { + ResultBuf[i+2] = '1'; + if (isdigit(ResultBuf[i+3])) { + memmove(&ResultBuf[i+3], &ResultBuf[i+4], strlen(&ResultBuf[i+3])); + } + } + } + } + } +} + + +__fastcall TCharsetObject::TCharsetObject(int FCharset) + : TObject() +{ + Charset = FCharset; +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/CBuilder5/prototype/mainfrm.cpp b/apps/windoze/CBuilder5/prototype/mainfrm.cpp new file mode 100644 index 0000000..cfe753e --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/mainfrm.cpp @@ -0,0 +1,825 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#include <vcl/clipbrd.hpp> +#pragma hdrstop + +#include "mainfrm.h" +#include "swdisprtfchap.h" +#include "searchfrm.h" +#include "swwinlog.h" +#include "AboutBoxfrm.h" +#include "ModInstForm.h" +#include "biblecsmgr.h" +#include "Greek2Greek.h" +#include "bookmarkfrm.h" +#include "optionfrm.h" +#include "vrslstfrm.h" +#include <utilstr.h> +#include <filemgr.h> +#include "editentryfrm.h" +#include "versesel.h" +#include "ModTabPanel.h" + +//--------------------------------------------------------------------------- +#pragma resource "*.dfm" +TForm1 *Form1; +//--------------------------------------------------------------------------- + + +__fastcall TForm1::TForm1(TComponent* Owner) + : TForm(Owner) +{ + optionsconf = new SWConfig("./options.conf"); + + Lookup->Text = "[ SWORD DDE Lookup ]"; + Search->Text = "[ SWORD DDE Search ]"; + Application->OnHint = DisplayHint; +} + +void __fastcall TForm1::DisplayHint(TObject* Sender) +{ + StatusBar1->SimpleText = Application->Hint; +} + +//--------------------------------------------------------------------------- +__fastcall TForm1::~TForm1() +{ + list <SWDisplay *>::iterator it; + int loop; + + if (mainmgr) + delete mainmgr; + for (it = displays.begin(); it != displays.end(); it++) + delete *it; + if (layoutconf) + delete layoutconf; + + if (optionsconf) + delete optionsconf; + +// for (loop = 0; loop < 10; loop++) { +// if (ctrlstates[loop]); +// delete ctrlstates[loop]; +// } +} +//--------------------------------------------------------------------------- +void TForm1::BuildRTFHeader(char *buf, char *font, int max) +{ + char buf1[1024], buf2[1024]; + SectionMap::iterator sit; + + sprintf(buf1, "{\\rtf1\\ansi"); + if (font) + sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 %s;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f2\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f3\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f4\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}", font); + else sprintf(buf2, "{\\fonttbl{\\f0\\fdecor\\fprq2 Times New Roman;}{\\f1\\froman\\fcharset0\\fprq2 Times New Roman;}{\\f7\\froman\\fcharset2\\fprq2 Symbol;}{\\f8\\froman\\fcharset2\\fprq2 Symbol;}}"); + strcat(buf1, buf2); + + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) { + sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red%d\\green%d\\blue%d;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}", + atoi((*sit).second["CurrentVSColorRed"].c_str()), + atoi((*sit).second["CurrentVSColorGreen"].c_str()), + atoi((*sit).second["CurrentVSColorBlue"].c_str())); + } + else sprintf(buf2, "{\\colortbl;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red0\\green200\\blue50;\\red0\\green0\\blue255;\\red255\\green0\\blue0;}"); + strcat(buf1, buf2); + memset(buf, 0, max); + strncpy(buf, buf1, max); +} + +char TForm1::CreateTextPane(SWModule *mod, char *font) { + TTabSheet *newtab = new TTabSheet(this); + SWDispRTFChap *newrtf = new SWDispRTFChap(this); + TTextPanel *panel = new TTextPanel(this, mod, font); + char buf[512]; + SectionMap::iterator sit; + + newtab->Caption = mod->Name(); + newtab->Hint = mod->Description(); +// newtab->PageControl = PageControl1; + panel->Parent = newtab; +/* + newrtf->Align = alClient; + newrtf->ScrollBars = ssVertical; + newrtf->ReadOnly = true; + newrtf->PopupMenu = (strcmp(mod->Name(), "N27U4")) ? PopupMenu2 : PopupMenu1; + newrtf->OnMouseDown = RTFMouseDown; + + BuildRTFHeader(buf, font, 512); + newrtf->RTFHeader = buf; + + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) { + newrtf->MarkCurrentVerse = (atoi((*sit).second["AutoVSColor"].c_str())) ? true:false; + } + + mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf))); + mod->SetKey(DefaultVSKey); +*/ + return 0; +} +//--------------------------------------------------------------------------- +char TForm1::CreateCommentPane(SWModule *mod) { + TTabSheet *newtab = new TTabSheet(this); + TWinControl *newrtf; + + if (mainmgr->config->Sections[mod->Name()]["ModDrv"] == "HREFCom") { +// if (mainmgr->config->Sections[mod->Name()]["External"] == "1") { + newrtf = new TPanel(this); + ((TPanel *)newrtf)->Caption = "Syncronizing to External Viewer"; + mod->Disp(*displays.insert(displays.begin(), new DispExternal())); +/* + } + else { + // newrtf = new THTML(this->Handle); + // newrtf = new SWDispRTF(this); + newrtf = HTML1; + newrtf->Visible = true; + mod->Disp(*displays.insert(displays.begin(), new HREFDisp((THTML *)newrtf))); + // mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf))); + } +*/ + } + else { + newrtf = new SWDispRTF(this); + mod->Disp(*displays.insert(displays.begin(), new RTFDisp((SWDispRTF *)newrtf))); + ((SWDispRTF *)newrtf)->ScrollBars = ssVertical; + ((SWDispRTF *)newrtf)->ReadOnly = true; + if (mainmgr->config->Sections[mod->Name()]["ModDrv"] == "RawFiles") { + ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu3; + ((SWDispRTF *)newrtf)->ExpandNewLine = false; + } + else ((SWDispRTF *)newrtf)->PopupMenu = PopupMenu2; + ((SWDispRTF *)newrtf)->OnMouseDown = RTFMouseDown; + } + + newtab->Caption = mod->Name(); + newtab->Hint = mod->Description(); + newtab->PageControl = PageControl2; + newrtf->Parent = newtab; + newrtf->Align = alClient; + + mod->SetKey(DefaultVSKey); + return 0; +} +//--------------------------------------------------------------------------- +char TForm1::CreateLDPane(SWModule *mod) { + TTabSheet *newtab = new TTabSheet(this); + SWDispRTF *newrtf = new SWDispRTF(this); + + newtab->Caption = mod->Name(); + newtab->Hint = mod->Description(); + newtab->PageControl = PageControl3; + newrtf->Parent = newtab; + newrtf->Align = alClient; + newrtf->ScrollBars = ssVertical; + newrtf->ReadOnly = true; + newrtf->PopupMenu = PopupMenu2; + newrtf->OnMouseDown = RTFMouseDown; + + mod->Disp(*displays.insert(displays.begin(), new RTFDisp(newrtf))); + mod->SetKey(DefaultStrKey); + return 0; +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::PageControl1Change(TObject *Sender) +{ +// RefreshActiveSheet(PageControl1); +// Form1->ActiveControl = PageControl1; +} +//--------------------------------------------------------------------------- +void TForm1::RefreshActiveSheet(TPageControl *pc) +{ + ModMap::iterator it; + + it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + (*it).second->Display(); + if (logmodstate) + modstates.insert(modstates.begin(), new ModState(pc, pc->ActivePage, (*it).second->KeyText())); + } +} + + +void TForm1::TextKeyChanged() +{ + cbBook->ItemIndex = cbBook->Items->IndexOf(DefaultVSKey.books[DefaultVSKey.Testament()-1][DefaultVSKey.Book()-1].name); + CHBox->Text = DefaultVSKey.Chapter(); + VSBox->Text = DefaultVSKey.Verse(); + freeHandLookup->Text = (const char *)DefaultVSKey; + textTabs->RefreshActiveSheet(); + logmodstate = false; // only log state once + RefreshActiveSheet(PageControl2); + logmodstate = true; +} + + +void __fastcall TForm1::btnLookupClick(TObject *Sender) +{ + if (!(StrToInt(CHBox->Text)) || (!StrToInt(VSBox->Text))) + DefaultVSKey.AutoNormalize(0); + + if (StrToInt(CHBox->Text) < 0) + CHBox->Text = StrToInt(CHBox->Text) + 1; + if (StrToInt(VSBox->Text) < 0) + VSBox->Text = StrToInt(VSBox->Text) + 1; + + DefaultVSKey = (cbBook->Text + " " + CHBox->Text + ":" + VSBox->Text).c_str(); + TextKeyChanged(); + DefaultVSKey.AutoNormalize(1); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::PageControl2Change(TObject *Sender) +{ + RefreshActiveSheet(PageControl2); + Form1->ActiveControl = PageControl2; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::DictKeyEditChange(TObject *Sender) +{ + if (DictKeyEdit->Modified) { + DefaultStrKey = DictKeyEdit->Text.c_str(); + RefreshActiveSheet(PageControl3); + DictKeyEdit->Modified = false; + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::PageControl3Change(TObject *Sender) +{ + RefreshActiveSheet(PageControl3); + Form1->ActiveControl = PageControl3; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::NewSearchWindow1Click(TObject *Sender) +{ + Form2->Show(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Exit1Click(TObject *Sender) +{ + Close(); +} + +void __fastcall TForm1::About1Click(TObject *Sender) +{ + AboutBox->ShowModal(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::DictionaryLookup1Click(TObject *Sender) +{ + int wordstart; + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + if (!rtf->SelLength) { + for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--); + rtf->SelStart = (wordstart > -1) ? wordstart: 0; + for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++); + rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1; + } + DictKeyEdit->Text = Trim(rtf->SelText); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::SaveLayout1Click(TObject *Sender) +{ + ConfigEntMap sit; + + sit = layoutconf->Sections["Screen"]; + sit["MainTop"] = IntToStr(Form1->Top).c_str(); + sit["MainLeft"] = IntToStr(Form1->Left).c_str(); + sit["MainHeight"] = IntToStr(Form1->Height).c_str(); + sit["MainWidth"] = IntToStr(Form1->Width).c_str(); + sit["TextComHeight"] = IntToStr(pnlTextCom->Height).c_str(); + sit["TextWidth"] = IntToStr(pnlText->Width).c_str(); + layoutconf->Sections["Screen"] = sit; + layoutconf->Save(); +} +//--------------------------------------------------------------------------- +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormCreate(TObject *Sender) +{ + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap::iterator eit; + AnsiString s1; + char *font; + int val; + int loop; + int maxFiles; + + mainmgr = new BibleCSMGR(ModInstFrm); +// textTabs = new TModTabPanel(this, mainmgr, "Biblical Texts"); +// textTabs->Align = alClient; +// textTabs->Parent = pnlText; +// logmodstate = true; +// freshdict = true; +// if ((maxFiles = atoi(optionsconf->Sections["System"]["MaxFiles"].c_str()))) { +// FileMgr::systemFileMgr.maxFiles = maxFiles; +// } + +// DefaultVSKey = TOP; +// DefaultVSKey = "Genesis 1:1"; +// cbBook->Clear(); +/* + while (!DefaultVSKey.Error()) { + s1 = (const char *)DefaultVSKey; + s1.SetLength(s1.Length() - 4); + cbBook->Items->Add(s1); + DefaultVSKey.Book(DefaultVSKey.Book() + 1); + } + cbBook->ItemIndex = cbBook->Items->IndexOf("James"); + + DefaultVSKey.Persist(1); // when set to a module, make the module hold on to this actual key and not a copy + DefaultVSKey = "James 1:19"; // set to our standard starting verse + DefaultStrKey.Persist(1); + DefaultStrKey = ""; + Hint = ""; + ShowHint = true; + Application->ShowHint = true; + if (SWLog::systemlog) + delete SWLog::systemlog; + SWLog::systemlog = new SWWinLog(this->Handle); // set the system logger to our MSWindows specific SWLog class + layoutconf = new SWConfig("./layout.conf"); + + if ((sit = layoutconf->Sections.find("Screen")) != layoutconf->Sections.end()) { + if (val = atoi((*sit).second["MainTop"].c_str())) + Form1->Top = val; + if (val = atoi((*sit).second["MainLeft"].c_str())) + Form1->Left = val; + if (val = atoi((*sit).second["MainHeight"].c_str())) + Form1->Height = val; + if (val = atoi((*sit).second["MainWidth"].c_str())) + Form1->Width = val; + if (val = atoi((*sit).second["TextComHeight"].c_str())) + pnlTextCom->Height = val; + if (val = atoi((*sit).second["TextWidth"].c_str())) + pnlText->Width = val; + } + + for (loop = 0; loop < 10; loop++) + ctrlstates.insert(ctrlstates.begin(), 0); + + ImageList1->Add(BackBtnImage->Picture->Bitmap, NULL); + ImageList1->Add(SearchBtnImage->Picture->Bitmap, NULL); + ImageList2->Add(BookmarkBtnImage->Picture->Bitmap, NULL); +*/ +} + + +//void __fastcall TForm1::CreateWnd() { +// TForm::CreateWnd(); + +/* + for (it = mainmgr->Modules.begin(); it != mainmgr->Modules.end(); it++) { + if (!strcmp((*it).second->Type(), "Biblical Texts")) { + font = 0; + if ((sit = mainmgr->config->Sections.find((*it).second->Name())) != mainmgr->config->Sections.end()) { + if ((eit = (*sit).second.find("Font")) != (*sit).second.end()) { + font = (char *)(*eit).second.c_str(); + } + } + CreateTextPane((*it).second, font); + } + if (!strcmp((*it).second->Type(), "Commentaries")) + CreateCommentPane((*it).second); + if (!strcmp((*it).second->Type(), "Lexicons / Dictionaries")) + CreateLDPane((*it).second); + } +*/ +//} + +//--------------------------------------------------------------------------- +void __fastcall TForm1::LookupPokeData(TObject *Sender) +{ + char buf[255]; + char *token; + ModMap::iterator it; + + strncpy(buf, Lookup->Text.c_str(), 254); + buf[254] = 0; + token = strtok(buf, " "); + if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) { + token = strtok(NULL, ""); + (*it).second->SetKey(token); + Lookup->Text = (const char *)(*(*it).second); + } + else Lookup->Text = ""; + +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::SearchPokeData(TObject *Sender) +{ + char buf[255]; + char *token; + ModMap::iterator it; + AnsiString retval = ""; + + strncpy(buf, Search->Text.c_str(), 254); + buf[254] = 0; + token = strtok(buf, " "); + if ((it = mainmgr->Modules.find(token)) != mainmgr->Modules.end()) { + token = strtok(NULL, ""); + ListKey &results = (*it).second->Search(token, REG_ICASE); + while (!results.Error()) { + retval = retval + (const char *)results + "; "; + results++; + } + Search->Text = retval; + } + else Search->Text = ""; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::UpDown3Click(TObject *Sender, TUDBtnType Button) +{ + ModMap::iterator it; + + it = mainmgr->Modules.find(PageControl3->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + if (Button == btNext) + (*((*it).second))++; + else (*((*it).second))--; + DictKeyEdit->Text = ((*it).second)->KeyText(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::UpDown1Click(TObject *Sender, TUDBtnType Button) +{ + btnLookupClick(Sender); +} +//--------------------------------------------------------------------------- + +void TForm1::RestoreState(ModState *state) +{ + if (state) { + state->pc->ActivePage = state->ap; +// if ((state->pc == PageControl1) || (state->pc == PageControl2)) { +// DefaultVSKey = state->key; +// TextKeyChanged(); +// } + if (state->pc == PageControl3) { + DictKeyEdit->Text = (const char *)state->key; + } + if (state->pc->ActivePage->ControlCount) + Form1->ActiveControl = (TWinControl *)state->pc->ActivePage->Controls[0]; + } +} + + +void __fastcall TForm1::BackbtnClick(TObject *Sender) +{ + list <ModState *>::iterator it; + + logmodstate = false; + it = modstates.begin(); + if (it != modstates.end()) { + it++; + + if (it != modstates.end()) { + RestoreState(*it); + delete *modstates.begin(); + modstates.erase(modstates.begin(), it); + } + } + logmodstate = true; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Button1Click(TObject *Sender) +{ +/* + list <ModState *>::iterator it; + ListBox1->Clear(); + for (it = modstates.begin(); it != modstates.end(); it++) { + ListBox1->Items->Add((*it)->ap->Caption.c_str()); + } +*/ +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::CopyasBGreekTransliteration1Click(TObject *Sender) +{ + char *retbuf; + int len; + TClipboard *clip = new TClipboard(); + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + len = rtf->SelText.Length() * 2; + retbuf = new char [ len ]; + if (!Greek2bGreek(retbuf, rtf->SelText.c_str(), len)) { + clip->SetTextBuf(retbuf); + } + delete clip; +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Copy1Click(TObject *Sender) +{ + int wordstart; + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + if (!rtf->SelLength) { + for (wordstart = rtf->SelStart; (wordstart > -1)&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart--); + rtf->SelStart = (wordstart > -1) ? wordstart: 0; + for (wordstart = rtf->SelStart + 1; (wordstart < rtf->Text.Length())&&(isdigit(rtf->Text[wordstart])||isalpha(rtf->Text[wordstart])); wordstart++); + rtf->SelLength = ((wordstart < rtf->Text.Length()) ? wordstart : rtf->Text.Length() - 1) - rtf->SelStart - 1; + } + rtf->CopyToClipboard(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BookmarkItemClick(TObject *Sender) +{ + TMenuItem *menuchoice = (TMenuItem *)Sender; + DefaultVSKey = menuchoice->Caption.c_str(); + TextKeyChanged(); +} + +void __fastcall TForm1::AddBookmark1Click(TObject *Sender) +{ +// TMenuItem *newitem; + + Bookmarksfrm->bmtree->Items->AddChild(Bookmarksfrm->bmtree->Items->Item[0], (const char *)DefaultVSKey); +} + +void TForm1::AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree) +{ + TMenuItem *newitem; + + for (tree = tree->getFirstChild(); tree; tree = tree->getNextSibling()) { + newitem = new TMenuItem(menu); + newitem->Caption = tree->Text; + if (!tree->getFirstChild()) + newitem->OnClick = BookmarkItemClick; + item->Add(newitem); + AddSectionToMenu(menu, newitem, tree); + } +} + +void TForm1::RefreshBookmarksMenu(TMenu *menu, TTreeView *treeview) +{ + TMenuItem *newitem; + TTreeNode *tree = 0; + + if (treeview->Items->Count) + tree = treeview->Items->Item[0]; + + while (menu->Items->Count > 3) + menu->Items->Delete(3); + + for (;tree;tree = tree->getNextSibling()) { + newitem = new TMenuItem(menu); + newitem->Caption = tree->Text; + menu->Items->Add(newitem); + AddSectionToMenu(menu, newitem, tree); + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::BookmarkbtnClick(TObject *Sender) +{ + TPoint menup; + TPoint point; + point.x = 0; + point.y = Bookmarkbtn->Height; + menup = Bookmarkbtn->ClientToScreen(point); + RefreshBookmarksMenu(BookmarkPopup, Bookmarksfrm->bmtree); + BookmarkPopup->Popup(menup.x, menup.y); +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::EditBookmarks1Click(TObject *Sender) +{ + Bookmarksfrm->Show(); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::FormKeyDown(TObject *Sender, WORD &Key, + TShiftState Shift) +{ + char buf[5]; + int val; + ModMap::iterator it; + TPageControl *pc = textTabs->pageControl; + + if ((Shift.Contains(ssCtrl)) && (!Shift.Contains(ssAlt))) { + if ((Key >= '0') && (Key <= '9')) { + sprintf(buf, "%c", Key); + val = atoi(buf); + + if (!Shift.Contains(ssShift)) { + if ((Screen->ActiveControl == PageControl2) || (IsChild(PageControl2->Handle, Screen->ActiveControl->Handle))) + pc = PageControl2; + if ((Screen->ActiveControl == PageControl3) || (IsChild(PageControl3->Handle, Screen->ActiveControl->Handle))) + pc = PageControl3; + + it = mainmgr->Modules.find(pc->ActivePage->Caption.c_str()); + if (it != mainmgr->Modules.end()) { + if (ctrlstates[val]) + delete ctrlstates[val]; + + ctrlstates[val] = new ModState(pc, pc->ActivePage, (*it).second->KeyText()); + } + } + else RestoreState(ctrlstates[val]); + } + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::Options1Click(TObject *Sender) +{ + ModMap::iterator it; + SectionMap::iterator sit; + ConfigEntMap emap; + int color; + + if ((sit = optionsconf->Sections.find("Appearance")) != optionsconf->Sections.end()) { + Optionsfrm->CurrentVSColor->Brush->Color = atoi((*sit).second["CurrentVSColorRed"].c_str()) + | (atoi((*sit).second["CurrentVSColorGreen"].c_str()) << 8) + | (atoi((*sit).second["CurrentVSColorBlue"].c_str()) << 16); + Optionsfrm->AutoVSColor->Checked = ((atoi((*sit).second["AutoVSColor"].c_str()))?true:false); + } + + if ((sit = optionsconf->Sections.find("Bookmarks")) != optionsconf->Sections.end()) { + Optionsfrm->AutoBMPersonal->Checked = ((atoi((*sit).second["AutoSavePersonal"].c_str()))?true:false); + Optionsfrm->AutoBMOther->Checked = ((atoi((*sit).second["AutoSaveOther"].c_str()))?true:false); + } + + if (Optionsfrm->ShowModal() == mrOk) { + emap = optionsconf->Sections["Appearance"]; + color = Optionsfrm->CurrentVSColor->Brush->Color; + emap["CurrentVSColorRed"] = IntToStr(color & 0xFF).c_str(); + emap["CurrentVSColorGreen"] = IntToStr((color >> 8) & 0xFF).c_str(); + emap["CurrentVSColorBlue"] = IntToStr((color >> 16) & 0xFF).c_str(); + emap["AutoVSColor"] = IntToStr((Optionsfrm->AutoVSColor->Checked)?1:0).c_str(); + optionsconf->Sections["Appearance"] = emap; + + emap = optionsconf->Sections["Bookmarks"]; + emap["AutoSavePersonal"] = IntToStr((Optionsfrm->AutoBMPersonal->Checked)?1:0).c_str(); + emap["AutoSaveOther"] = IntToStr((Optionsfrm->AutoBMOther->Checked)?1:0).c_str(); + optionsconf->Sections["Bookmarks"] = emap; + + optionsconf->Save(); + } +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::cbBookChange(TObject *Sender) +{ + CHBox->Text = "1"; + VSBox->Text = "1"; + if (Screen->ActiveControl == cbBook) + btnLookupClick(Sender); +} +//--------------------------------------------------------------------------- +void __fastcall TForm1::PopupMenuPopup(TObject *Sender) +{ + + int versestart, verseend; + TMenuItem * newitem; + TPopupMenu *menu = (TPopupMenu *)Sender; + int staticMenuItemsCount = 0; + + if (menu == PopupMenu1) + staticMenuItemsCount = 3; + else if (menu == PopupMenu2) + staticMenuItemsCount = 2; + else if (menu == PopupMenu3) + staticMenuItemsCount = 6; + + while (menu->Items->Count > staticMenuItemsCount) + menu->Items->Delete(staticMenuItemsCount); + + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + if (!rtf->SelLength) { + for (versestart = rtf->SelStart; ((versestart)&&(rtf->Text[versestart] != '#')); versestart--); + if (versestart) { + for (verseend = versestart; ((verseend < rtf->Text.Length())&&(rtf->Text[verseend] != '|')); verseend++); + if ((verseend < rtf->Text.Length()) && (verseend > rtf->SelStart)) { + int len = (verseend - versestart) + 1; + char *buf = new char [ len + 1 ]; + memset(buf, 0 , len + 1); + strncpy(buf, &rtf->Text.c_str()[versestart], len - 2); // strip the # and | from the string + tmpVerseList = DefaultVSKey.ParseVerseList(buf, DefaultVSKey); + + ModMap::iterator target; + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + char *keytext = 0; // check for and remove return at end of keytext + stdstr(&keytext, (*(*target).second).KeyText()); + if (keytext[strlen(keytext)-1] == '\r') + keytext[strlen(keytext)-1] = 0; + + tmpVerseListCaption = String("VerseList from- ") + (*target).first.c_str() + ": " + keytext; + delete [] keytext; // --------------------------------- + } + delete [] buf; + newitem = new TMenuItem(menu); + newitem->Caption = "-"; + menu->Items->Add(newitem); + newitem = new TMenuItem(menu); + newitem->Caption = "Create Verse List"; + newitem->Hint = "Create a New Verse List Window"; + newitem->Default = true; + newitem->OnClick = createVerseList; + menu->Items->Add(newitem); + versestart = 3; + while (!tmpVerseList.Error()) { + versestart++; + newitem = new TMenuItem(menu); + newitem->Caption = (const char *)tmpVerseList; + newitem->OnClick = BookmarkItemClick; + if (!(versestart%15)) + newitem->Break = mbBreak; + menu->Items->Add(newitem); + tmpVerseList++; + } + } + } + } + +} +//--------------------------------------------------------------------------- + + +void __fastcall TForm1::createVerseList(TObject *Sender) +{ + TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList); + tmpForm->Caption = tmpVerseListCaption; + tmpForm->Show(); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::freeHandLookupKeyPress(TObject *Sender, char &Key) +{ + if (Key == '\r') { + ListKey tmpVerseList = DefaultVSKey.ParseVerseList(freeHandLookup->Text.c_str(), DefaultVSKey); + if (tmpVerseList.Count() > 1) { + TVerseListFrm *tmpForm = new TVerseListFrm(this, tmpVerseList); + tmpForm->Caption = "User Verse List"; + tmpForm->Show(); + } + if (tmpVerseList.Count()) { + tmpVerseList = TOP; + DefaultVSKey = tmpVerseList; + TextKeyChanged(); + } + } +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::RTFMouseDown(TObject *Sender, TMouseButton Button, + TShiftState Shift, int X, int Y) +{ + ((TWinControl *)Sender)->SetFocus(); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::EditEntry1Click(TObject *Sender) +{ + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + SWModule *module = 0; +// EditEntry->RichEdit1->Text = rtf->Text; + ModMap::iterator target; + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + EditEntry->Module = module = (*target).second; + EditEntry->RTFDisplay = rtf; + } + else EditEntry->Module = module = 0; + EditEntry->ShowModal(); + if (EditEntry->ResultBuf) { + if (module) +// DictKeyEdit->Text = EditEntry->ResultBuf; // for testing purposes + *module << EditEntry->ResultBuf; + } + RefreshActiveSheet(PageControl2); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::DeleteEntry1Click(TObject *Sender) +{ + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + SWModule *module = 0; + ModMap::iterator target; + + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + module = (*target).second; + module->deleteEntry(); + } + RefreshActiveSheet(PageControl2); +} +//--------------------------------------------------------------------------- + +void __fastcall TForm1::LinktoVerse1Click(TObject *Sender) +{ + if (VerseSelFrm->ShowModal() == mrOk) { + SWDispRTF *rtf = (SWDispRTF *)Screen->ActiveControl; + SWModule *module = 0; + ModMap::iterator target; + SWKey *linkkey = new VerseKey(VerseSelFrm->Panel2->Caption.c_str()); + + target = mainmgr->Modules.find(((TPageControl*)rtf->Parent->Parent)->ActivePage->Caption.c_str()); + if (target != Form1->mainmgr->Modules.end()) { + module = (*target).second; + *module << linkkey; + } + RefreshActiveSheet(PageControl2); + } +} +//--------------------------------------------------------------------------- + + + diff --git a/apps/windoze/CBuilder5/prototype/mainfrm.h b/apps/windoze/CBuilder5/prototype/mainfrm.h new file mode 100644 index 0000000..c24ca52 --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/mainfrm.h @@ -0,0 +1,238 @@ +//--------------------------------------------------------------------------- +#ifndef mainfrmH +#define mainfrmH +//--------------------------------------------------------------------------- +#include <vcl\Classes.hpp> +#include <vcl\Controls.hpp> +#include <vcl\StdCtrls.hpp> +#include <vcl\Forms.hpp> +#include <vcl\ExtCtrls.hpp> +#include <vcl\ComCtrls.hpp> +#include <swmgr.h> +#include <swtext.h> +#include <strkey.h> +#include <regex.h> +#include <listkey.h> +#include "swdisprtfchap.h" +#include <vcl\Buttons.hpp> +#include <vcl\Menus.hpp> +#include <vcl\DdeMan.hpp> +//#include <NMHTML.hpp> +#include <OleCtrls.hpp> +#include <ToolWin.hpp> +//#include <vcl\isp.hpp> +#include <shellapi.h> +#include <Graphics.hpp> +#include <ImgList.hpp> +#include <list> +#include <vector> +#include "TextPanel.h" +#include "ModTabPanel.h" + +class RTFDisp : public SWDisplay { + SWDispRTF *edit; +public: + RTFDisp(SWDispRTF *iedit) { edit = iedit; } + RTFDisp() {} + char Display(SWModule &imodule) { + edit->Display(imodule); + } +}; + +/* +class HREFDisp : public SWDisplay { + THTML *edit; +public: + HREFDisp(THTML *iedit) { edit = iedit; } + HREFDisp() {} + char Display(SWModule &imodule) { + edit->RequestDoc((char *)imodule); + } +}; +*/ + +class DispExternal : public SWDisplay { +public: + DispExternal() {} + char Display(SWModule &imodule) { + SHELLEXECUTEINFO info; + info.cbSize = sizeof(SHELLEXECUTEINFO); + info.fMask = SEE_MASK_NOCLOSEPROCESS; //SEE_MASK_CLASSNAME; + info.hwnd = GetFocus(); + info.lpVerb = "open"; + info.lpFile = (char *)imodule; + info.lpParameters = NULL; + info.lpDirectory = NULL; + info.nShow = 0; +// info.lpClass = ".html"; + ShellExecuteEx(&info); +// ShellExecute(edit->Handle, "open", (char *)imodule, NULL, NULL, SW_SHOWNORMAL); + } +}; + + +class ModState { +public: + ModState(TPageControl *ipc, TTabSheet *iap, SWKey ikey) { pc = ipc; ap = iap; key = ikey; } + ModState(); + TPageControl *pc; + TTabSheet* ap; + SWKey key; +}; + +//--------------------------------------------------------------------------- +class TForm1 : public TForm +{ +__published: // IDE-managed Components + TPanel *pnlTextCom; + TSplitter *Splitter2; + TPanel *pnlText; + TPanel *pnlComment; + TSplitter *Splitter1; + TPanel *pnlDict; + TPageControl *PageControl2; + TStatusBar *StatusBar1; + TPageControl *PageControl3; + + TPanel *pnlDictHeader; + TLabel *Label1; + TRichEdit *DictKeyEdit; + TMainMenu *MainMenu1; + TMenuItem *Search1; + TMenuItem *NewSearchWindow1; + TMenuItem *Help1; + TMenuItem *About1; + TPopupMenu *PopupMenu2; + TMenuItem *DictionaryLookup1; + TMenuItem *File1; + TMenuItem *SaveLayout1; + TMenuItem *Exit1; + TMenuItem *N1; + TDdeServerItem *Search; + TDdeServerItem *Lookup; + TDdeServerConv *Bible; + TPopupMenu *PopupMenu1; + TMenuItem *MenuItem1; + TMenuItem *Copy1; + TMenuItem *CopyasBGreekTransliteration1; + TMenuItem *Copy2; + TMenuItem *Edit1; + TMenuItem *Copy3; + TPopupMenu *BookmarkPopup; + TMenuItem *AddBookmark1; + TMenuItem *N2; + TMenuItem *EditBookmarks1; + TMenuItem *Options1; + TCoolBar *CoolBar1; + TImageList *ImageList1; + TImage *BackBtnImage; + TImage *SearchBtnImage; + TToolBar *ToolBar2; + TToolButton *ToolButton3; + TToolButton *ToolButton4; + TPanel *pnlSpeed; + TPanel *Panel1; + TComboBox *cbBook; + TEdit *CHBox; + TUpDown *UpDown1; + TEdit *VSBox; + TUpDown *UpDown2; + TSpeedButton *btnLookup; + TToolBar *ToolBar1; + TImageList *ImageList2; + TImage *BookmarkBtnImage; + TSpeedButton *Bookmarkbtn; + TPopupMenu *PopupMenu3; + TMenuItem *MenuItem2; + TMenuItem *MenuItem3; + TMenuItem *N3; + TMenuItem *EditEntry1; + TMenuItem *DeleteEntry1; + TMenuItem *LinktoVerse1; + TUpDown *UpDown3; + TComboBox *freeHandLookup; + void __fastcall PageControl1Change(TObject *Sender); + void __fastcall btnLookupClick(TObject *Sender); + void __fastcall PageControl2Change(TObject *Sender); + + + + void __fastcall DictKeyEditChange(TObject *Sender); + void __fastcall PageControl3Change(TObject *Sender); + void __fastcall NewSearchWindow1Click(TObject *Sender); + + void __fastcall Exit1Click(TObject *Sender); + void __fastcall About1Click(TObject *Sender); + void __fastcall DictionaryLookup1Click(TObject *Sender); + void __fastcall SaveLayout1Click(TObject *Sender); + + void __fastcall LookupPokeData(TObject *Sender); + + void __fastcall SearchPokeData(TObject *Sender); + void __fastcall UpDown3Click(TObject *Sender, TUDBtnType Button); + void __fastcall UpDown1Click(TObject *Sender, TUDBtnType Button); + + + void __fastcall BackbtnClick(TObject *Sender); + void __fastcall Button1Click(TObject *Sender); + void __fastcall CopyasBGreekTransliteration1Click(TObject *Sender); + void __fastcall Copy1Click(TObject *Sender); + + + + void __fastcall AddBookmark1Click(TObject *Sender); + void __fastcall BookmarkItemClick(TObject *Sender); + void __fastcall BookmarkbtnClick(TObject *Sender); + void __fastcall EditBookmarks1Click(TObject *Sender); + + void __fastcall FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift); + void __fastcall Options1Click(TObject *Sender); + void __fastcall cbBookChange(TObject *Sender); + + void __fastcall FormCreate(TObject *Sender); + void __fastcall DisplayHint(TObject* Sender) ; + void __fastcall PopupMenuPopup(TObject *Sender); + void __fastcall createVerseList(TObject *Sender); + void __fastcall freeHandLookupKeyPress(TObject *Sender, char &Key); + void __fastcall RTFMouseDown(TObject *Sender, TMouseButton Button, TShiftState Shift, int X, int Y); + void __fastcall EditEntry1Click(TObject *Sender); + void __fastcall DeleteEntry1Click(TObject *Sender); + void __fastcall LinktoVerse1Click(TObject *Sender); + +private: // User declarations + list <SWDisplay *> displays; // so we can delete each display we create + list <ModState *> modstates; + vector <ModState *> ctrlstates; + bool logmodstate; + bool freshdict; + + char CreateTextPane(SWModule *mod, char *font = 0); + char CreateCommentPane(SWModule *mod); + char CreateLDPane(SWModule *mod); + void PushState(); + void BackState(); + void ForwardState(); + void BuildRTFHeader(char *buf, char *font, int max); + void AddSectionToMenu(TMenu *menu, TMenuItem *item, TTreeNode *tree); + +public: // User declarations + TModTabPanel *textTabs; + VerseKey DefaultVSKey; + SWKey DefaultStrKey; + SWMgr *mainmgr; + SWConfig *layoutconf; + SWConfig *optionsconf; + __fastcall TForm1(TComponent* Owner); + __fastcall ~TForm1(); +// virtual void __fastcall CreateWnd(); + void RefreshActiveSheet(TPageControl *ts); + void TextKeyChanged(); // updates dependents on TextKeyChanged + void RefreshBookmarksMenu(TMenu *menu, TTreeView *tree); + void RestoreState(ModState *state); + ListKey tmpVerseList; + String tmpVerseListCaption; +}; +//--------------------------------------------------------------------------- +extern TForm1 *Form1; +//--------------------------------------------------------------------------- +#endif diff --git a/apps/windoze/CBuilder5/prototype/sword.bpr b/apps/windoze/CBuilder5/prototype/sword.bpr new file mode 100644 index 0000000..f325f9a --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/sword.bpr @@ -0,0 +1,124 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.05.03"/> + <PROJECT value="sword.exe"/> + <OBJFILES value="sword.obj mainfrm.obj ModInstForm.obj ..\..\swdisprtf.obj + ..\..\swdisprtfchap.obj ..\..\swwinlog.obj ..\..\tbdisp.obj searchfrm.obj + editentryfrm.obj biblecsmgr.obj bookmarkfrm.obj AboutBoxfrm.obj + optionfrm.obj vrslstfrm.obj versesel.obj newbmfilefrm.obj CommentPanel.obj + ModTabPanel.obj AppBar.obj BookMarkPanel.obj TextPanel.obj LDPanel.obj + DeskTopNameForm.obj DockCanvas.obj"/> + <RESFILES value="sword.res"/> + <IDLFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES) mainfrm.dfm ModInstForm.dfm searchfrm.dfm editentryfrm.dfm + bookmarkfrm.dfm AboutBoxfrm.dfm optionfrm.dfm vrslstfrm.dfm versesel.dfm + newbmfilefrm.dfm AppBar.dfm DeskTopNameForm.dfm DockCanvas.dfm"/> + <LIBFILES value="swordlib.lib"/> + <LIBRARIES value="vclx50.lib vcl50.lib"/> + <SPARELIBS value="vcl50.lib vclx50.lib"/> + <PACKAGES value="vcl50.bpi vclx50.bpi vcljpg50.bpi vclmid50.bpi vcldb50.bpi vclbde50.bpi + bcbsmp50.bpi vcldbx50.bpi qrpt50.bpi teeui50.bpi teedb50.bpi tee50.bpi + dss50.bpi ibsmp50.bpi nmfast50.bpi inetdb50.bpi inet50.bpi dclocx50.bpi"/> + <PATHCPP value=".;..\..\..\windoze"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value="$(BCB)\lib\debug"/> + <RELEASELIBPATH value="$(BCB)\lib\release"/> + <LINKER value="ilink32"/> + <USERDEFINES value="_DEBUG"/> + <SYSDEFINES value="NO_STRICT;_VIS_NOLIB"/> + <MAINSOURCE value="sword.cpp"/> + <INCLUDEPATH value=""C:\Program Files\Common Files\Borland Shared\Images\Buttons\";..\..\..\windoze;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include"/> + <LIBPATH value=""C:\Program Files\Common Files\Borland Shared\Images\Buttons\";$(BCB)\Projects\Lib;"C:\program files\borland\cbuilder4\Lib\";..\..\..\windoze;$(BCB)\lib\obj;$(BCB)\lib"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + </MACROS> + <OPTIONS> + <IDLCFLAGS value="-I"..\..\..\..\..\..\..\Program Files\Common Files\Borland Shared\Images\Buttons" + -I..\.. -I$(BCB)\include -I$(BCB)\include\vcl -I..\..\..\..\include + -src_suffix cpp -boa"/> + <CFLAG1 value="-Od -H=c:\PROGRA~1\BORLAND\CBUILD~1\lib\vcl50.csm -Hc -Vx -Ve -X- -r- -a8 + -b- -k -y -v -vi- -c -tW -tWM"/> + <PFLAGS value="-$Y+ -$W -$O- -v -JPHNE -M"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zi"/> + <LFLAGS value="-D"" -aa -Tpe -x -Gn -v"/> + </OPTIONS> + <LINKER> + <ALLOBJ value="c0w32.obj sysinit.obj $(OBJFILES)"/> + <ALLRES value="$(RESFILES)"/> + <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/> + </LINKER> + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[HistoryLists\hlIncludePath] +Count=5 +Item0=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;..\..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item1=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;..\..\..\windoze;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item2=..\..\..\..\..\..\..\Program Files\Common Files\Borland Shared\Images\Buttons;..\..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item3=..\..;$(BCB)\include;$(BCB)\include\vcl;..\..\..\..\include +Item4=$(BCB)\include;$(BCB)\include\vcl;../../../../include + +[HistoryLists\hlLibraryPath] +Count=5 +Item0=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;$(BCB)\Projects\Lib;C:\program files\borland\cbuilder4\Lib\;..\..;$(BCB)\lib\obj;$(BCB)\lib +Item1=C:\Program Files\Common Files\Borland Shared\Images\Buttons\;$(BCB)\Projects\Lib;C:\program files\borland\cbuilder4\Lib\;..\..\..\windoze;$(BCB)\lib\obj;$(BCB)\lib +Item2=..\..\..\..\..\..\..\Program Files\Common Files\Borland Shared\Images\Buttons;$(BCB)\Projects\Lib;..\..\..\..\..\..\..\program files\borland\cbuilder4\Lib;..\..;$(BCB)\lib\obj;$(BCB)\lib +Item3=..\..;$(BCB)\lib\obj;$(BCB)\lib +Item4=$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/prototype/sword.cpp b/apps/windoze/CBuilder5/prototype/sword.cpp new file mode 100644 index 0000000..113f717 --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/sword.cpp @@ -0,0 +1,47 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop +USERES("sword.res"); +USEFORM("mainfrm.cpp", Form1); +USELIB("swordlib.lib"); +USEFORM("ModInstForm.cpp", ModInstFrm); +USEUNIT("..\..\swdisprtf.cpp"); +USEUNIT("..\..\swdisprtfchap.cpp"); +USEUNIT("..\..\swwinlog.cpp"); +USEUNIT("..\..\tbdisp.cpp"); +USEFORM("searchfrm.cpp", Form2); +USEFORM("editentryfrm.cpp", EditEntry); +USEUNIT("biblecsmgr.cpp"); +USEFORM("bookmarkfrm.cpp", Bookmarksfrm); +USEFORM("AboutBoxfrm.cpp", AboutBox); +USEFORM("optionfrm.cpp", Optionsfrm); +USEFORM("vrslstfrm.cpp", VerseListFrm); +USEFORM("versesel.cpp", VerseSelFrm); +USEFORM("newbmfilefrm.cpp", NewBMfrm); +USEUNIT("CommentPanel.cpp"); +USEUNIT("ModTabPanel.cpp"); +USEFORM("AppBar.cpp", AppBarFrm); +USEUNIT("BookMarkPanel.cpp"); +USEUNIT("TextPanel.cpp"); +USEUNIT("LDPanel.cpp"); +USEFORM("DeskTopNameForm.cpp", DeskTopNameFrm); +USEFORM("DockCanvas.cpp", DockCanvasFrm); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE, HINSTANCE, LPSTR, int) +{ + try + { + Application->Initialize(); + Application->CreateForm(__classid(TAppBarFrm), &AppBarFrm); + Application->CreateForm(__classid(TDeskTopNameFrm), &DeskTopNameFrm); + Application->CreateForm(__classid(TDockCanvasFrm), &DockCanvasFrm); + Application->Run(); + } + catch (Exception &exception) + { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- + diff --git a/apps/windoze/CBuilder5/prototype/swordlib.bpr b/apps/windoze/CBuilder5/prototype/swordlib.bpr new file mode 100644 index 0000000..3948c15 --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/swordlib.bpr @@ -0,0 +1,168 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.05.03"/> + <PROJECT value="swordlib.lib"/> + <OBJFILES value="swordlib.obj ..\..\..\..\src\keys\versekey.obj + ..\..\..\..\src\keys\swkey.obj ..\..\..\..\src\keys\listkey.obj + ..\..\..\..\src\keys\strkey.obj ..\..\..\..\src\mgr\swmgr.obj + ..\..\..\..\src\mgr\swconfig.obj + ..\..\..\..\src\modules\comments\rawcom\rawcom.obj + ..\..\..\..\src\modules\comments\swcom.obj + ..\..\..\..\src\modules\common\rawverse.obj + ..\..\..\..\src\modules\common\rawstr.obj + ..\..\..\..\src\modules\filters\rwprtf.obj + ..\..\..\..\src\modules\filters\gbfrtf.obj + ..\..\..\..\src\modules\filters\gbfplain.obj + ..\..\..\..\src\modules\lexdict\rawld\rawld.obj + ..\..\..\..\src\modules\lexdict\swld.obj + ..\..\..\..\src\modules\texts\rawgbf\rawgbf.obj + ..\..\..\..\src\modules\texts\rawtext\rawtext.obj + ..\..\..\..\src\modules\texts\swtext.obj + ..\..\..\..\src\modules\swmodule.obj ..\..\tbdisp.obj + ..\..\swdisprtfchap.obj ..\..\swwinlog.obj ..\..\swdisprtf.obj + ..\..\..\..\src\modules\comments\hrefcom\hrefcom.obj + ..\..\..\..\src\mgr\filemgr.obj + ..\..\..\..\src\modules\comments\rawfiles\rawfiles.obj + ..\..\..\..\src\utilfuns\utilstr.obj ..\..\..\..\src\utilfuns\utilconf.obj + ..\..\..\..\src\utilfuns\Greek2Greek.obj + ..\..\..\..\src\utilfuns\regex.obj ..\..\..\..\src\frontend\swlog.obj + ..\..\..\..\src\frontend\swdisp.obj + ..\..\..\..\src\modules\filters\gbfstrongs.obj + ..\..\..\..\src\modules\filters\gbffootnotes.obj + ..\..\..\..\src\modules\filters\cipherfil.obj + ..\..\..\..\src\modules\common\sapphire.obj + ..\..\..\..\src\modules\common\swcipher.obj + ..\..\..\..\src\mgr\swlocale.obj ..\..\..\..\src\mgr\localemgr.obj + ..\..\..\..\src\modules\common\lzsscomprs.obj + ..\..\..\..\src\modules\common\zverse.obj + ..\..\..\..\src\modules\common\swcomprs.obj + ..\..\..\..\src\modules\texts\ztext\ztext.obj + ..\..\..\..\src\modules\filters\thmlrtf.obj + ..\..\..\..\src\modules\filters\gbfhtml.obj + ..\..\..\..\src\modules\filters\gbfthml.obj + ..\..\..\..\src\modules\filters\plainfootnotes.obj + ..\..\..\..\src\modules\filters\plainhtml.obj + ..\..\..\..\src\modules\filters\rtfhtml.obj + ..\..\..\..\src\modules\filters\rwphtml.obj + ..\..\..\..\src\modules\filters\thmlgbf.obj + ..\..\..\..\src\modules\filters\thmlhtml.obj + ..\..\..\..\src\modules\filters\thmlplain.obj"/> + <RESFILES value=""/> + <IDLFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES)"/> + <LIBFILES value=""/> + <LIBRARIES value="nmfast50.lib vclx50.lib vcl50.lib"/> + <SPARELIBS value="vcl50.lib vclx50.lib nmfast50.lib"/> + <PACKAGES value=""/> + <PATHCPP value=".;..\..\..\..\src\keys;..\..\..\..\src\mgr;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\common;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts;..\..\..\..\src\modules;..\..\..\windoze;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\utilfuns;..\..\..\..\src\frontend;..\..\..\..\src\modules\texts\ztext"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value=""/> + <RELEASELIBPATH value=""/> + <LINKER value="TLib"/> + <USERDEFINES value="_DEBUG"/> + <SYSDEFINES value="NO_STRICT;_NO_VCL"/> + <MAINSOURCE value="swordlib.cpp"/> + <INCLUDEPATH value="..\..\..\windoze;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl"/> + <LIBPATH value="..\..\..\windoze;..\..\..\..\src\modules\texts\ztext;..\..\..\..\src\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + <LISTFILE value=""/> + </MACROS> + <OPTIONS> + <CFLAG1 value="-Od -H=c:\PROGRA~1\borland\CBUILD~2\lib\vcl50.csm -Hc -Vx -Ve -RT- -X- -r- + -a8 -4 -b- -k -y -v -vi- -c -g0 -tWM"/> + <PFLAGS value="-$Y+ -$W -$O- -v -M -JPHNE"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zi"/> + <LFLAGS value="/P128"/> + </OPTIONS> + <LINKER> + <ALLOBJ value="$(OBJFILES)"/> + <ALLRES value=""/> + <ALLLIB value="cg32.lib"/> + </LINKER> + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=0 +AutoIncBuild=0 +MajorVer=1 +MinorVer=0 +Release=0 +Build=0 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName= +FileDescription= +FileVersion=1.0.0.0 +InternalName= +LegalCopyright= +LegalTrademarks= +OriginalFilename= +ProductName= +ProductVersion=1.0.0.0 +Comments= + +[HistoryLists\hlIncludePath] +Count=13 +Item0=..\..;..\..\..\..\src\modules\texts\ztext;..\..\..\windoze;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item1=..\..\..\..\src\modules\texts\ztext;..\..;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item2=..\..\..\..\src\modules\texts\ztext;..\..\..\windoze;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item3=..\..;..\..\..\..\src\frontend;..\..\..;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item4=..\..;..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item5=..\..\..\..\src\frontend;..\..\..\..\apps;..\..\..\..\utilfuns;..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item6=..\..\..\framework;..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item7=..\..\..\..\src\modules\comments\rawfiles;..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item8=..\..\..\..\src\modules\comments\hrefcom;..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item9=..\..\..\..\include;..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item10=..\..\..\..\frontend;..\..\..\windoze;..\..\..\..\src\utilfuns;..\..\..\..\src\modules;..\..\..\..\src\modules\texts;..\..\..\..\src\modules\texts\rawtext;..\..\..\..\src\modules\texts\rawgbf;..\..\..\..\src\modules\lexdict;..\..\..\..\src\modules\lexdict\rawld;..\..\..\..\src\modules\filters;..\..\..\..\src\modules\common;..\..\..\..\src\modules\comments;..\..\..\..\src\modules\comments\rawcom;..\..\..\..\src\mgr;..\..\..\..\src\keys;$(BCB)\include;$(BCB)\include\vcl +Item11=c:\usr\troy\src\sword\include;c:\usr\troy\src\sword\frontend;c:\usr\troy\src\sword\frontend\windoze;c:\usr\troy\src\sword\utilfuns;c:\usr\troy\src\sword\modules;c:\usr\troy\src\sword\modules\texts;c:\usr\troy\src\sword\modules\texts\rawtext;c:\usr\troy\src\sword\modules\texts\rawgbf;c:\usr\troy\src\sword\modules\lexdict;c:\usr\troy\src\sword\modules\lexdict\rawld;c:\usr\troy\src\sword\modules\filters;c:\usr\troy\src\sword\modules\common;c:\usr\troy\src\sword\modules\comments;c:\usr\troy\src\sword\modules\comments\rawcom;c:\usr\troy\src\sword\mgr;c:\usr\troy\src\sword\keys;$(BCB)\include;$(BCB)\include\vcl +Item12=c:\usr\src\sword\include;c:\usr\troy\src\sword\frontend;c:\usr\troy\src\sword\frontend\windoze;c:\usr\troy\src\sword\utilfuns;c:\usr\troy\src\sword\modules;c:\usr\troy\src\sword\modules\texts;c:\usr\troy\src\sword\modules\texts\rawtext;c:\usr\troy\src\sword\modules\texts\rawgbf;c:\usr\troy\src\sword\modules\lexdict;c:\usr\troy\src\sword\modules\lexdict\rawld;c:\usr\troy\src\sword\modules\filters;c:\usr\troy\src\sword\modules\common;c:\usr\troy\src\sword\modules\comments;c:\usr\troy\src\sword\modules\comments\rawcom;c:\usr\troy\src\sword\mgr;c:\usr\troy\src\sword\keys;$(BCB)\include;$(BCB)\include\vcl + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=2 +Item0=_DEBUG +Item1=_NO_VCL + +[HistoryLists\hlTlibPageSize] +Count=3 +Item0=0x0080 +Item1=128 +Item2=0x0040 + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +HostApplication= +RemoteHost= +RemotePath= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=1 +LinkCGLIB=0 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder5/prototype/swordlib.cpp b/apps/windoze/CBuilder5/prototype/swordlib.cpp new file mode 100644 index 0000000..fb5ebe2 --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/swordlib.cpp @@ -0,0 +1,61 @@ +//--------------------------------------------------------------------------- +#include <condefs.h> +#pragma hdrstop +USEUNIT("..\..\..\..\src\keys\versekey.cpp"); +USEUNIT("..\..\..\..\src\keys\swkey.cpp"); +USEUNIT("..\..\..\..\src\keys\listkey.cpp"); +USEUNIT("..\..\..\..\src\keys\strkey.cpp"); +USEUNIT("..\..\..\..\src\mgr\swmgr.cpp"); +USEUNIT("..\..\..\..\src\mgr\swconfig.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\rawcom\rawcom.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\swcom.cpp"); +USEUNIT("..\..\..\..\src\modules\common\rawverse.cpp"); +USEUNIT("..\..\..\..\src\modules\common\rawstr.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\rwprtf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfrtf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfplain.cpp"); +USEUNIT("..\..\..\..\src\modules\lexdict\rawld\rawld.cpp"); +USEUNIT("..\..\..\..\src\modules\lexdict\swld.cpp"); +USEUNIT("..\..\..\..\src\modules\texts\rawgbf\rawgbf.cpp"); +USEUNIT("..\..\..\..\src\modules\texts\rawtext\rawtext.cpp"); +USEUNIT("..\..\..\..\src\modules\texts\swtext.cpp"); +USEUNIT("..\..\..\..\src\modules\swmodule.cpp"); +USEUNIT("..\..\tbdisp.cpp"); +USEUNIT("..\..\swdisprtfchap.cpp"); +USEUNIT("..\..\swwinlog.cpp"); +USEUNIT("..\..\swdisprtf.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\hrefcom\hrefcom.cpp"); +USEUNIT("..\..\..\..\src\mgr\filemgr.cpp"); +USEUNIT("..\..\..\..\src\modules\comments\rawfiles\rawfiles.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\utilstr.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\utilconf.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\Greek2Greek.cpp"); +USEUNIT("..\..\..\..\src\utilfuns\regex.c"); +USEUNIT("..\..\..\..\src\frontend\swlog.cpp"); +USEUNIT("..\..\..\..\src\frontend\swdisp.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfstrongs.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbffootnotes.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\cipherfil.cpp"); +USEUNIT("..\..\..\..\src\modules\common\sapphire.cpp"); +USEUNIT("..\..\..\..\src\modules\common\swcipher.cpp"); +USEUNIT("..\..\..\..\src\mgr\swlocale.cpp"); +USEUNIT("..\..\..\..\src\mgr\localemgr.cpp"); +USEUNIT("..\..\..\..\src\modules\common\lzsscomprs.cpp"); +USEUNIT("..\..\..\..\src\modules\common\zverse.cpp"); +USEUNIT("..\..\..\..\src\modules\common\swcomprs.cpp"); +USEUNIT("..\..\..\..\src\modules\texts\ztext\ztext.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlrtf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\gbfthml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\plainfootnotes.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\plainhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\rtfhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\rwphtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlgbf.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlhtml.cpp"); +USEUNIT("..\..\..\..\src\modules\filters\thmlplain.cpp"); +//--------------------------------------------------------------------------- +#define Library + +// To add a file to the library use the Project menu 'Add to Project'. + diff --git a/apps/windoze/CBuilder5/prototype/swordprj.bpg b/apps/windoze/CBuilder5/prototype/swordprj.bpg new file mode 100644 index 0000000..0333c75 --- /dev/null +++ b/apps/windoze/CBuilder5/prototype/swordprj.bpg @@ -0,0 +1,23 @@ +#------------------------------------------------------------------------------ +VERSION = BWS.01 +#------------------------------------------------------------------------------ +!ifndef ROOT +ROOT = $(MAKEDIR)\.. +!endif +#------------------------------------------------------------------------------ +MAKE = $(ROOT)\bin\make.exe -$(MAKEFLAGS) -f$** +DCC = $(ROOT)\bin\dcc32.exe $** +BRCC = $(ROOT)\bin\brcc32.exe $** +#------------------------------------------------------------------------------ +PROJECTS = swordlib.lib sword.exe +#------------------------------------------------------------------------------ +default: $(PROJECTS) +#------------------------------------------------------------------------------ + +swordlib.lib: swordlib.bpr + $(MAKE) + +sword.exe: sword.bpr + $(MAKE) + + diff --git a/apps/windoze/CBuilder6/BibleCS/sword.bpr b/apps/windoze/CBuilder6/BibleCS/sword.bpr new file mode 100644 index 0000000..e941b25 --- /dev/null +++ b/apps/windoze/CBuilder6/BibleCS/sword.bpr @@ -0,0 +1,221 @@ +<?xml version='1.0' encoding='utf-8' ?> +<!-- C++Builder XML Project --> +<PROJECT> + <MACROS> + <VERSION value="BCB.06.00"/> + <PROJECT value=""C:\Documents and Settings\dtrotzjr\My Documents\My Projects\The Sword Project\Stage_Sword\sword.exe""/> + <OBJFILES value="obj\sword.obj obj\swdisprtfchap.obj obj\swdisprtf.obj obj\AboutBoxfrm.obj + obj\biblecsmgr.obj obj\bookmarkfrm.obj obj\DevOfTheDay.obj + obj\editentryfrm.obj obj\FontSel.obj obj\mainfrm.obj obj\ModInstForm.obj + obj\ModVisFrm.obj obj\newbmfilefrm.obj obj\optionfrm.obj + obj\RangeMaintFrm.obj obj\searchfrm.obj obj\splashfrm.obj + obj\SplashPage.obj obj\StudyProfessor.obj obj\versesel.obj obj\vrslstfrm.obj"/> + <RESFILES value="..\..\CBuilder5\BibleCS\sword.res"/> + <IDLFILES value=""/> + <IDLGENFILES value=""/> + <DEFFILE value=""/> + <RESDEPEN value="$(RESFILES) ..\..\CBuilder5\BibleCS\AboutBoxfrm.dfm + ..\..\CBuilder5\BibleCS\bookmarkfrm.dfm + ..\..\CBuilder5\BibleCS\DevOfTheDay.dfm + ..\..\CBuilder5\BibleCS\editentryfrm.dfm + ..\..\CBuilder5\BibleCS\FontSel.dfm ..\..\CBuilder5\BibleCS\mainfrm.dfm + ..\..\CBuilder5\BibleCS\ModInstForm.dfm + ..\..\CBuilder5\BibleCS\ModVisFrm.dfm + ..\..\CBuilder5\BibleCS\newbmfilefrm.dfm + ..\..\CBuilder5\BibleCS\optionfrm.dfm + ..\..\CBuilder5\BibleCS\RangeMaintFrm.dfm + ..\..\CBuilder5\BibleCS\searchfrm.dfm + ..\..\CBuilder5\BibleCS\splashfrm.dfm ..\..\CBuilder5\BibleCS\SplashPage.dfm + ..\..\CBuilder5\BibleCS\StudyProfessor.dfm + ..\..\CBuilder5\BibleCS\versesel.dfm ..\..\CBuilder5\BibleCS\vrslstfrm.dfm"/> + <LIBFILES value="swordlib.lib C:\icu-sword\as_is\borland\icucommon.lib + C:\icu-sword\as_is\borland\icudatab.lib + C:\icu-sword\as_is\borland\icui18n.lib"/> + <LIBRARIES value="bcbie.lib nmfast.lib bdertl.lib vcldb.lib dbrtl.lib vclx.lib vcl.lib rtl.lib"/> + <SPARELIBS value="rtl.lib vcl.lib vclx.lib dbrtl.lib vcldb.lib bdertl.lib nmfast.lib bcbie.lib"/> + <PACKAGES value="rtl.bpi vcl.bpi vclx.bpi bcbsmp.bpi qrpt.bpi dbrtl.bpi vcldb.bpi + bdertl.bpi ibsmp.bpi vcldbx.bpi teeui.bpi teedb.bpi tee.bpi teeqr.bpi + ibxpress.bpi bcbie.bpi vclie.bpi inetdb.bpi inet.bpi nmfast.bpi dclocx.bpi + bcb2kaxserver.bpi"/> + <PATHCPP value=".;..\..;..\..;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS;..\..\CBuilder5\BibleCS"/> + <PATHPAS value=".;"/> + <PATHRC value=".;"/> + <PATHASM value=".;"/> + <DEBUGLIBPATH value="$(BCB)\lib\debug"/> + <RELEASELIBPATH value="$(BCB)\lib\release"/> + <LINKER value="ilink32"/> + <USERDEFINES value="_USE_OLD_RW_STL;_DEBUG"/> + <SYSDEFINES value="NO_STRICT"/> + <MAINSOURCE value="sword.cpp"/> + <INCLUDEPATH value="..\..;..\..\..\..\include;C:\sword\apps\windoze\CBuilder5\BibleCS;"C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units";..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\include;$(BCB)\include\vcl"/> + <LIBPATH value="..\..\CBuilder5\BibleCS;obj;"C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units";..\..;..\..\..\..\lib;$(BCB)\Projects\Lib;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib"/> + <WARNINGS value="-w-par -w-8027 -w-8026"/> + <WARNOPTSTR value=""/> + <OTHERFILES value=""/> + </MACROS> + <OPTIONS> + <IDLCFLAGS value="-I..\..\..\..\..\icu-sword\source\common + -I..\..\..\..\..\icu-sword\source\i18n -I..\.. + -I"C:\Program Files\Borland\CBuilder5\RX\Units\." -I..\..\..\..\include + -I$(BCB)\include -I$(BCB)\include\vcl -Irxlib -src_suffix cpp -D_ICU_ + -D_DEBUG"/> + <CFLAG1 value="-Od -Vx -Ve -X- -r- -a8 -5 -b- -k -y -v -vi- -c -tW -tWM"/> + <PFLAGS value="-N2obj -N0obj -$Y+ -$W -$O- -$A8 -v -M -JPHNE"/> + <RFLAGS value=""/> + <AFLAGS value="/mx /w2 /zi"/> + <LFLAGS value="-Iobj -D"" -aa -Tpe -GD -s -Gn -v"/> + <OTHERFILES value=""/> + </OPTIONS> + <LINKER> + <ALLOBJ value="c0w32.obj $(OBJFILES)"/> + <ALLRES value="$(RESFILES)"/> + <ALLLIB value="$(LIBFILES) $(LIBRARIES) import32.lib cp32mt.lib"/> + <OTHERFILES value=""/> + </LINKER> + <FILELIST> + <FILE FILENAME="sword.cpp" FORMNAME="" UNITNAME="sword" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="swordlib.lib" FORMNAME="" UNITNAME="swordlib" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\swdisprtfchap.cpp" FORMNAME="" UNITNAME="swdisprtfchap" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\swdisprtf.cpp" FORMNAME="" UNITNAME="swdisprtf" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="C:\icu-sword\as_is\borland\icucommon.lib" FORMNAME="" UNITNAME="icucommon" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="C:\icu-sword\as_is\borland\icudatab.lib" FORMNAME="" UNITNAME="icudatab" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="C:\icu-sword\as_is\borland\icui18n.lib" FORMNAME="" UNITNAME="icui18n" CONTAINERID="LibTool" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\AboutBoxfrm.cpp" FORMNAME="AboutBox" UNITNAME="AboutBoxfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\biblecsmgr.cpp" FORMNAME="" UNITNAME="biblecsmgr.cpp" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\bookmarkfrm.cpp" FORMNAME="Bookmarksfrm" UNITNAME="bookmarkfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\DevOfTheDay.cpp" FORMNAME="DevOfTheDay2" UNITNAME="DevOfTheDay" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\editentryfrm.cpp" FORMNAME="EditEntry" UNITNAME="editentryfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\FontSel.cpp" FORMNAME="FontSelFrm" UNITNAME="FontSel" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\mainfrm.cpp" FORMNAME="Form1" UNITNAME="mainfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\ModInstForm.cpp" FORMNAME="ModInstFrm" UNITNAME="ModInstForm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\ModVisFrm.cpp" FORMNAME="ModVisForm" UNITNAME="ModVisFrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\newbmfilefrm.cpp" FORMNAME="NewBMfrm" UNITNAME="newbmfilefrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\optionfrm.cpp" FORMNAME="Optionsfrm" UNITNAME="optionfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\RangeMaintFrm.cpp" FORMNAME="RangeMaintForm" UNITNAME="RangeMaintFrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\searchfrm.cpp" FORMNAME="Form2" UNITNAME="searchfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\splashfrm.cpp" FORMNAME="splashForm" UNITNAME="splashfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\SplashPage.cpp" FORMNAME="SplashPg" UNITNAME="SplashPage" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\StudyProfessor.cpp" FORMNAME="Form3" UNITNAME="StudyProfessor" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\versesel.cpp" FORMNAME="VerseSelFrm" UNITNAME="versesel" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\vrslstfrm.cpp" FORMNAME="VerseListFrm" UNITNAME="vrslstfrm" CONTAINERID="CCompiler" DESIGNCLASS="" LOCALCOMMAND=""/> + <FILE FILENAME="..\..\CBuilder5\BibleCS\sword.res" FORMNAME="" UNITNAME="sword.res" CONTAINERID="ResTool" DESIGNCLASS="" LOCALCOMMAND=""/> + </FILELIST> + <BUILDTOOLS> + </BUILDTOOLS> + + <IDEOPTIONS> +[Version Info] +IncludeVerInfo=1 +AutoIncBuild=1 +MajorVer=1 +MinorVer=5 +Release=3 +Build=49 +Debug=0 +PreRelease=0 +Special=0 +Private=0 +DLL=0 +Locale=1033 +CodePage=1252 + +[Version Info Keys] +CompanyName=CrossWire Software & Bible Society +FileDescription=Windows 32bit User Interface to The SWORD Project +FileVersion=1.5.3.49 +InternalName=biblecs +LegalCopyright=(c) 2002 CrossWire Bible Society under the terms of the GNU General Public License +LegalTrademarks= +OriginalFilename= +ProductName=The SWORD Project +ProductVersion=1.5.3 +Comments=Seek Him and you will find Him + +[HistoryLists\hlIncludePath] +Count=16 +Item0=..\..;..\..\..\..\include;C:\sword\apps\windoze\CBuilder5\BibleCS;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\include;$(BCB)\include\vcl +Item1=..\..;C:\sword\apps\windoze\CBuilder5\BibleCS;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item2=..\..;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item3=C:\Program Files\Borland\CBuilder6\Projects\Rx6\Units;..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item4=..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;C:\Program Files\Borland\CBuilder6\Projects\Rx6\Units +Item5=..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item6=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item7=..\..;..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item8=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl +Item9=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item10=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib;C:\Program Files\Borland\CBuilder6\Projects\Rx6\Units +Item11=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..\..\windoze;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item12=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item13=..\..\..\..\..\icu-sword\source\common\;..\..\..\..\..\icu-sword\source\i18n\;..\..;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item14=C:\icu-sword\source\common\;C:\icu-sword\source\i18n\;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib +Item15=..\..\..\..\..\icu-sword\source\common;..\..\..\..\..\icu-sword\source\i18n;..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;..\..\..\..\include;$(BCB)\include;$(BCB)\include\vcl;rxlib + +[HistoryLists\hlLibraryPath] +Count=13 +Item0=..\..\CBuilder5\BibleCS;obj;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..;..\..\..\..\lib;$(BCB)\Projects\Lib;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item1=obj;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;..\..;..\..\..\..\lib;$(BCB)\Projects\Lib;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item2=..\..\CBuilder5\BibleCS;..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item3=..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder6\Projects\RxLib\Units;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item4=..\..;C:\sword\apps\windoze\CBuilder6\BibleCS\rxlib;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item5=..\..;$(BCB)\Projects\Rx6\Units;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item6=..\..;$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item7=$(BCB)\Projects\Rx6\Units;..\..\..\windoze;..\..\..\..\lib;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item8=..\..\..\windoze;..\..\..\..\lib;$(BCB)\Projects\Rx6\Units;$(BCB)\Projects\Lib;..\InstallMgr;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item9=..\..\..\windoze;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item10=..\..;..\..\..\..\lib;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item11=..\..;..\..\..\..\lib\;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib +Item12=..\..;C:\Program Files\Borland\CBuilder5\RX\Units\;$(BCB)\Projects\Lib;RX\Units;rxlib;..\InstallMgr;C:\program files\borland\cbuilder3\projects\;C:\borland\cbuilder3\lib\release\;$(BCB)\lib\release;$(BCB)\lib\obj;$(BCB)\lib + +[HistoryLists\hlDebugSourcePath] +Count=1 +Item0=$(BCB)\source\vcl + +[HistoryLists\hlConditionals] +Count=6 +Item0=_USE_OLD_RW_STL;_DEBUG +Item1=_USE_OLD_RW_STL +Item2=_ICU_;_USE_OLD_RW_STL +Item3=_ICU_;_USE_OLD_RW_STL;_DEBUG +Item4=_ICU_ +Item5=_ICU_;_DEBUG + +[HistoryLists\hlIntOutputDir] +Count=2 +Item0=obj +Item1=C:\sword\apps\windoze\CBuilder5\BibleCS\obj + +[HistoryLists\hlFinalOutputDir] +Count=6 +Item0=C:\Documents and Settings\dtrotzjr\My Documents\My Projects\The Sword Project\Stage_Sword\ +Item1=C:\Documents and Settings\dtrotzjr\My Documents\My Projects\The Sword Project\Stage_Sword +Item2=stage\ +Item3=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword\ +Item4=C:\Documents and Settings\Michelle Trotz\My Documents\My Projects\The Sword Project\Stage_Sword +Item5=C:\sword\apps\windoze\CBuilder5\BibleCS\stage + +[Debugging] +DebugSourceDirs=$(BCB)\source\vcl + +[Parameters] +RunParams= +Launcher= +UseLauncher=0 +DebugCWD= +HostApplication= +RemoteHost= +RemotePath= +RemoteLauncher= +RemoteCWD= +RemoteDebug=0 + +[Compiler] +ShowInfoMsgs=0 +LinkDebugVcl=0 +LinkCGLIB=0 + +[Language] +ActiveLang= +ProjectLang= +RootDir= + </IDEOPTIONS> +</PROJECT>
\ No newline at end of file diff --git a/apps/windoze/CBuilder6/BibleCS/sword.cpp b/apps/windoze/CBuilder6/BibleCS/sword.cpp new file mode 100644 index 0000000..f474a29 --- /dev/null +++ b/apps/windoze/CBuilder6/BibleCS/sword.cpp @@ -0,0 +1,133 @@ +//--------------------------------------------------------------------------- +#include <vcl.h> +#pragma hdrstop +#include "SplashPage.h" +#include <winreg.h> +#include <dir.h> +#include "sword.h" + +USEFORM("..\..\CBuilder5\BibleCS\AboutBoxfrm.cpp", AboutBox); +USEFORM("..\..\CBuilder5\BibleCS\bookmarkfrm.cpp", Bookmarksfrm); +USEFORM("..\..\CBuilder5\BibleCS\DevOfTheDay.cpp", DevOfTheDay2); +USEFORM("..\..\CBuilder5\BibleCS\editentryfrm.cpp", EditEntry); +USEFORM("..\..\CBuilder5\BibleCS\FontSel.cpp", FontSelFrm); +USEFORM("..\..\CBuilder5\BibleCS\mainfrm.cpp", Form1); +USEFORM("..\..\CBuilder5\BibleCS\ModInstForm.cpp", ModInstFrm); +USEFORM("..\..\CBuilder5\BibleCS\ModVisFrm.cpp", ModVisForm); +USEFORM("..\..\CBuilder5\BibleCS\newbmfilefrm.cpp", NewBMfrm); +USEFORM("..\..\CBuilder5\BibleCS\optionfrm.cpp", Optionsfrm); +USEFORM("..\..\CBuilder5\BibleCS\RangeMaintFrm.cpp", RangeMaintForm); +USEFORM("..\..\CBuilder5\BibleCS\searchfrm.cpp", Form2); +USEFORM("..\..\CBuilder5\BibleCS\splashfrm.cpp", splashForm); +USEFORM("..\..\CBuilder5\BibleCS\SplashPage.cpp", SplashPg); +USEFORM("..\..\CBuilder5\BibleCS\StudyProfessor.cpp", Form3); +USEFORM("..\..\CBuilder5\BibleCS\versesel.cpp", VerseSelFrm); +USEFORM("..\..\CBuilder5\BibleCS\vrslstfrm.cpp", VerseListFrm); +//--------------------------------------------------------------------------- +WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nCmdShow) { + + LONG result; + + result = Application->ExeName.Length(); + char * dir = new char[result + 1]; + strcpy (dir, Application->ExeName.c_str()); + for (;result > 0 && dir[result] != '\\'; result--) { + dir[result] = 0; + } + chdir(dir); + delete [] dir; + + try { + HKEY hkey; + HWND otherInst; + + // see if there's a previous instance running + otherInst = ::FindWindow(NULL, "The SWORD Project for Windows"); + // if so, and we have an argument, send the argument to the other instance + if (otherInst && *lpCmdLine) { + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\OpenVerse", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, lpCmdLine, strlen(lpCmdLine) + 1); + result = RegCloseKey(hkey); + + PostMessage(otherInst, WM_VERSE, NULL, NULL); + return 0; + } + + // adjust the registry for our private protocol using the current path + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1); + result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1); + result = RegCloseKey(hkey); + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1); + result = RegCloseKey(hkey); + AnsiString opencommand = Application->ExeName + " \"%1\""; + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "sword\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1); + result = RegCloseKey(hkey); + + + /* + // don't override Logos' setting if it exists + result = RegOpenKeyEx(HKEY_CLASSES_ROOT, "libronixdls", 0, KEY_READ | KEY_WRITE, &hkey); + if (!result) { + char* libStr = new char[32]; + unsigned long libSize = 32; + result = RegQueryValueEx(hkey, NULL, NULL, NULL, libStr, &libSize); + if (!result) { + if (strstr(libStr, "SWORD")) { + result = 1; + } + } + } + if (result) { + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, "URL:SWORD Protocol", strlen("URL:SWORD Protocol") + 1); + result = RegSetValueEx(hkey, "URL Protocol", 0, REG_SZ, "", 1); + result = RegCloseKey(hkey); + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\DefaultIcon", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, Application->ExeName.c_str(), Application->ExeName.Length() + 1); + result = RegCloseKey(hkey); + AnsiString opencommand = Application->ExeName + " \"%1\""; + result = RegCreateKeyEx(HKEY_CLASSES_ROOT, "libronixdls\\shell\\open\\command", NULL, "", NULL, KEY_READ | KEY_WRITE, NULL, &hkey, NULL); + result = RegSetValueEx(hkey, NULL, 0, REG_SZ, opencommand.c_str(), opencommand.Length() + 1); + result = RegCloseKey(hkey); + } + */ + } + catch (Exception &exception) { + Application->ShowException(&exception); + } + + try { + Application->Initialize(); + Application->Title = "The SWORD Project"; + Application->CreateForm(__classid(TAboutBox), &AboutBox); + Application->CreateForm(__classid(TBookmarksfrm), &Bookmarksfrm); + Application->CreateForm(__classid(TDevOfTheDay2), &DevOfTheDay2); + Application->CreateForm(__classid(TEditEntry), &EditEntry); + Application->CreateForm(__classid(TFontSelFrm), &FontSelFrm); + Application->CreateForm(__classid(TForm1), &Form1); + Application->CreateForm(__classid(TModInstFrm), &ModInstFrm); + Application->CreateForm(__classid(TModVisForm), &ModVisForm); + Application->CreateForm(__classid(TNewBMfrm), &NewBMfrm); + Application->CreateForm(__classid(TOptionsfrm), &Optionsfrm); + Application->CreateForm(__classid(TRangeMaintForm), &RangeMaintForm); + Application->CreateForm(__classid(TForm2), &Form2); + Application->CreateForm(__classid(TsplashForm), &splashForm); + Application->CreateForm(__classid(TSplashPg), &SplashPg); + Application->CreateForm(__classid(TForm3), &Form3); + Application->CreateForm(__classid(TVerseSelFrm), &VerseSelFrm); + Application->CreateForm(__classid(TVerseListFrm), &VerseListFrm); + SplashPg = new TSplashPg(static_cast<void*>(NULL)); + SplashPg->Show(); + Application->ProcessMessages(); + Application->Run(); + delete SplashPg; + } + catch (Exception &exception) { + Application->ShowException(&exception); + } + return 0; +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/swdisprtf.cpp b/apps/windoze/swdisprtf.cpp new file mode 100644 index 0000000..3a725af --- /dev/null +++ b/apps/windoze/swdisprtf.cpp @@ -0,0 +1,113 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include "swdisprtf.h" +#include <unicodertf.h> + + + +//--------------------------------------------------------------------------- +__fastcall SWDispRTF::SWDispRTF(TWinControl *Owner) + : TRxRichEditX(Owner) { + RTFStream = new TMemoryStream(); + + ExpandNewLine = true; + this->AutoURLDetect = true; +} + +__fastcall SWDispRTF::~SWDispRTF() +{ + if (RTFStream) + delete RTFStream; +} + + +void __fastcall SWDispRTF::Loaded(void) +{ + TRxRichEditX::Loaded(); +} + + +int __fastcall SWDispRTF::GetMySelStart() { + CHARRANGE cr; + + SendMessage(Handle, EM_EXGETSEL, 0, (long)&cr); + return cr.cpMin; +} + + +void __fastcall SWDispRTF::SetMySelStart(int iselstart) { + CHARRANGE cr; + + cr.cpMin = iselstart; + cr.cpMax = iselstart; + SendMessage(Handle, EM_EXSETSEL, 0, (long)&cr); +} + +// Display for Comm and LD +char SWDispRTF::Display(SWModule &Module) { + System::AnsiString newtext, tmptext; + static UnicodeRTF filter; + char buf[255]; + + module = &Module; + type = "Default"; + + recalcAppearance(); + + newtext = RTFHeader; + newtext = newtext + RTFHeadMargin; + Module.Error(); // clear error; + newtext = newtext + "\\pard \\nowidctlpar \\cf7\\f0 "; + (const char *)Module; // force key to snap to entry before pulling out the text of the key + strcpy(buf, Module.KeyText()); + SWKey *key = Module; + + // VerseKey locales are not yet UTF8, so don't try to convert them. + if (!SWDYNAMIC_CAST(VerseKey, key)) + filter.ProcessText(buf, 253, Module, &Module); + + newtext = newtext + RTFHeadingPre + buf + RTFHeadingPost + ":\\par "; + tmptext = ""; + + tmptext = (const char *)Module; + + newtext = newtext + RTFVersePre + " " + tmptext + RTFVersePost; + newtext = newtext + RTFTrailer; + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.Length()); + RTFStream->Position = 0; + Lines->LoadFromStream(RTFStream); + + // make links + while (true) { + int start, len, foundAt, endAt; + + start = (SelLength) ? SelStart + SelLength : 0; + len = Text.Length() - start; + foundAt = this->SearchText("<a href=\"\">", start, len, TRichSearchTypes()); + if (foundAt == -1) + break; + + SelStart = foundAt; + SelLength = 11; + this->SelText = ""; + endAt = this->SearchText("</a>", foundAt, len, TRichSearchTypes()); + if (foundAt == -1) + break; + SelStart = endAt; + SelLength = 4; + this->SelText = ""; + SelStart = foundAt; + SelLength = endAt - foundAt; + this->SelAttributes->Link = true; + } + SelLength = 0; + + return 0; +} + +//--------------------------------------------------------------------------- + + diff --git a/apps/windoze/swdisprtfchap.cpp b/apps/windoze/swdisprtfchap.cpp new file mode 100644 index 0000000..8af96d4 --- /dev/null +++ b/apps/windoze/swdisprtfchap.cpp @@ -0,0 +1,143 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include "biblecsmgr.h" +#include "swdisprtfchap.h" + + +//--------------------------------------------------------------------------- +static inline SWDispRTFChap *ValidCtrCheck() +{ + return new SWDispRTFChap(NULL); +} + +char SWDispRTFChap::platformID = 0; + +class SWDispRTFChap_init { +public: + SWDispRTFChap_init() { + OSVERSIONINFO osvi; + memset(&osvi, 0, sizeof(OSVERSIONINFO)); + osvi.dwOSVersionInfoSize = sizeof(OSVERSIONINFO); + GetVersionEx(&osvi); + SWDispRTFChap::platformID = osvi.dwPlatformId; + } +} SWDispRTFChap::_init; + + +//--------------------------------------------------------------------------- +__fastcall SWDispRTFChap::SWDispRTFChap(TWinControl *Owner) + : SWDispRTF(Owner) +{ +} + +__fastcall SWDispRTFChap::~SWDispRTFChap() +{ +} + + +void __fastcall SWDispRTFChap::Loaded(void) +{ + SWDispRTF::Loaded(); +} + +// Display for biblical text +char SWDispRTFChap::Display(SWModule &Module) { + int testmt, book, chap, verse, versepos; + System::AnsiString newtext, tmptext, tmptext2; + VerseKey *key = (VerseKey *)(SWKey *)Module; + testmt = key->Testament(); + chap = key->Chapter(); + book = key->Book(); + verse = key->Verse(); + key->Verse(1); + + module = &Module; + type = "Default"; + + recalcAppearance(); + + + newtext = RTFHeader; + newtext = newtext + RTFChapterMarkPre + IntToStr(chap) + RTFChapterMarkPost; + newtext = newtext + "\\pard\\f0\\nowidctlpar\\cf7 "; + if (Module.Direction() == DIRECTION_RTL) { + newtext = newtext + "\\qr "; + } + if (Module.Direction() == DIRECTION_RTL && (platformID == WINNT && (!strnicmp(Module.Lang(), "he", 2) || !strnicmp(Module.Lang(), "ar", 2)))) { + newtext = newtext + "\\rtlpar "; + } + + Module.Error(); // clear error; + while ((key->Book() == book) && (key->Chapter() == chap) && (Module.Error() == 0)) { + newtext = newtext + "{"; + + tmptext = ""; + for (const char *loop = (const char *)Module; *loop; loop++) { + if (*loop == '\n') { + tmptext += "\\par "; + } + else tmptext += *loop; + } + if (tmptext.Length() > 3) { // make sure we have an entry + if (Module.Direction() == DIRECTION_RTL && (platformID == WIN9X || (Module.Lang() && strnicmp(Module.Lang(), "he", 2) && strnicmp(Module.Lang(), "ar", 2)))) { + newtext = newtext + RTFVersePre; + if ((key->Verse() == verse) && (dispAttribs.markCurrentVerse)) { + newtext = newtext + "\\cf2 "; // \cf2 = second color in color table + } + newtext += tmptext + RTFVersePost; + newtext = newtext + RTFVerseMarkPre + IntToStr(key->Verse()) + RTFVerseMarkPost; + newtext = newtext + "\\par "; + } + else { + newtext = newtext + RTFVerseMarkPre + IntToStr(key->Verse()) + RTFVerseMarkPost; + newtext = newtext + RTFVersePre; + if ((key->Verse() == verse) && (dispAttribs.markCurrentVerse)) { + newtext = newtext + "\\cf2 "; // \cf2 = second color in color table + } + newtext += tmptext + RTFVersePost; + } + } + if (key->Verse() == verse) { + tmptext = newtext + RTFTrailer + "}"; + RTFStream->Clear(); + RTFStream->WriteBuffer(tmptext.c_str(), tmptext.Length()); + RTFStream->Position = 0; + Lines->LoadFromStream(RTFStream); + versepos = GetTextLen() - 3; + } + newtext = newtext + "}"; + Module++; + } + newtext = newtext + RTFTrailer; + key->Verse(1); //{ When setting chapter: if (verse <> new chapter range) don't autonormalize. (we could've just turned the autonormalize option off then back on, but this is cooler) } + key->Chapter(1); + key->Book(1); + key->Testament(testmt); + key->Book(book); + key->Chapter(chap); + key->Verse(verse); + RTFStream->Clear(); + RTFStream->WriteBuffer(newtext.c_str(), newtext.Length()); + RTFStream->Position = 0; + Lines->LoadFromStream(RTFStream); + + //{ Position control text at current verse } + this->SetFocus(); + SelStart = versepos; + SendMessage(Handle, EM_SCROLLCARET, 0, 0); + return 0; +} + + +//--------------------------------------------------------------------------- +namespace Swdisprtfchap +{ + void __fastcall Register() + { + TComponentClass classes[1] = {__classid(SWDispRTFChap)}; + RegisterComponents("SWORD", classes, 0); + } +} +//--------------------------------------------------------------------------- diff --git a/apps/windoze/swwinlog.cpp b/apps/windoze/swwinlog.cpp new file mode 100644 index 0000000..cf7d8e8 --- /dev/null +++ b/apps/windoze/swwinlog.cpp @@ -0,0 +1,74 @@ +//--------------------------------------------------------------------------- +#include <vcl\vcl.h> +#pragma hdrstop + +#include "swwinlog.h" +#include <stdio.h> +#include <conio.h> +#include <stdarg.h> +//--------------------------------------------------------------------------- + +SWWinLog::SWWinLog(HWND iparent) : SWLog() { + parent = iparent; +} + + +void SWWinLog::LogWarning(char *fmt, ...) +{ + char msg[2048]; + va_list argptr; + + if (logLevel >= 2) { + va_start(argptr, fmt); + vsprintf(msg, fmt, argptr); + va_end(argptr); + + MessageBox(NULL, msg, "Warning", MB_OK); + } +} + + +void SWWinLog::LogError(char *fmt, ...) +{ + char msg[2048]; + va_list argptr; + + if (logLevel) { + va_start(argptr, fmt); + vsprintf(msg, fmt, argptr); + va_end(argptr); + + MessageBox(NULL, msg, "Error", MB_OK); + } +} + + +void SWWinLog::LogTimedInformation(char *fmt, ...) +{ + char msg[2048]; + va_list argptr; + + if (logLevel >= 4) { + va_start(argptr, fmt); + vsprintf(msg, fmt, argptr); + va_end(argptr); + + MessageBox(NULL, msg, "Information...", MB_OK); + + } +} + + +void SWWinLog::LogInformation(char *fmt, ...) +{ + char msg[2048]; + va_list argptr; + + if (logLevel >= 3) { + va_start(argptr, fmt); + vsprintf(msg, fmt, argptr); + va_end(argptr); + + MessageBox(NULL, msg, "Information", MB_OK); + } +} diff --git a/apps/windoze/tbdisp.cpp b/apps/windoze/tbdisp.cpp new file mode 100644 index 0000000..45de2bd --- /dev/null +++ b/apps/windoze/tbdisp.cpp @@ -0,0 +1,55 @@ +/****************************************************************************** + * tbdisp.cpp - code for class 'tbdisp'. tbdisp writes module output to a + * MSWindows TextBox (or any other control that takes a + * SetDialogItemText + */ + +#include <swmodule.h> +#include <tbdisp.h> +#include <windows.h> +#include <string.h> + + +/****************************************************************************** + * TBDisp Constructor - sets up an instance of TBDisp for use + * + * ENT: iwnd - window id on which control resides + * ictrlid - control id in which to display module text + */ + +TBDisp::TBDisp(HWND iwnd, int ictrlid) +{ + wnd = iwnd; + ctrlid = ictrlid; +} + + +/****************************************************************************** + * SWDisplay::Display - casts a module to a character pointer and displays it in + * an MSWindows control + * + * ENT: imodule - module to display + * + * RET: error status + */ + +char TBDisp::Display(SWModule &imodule) +{ + char *buf, *to; + const char *mtext; + + mtext = (const char *)imodule; + + buf = new char [ strlen(mtext) + 100 ]; + + for (to = buf; *mtext; mtext++) { + if (*mtext == '\n') + *to++ = '\r'; + *to++ = *mtext; + } + *to = 0; + + SetDlgItemText(wnd, ctrlid, buf); + delete [] buf; + return 0; +} |